Sub topic 19
Summarizing Routes at ABRs and ASBRs
This chapter assumes you know the router roles (internal, ABR, ASBR), the LSA types 1 to 5, and the difference between intra-area, inter-area, and external routes. It also assumes you can read a subnet mask in binary.
Why summarize
Without summarization, every ABR turns each intra-area prefix into its own Type 3 LSA, and every ASBR turns each redistributed prefix into its own Type 5 LSA. Every router that receives those LSAs stores them and reruns SPF when they change. A single flapping link in one area then disturbs routers in all the others.
Summarization replaces many specific prefixes with one aggregate. Routers outside the originating area see only the aggregate. If a component prefix flaps, the aggregate stays up, so no LSA changes and no SPF runs outside the area.
OSPF can only summarize at two places:
| Where | Router | What is summarized | LSA produced | Command (IOS style) |
|---|---|---|---|---|
| Area boundary | ABR | Intra-area routes leaving an area | Type 3 | `area X range` |
| Domain boundary | ASBR | Redistributed external routes | Type 5 (or 7 in an NSSA) | `summary-address` |
Inside an area, every router must hold an identical LSDB. For that reason you cannot summarize within an area.
Finding a valid summary
A summary must cover the component prefixes on a binary boundary. Four contiguous /24 networks starting at 10.1.0.0 collapse into 10.1.0.0/22, because the third octet values 0 to 3 differ only in the last two bits. The Python standard library can check this before you touch a router.
import ipaddress
def covering(nets):
net = nets[0]
while not all(n.subnet_of(net) for n in nets):
net = net.supernet()
return net
full = [ipaddress.ip_network(f"10.1.{i}.0/24") for i in range(4)]
gap = [ipaddress.ip_network(p) for p in
("10.1.0.0/24", "10.1.1.0/24", "10.1.3.0/24")]
print(covering(full)) # 10.1.0.0/22
print(list(ipaddress.collapse_addresses(full))) # one /22: an exact fit
print(covering(gap)) # 10.1.0.0/22
print(list(ipaddress.collapse_addresses(gap))) # a /23 and a /24: not exactIn the second case the /22 still works as a summary. It also covers 10.1.2.0/24, which does not exist in the area. OSPF allows this. Whether it is safe depends on the discard route described below.
Inter-area summarization on the ABR
Configure the range on the ABR, using the area number of the area where the specific prefixes live.
router ospf 1
router-id 2.2.2.2
area 1 range 10.1.0.0 255.255.252.0The ABR now advertises one Type 3 LSA for 10.1.0.0/22 into area 0 and suppresses the Type 3 LSAs for the individual /24 networks. Routers inside area 1 still see the specific routes, because the range only affects what leaves the area.
Behavior to know:
- The summary is advertised as long as at least one component route exists in the area. It is withdrawn only when the last component disappears.
- The summary cost is the largest cost among the components under the RFC 2328 rules. Older RFC 1583 compatibility mode uses the smallest. Mixed modes on one network can cause suboptimal routing, so keep them consistent.
- Add
not-advertiseto the range to suppress the components and advertise nothing in their place. - Ranges are configured per area. The same prefixes seen from another area need their own range statement on the ABR that borders that area.
External summarization on the ASBR
External routes are not in any area, so area range does not apply to them. Use summary-address on the ASBR that redistributes them.
router ospf 1
redistribute static subnets
summary-address 172.16.0.0 255.255.252.0The ASBR advertises one Type 5 LSA for 172.16.0.0/22 and suppresses the more specific externals. The route type and metric type of the summary follow the redistribution settings, E2 by default.
In an NSSA, the ASBR originates Type 7 LSAs, and the NSSA ABR translates them to Type 5. Summarize at the translating ABR with summary-address. Summarizing there, instead of at the ASBR, lets you aggregate the translated routes before they enter the backbone.
The discard route
When a router originates a summary, it also installs a route for that summary pointing to Null0. This route has an administrative distance of 110.
show ip route 10.1.0.0 255.255.252.0
show ip route ospfOn the ABR you will see something like O 10.1.0.0/22 is a summary, Null0. This route prevents routing loops. Suppose a packet arrives for 10.1.2.5, inside the /22 but with no specific route (the gap case above). Without the discard route, the ABR could follow a default route back toward the backbone, and the backbone would send the packet back to the ABR because of the summary. With the discard route, the longest-prefix match finds the /22 entry and the packet is dropped at once. Longest-prefix match still prefers real /24 routes whenever they exist.
Common errors
- Configuring
area rangeon a router that is not an ABR. The command is accepted but does nothing. The router needs interfaces in at least two areas, one of them area 0. - Using the wrong area number. The range must name the area that contains the specific prefixes, not the area you are advertising into.
- Using
summary-addressfor inter-area routes. On an ABR it affects only external and translated Type 7 routes. It never aggregates Type 3 LSAs. - Summarizing too broadly. A /16 summary over a few /24 networks attracts traffic for addresses that belong somewhere else, such as another router that also advertises part of that space. Those packets can be pulled to the wrong ABR and dropped.
- Summarizing non-contiguous space. If two ABRs each summarize a block that includes the other's prefixes, traffic follows the summary to the wrong exit. Design the addressing so each area owns one aggregatable block.
- Expecting less data inside the area. Summarization reduces what leaves the area. The area's own LSDB is unchanged.
Verification
Use these checks after configuring a summary:
show ip route ospfon a router in another area should show the singleO IAaggregate and no specific /24 entries.show ip ospf database summaryon a backbone router should show one Type 3 LSA for the aggregate.show ip ospf database externalshould show one Type 5 LSA for the external aggregate.- On the originating router, confirm the
Null0discard route is present.
Exercise
Area 2 contains 10.2.4.0/24, 10.2.5.0/24, 10.2.6.0/24, and 10.2.7.0/24. Write the ABR command that summarizes them into area 0 and say what route type a router in area 3 will show for the result.
Show answer
The command is area 2 range 10.2.4.0 255.255.252.0. The four third-octet values 4 to 7 share the same upper six bits, so the aggregate is 10.2.4.0/22. A router in area 3 learns it from a Type 3 LSA, so it shows it as an inter-area route (O IA). The ABR also installs a discard route for 10.2.4.0/22 pointing to Null0.
Exercise
An ASBR redistributes 192.168.8.0/24 through 192.168.11.0/24 from static routes. Which command aggregates them, which LSA type carries the aggregate, and why can't area range be used?
Show answer
Use summary-address 192.168.8.0 255.255.252.0 under router ospf. The aggregate is carried in a Type 5 LSA (Type 7 in an NSSA). area range works only on routes that belong to an area, and redistributed routes are external to every area.