Introduction: why OSPF uses areas
OSPF is a link-state protocol. A router maintains a Link-State Database (LSDB) describing its area and calculates paths with SPF. In a large domain, one database containing every router and link increases the data volume and the cost of recalculation.
In a single-area OSPF network, a topology change may require every router in that area to process new information. As the router count grows, the LSDB grows and SPF uses more CPU resources. Frequent link changes can therefore increase protocol traffic and repeated calculations.
OSPF limits this scope through the hierarchy of areas. A router stores detailed topology for its own area and receives inter-area information, usually as summarized routes, about other areas. This reduces LSA flooding and the number of calculations after a local link change.
An ABR handles an area boundary. It maintains a separate LSDB for each attached area, calculates routes in those areas, and creates Type 3 LSAs for inter-area information. Detailed Type 1 and Type 2 LSAs remain local, so a router in another area does not need every link in the source topology.
The backbone: Area 0
The foundation of OSPF's hierarchy is the backbone area, designated as Area 0. Inter-area traffic uses the backbone, and non-backbone areas must connect to Area 0 through an ABR or a virtual link.
Area 0 connects the other areas and carries information needed for inter-area routing. A route from Area 10 to Area 20 is calculated by leaving the first area for the backbone, crossing Area 0, and entering the second area.
Area 0 and ABR rules
- Area 0 must be contiguous: Backbone routers must have paths within Area 0. If physical continuity is impossible, OSPF can use a configured virtual link through a transit area.
- Other areas must connect to Area 0: A non-backbone area uses an ABR with interfaces in that area and Area 0, or a virtual link. Losing the backbone connection limits inter-area routing.
These rules define the topology of inter-area routing. Keeping a contiguous backbone lets routers calculate paths from a consistent Area 0 model and limits the possibility of loops between areas.
An ABR can summarize prefixes when advertising them out of an area. Summarization reduces the number of Type 3 LSAs but requires a consistent addressing plan. A virtual link depends on correct communication through the transit area and should terminate on routers that share that area.
LSAs and flooding scope
Routers build the LSDB from messages called Link-State Advertisements (LSAs). LSAs describe routers, networks, inter-area routes, and external routes, while their flooding scope depends on the type.
Different LSA types have different flooding scopes. Local types remain inside an area, while an ABR creates summary information for other areas. Selective topology sharing limits the data stored outside the source area.
Each LSA has a header with an age, sequence number, and checksum. Routers use these fields to recognize newer versions and remove expired information. Flooding scope does not change how a router checks whether an LSA is current.
Primary LSA types and flooding scope
Type 1 LSA - Router LSA
Each router generates a Type 1 LSA for the area in which it operates. It describes its links, interface states, neighbors, and OSPF costs used by SPF.
Flooding scope: Strictly contained within a single area. It is not flooded beyond an .
Type 2 LSA - Network LSA
A Type 2 LSA exists on broadcast and NBMA multi-access networks, such as Ethernet. The Designated Router (DR) generates it and lists the routers attached to that segment and the segment's relationship with the DR.
Flooding scope: Strictly contained within a single area. Like Type 1, it is not flooded through an ABR.
Routers use Type 1 and Type 2 LSAs to build a complete, detailed map of their own local area.
Type 3 LSA - Summary LSA
An ABR generates a Type 3 LSA to advertise a prefix from one area into another. It does not describe the source area's detailed topology; it contains the prefix, mask, and inter-area cost, for example for .
Flooding scope: An ABR floods Type 3 LSAs into attached areas according to inter-area routing rules, including through the Area 0 backbone. The information summarizes a prefix without the source area's internal topology.
Type 4 LSA - ASBR Summary LSA
An ABR generates a Type 4 LSA to tell routers in other areas how to reach an ASBR outside their area. The Type 4 LSA identifies the ASBR rather than the external prefix itself.
Flooding scope: Type 4 information is passed between areas by ABRs so routers can calculate a path to the ASBR referenced by a Type 5 LSA.
Type 5 LSA - AS External LSA
A Type 5 LSA describes an external route introduced into OSPF by an . It describes a destination outside the OSPF domain, for example a prefix learned from the Internet through BGP.
Flooding scope: By default, Type 5 LSAs are flooded through OSPF areas that support external routes, except areas with restricted flooding. Special area types reduce the number of such advertisements.
Special area types and LSA filtering
OSPF defines stub areas, while implementation extensions add the totally stubby variant. These areas restrict external or inter-area LSAs and usually have one or a few exit points. NSSA is a standard OSPF extension.
A stub area still receives permitted internal and inter-area routes. Its restriction concerns external information. If an area needs a local redistribution point, NSSA is generally appropriate instead of a regular stub.
Stub Area
A stub area does not receive detailed external routes. Routers can use a default route advertised by the ABR when sending traffic outside the area.
A Stub Area does not accept Type 5 external-route information.
- It blocks Type 5 LSAs describing external routes.
- The ABR can advertise a default route () that routers use for external destinations.
- It limits the LSDB and routing-table size inside the area. A stub area cannot contain an ASBR.
Totally Stubby Area: implementation extension
Totally Stubby Area restricts information further than a standard stub. In a typical configuration, routers receive detailed local routes and a default path for destinations outside the area.
A Totally Stubby Area is an implementation extension rather than an area type defined by the base OSPF specification.
- It blocks Type 5 LSAs and, depending on the implementation, Type 3 LSAs for other inter-area routes.
- The ABR advertises one default route for traffic outside the local area, including other OSPF areas and external networks.
- It reduces the LSDB and routing table, while the configuration and exact filtering scope depend on the implementation.
Not-So-Stubby Area (NSSA)
An NSSA limits external routes entering the area while allowing an ASBR inside the area to introduce external routes into OSPF.
A Not-So-Stubby Area (NSSA) is a standard OSPF area that can contain an ASBR.
- Like a stub area, it blocks Type 5 LSAs coming from outside the NSSA.
- An ASBR inside the NSSA can inject external routes with a special Type 7 LSA.
- Type 7 LSAs are flooded within the NSSA. The elected NSSA translator can translate a Type 7 LSA with the P-bit set into a Type 5 LSA and advertise the route outside the NSSA.
- This keeps the local ASBR while limiting Type 5 flooding inside the NSSA. Implementations also offer a Totally NSSA variant with stricter inter-area filtering.
OSPF virtual link
If a non-backbone area has no physical connection to Area 0, OSPF can use a configured virtual link through a transit area to maintain logical backbone connectivity.
A virtual link is a logical OSPF connection between ABRs through a transit area. It lets Area 0 operate as a connected backbone, requires valid routing through the transit area, and increases configuration complexity. It is usually used to repair an existing topology; new designs should provide direct backbone connectivity.
A virtual link does not change the physical location or flooding scope of Type 1 and Type 2 LSAs. It creates a logical relationship through the transit area so backbone routers can exchange information. The transit area must support the required OSPF adjacency and routing.