hierarchical routing
Imagine trying to memorize directions to every single house on Earth — impossible. Instead the postal system uses a hierarchy: you only need to know how to reach the right country, then the right city, then the right street, then the house. Hierarchical routing applies the same idea to networks: routers keep detailed knowledge of their local region and only coarse, summarized knowledge of everywhere else.
In practice a large network is partitioned into regions (OSPF calls them areas; the Internet at large uses autonomous systems). A router holds the full topology only for its own region and runs its routing algorithm in detail there. To reach destinations in other regions, it does not need their internal maps; it only needs to know which border router leads toward each remote region, and the regions advertise their addresses as compact summaries (route aggregation) rather than as long lists of individual networks. This keeps each router's routing table and its computation small even as the overall network grows huge.
It matters because flat routing simply does not scale. If every router had to store and recompute paths to every individual destination on the Internet, the routing tables and the flooding traffic would be unmanageable. Hierarchy is the indispensable trick that lets both link-state protocols (OSPF areas) and the global Internet (autonomous systems) cope with millions of networks.
An honest caveat: hierarchy trades optimality for scale. Because a router sees only summaries of far-off regions, the path it picks across region boundaries can be slightly longer than the true global least-cost path — summarization can hide the cheapest internal route. Designers accept this small inefficiency because the alternative, perfect global knowledge everywhere, is impossible at Internet scale.
An OSPF network with areas 0, 1, and 2: a router in area 1 stores area 1's full map but only summaries like '10.2.0.0/16 lives behind border router R' for area 2. It never sees area 2's internal links — keeping its database small.
Detailed locally, summarized globally — the same principle behind postal codes and OSPF areas.
Hierarchy is what makes routing scale, but summarized paths across boundaries may be slightly sub-optimal. Scale is bought at a small cost in path quality.