Route aggregation in hierarchical routing
Routers forward packets using information in their .
Early classful addressing made it difficult to match an allocation to the size of a network. CIDR introduced prefixes with an explicit length, but a large number of specific routes still increases table size and the number of routing updates processed by routers.
The solution is to advertise a common prefix that covers several more-specific routes. An external router can use one summary route, while routers closer to the destination retain specific routes. This is the essence of .
This approach follows the hierarchy of address allocation and limits the scope of routing changes. Route selection still uses longest-prefix matching.
A router can install the aggregate with one next hop while more-specific routes use different next hops. If the aggregate covers addresses without a real component network, the configuration should provide controlled discard behavior.
Aggregation, summarization, and supernetting
These terms describe related operations, but their scope depends on the context:
- Route aggregation: This is the general concept of combining multiple routes into one summary prefix. In BGP (Border Gateway Protocol), it can describe advertising prefixes between Autonomous Systems when the address allocation permits a safe summary.
- Route summarization: This term is often used with Interior Gateway Protocols (IGPs) such as OSPF and EIGRP. It describes creating a shorter prefix at a boundary between areas or parts of one organization's network, reducing the number of routes passed onward.
- Supernetting: This technical term describes creating a shorter prefix than the component prefixes. It combines contiguous, correctly aligned blocks within the classless CIDR model. Explanations based on default class masks are mainly historical.
Aggregation and summarization both create a common prefix for component routes. The bit-level check is the same, while the validity of an advertisement also depends on topology and prefix scope.
The mathematics of route summarization
Route aggregation is a bit-level process. An ISP wants to advertise a summary route for four customers that have been assigned these contiguous /24 networks:
- 217.15.112.0/24
- 217.15.113.0/24
- 217.15.114.0/24
- 217.15.115.0/24
Step 1: convert the addresses to binary
The first two octets are the same (217.15), so the comparison can focus on the third octet. Write its values as 8-bit binary numbers:
- 112 →
01110000 - 113 →
01110001 - 114 →
01110010 - 115 →
01110011
Step 2: find the common matching bits
Line up the values and compare them from left to right. Find the longest sequence of bits that is identical for every address.
01110000011100010111001001110011
The first 6 bits (011100) are identical for all four values. The 7th bit is the first position where they differ (0 and 1).
The common prefix therefore contains 16 bits shared by the first two octets and 6 bits from the third octet.
Step 3: calculate the summary route
The boundary of the common prefix is now known.
- The new prefix length: The first two octets were all common (8 + 8 = 16 bits). Add the 6 matching bits from the third octet.
Total prefix length = . The new prefix is/22. - The network address: Take the first address of the block (217.15.112.0) and set every bit after the new prefix boundary to zero. The first 22 bits include the common fragment
011100of the third octet. The remaining bits produce binary octet01110000, or decimal value 112, so the network address is217.15.112.0.
The Final Result
The summary route that exactly covers these four individual networks is 217.15.112.0/22. The ISP can advertise this one prefix instead of four /24 routes when its topology and routing policy permit the summary.
A /22 contains four /24 blocks because their prefix lengths differ by two bits. The start address 217.15.112.0 is aligned to a /22 boundary, so the aggregate spans 217.15.112.0 through 217.15.115.255 without additional /24 networks.
A shorter prefix would cover additional networks, while a longer prefix would fail to include all four customers. The prefix length therefore expresses both the common bits and the exact size of the aligned block.
The forwarding table can retain a more-specific route when a component needs a different next hop.
Rules for correct summarization
Correct summarization requires a matching bit pattern, an address plan, and a protocol that carries the prefix length. The advertisement direction, return path, and next-hop behavior also need verification.
- Rule 1: contiguous and aligned blocks.
The networks must form a contiguous block, and their count must be a power of two. The first address must align with the boundary of the resulting prefix. Networks 10.1.8.0/24 through 10.1.11.0/24 form a valid /22 block. Networks 10.1.8.0/24 and 10.1.20.0/24 do not form one exact summary without including the space between them.
- Rule 2: hierarchical address planning.
Effective summarization requires planning address allocation according to topology. ISPs and large organizations can assign larger blocks to regions and then divide them among sites and subnets. This structure enables summarization at successive levels and limits the scope of routing changes.
- Rule 3: classless routing.
Summarization requires a protocol that carries the prefix length with the network address. Classless protocols such as OSPF, EIGRP, and BGP can carry CIDR prefixes. RIPv1 and other classful protocols do not describe such routes in a way that supports prefixes crossing historical class boundaries, such as /22. A classless receiver can also retain a more-specific route when it has precedence at that location.
Benefits and limitations of route aggregation
Core benefits
- Smaller routing tables: Fewer routes reduce the memory needed to store routing information and the processing cost of updates. Lookups still use longest-prefix matching.
- More stable advertisements: Summarization can limit propagation of a local route change. If at least one component route remains reachable, the aggregate can remain advertised while changes to other components stay closer to their source. The configuration must direct traffic for unreachable covered ranges to controlled discard.
- Reduced routing protocol overhead: Advertising one summary route instead of many specific routes reduces the number of entries in update messages and the bandwidth used by routing updates. It also reduces the number of changes neighboring routers must process.
Potential drawbacks and considerations
- Suboptimal routing: Aggregation can hide a more-specific path. An external router may know only one path to the /22 block even though a better route to one /24 subnet within it exists through another ISP. The result depends on the advertisements available and longest-prefix matching.
- Discarding traffic in an aggregate: If a summary remains advertised after component routes become unreachable, packets can enter the aggregate and be discarded. A discard or null route and a condition for advertising the aggregate help limit loops and uncontrolled forwarding.