Why the flat picture falls apart
In the earlier guides of this rung we treated the network as one flat weighted graph and let every router compute least-cost paths to every destination — by flooding a full map and running Dijkstra in link-state routing, or by swapping distance vectors with neighbors using the Bellman-Ford idea. That works perfectly for a campus or a company. It does not work for the Internet, and the reason is pure arithmetic. There are hundreds of thousands of distinct destination networks out there. A flat scheme would force every router to know about every one of them.
Three costs explode at once. First, memory: every router would need a routing table with an entry for every network on Earth, and the forwarding table it derives would be just as enormous. Second, computation: Dijkstra's running time grows with the size of the graph, so rebuilding the tree over a planet-sized map every time a link flickers is hopeless. Third, churn: in a single flat domain, a flapping cable in one corner of the world would ripple a fresh round of updates to every router everywhere. The thing simply cannot converge if it never holds still.
Hierarchy: divide the world into regions
The first tool is hierarchical routing. Instead of one flat graph, we group routers into regions and route in two stages: in detail inside your own region, and in summary between regions. Think of how you give directions. Inside your own neighborhood you know every street; to reach another city you do not memorize its streets at all — you just know how to get onto the highway, and trust each city to handle its own roads once you arrive. A router does the same: full detail nearby, a coarse summary for everywhere else.
On the real Internet this regional unit is the autonomous system (AS): a network under one administration, like a university, a company, or an internet provider, that decides its own internal routing. Inside an AS you run an interior gateway protocol — the OSPF or RIP you met in the last guide — to learn every detail of your own region. Between autonomous systems, a completely different protocol (BGP, the subject of the next rung) carries only summaries: not every street in a network, but the fact that 'this whole block of addresses lives over there.' This two-level split is exactly why a router in Tokyo does not, and need not, know the internal wiring of a network in Brazil.
OSPF actually pushes hierarchy one level deeper, inside a single domain. A large OSPF network is split into areas, all hanging off a central backbone area. Routers flood their detailed link-state maps only within their own area, and area-border routers inject just summaries across the boundary. So even within one company, a problem in one area does not force every router company-wide to recompute. Hierarchy is fractal: the same divide-and-summarize idea is applied again at a smaller scale.
Aggregation: many addresses, one route
Hierarchy organizes routers; route aggregation shrinks what each of them must remember. The trick rides entirely on CIDR addressing from the IP rung. Because addresses are handed out in contiguous prefixes, a router can fold many specific networks into one summary prefix and advertise just that. Suppose an ISP owns 200.23.16.0/20, and it has carved that into many smaller customer networks like 200.23.16.0/23, 200.23.18.0/23, and so on. To the rest of the world the ISP does not announce every little piece. It announces one line: 'send anything matching 200.23.16.0/20 to me,' and sorts out the details internally.
Without aggregation: 8 routes leak to the world 200.23.16.0/23 -> ISP 200.23.18.0/23 -> ISP 200.23.20.0/23 -> ISP 200.23.22.0/23 -> ISP ... 4 more /23s ... With aggregation: 1 summary route covers them all 200.23.16.0/20 -> ISP (a /20 spans 16 of these /23 blocks) The outside world stores ONE entry instead of eight. The ISP keeps the detailed /23 routes only inside itself.
Aggregation only works when addresses are allocated hierarchically — when one provider's blocks really are contiguous and can be summarized as one. That is exactly why providers hand customers addresses out of their own range: it keeps the routing tables of the whole Internet from exploding. The honest limit is that the real world is messy. A customer who switches providers but keeps its old address block punches a hole in someone's clean summary, so that more-specific prefix must be advertised separately again. Aggregation is a tendency the addressing system encourages, not a law it can guarantee.
Two prefixes match — longest one wins
Summaries create an obvious puzzle. If a router holds a broad route for 200.23.16.0/20 and also a specific route for 200.23.18.0/23 that lives inside it, a packet headed for 200.23.18.5 matches both. Which entry wins? The rule, which you first met in the IP rung, is longest prefix match: the router always picks the entry with the most matching bits — the most specific route. The broad /20 is the safety net; the precise /23 is the detour that overrides it whenever it applies.
Longest prefix match is what makes hierarchy and aggregation safe to combine. You can advertise a broad summary AND override it locally with finer routes, and forwarding always does the most specific thing. It also explains a subtle point: aggregation never makes forwarding wrong, only coarser. A summarized route might send a packet on a slightly less ideal path than the full map would have chosen, but it still reaches a router that knows the rest of the way. We trade a little path optimality for an enormous reduction in table size, and on a planet-scale network that is a bargain.
The default route: when in doubt, go up
Aggregation has a glorious limit case. What is the coarsest possible summary? A prefix of length zero — 0.0.0.0/0 — which matches every address in existence. This is the default route, the single entry that says 'for anything I do not have a more specific route for, send it this way.' By longest prefix match, the default route is the loser of every contest: any real prefix is more specific, so the default only fires when nothing else matches. It is the catch-all at the very bottom of the table.
The default route is the ultimate expression of disciplined ignorance, and it is why your home router survives at all. Your router does not store a map of the Internet. It holds a tiny handful of local routes plus one default route pointing at your provider, and that single line covers the entire rest of the world. The pattern repeats up the hierarchy: a small office points its default at its ISP; that ISP points its default at a larger ISP; and so on, until you reach the very top of the Internet — the autonomous systems in the core that carry no default route because they genuinely must know about every destination directly.
- A packet arrives at your laptop's router headed for some public website. The router checks its table for the longest prefix that matches the destination.
- It finds no specific route — the destination is not on your home network or any block the router knows in detail. The only entry that matches is 0.0.0.0/0, the default route.
- By longest prefix match the default route wins by being the only match, so the router forwards the packet to its next hop: your ISP's router.
- Your ISP repeats the same logic with its own (larger) table, perhaps using its own default route up to a bigger provider, and so the packet climbs the hierarchy until it reaches a router with a specific route toward the destination.
The whole picture: small tables, planet-scale reach
Step back and the two ideas lock together. Hierarchy partitions the network so each router knows its own region in full and everywhere else only in summary. Aggregation, built on CIDR, lets those summaries be tiny — one short prefix standing for thousands of addresses — while longest prefix match guarantees that adding a summary never overrides a more specific local route. The default route is aggregation taken to its logical end: one line that means 'everything else, that way.'
This is the natural bridge out of intra-domain routing. Everything in this rung — modeling the network as a graph, link-state and distance-vector algorithms, RIP and OSPF — lives inside a single autonomous system, where one administrator wants the cheapest paths. The moment routing crosses between autonomous systems, the goal stops being 'shortest' and becomes 'whatever my business policy and contracts allow.' That world has its own protocol, BGP, and it is where the next rung begins.