OSPF Multiarea Networks
Module Introduction
Before you start the hands-on part of this module, you should load the appropriate configuration and verify that the testbed is up and running by executing the corresponding robot file:
student@tour:~/trainings_resources/robot$ robot ospf_multiarea/ospf_multiarea_setup.robot
In order to get a better understanding, the lab setup is shown in the picture below.
OSPF Areas
OSPF areas allow you to divide a large single OSPF domain into smaller, more manageable parts. Each area can be thought of as a separate OSPF network, and routers within an area only need to maintain routing information for that area. This reduces the size of the OSPF link-state database and therefore reduces the CPU and memory resources needed to calculate and store the routing table. In addition, OSPF can converge faster by using areas because routers only need to recalculate routes within their own area.
OSPF areas are distinguished by 32-bit area IDs. The backbone area is designated as area 0.0.0.0 and serves as the core of the network, to which all other areas must connect, enabling traffic exchange. An OSPF router that connects interfaces in different OSPF areas is referred to as an OSPF Area Border Router (ABR). Conversely, routers with all interfaces residing in the same area are internal routers.
OSPF differs from IS-IS in how it separates areas. Instead of physical links, ABRs isolate different areas. This means that an OSPF router can belong to multiple areas simultaneously. |
Understanding Link-State Advertisements
Before delving into the specifics of OSPF multiarea configuration, let’s explore the various types of link-state advertisements (LSAs). In module Single-Area OSPF, we discussed two LSA types:
-
Router LSA (Type-1): Every OSPF router within an area generates a router LSA, containing a list of directly connected links. These LSAs are confined to the originating area.
-
External LSA (Type-5): An OSPF router that redistributes non-OSPF routes into OSPF is referred to as an Autonomous System Border Router (ASBR). ASBRs create external LSAs to disseminate information about non-OSPF routes.
If we split an OSPF domain into several areas, additional LSA types are generated. For the sake of demonstration, router R4 is now configured to be in area 0.0.0.4 and routers R2 and R3 were reconfigured to ABRs. Let’s first look at the impact on the OSPF database on R1:
cfg> show ospf database
Instance: default, Area: 0.0.0.0
Type Link State ID Advertising Router Age Sequence Checksum Cost Link Count
Router 192.168.0.1 192.168.0.1 247 0x80000005 0x2715 - 5
Router 192.168.0.2 192.168.0.2 248 0x80000008 0x3108 - 5
Router 192.168.0.3 192.168.0.3 253 0x80000008 0xef3e - 5
Summary-Network 172.16.0.8 192.168.0.2 988 0x80000001 0x7558 100 -
Summary-Network 172.16.0.8 192.168.0.3 977 0x80000001 0x5b0d 200 -
Summary-Network 172.16.0.16 192.168.0.2 987 0x80000001 0x1150 200 -
Summary-Network 172.16.0.16 192.168.0.3 986 0x80000001 0x1fa5 100 -
Summary-Network 192.168.0.4 192.168.0.2 987 0x80000001 0x8466 10100 -
Summary-Network 192.168.0.4 192.168.0.3 977 0x80000001 0x7e6b 10100 -
Summary-Asbr 192.168.0.4 192.168.0.2 987 0x80000001 0x75ab 100 -
Summary-Asbr 192.168.0.4 192.168.0.3 977 0x80000001 0x6fb0 100 -
Instance: default
Type Link State ID Advertising Router Age Sequence Checksum Cost Link Count
External 172.16.104.0 192.168.0.4 997 0x80000001 0x4d76 16777214 -
There are two new OSPF LSA types in the above output:
-
Summary-Network LSA (Type-3): The Summary-Network LSA is generated by an ABR. Its purpose is to represent all the information contained in a router-LSA from another OSPF area. This is because router-LSAs are confined to their originating areas and are not flooded to routers outside those areas. To achieve end-to-end reachability in a multi-area OSPF network, OSPF employs Summary-LSAs to convert the router-LSA information at the ABR, ensuring that routing details can be distributed effectively.
-
Summary-ASBR LSA (Type-4): To understand the role of the Summary-ASBR LSA, let’s take a step back and revisit the concept of external LSAs. An external LSA is unique in that it is not associated with a particular OSPF area. These LSAs are created by Autonomous System Border Routers (ASBRs) and are disseminated across the entire OSPF network without modification by ABRs. However, routers within the same OSPF area as the ASBR receive a router LSA for that ASBR, while routers in other areas do not. To bridge this information gap, ABRs generate another type of LSA, the Summary-ASBR LSA, which serves to represent an ASBR located outside of the ABR’s area. This LSA ensures that all routers within the OSPF network have the necessary knowledge to reach external networks.
Configuring Non-Backbone Area
We have already learnt about the area hierarchy in the CLI when configuring area 0.0.0.0, so let’s configure an additional area.
Configure a new unit for interface lo-0/0/0 and assign the IP address of 192.168.0.101/32 to it. Configure OSPF area 1 and associate the newly created loopback-interface to it.
Click to reveal the answer
cfg> set interface lo-0/0/0 unit 101
cfg> set interface lo-0/0/0 unit 101 instance default
cfg> set interface lo-0/0/0 unit 101 address ipv4 192.168.0.101/32
cfg> set instance default protocol ospf address-family ipv4 area 0.0.0.1 interface lo-0/0/0/101
cfg> commit
After we added area 0.0.0.1 to router R1, the originally internal router now became an ABR. This means that the OSPF link-state database has also changed and a new database for area 0.0.0.1 has been added that we can take a look at:
cfg> show ospf database area 0.0.0.1
Instance: default, Area: 0.0.0.1
Type Link State ID Advertising Router Age Sequence Checksum Cost Link Count
Router 192.168.0.1 192.168.0.1 32 0x80000001 0x5920 - 1
Summary-Network 172.16.0.0 192.168.0.1 32 0x80000001 0xcb0b 100 -
Summary-Network 172.16.0.4 192.168.0.1 32 0x80000001 0xa32f 100 -
Summary-Network 172.16.0.8 192.168.0.1 32 0x80000001 0x6703 200 -
Summary-Network 172.16.0.12 192.168.0.1 32 0x80000001 0xda95 190 -
Summary-Network 172.16.0.16 192.168.0.1 32 0x80000001 0x174b 200 -
Summary-Network 192.168.0.1 192.168.0.1 32 0x80000001 0xbc96 10000 -
Summary-Network 192.168.0.2 192.168.0.1 32 0x80000001 0x9e4f 10100 -
Summary-Network 192.168.0.3 192.168.0.1 32 0x80000001 0x9458 10100 -
Summary-Network 192.168.0.4 192.168.0.1 32 0x80000001 0x7611 10200 -
Summary-Asbr 192.168.0.4 192.168.0.1 32 0x80000001 0x6756 200 -
In area 0.0.0.1, there are no OSPF neighbors. Therefore, the only router LSA present is the one generated by R1 itself. From R1’s perspective, it plays the role of an Area Border Router (ABR) for Area 0.0.0.1. As a result, all Summary LSAs and Summary-ASBR LSAs in this area are generated by R1. These LSAs are essential for maintaining inter-area connectivity. ABRs, like R1, are responsible for modifying Summary and Summary-ASBR LSAs to ensure efficient routing between OSPF areas.
Stub Areas
Why did we introduce areas if all router LSAs are translated to Summary LSAs? The primary reason is to improve network scalability and reduce the size of the link-state database. At a first glance, this goal was not achieved. One important aspect of reducing the size of the link-state database is the introduction of stub areas. A stub area in OSPF is analogous to a dead-end road. It is an area that does not serve as a transit area for traffic passing between other areas. In a stub area, the number of exit points is limited, often consisting of only a few Area Border Routers (ABRs). This limited connectivity allows us to block external LSAs from entering the stub area, which further reduces the size of the OSPF database. This approach helps maintain a compact and efficient OSPF network structure, especially in scenarios where certain areas don’t need access to external routing information.
Configure area 0.0.0.1 to be a stub
area using the instance <instance> protocol ospf address-family ipv4 area <area> area-type
syntax.
Click to reveal the answer
cfg> set instance default protocol ospf address-family ipv4 area 0.0.0.1 area-type stub
cfg> commit
Let’s take a look at the result:
cfg> show ospf database area 0.0.0.1
Instance: default, Area: 0.0.0.1
Type Link State ID Advertising Router Age Sequence Checksum Cost Link Count
Router 192.168.0.1 192.168.0.1 481 0x80000001 0x5920 - 1
Summary-Network 0.0.0.0 192.168.0.1 22 0x80000001 0x7845 10000 -
Summary-Network 172.16.0.0 192.168.0.1 22 0x80000003 0xc70d 100 -
Summary-Network 172.16.0.4 192.168.0.1 22 0x80000003 0x9f31 100 -
Summary-Network 172.16.0.8 192.168.0.1 22 0x80000003 0x6305 200 -
Summary-Network 172.16.0.12 192.168.0.1 22 0x80000003 0xd697 190 -
Summary-Network 172.16.0.16 192.168.0.1 22 0x80000003 0x134d 200 -
Summary-Network 192.168.0.1 192.168.0.1 22 0x80000003 0xb898 10000 -
Summary-Network 192.168.0.2 192.168.0.1 22 0x80000003 0x9a51 10100 -
Summary-Network 192.168.0.3 192.168.0.1 22 0x80000003 0x905a 10100 -
Summary-Network 192.168.0.4 192.168.0.1 22 0x80000003 0x7213 10200 -
We can see, that in OSPF stub areas, external LSAs and Summary-ASBR LSAs are not allowed. To ensure reachability, a new Summary LSA representing the default route (0.0.0.0) is created.
By configuring a area to be stub, OSPF sets the External Routing Capability (E bit) in the options field of OSPF Hello packets to 0 indicating that it is not capable of routing external routes. By default, the E bit is set to 1 signaling that the router is capable of handling external routes. The E bit setting is essential for forming OSPF neighborships, i.e., all OSPF routers in the same area must be configured as stub area routers in order to establish an adjacency. |
The OSPF database is still large. But we can reduce it even more.
Configure area 0.0.0.1 to be a totally-stub
area using the instance <instance> protocol ospf address-family ipv4 area <area> area-type
syntax.
Click to reveal the answer
cfg> set instance default protocol ospf address-family ipv4 area 0.0.0.1 area-type totally-stub
cfg> commit
A totally stub area is an OSPF area where the Area Border Router (ABR) blocks not only external LSAs but also Summary-LSAs (Type-3 LSAs). In a totally stub area, there is only one Summary-LSA representing the default route. As filtering of Summary-LSAs takes place at the ABR only, routers internal to a totally stub area do not need to be aware of it, i.e., they cannot differentiate between being part of a stub or a totally stub area.
op> show ospf database area 0.0.0.1
Instance: default, Area: 0.0.0.1
Type Link State ID Advertising Router Age Sequence Checksum Cost Link Count
Router 192.168.0.1 192.168.0.1 71 0x80000001 0x5920 - 1
Summary-Network 0.0.0.0 192.168.0.1 71 0x80000001 0x7845 10000 -
It’s worth noting that OSPF, with the introduction of RFC 3101, introduced the concept of not-so-stubby areas (NSSA). NSSAs are similar to stub areas but allow Autonomous System Border Routers (ASBRs) to be located within the area, providing more flexibility for network design. Currently, NSSA is not supported in RBFS. |
To conclude this module, let’s summarize all LSA types at a glance.
LSA Type | LSA Name | Description | Originator |
---|---|---|---|
1 |
Router LSA |
Generated by each router and used to describe the state and cost of the router’s interfaces to the area |
all routers |
2 |
Network LSA |
Represents a broadcast network in the area which supports two or more routers and describes all routers attached to the network |
DR |
3 |
Summary-Network LSA |
Describe inter-area destinations |
ABR |
4 |
Summary-ASBR LSA |
Advertises location of ASBR to routers outside the area |
ABR |
5 |
External LSA |
Describes a particular destination which is external to OSPF |
ASBR |
7 |
NSSA LSA |
Describes external routes within an NSSA area |
ASBR |
9,10,11 |
Opaque LSA |
Describes OSPF extensions, e.g., graceful restart or segment routing |
all routers |