By default, OSPF does not perform automatic route summarization. Instead, OSPF-enabled routers must be manually configured to summarize routes. In Cisco IOS software, different commands must be used to summarize internal and external routing information. The following sections describe both types of route summarization and delve into the specifics on each type of summary and how it is propagated throughout the OSPF domain.
Internal route summarization
In OSPF, ABRs are responsible for generating a single Type 3 Summary LSA for each intra-area route, i.e. Type 1 and Type 2 LSA, within their area. These LSAs are then flooded to adjacent areas, allowing for reachability between subnets and hosts in different areas. In large networks, this typically increases the overall size of the LSDB and the IP routing table. In addition to this, router resources, such as memory and processor utilization may become heavily taxed, resulting in poor overall network and device performance.
Assuming that a hierarchical IP addressing scheme is in place, internal route summarization can implemented on the ABR, allowing it to generate a single Type 3 LSA to represent a collection of intra-area routes. This reduces the overall size of the LSDB and IP routing table for routers in adjacent areas, also effectively reducing resource utilization on those devices. In Cisco IOS software, internal route summarization is configured by using the area [area ID] range [<address> <mask> [advertise | not-advertise] [cost <cost>] router configuration command on the Area Border Router (ABR).
The area ID is used to specify the OSPF area for which the summary route is being generated. The [<address>are <mask> are used to specify the aggregate (summary) address and its subnet mask. The advertise keyword allows the ABR to generate a Type 3 LSA for the summary route and flood it to adjacent areas. By default, this keyword is enabled when the area…range command is configured on the ABR.
The not-advertise keyword sets the DoNotAdvertise bit in the Type 3 LSA. This keyword configures the ABR to suppress both the aggregate Type 3 LSA as well as the Type 3 LSAs for the specific routes which are included in the summary. This is essentially a method of preventing Type 3 LSAs from being generated and flooded to adjacent areas. In other words, this keyword can be used to perform Type 3 LSA filtering in OSPF networks.
And finally, the cost <cost> keyword is used to manually specify the metric or cost for this summary route, which is used during OSPF SPF calculation to determine the shortest paths to the destination. The value can be 0 to 16777215. By default, the cost of the Type 3 LSA is derived from the lowest route metric of the specific routes contributing to the summary. The topology illustrated in Figure 3-29 will be used to demonstrate the configuration and validation of OSPF internal route summarization:
Fig. 3-29. OSPF Internal Route Summarization
Figure 3-29 shows a very basic multi-area OSPF network. R4 is advertising the 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24 subnets to R3, the ABR. The respective Loopback interfaces on R4 have been assigned to area 2 using the ip ospf 4 area 2 interface configuration command. In addition, the Loopback interfaces have also been assigned different cost values using the ip ospf cost interface configuration command. This configuration is illustrated in the following output:
| R4#show ip ospf interface brief | include Lo Interface PID Area IP Address/Mask Cost State Nbrs F/C Lo100 4 2 192.168.0.4/24 1 LOOP 0/0 Lo101 4 2 192.168.1.4/24 1 LOOP 0/0 Lo102 4 2 192.168.2.4/24 2 LOOP 0/0 Lo103 4 2 192.168.3.4/24 3 LOOP 0/0 |
These intra-area routes are flooded into area 2 by R4 and R3, the ABR, generates a single Type 3 Summary LSA for each individual route and floods this Summary LSA into the backbone area as illustrated in the output of theshow ip ospf database summary command on R3:
| R3#show ip ospf database summaryOSPF Router with ID (3.3.3.3) (Process ID 3)Summary Net Link States (Area 0)
[Truncated Output] LS age: 167 LS age: 167 LS age: 167 LS age: 169
[Truncated Output] |
Using the area…range command, the ABR (R3) can be configured to suppress the more specific routes and advertises a single Type 3 LSA representing these subnets. This configuration would be implemented on R3 as follows:
| R3(config)#router ospf 3 R3(config-router)#area 2 range 192.168.0.0 255.255.252.0 R3(config-router)#exit |
Following the configuration of the summary route on the ABR, the following happens:
- An intra-area route for the summary pointing to Null0 is installed into the routing table
- The specific Type 3 entries in the LSDB are replaced by the single Type 3 LSA
The first point can be validated using the show ip route command on R3 as shown below:
| R3#show ip route 192.168.0.0 255.255.252.0 Routing entry for 192.168.0.0/22, supernet Known via “ospf 3”, distance 110, metric 0, type intra area Routing Descriptor Blocks: * directly connected, via Null0 Route metric is 0, traffic share count is 1 |
To view the specific routes included in the summary address, the longer-prefixes keyword can be appended to this command as shown in the following output:
| R3#show ip route 192.168.0.0 255.255.252.0 longer-prefixes Codes: C – connected, S – static, R – RIP, M – mobile, B – BGP D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2 E1 – OSPF external type 1, E2 – OSPF external type 2 i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2 ia – IS-IS inter area, * – candidate default, U – per-user static route o – ODR, P – periodic downloaded static routeGateway of last resort is not set192.168.0.0/32 is subnetted, 1 subnets O 192.168.0.4 [110/65] via 10.0.2.4, 00:15:35, Serial0/0 192.168.1.0/32 is subnetted, 1 subnets O 192.168.1.4 [110/65] via 10.0.2.4, 00:15:35, Serial0/0 192.168.2.0/32 is subnetted, 1 subnets O 192.168.2.4 [110/66] via 10.0.2.4, 00:15:35, Serial0/0 192.168.3.0/32 is subnetted, 1 subnets O 192.168.3.4 [110/67] via 10.0.2.4, 00:15:35, Serial0/0 O 192.168.0.0/22 is a summary, 00:15:35, Null0 |
In regards to the second point, the show ip ospf database command can be issued on R3 to view the single aggregate entry in the LSDB as shown in the following output:
| R3#show ip ospf database | begin Summary Summary Net Link States (Area 0)Link ID ADV Router Age Seq# Checksum[Truncated Output] 192.168.0.0 3.3.3.3 3 0x80000001 0x00FA8E |
The show ip ospf database summary 192.168.0.0 command prints more detailed information on the summary. This includes the network ID, the advertising router, network mask as well the metric. The metric is derived by simply adding the cost of the link to the cost of reaching the network from R3 as shown in the following output:
| R3#show ip ospf database summary 192.168.0.0OSPF Router with ID (3.3.3.3) (Process ID 3)Summary Net Link States (Area 0)
LS age: 185 |
The cost of the link is the metric included in the LSA that is flooded by R2 to R3. This value can be viewed in the output of the show ip ospf database summary command on R3 prior to the summarization configuration has been implemented on the router. This is illustrated below:
| R3#show ip ospf database summaryOSPF Router with ID (3.3.3.3) (Process ID 3)Summary Net Link States (Area 0)
[Truncated Output]
LS age: 119 LS age: 119 LS age: 120 LS age: 121 |
When the not-advertise keyword is configured, the ABR suppresses the specific route entries and does not advertise the summary route. The DoNotAdvertise bit is set in the LSA and the LSA is not flooded to adjacent areas.
NOTE: Do not confuse the DoNotAdvertise bit with the DoNotAge bit in demand circuits. The two are not one and the same and they do not operate in the same manner.
Referencing the topology in Figure 3-29 and continuing with the same configuration examples, the following illustrates how to configure OSPF to suppress specific route entries that are included in the aggregate address by setting the DoNotAdvertise bit on the Type 3 LSA:
| R3(config)#router ospf 3 R3(config-router)#area 2 range 192.168.0.0 255.255.252.0 not-advertise R3(config-router)#exit |
After this configuration has been implemented on the router, the following happens:
- The specific entries included in the summary address range are removed from the LSDB
- The router does not generate a route to Null0 for the summary address
- The Type 3 LSA for the summary address will not be present in the Link State Database
To verify the above, first we will ensure that the routes are indeed still received by R3 from R4:
| R3#show ip route ospf | include 192.168. 192.168.0.0/32 is subnetted, 1 subnets O 192.168.0.4 [110/65] via 10.0.2.4, 00:08:05, Serial0/0 192.168.1.0/32 is subnetted, 1 subnets O 192.168.1.4 [110/65] via 10.0.2.4, 00:08:05, Serial0/0 192.168.2.0/32 is subnetted, 1 subnets O 192.168.2.4 [110/66] via 10.0.2.4, 00:08:05, Serial0/0 192.168.3.0/32 is subnetted, 1 subnets O 192.168.3.4 [110/67] via 10.0.2.4, 00:08:05, Serial0/0 |
Next, look at the contents of the LSDB on R3 to ensure that neither the specific entries nor the Type 3 LSA for the summary route is included as shown below:
| R3#show ip ospf databaseOSPF Router with ID (3.3.3.3) (Process ID 3) Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum Router Link States (Area 2) Link ID ADV Router Age Seq# Checksum Link count Summary Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum |
And finally, the cost keyword overrides the metric for the summary address and uses the value specified in the configuration of the summary. This configuration is illustrated below:
| R3(config)#router ospf 3 R3(config-router)#area 2 range 192.168.0.0 255.255.252.0 cost 333 R3(config-router)#exit |
Based on this configuration, the show ip ospf database summary 192.168.0.0 command reflects the manually configured cost value for the Type 3 LSA:
| R3#show ip ospf database summary 192.168.0.0OSPF Router with ID (3.3.3.3) (Process ID 3)Summary Net Link States (Area 0)
LS age: 36 |
This cost value will be included in the Type 3 LSAs flooded into adjacent areas. For example, R2 would reflect the same value in its LSDB and then increment that value by the cost of reaching R3 from itself before flooding it to adjacent areas, i.e. area 1:
| R2#show ip ospf database summary 192.168.0.0OSPF Router with ID (2.2.2.2) (Process ID 2)Summary Net Link States (Area 0)
Routing Bit Set on this LSA
Summary Net Link States (Area 1) LS age: 209 |
R2 would calculate the route metric for the 192.168.0.0/22 network by adding the received metric value to the cost of reaching R2 from itself. Assuming the default OSPF reference bandwidth is used, the default cost for the FastEthernet link between R2 and R3 would be 1. R2 would simply add 1 to 333 to derive the route metric 334 for this subnet:
| R2#show ip route 192.168.0.0 255.255.252.0 Routing entry for 192.168.0.0/22, supernet Known via “ospf 2”, distance 110, metric 334, type inter area Last update from 10.0.1.3 on FastEthernet0/0, 00:06:57 ago Routing Descriptor Blocks: * 10.0.1.3, from 3.3.3.3, 00:06:57 ago, via FastEthernet0/0 Route metric is 334, traffic share count is 1 |
External route summarization
When configuring OSPF route summarization, internal route summarization is configured on the ABR; however, external route summarization must be configured on the ASBR. External route summarization in OSPF is configured using the summary-address [<address> <mask> | prefix] [not-advertise] [tag <tag>] [nssa-only]router configuration command. The [<address> <mask>keywords are used to specify the summary network address and its subnet mask.
The prefix keyword is used to specify a prefix mask length for the summary network address instead of a dotted-decimal subnet mask. The not-advertise keyword suppresses both the specific external entries and the summary route entry from being advertised. The tag <tag> keyword is used to specify the route tag for the summary address. By default, as was illustrated earlier in this chapter, this field will contain the process ID of the ASBR.
The final keyword, the nssa-only keyword is used on the NSSA ASBR to set the NSSA-only attribute for the summary route. This limits the summary to not-so-stubby-area (NSSA) areas.
Referencing the topology illustrated in Figure 3-29, the Loopback interfaces that are configured on R4 and previously advertised an internal OSPF routes are now redistributed into OSPF on the same router using theredistribute connected subnets router configuration command, making R4 an ASBR. The LSDB of R4 shows the following:
| R4#show ip ospf database | begin External Type-5 AS External Link StatesLink ID ADV Router Age Seq# Checksum Tag 192.168.0.0 4.4.4.4 21 0x8000000D 0x00A575 0 192.168.1.0 4.4.4.4 26 0x80000001 0x00B273 0 192.168.2.0 4.4.4.4 26 0x80000001 0x00A77D 0 192.168.3.0 4.4.4.4 26 0x80000001 0x009C87 0 |
These routes are then advertised to R3 as External Type 2 (default) routes as illustrated in the output of theshow ip route command on R3:
| R3#show ip route ospf | include 192.168 O E2 192.168.0.0/24 [110/20] via 10.0.2.4, 00:00:48, Serial0/0 O E2 192.168.1.0/24 [110/20] via 10.0.2.4, 00:00:53, Serial0/0 O E2 192.168.2.0/24 [110/20] via 10.0.2.4, 00:00:53, Serial0/0 O E2 192.168.3.0/24 [110/20] via 10.0.2.4, 00:00:53, Serial0/0 |
Before summarizing on these routes on the ASBR, let us take a detailed look at one of the individual route entries in the LSDB using the show ip ospf database external command as shown in the following output:
| R3#show ip ospf database external 192.168.1.0OSPF Router with ID (3.3.3.3) (Process ID 3)Type-5 AS External Link States
Routing Bit Set on this LSA |
In the output above, the section printed in bold the Type 5 LSA for the 192.168.1.0/24 subnet is advertised to R3 by R4. By default, OSPF routes are Type 2 External LSAs. The metric value assigned to the route is 20. This brings us to two important points:
When routes are redistributed into OPSF from external routing sources, for example, connected interfaces or routes received via EIGRP, if a metric is not specified during redistribution, the routes are assigned a default metric value of 20 because the metric values of external protocols are incompatible with OSPF metric values. This same value will be applied to the summary.
When routes are redistributed into OSPF from another OSPF process, the metric values are carried over because they are compatible. In this case, the summary metric will be set to the lowest metric value of all contributing routes. The output below illustrates the metric on routes redistributed from another OSPF process using theredistribute ospf [process ID] subnets router configuration command:
| R3#show ip ospf database external 192.168.1.0OSPF Router with ID (3.3.3.3) (Process ID 3)Type-5 AS External Link States
Routing Bit Set on this LSA |
The Forward Address will always be 0.0.0.0, indicating that traffic to this network should be forwarded to the ASBR. A corresponding Type 4 for the ASBR is automatically generated and flooded to adjacent areas. And finally, the route tag field contains a value of 0 for all redistributed routes, by default. However, Cisco IOS software allows all redistributed routes to be assigned a route tag during redistribution. The tag can then be used for route filtering.
NOTE: Route redistribution is described in detail later in this guide.
The following configuration example shows how to summarize the external routes that have been redistributed into OSPF on R4 and generate a single route entry:
| R4(config)#router ospf 4 R4(config-router)#summary-address 192.168.0.0 255.255.252.0 R4(config-router)#exit |
After this configuration has been implemented, the following is performed on the ASBR:
- An intra-area route for the summary pointing to Null0 is installed into the routing table
- The specific Type 5 entries in the LSDB are replaced by the single Type 5 LSA
The intra-area route representing the configuration summary address can be viewed by issuing the show ip route command as shown in the output below:
| R4#show ip route 192.168.0.0 255.255.252.0 Routing entry for 192.168.0.0/22, supernet Known via “ospf 4”, distance 110, metric 0, type intra area Routing Descriptor Blocks: * directly connected, via Null0 Route metric is 0, traffic share count is 1 |
The second point can be validated by looking at the contents of the LSDB on R4:
| R4#show ip ospf database externalOSPF Router with ID (4.4.4.4) (Process ID 4)Type-5 AS External Link States
LS age: 4 |
Alternatively, the show ip ospf summary command could be used to verify most of the parameters illustrated above. The output of this command is shown below:
| R4#show ip ospf summary-addressOSPF Process 4, Summary-address192.168.0.0/255.255.252.0 Metric 20, Type 2, Tag 0 |
Because the summary address is advertised as a Type 2 External LSA, the assigned route metric remains consistent throughout the network as shown below on R3:
| R3#show ip route 192.168.0.0 255.255.252.0 Routing entry for 192.168.0.0/22, supernet Known via “ospf 3”, distance 110, metric 20, type extern 2, forward metric 64 Last update from 10.0.2.4 on Serial0/0, 00:04:39 ago Routing Descriptor Blocks: * 10.0.2.4, from 4.4.4.4, 00:04:39 ago, via Serial0/0 Route metric is 20, traffic share count is 1 |
We will conclude this section by listing the differences between the area…range and the summary-addressrouter configuration commands. It is important to understand the differences between these two commands as they apply to the configuration of OSPF route summarization. The important aspects to remember in regards to the area…range router configuration command are as follows:
- This command is issued on the Area Border Router (ABR)
- An intra-area route for the summary pointing to Null0 is installed into the routing table
- The specific Type 3 entries in the LSDB are replaced by the single Type 3 LSA
- The summary is not advertised if none of the contributing entries are in the routing table
- The summary address metric can be set directly using this command
- The summary metric is equal to the lowest metric of all contributing routes
- This command can be used for OSPF route filtering
The important aspects to remember in regards to the summary-address router configuration command are as follows:
- This command is issued on the Autonomous System Border Router (ASBR)
- An intra-area route for the summary pointing to Null0 is installed into the routing table
- The specific Type 5 entries in the LSDB are replaced by the single Type 5 LSA
- The summary is not advertised if none of the contributing entries are in the routing table
- The summary metric defaults to 20 for non-OSPF external routes
- The summary metric uses the lowest contributing route metric for external OSPF routes
- This command can be used for OSPF route filtering
- The summary address metric cannot be set directly using this command
