As shown in Part 1, routing tables increase in the number of entries as more and more networks are connected to the OSPF domain.
To reduce the size of the routing table and LSDB, network prefixes must be summarized. Route summarization improves OSPF performance as fewer network entries are required.
Route summarization involves consolidating multiple routes into a single advertisement. Proper route summarization reduces the bandwidth, memory, and CPU resources consumed by the OSPF process.
OSPF routes can only be summarized between areas. Interarea route summarization is configured on ABRs using the area area-id range network subnet-mask [advertise | not-advertise] [cost metric] router configuration command.
Parameter | Description |
area area-id | Identifies the area subject to route summarization. |
address | The summary address designated for a range of addresses. |
mask | The IP subnet mask used for the summary route. |
advertise | Enabled by default, it sets the address range status to advertise and generate a type 3 summary LSA. |
not-advertise | (Optional) Sets the address range status to DoNotAdvertise. Can be used for route filtering as the type 3 summary LSA is suppressed, and the component networks remain hidden from other networks. |
cost cost | (Optional) Metric or cost for this summary route, which is used during the OSPF SPF calculation to determine the shortest paths to the destination. The value can be 0 to 16777215. |
In this part, you will learn how to reduce the number of routing entries without compromising access to any networks.
Area 1 consists of networks 10.10.0.0/30, 10.10.1.0/24, 10.10.2.0/24, and 10.10.3.0/24. To calculate the summary address of these networks:
1) List the networks in binary format.
2) Count the number of left-most matching bits to determine the mask.
3) Copy the matching bits and add zero bits to determine the network address.
The four networks are listed in binary format.
Network | 1st Octet | 2nd Octet | 3rd Octet | 4th Octet |
10.10.0.0 | 0000 1010 | 0000 1010 | 0000 0000 | 0000 0000 |
10.10.1.0 | 0000 1010 | 0000 1010 | 0000 0001 | 0000 0000 |
10.10.2.0 | 0000 1010 | 0000 1010 | 0000 0010 | 0000 0000 |
10.10.3.0 | 0000 1010 | 0000 1010 | 0000 0011 | 0000 0000 |
There are 22 left-most bits that match. Octet 1 and 2 match for a sum of 16 bits. There are 6 left-most bits that match in the 3rd octet which results in a total of 22 bits that match.
A /22 subnet converts to 255.255.252.0.
Therefore, the summary network address of networks 10.10.0.0/30, 10.10.1.0/24, 10.10.2.0/24, and 10.10.3.0/24 is 10.10.0.0 255.255.252.0.
Open configuration window
a. On the Area 1 ABR router R1, enter OSFP router config mode.
R1(config)# router ospf 123 |
b. Summarize the D1 LANs using the area 1 range 10.10.0.0 255.255.252.0 router configuration command.
R1(config-router)# area 1 range 10.10.0.0 255.255.252.0 R1(config-router)# end |
a. Verify the routing table of R1 using the show ip route ospf command.
Open configuration window
R1# show ip route ospf | begin Gateway Gateway of last resort is 172.16.0.1 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 10.0.0.0/8 is variably subnetted, 16 subnets, 4 masks O 10.10.0.0/22 is a summary, 00:40:51, Null0 O 10.10.1.0/24 [110/11] via 10.10.0.2, 00:40:51, GigabitEthernet0/1 O 10.10.2.0/24 [110/2] via 10.10.0.2, 00:40:51, GigabitEthernet0/1 O 10.10.3.0/24 [110/2] via 10.10.0.2, 00:40:51, GigabitEthernet0/1 O IA 10.10.4.0/30 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.5.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.16.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.17.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.18.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.19.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.20.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.21.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.22.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 O IA 10.10.23.0/24 [110/4] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks O 172.16.1.0/30 [110/2] via 172.16.0.1, 00:40:51, GigabitEthernet0/0 |
The routing table of the ABR using the summary address adds a discard route entry to the Null 0 interface to prevent routing loops. The portions of the summarized network range will not have a more specific route in the routing table.
b. Verify the routing table of R2 using the show ip route ospf command.
R2# show ip route ospf | begin Gateway Gateway of last resort is 0.0.0.0 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 11 subnets, 3 masks O IA 10.10.0.0/22 [110/2] via 172.16.0.2, 00:36:38, GigabitEthernet0/0 O IA 10.10.4.0/30 [110/2] via 172.16.1.2, 02:20:03, GigabitEthernet0/1 O IA 10.10.5.0/24 [110/12] via 172.16.1.2, 01:30:21, GigabitEthernet0/1 O IA 10.10.16.0/24 [110/3] via 172.16.1.2, 01:20:39, GigabitEthernet0/1 O IA 10.10.17.0/24 [110/3] via 172.16.1.2, 01:20:39, GigabitEthernet0/1 O IA 10.10.18.0/24 [110/3] via 172.16.1.2, 01:20:39, GigabitEthernet0/1 O IA 10.10.19.0/24 [110/3] via 172.16.1.2, 01:20:39, GigabitEthernet0/1 O IA 10.10.20.0/24 [110/3] via 172.16.1.2, 01:20:39, GigabitEthernet0/1 O IA 10.10.21.0/24 [110/3] via 172.16.1.2, 01:20:39, GigabitEthernet0/1 O IA 10.10.22.0/24 [110/3] via 172.16.1.2, 01:20:39, GigabitEthernet0/1 O IA 10.10.23.0/24 [110/3] via 172.16.1.2, 01:20:39, GigabitEthernet0/1 |
Notice how the previous four route entries for network 10.10.0.0 to 10.0.3.0 have now been summarized onto one route.
Area 2 consists of networks 10.10.4.0/30 and 10.10.5.0/24. It also consists of LANs 10.10.16.0/24 through to 10.10.23.0/24. These networks are not contiguous and cannot easily be summarized. For this reason, two summary commands will be configured on R3.
Open configuration window
a. On R3 enter OSFP router config mode.
R3(config)# router ospf 123 |
b. The first summary advertisement will be for the 10.10.4.0/30 and 10.10.5.0/24 networks. To summarize they are listed in binary format.
Network | 1st Octet | 2nd Octet | 3rd Octet | 4th Octet |
10.10.4.0 | 0000 1010 | 0000 1010 | 0000 0100 | 0000 0000 |
10.10.5.0 | 0000 1010 | 0000 1010 | 0000 0101 | 0000 0000 |
There are 23 left-most bits that match. Octet 1 and 2 match for a sum of 16 bits. There are 7 left-most bits that match in the 3rd octet which results in a total of 23 bits that match.
A /23 subnet converts to 255.255.254.0. Therefore, the summary network address of networks 10.10.4.0/30 and 10.10.5.0/24 is 10.10.4.0 255.255.254.0.
Summarize the D2 LANs and using the area 2 range 10.10.4.0 255.255.254.0 router configuration command.
R3(config-router)# area 2 range 10.10.4.0 255.255.254.0 |
c. The second summary advertisement will be for the 10.10.16.0/24 through to 10.10.23.0/24 networks. Although all eight networks could be listed in binary format, it is possible to discover the summary addresses by only listing the first network and last network in binary format.
Network | 1st Octet | 2nd Octet | 3rd Octet | 4th Octet |
10.10.16.0 | 0000 1010 | 0000 1010 | 0001 0000 | 0000 0000 |
10.10.23.0 | 0000 1010 | 0000 1010 | 0001 0111 | 0000 0000 |
There are 21 left-most bits that match. Octet 1 and 2 match for a sum of 16 bits. There are 5 left-most bits that match in the 3rd octet which results in a total of 21 bits that match.
A /21 subnet converts to 255.255.248.0. Therefore, the summary network address of networks 10.10.16.0/24 through to 10.10.23.0/24 is 10.10.16.0 255.255.248.0.
A cost can also be assigned to a summary route by using the cost keyword.
Summarize the D2 LANs and assign them a cost of 65 using the area 2 range 10.10.16.0 255.255.248.0 cost 65 router configuration command.
R3(config-router)# area 2 range 10.10.16.0 255.255.248.0 cost 65 |
a. Verify the routing table of R1using the show ip route ospf command.
Open configuration window
R3# show ip route ospf | begin Gateway Gateway of last resort is 172.16.1.1 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 172.16.1.1, 00:01:14, GigabitEthernet0/1 10.0.0.0/8 is variably subnetted, 14 subnets, 6 masks O IA 10.10.0.0/22 [110/3] via 172.16.1.1, 00:01:14, GigabitEthernet0/1 O 10.10.4.0/23 is a summary, 00:01:14, Null0 O 10.10.5.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 O 10.10.16.0/21 is a summary, 00:01:14, Null0 O 10.10.16.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 O 10.10.17.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 O 10.10.18.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 O 10.10.19.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 O 10.10.20.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 O 10.10.21.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 O 10.10.22.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 O 10.10.23.0/24 [110/2] via 10.10.4.2, 00:01:14, GigabitEthernet0/2 172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks O 172.16.0.0/30 [110/2] via 172.16.1.1, 00:01:14, GigabitEthernet0/1 |
R3 added two discard route entries to the Null 0 interface to prevent routing loops.
b. Verify the routing table of R2 using the show ip route ospf command.
R2# show ip route ospf | begin Gateway Gateway of last resort is 0.0.0.0 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks O IA 10.10.0.0/22 [110/2] via 172.16.0.2, 00:01:25, GigabitEthernet0/0 O IA 10.10.4.0/23 [110/2] via 172.16.1.2, 00:01:25, GigabitEthernet0/1 O IA 10.10.16.0/21 [110/66] via 172.16.1.2, 00:00:04, GigabitEthernet0/1 |
Notice how R2 now has only two route entries for the D2 LANs. Previous to route summarization on R3, R2 had 10 route entries for the D2 LANs. Also notice the cost of the 10.10.16.0/21 route has been influenced.
c. Verify the routing table of D1 using the show ip route ospf command.
D1# show ip route ospf | begin Gateway Gateway of last resort is 10.10.0.1 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 10.10.0.1, 01:19:46, GigabitEthernet1/0 10.0.0.0/8 is variably subnetted, 10 subnets, 5 masks O IA 10.10.4.0/23 [110/4] via 10.10.0.1, 00:10:04, GigabitEthernet1/0 O IA 10.10.16.0/21 [110/68] via 10.10.0.1, 00:09:23, GigabitEthernet1/0 172.16.0.0/30 is subnetted, 2 subnets O IA 172.16.0.0 [110/2] via 10.10.0.1, 01:19:46, GigabitEthernet1/0 O IA 172.16.1.0 [110/3] via 10.10.0.1, 01:19:46, GigabitEthernet1/0 |
Notice how its routing table is smaller.
d. Verify connectivity to D2.
D1# ping 10.10.23.1 source 10.10.1.1
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.10.23.1, timeout is 2 seconds: Packet sent with a source address of 10.10.1.1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms |