Open Shortest Path First is a link state protocol, meaning that it propagates information about individual links (and their connected subnets) and each router builds a complete view of the attached network (really the OSPF area, but more on this later...). Each router analyzes the information in the OSPF link state database and makes its own decision on the best way to route traffic to a particular destination. Compare this with a distance vector protocol such as RIPv2 where each router has no view of the topology beyond the first hop, but only knows the distance (for RIP this is hop count) to reach a subnet that was advertised by the neighboring router. No computation is necessary beyond knowing which next hop has the lowest hop count to a specific destination.
Areas are the name given to a set of routers that has a complete view of the link states in any given area. OSPF uses a two layer hierarchy of consisting of a backbone area (area 0) and one or more non-backbone areas. For small networks, it is possible that only a single area is used. Each interface/subinterface can be part of a single OSPF area. All areas other than the backbone area must connect directly to the backbone area (or connect via an OSPF virtual link). Since the routers in a single area have a complete view of the topology, adding more routers to an area increases the size of the OSPF database in memory and increases the time that the shortest path first (SPF) algorithm takes to run. Specifics with each type of area: normal area, stub area, totally stubby area, not so stubby area (NSSA), and totally not so stubby area will be discussed in their own posts.
OSPF LSA Types
Routers in an OSPF area propagate reachable subnets via link state advertisements (LSAs). Within an individual area Type 1 (link) and type 2 (transit network) LSAs help routers develop a complete topology view. Between areas type 3 (summary) and type 4 (autonomous system border router summary [ASBR summary]) LSAs are propagated. Type 5 LSAs are generated and propagated for external routes (those completely outside of OSPF). Type 7 LSAs are used to represent external routes in not so stubby areas (NSSAs). Each of these LSA types and their appearance in the OSPF database will be described in more detail and demonstrated in future configuration examples.
The Road to the CCIE