Hi,
As an effective means to reduce OSPF LSDB and OSPF routing table, OSPF route summarization is very different from that of other routing protocols, such as BGP. In this post, we are going to introduce the OSPF route summary.
What is route summarization?
Route summarization refers to the operation in which the device aggregates a part of the learned route network segments into a single route according to certain rules. Generally, route summarization can greatly reduce device routing table entries and forwarding table entries. On the one hand, it can reduce the burden on the device, and on the other hand, it also enables the device to save more routes to different addresses.
While route summarization looks great, it is also flawed. The biggest problem is that it can cause black hole routing.
For example the following example,

Figure 1: Loop due to route summarization
R2 sends the learned route 10.1.1.0/28 to R1, and R1 summarizes this route into 10.1.1.0/24. If R2 is equipped with a default route to R1, at this time, if R1 receives a packet destined for 10.1.1.128, it will forward it to R2, and there is no route to 10.1.1.128 on R2, it will send the data packet back to R1, in which scenario, a loop is generated.
Therefore, in the process of configuring route summarization, it is necessary to carefully consider whether it will cause such problems.
Why do we need OSPF route summarization?
In the previous articles, we know that for OSPF edge routers, we can configure stub area, totally stub area, NSSA area or totally NSSA area to reduce its stored LSDB and OSPF routing table entries. But if there are too many LSDB entries on the backbone routers, or areas that are not backbones but cannot be configured as special areas, how can we reduce the number of LSDB and OSPF routes on these routers?
From the previous description, we can know that it can be achieved through route summarization.
Since OSPF is a link-state routing protocol, OSPF routers do not transmit routes but link-state information. Therefore, OSPF routes control the transmission of link-state information by summarizing LSAs, thereby reducing the size of the LSDB database, and then controlling the summarization of routes.
Since OSPF routes are divided into intra-area routes, inter-area routes, and external routes (that is, routes imported into the OSPF process), intra-area routes do not need to be summarized. Therefore, OSPF route summarization includes two types: inter-area route summarization and external route summarization.
OSPF Inter-Area Route Summary
OSPF inter-area route summarization refers to the operation of converging multiple LSAs into one LSA by configuring on the ABR when OSPF LSAs are diffused between different areas and then performing the diffusion operation.

Figure 2: OSPF Inter-Area Route Summary
As shown in the figure above, assuming that the network segment between R1 and R2 is 10.1.1.0/24, and the network segment between R2 and R3 is the network segment 10.1.0.0/24, then on R4 and R5, you will learn two OSPF routes, namely 10.1.1.0/24 and 10.1.0.0/24. If we summarize these two network segments on R1 and summarize them into 10.1.0.0/23, then there will be only one OSPF network segment on R4 and R5, namely 10.1.0.0/23.
It should be noted that when configuring route summarization on the ABR, you need to configure it under the area. For example, in this example, we want to summarize the two network segments 10.1.0.0/24 and 10.1.1.0/24 in area 1. Then, we need to configure aggregation under area 1 on R1.
Observing the LSDB data on R1 and R4, we can see that R1 aggregates the two routes 10.1.1.0/24 and 10.1.0.0/24 into one LSA and sends it to area 0.

Figure 3: OSPF Inter-Area Route Summary
OSPF External Route Summary
In addition to OSPF inter-area route summarization, when OSPF imports external routes, we can also configure route summarization on ASBR.

Figure 4: OSPF External Route Summary
Similar to OSPF inter-area route summarization, OSPF external route summarization also generates LSAs based on the summarized routes for diffusion after route summarization is completed.
Checking the LSDB on R2, you can see the aggregated LSA.

Figure 5: OSPF External Route Summary LSDB
Configuring OSPF Route Summarization
Configuring OSPF route summarization is divided into configuring OSPF inter-area route summarization and configuring OSPF external route summarization.
Note: OSPF inter-area route summarization can only be configured on the ABR, and OSPF external route summarization can only be configured on the ASBR.
Configuring Inter-Area Route Summarization
[R1] ospf 1
[R1-ospf-1] area 1
[R1-ospf-1-area-0.0.0.1] abr-summary 10.1.0.0 255.255.254.0
Configure External Route Summarization
[R3] ospf 1
[R3-ospf-1] asbr-summary 1.1.0.0 255.255.252.0
That's all for this post, if you have any further questions, please feel free to let us know!
Thank you!