< Home

OSPF Areas

When networks expand and all routers in a large network are running OSPF, the following problems may occur:
  • Network expansion increases the possibility of network topology changes, leading to more frequent LSA flooding and reducing network bandwidth efficiency.
  • LSDBs of routers become large, requiring a large amount of storage space and complicating SPF calculations.
  • Routers need to maintain large routing tables.

OSPF resolves these problems by partitioning an AS into different areas. Area partitioning contains LSA flooding within an area, improving network efficiency and route convergence. The number of routers in each area becomes less, reducing the size of routing tables and LSDBs maintained by routers and limiting SPF calculations to LSAs within the area. Design of multiple areas also improves network scalability and facilitates the setup of large networks.

An area is regarded as a logical group of routers and is identified by an area ID. A router, not a link, resides on the border of an area. Each OSPF interface must belong to an area, meaning that a link (or network segment) belongs to only one area.

Before understanding OSPF areas, you need to get to know two concepts: router type and route type.

Router Types

Figure 1 shows common router types involved in OSPF.

Figure 1 Router types

Table 1 Router types

Router Type

Description

Internal router

A router that has all of its interfaces within the same OSPF area.

Area Border Router (ABR)

A router that has interfaces in two or more areas, one of which must be a backbone area.

ABRs connect backbone and non-backbone areas and can be physically or logically connected to a backbone area.

Backbone router

A router that has one or more interfaces within a backbone area.

Internal routers in Area 0 and all ABRs are backbone routers.

Autonomous System Boundary Router (ASBR)

A router that exchanges routing information with other ASs.

An ASBR is not required to reside on the border of an AS. It may be an internal router or an ABR. An OSPF device that imports external routing information becomes an ASBR.

Route Types

Inter-area and intra-area routes in an AS describe the internal network structure of the AS. AS external routes describe routes to destinations outside the AS. OSPF classifies imported AS external routes into Type 1 and Type 2.

Table 2 lists route types in descending order of priority.

Table 2 Route types

Route Type

Description

Intra-area route

Routes that are generated from within an area (the destination belongs to the area).

Inter-area route

Routes that originate from other areas.

External route

Routes that are imported into OSPF from other routing protocols or different OSPF processes. External routes fall into two categories: Type 1 and Type 2 external routes. The difference between the two types is the way the cost of a route is calculated.

  • Type 1 external route: The cost of a Type 1 external route is the addition of the external cost (from the local device to an ASBR) and the internal cost (from the ASBR to the destination) used to reach that route.
  • Type 2 external route: The cost of a Type 2 external route is always the external cost (from an ASBR to the destination), irrespective of the internal cost to reach that route.

A Type 1 external route is always preferred over a Type 2 external route for the same destination.

Area Types

OSPF areas include common areas, stub areas, and not-so-stubby areas (NSSAs), as shown in Table 3.

Table 3 Area types

Area Type

Function

Description

Common area

By default, OSPF areas are common areas that include:

  • Standard area: transmits intra-area, inter-area, and external routes.
  • Backbone area: connects to all other OSPF areas and transmits inter-area routes. The backbone area is represented by area 0. Routes between non-backbone areas must be forwarded through the backbone area.
  • The backbone area must have all its devices connected.
  • All non-backbone areas must have themselves connected to the backbone area.

Stub area

A stub area is a special area where an ABR does not flood received AS external routes. In a stub area, routers maintain fewer routing entries and transmit less routing information. Configuring a stub area is optional and not every area can be configured as such. A stub area is usually a non-backbone area containing only one ABR, located on the AS border. A stub area is a non-backbone area containing only one ABR and generally resides on the border of an AS. The ABR in a stub area does not transmit received AS external routes, which significantly decreases the routing table size on the ABR and the amount of routing information transmitted. To ensure the reachability of AS external routes, the ABR generates a default route and advertises the route to non-ABRs in the stub area.

A totally stub area allows only intra-area routes and ABR-advertised Type 3 LSAs carrying a default route to be advertised within the area.

  • A backbone area cannot be configured as a stub area.
  • Stub area attributes need to be configured on all the routers in the area that needs to be configured as a stub area.
  • An ASBR cannot exist in a stub area. Therefore, AS external routes cannot be advertised within a stub area.
  • A virtual link cannot pass through a stub area.

NSSA

An NSSA is similar to a stub area. An NSSA does not advertise Type 5 LSAs, but can import AS external routes. ASBRs in an NSSA generate Type 7 LSAs to carry the information about the AS external routes. The Type 7 LSAs are advertised only within the NSSA. When the Type 7 LSAs reach an ABR in the NSSA, the ABR translates the Type 7 LSAs into Type 5 LSAs and floods them to the entire AS.

A totally NSSA allows only intra-area routes to be advertised within the area.

  • A backbone area cannot be configured as an NSSA.
  • NSSA attributes need to be configured on all the routers in the area that needs to be configured as an NSSA.
  • An ABR in an NSSA advertises default routes in Type 7 LSAs within the NSSA.
  • All inter-area routes are advertised by ABRs.
  • A virtual link cannot pass through an NSSA.

After an OSPF network is partitioned into multiple areas, only LSAs within an area are used in SPF calculations of this area. For example, in Figure 2, the link in Area 1 is always flapping, and therefore SPF calculations are frequently performed in Area 1. However, frequent SPF calculations occur only in Area 1 without affecting other areas, improving network stability.

Figure 2 Area partitioning reducing the impact of link flapping

Stub area and totally stub area

In Figure 3, an AS is partitioned into Area 0 and Area 2, and external routes are imported by the ASBR in Area 0. Typically, all routes on the network are advertised into OSPF to ensure network reachability. In this situation, network expansion will increase the number of devices and routing entries on each device and require a large amount of CPU and memory resources to maintain these entries. In some edge areas, low-performance devices may be deployed, and therefore maintaining a large number of routing entries brings heavy load on these devices.

Figure 3 Stub area and totally stub area

To optimize network performance, you often need to minimize the routing table size to reduce the number of LSAs to be flooded without compromising network reachability. If Area 2 is a common area, five types of LSAs, Type 1, Type 2, Type 3, Type 4, and Type 5, may exist in this area. Traffic from routers in Area 2 must first reach the ABR, regardless of the traffic destination outside Area 2. Therefore, non-ABR routers in Area 2 do not need to know detailed information about external networks. To meet this requirement, Area 2 is designed as a stub area.

Routers in Area 2 do not need to know inter-area specific routes and only one egress is required to transmit traffic of these routers outside Area 2. To meet this requirement, a totally stub area is designed. In a totally stub area, AS external routes and inter-area routes cannot be advertised, reducing the number of LSAs transmitted within this area.

NSSA and totally NSSA

In Figure 4, Area 2 is a stub area. An external network needs to connect to the OSPF network through Area 2. That is, AS external routes need to be imported to and advertised within the entire AS. One method is to enable RouterA in Area 2 to import AS external routes into the AS. RouterA then becomes an ASBR, indicating that Area 2 is no longer a stub area. To meet this requirement, an NSSA is designed.

Figure 4 NSSA and totally NSSA

An NSSA differs from a stub area in that an NSSA allows importing AS external routes into and advertising them within the entire AS without transmitting routes learned from other areas in the AS.

To ensure the reachability of AS external routes, the ABR in an NSSA generates a default route and advertises the route to the other routers in this NSSA.

Multiple ABRs may be deployed in an NSSA. To prevent routing loops caused by default routes, ABRs do to calculate the default routes advertised by each other.

All routers in an area must have the same area type configured. A router uses the N-bit carried in a Hello packet to specify the area type that it supports. If routers have different area types, they cannot establish OSPF neighbor relationships. Some vendors' devices do not comply with this requirement, and the N-bit is also set in Database Description (DD) packets. You can manually set the N-bit on switches to enable interworking with these vendors' devices.

Similar to a totally stub area, a totally NSSA is defined to further reduce the number of LSAs transmitted within an NSSA.

Inter-Area Loop and Loop Prevention

OSPF runs an SPF algorithm within an area, which prevents routing loops within the area. However, the distance-vector algorithm is used for inter-area route transmission, which may easily cause routing loops.

To prevent inter-area loops, OSPF prohibits routing information from being advertised directly between two non-backbone areas and allows advertising routing information within a single area or between the backbone and non-backbone areas. Therefore, each ABR must be connected to the backbone area.

If OSPF allows advertising routing information directly between non-backbone areas, an inter-area loop may occur, as shown in Figure 5. The route from the backbone area to the external network can be transmitted from Area 0 to Area 1. If transmitting routing information directly between non-backbone areas is allowed, this route can be transmitted back to Area 0, forming an inter-area routing loop. To prevent this loop, OSPF allows exchanging routing information only between the backbone and non-backbone areas. That is, OSPF prohibits routing information from being exchanged directly between Area 1 and Area 3 or directly between Area 2 and Area 3.

Figure 5 OSPF inter-area loop

OSPF Default Route

A default route has an all–0 destination address and an all-0 mask. A device uses a default route to forward packets when no matching route is discovered. Hierarchical management of OSPF routes prioritizes the default route carried in Type 3 LSAs over that carried in Type 5 or Type 7 LSAs.

An OSPF default route is used in the following scenarios:

  • An ABR advertises a default route in Type 3 LSAs for instructing routers within an area to forward packets between areas.

  • An ASBR advertises a default route in Type 5 LSAs or Type 7 LSAs for instructing routers in an AS to forward packets to other ASs.

Advertising an OSPF default route must follow these rules:
  • An OSPF router in an area can advertise LSAs carrying a default route only when the router has an interface connected to a device outside the area.
  • If an OSPF router has advertised LSAs carrying a default route, the router no longer learns the same-type LSAs carrying a default route advertised by other routers. That is, the router uses only the LSAs advertised by itself to calculate routes. The LSAs advertised by other routers are still recorded in the LSDB.
  • If a router must use a route to advertise LSAs carrying an external default route, the route cannot be a route learned by the local process. This is because external default routes guide packet forwarding outside an AS, whereas routes within an AS have the next hops pointing to the devices within the AS.

Table 4 lists default route advertisement principles in different areas.

Table 4 OSPF areas and default route advertisement

Area Type

Function

Common area

By default, devices in a common OSPF area do not generate default routes.

When a default route on the network is generated by another non-OSPF routing process, the device that generates the default route must advertise it within the entire OSPF AS. You can use commands to configure an ASBR to generate a default route. After configuration, the ASBR generates a Type 5 LSA carrying the default route and then advertises the LSA within the entire OSPF AS.

Stub area

A stub area does not allow AS external routes (carried in Type 5 LSAs) to be transmitted within the area.

All routers within a stub area must learn AS external routes from the ABR. The ABR automatically generates a Summary LSA (Type 3 LSA) carrying a default route and then advertises it within the entire stub area. This makes all routes to destinations outside an AS learnable from the ABR.

Totally stub area

A totally stub area does not allow AS external routes (carried in Type 5 LSAs) or inter-area routes (carried in Type 3 LSAs) to be transmitted within the area.

All routers within the totally stub area must learn AS external routes and inter-area routes from the ABR. The ABR automatically generates a Summary LSA (Type 3 LSA) carrying a default route and advertises it within the entire totally stub area. This makes all routes to destinations outside an AS and to destinations in other areas learnable from the ABR.

NSSA

An NSSA allows its ASBRs to import a small number of AS external routes. The ASBRs do not advertise Type 5 LSAs received from other areas within the NSSA. That is, AS external routes can be learned only from ASBRs in the NSSA.

Devices in an NSSA do not automatically generate default routes.

Use either of the following methods to generate default routes:
  • Method 1: To advertise AS external routes through the ASBR in the NSSA and advertise other external routes through other areas, configure a Type 7 LSA carrying a default route on the ABR and advertise this LSA within the entire NSSA. In this manner, a small number of AS external routes can be learned from the ASBR in the NSSA, and other routes can be learned from the ABR in the NSSA.
  • Method 2: To advertise all external routes through the ASBR in the NSSA, configure a Type 7 LSA carrying a default route on the ASBR and advertise this LSA within the entire NSSA.

The difference between the two methods is:

  • In method 1, an ABR generates a Type 7 LSA carrying a default route regardless of whether the routing table contains a default route.
  • An ASBR generates a Type 7 LSA carrying a default route only when the routing table contains a default route.

Default routes are flooded only within the local NSSA and are not flooded within the entire OSPF AS. If routers in the local NSSA cannot discover routes to the outside of the AS, the routers can forward packets outside of the AS through an ASBR. However, packets of other OSPF areas cannot be sent outside the AS through this ASBR. Type 7 LSAs carrying default routes are not translated into Type 5 LSAs to make the default routes be flooded within the entire OSPF AS.

Totally NSSA

A totally NSSA does not allow AS external routes (carried in Type 5 LSAs) or inter-area routes (carried in Type 3 LSAs) to be transmitted within the area.

All routers within the totally NSSA must learn AS external routes from the ABR. The ABR automatically generates a Type 3 LSA carrying a default route and advertises it within the entire totally NSSA. This allows all external routes received from other areas and inter-area routes to be advertised within the totally NSSA.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >