OSPF Inter-Area Routing

Inside an area every router holds the whole map, but no router LSA ever leaves its area. Routes between areas are carried by the ABRs as summary LSAs: a prefix and a cost, with nothing of the links behind them. This demo follows one such route from area 2 to area 1 across the network from the Hello , Database Exchange and Shortest Path First demos, then configures an area range to show what summarising addresses changes.

Areas and ABRs

  • Each area has its own database. R1A holds area 1's router LSAs and nothing else, so it knows every link in area 1 and none beyond.
  • An ABR sits in two areas. ABR-2 holds area 0's database and area 2's, and runs SPF on each separately.
  • The ABR carries the routes across. From its SPF in area 2, ABR-2 knows R2B's LAN, 10.2.100.0/24, costs 10 + 10 + 10 = 30 through R2A, and says so to area 0.

An ABR tells the next area every prefix it can reach, one summary LSA (type 3) each, carrying the prefix and the ABR's cost to it:

  • The links stay behind. Area 2's database says which router connects to which, over which link, at what cost. Area 0 gets only the four prefixes and ABR-2's cost to each.
  • No address is left out or merged. Area 0 receives less data, but it still sees every one of area 2's networks. That is not summarisation in the configuration sense: the name "summary LSA" means the topology is summed up as a cost, not that the addresses are.
  • The prefixes are summarised only when an area range is configured, the subject of the last section.

Distance vector between areas

Across an ABR, OSPF works the way a distance-vector protocol such as RIP does: a router trusts the cost it is given and adds its own.

  • ABR-1A and ABR-1B each reach ABR-2 at 10 across the area-0 segment, so each reaches 10.2.100.0/24 at 10 + 30 = 40.
  • Each sends its own summary LSA into area 1, at 40. Every area-1 router now holds two for the prefix, one per ABR.
  • An area-1 router adds its own cost to each ABR, from its SPF in area 1, and takes the lower sum.

Area 0 as the hub

A distance vector can loop: a router taking a neighbor's cost cannot tell whether that cost was worked out through itself. OSPF rules this out by restricting where summaries may go.

  • Summaries go from an area into area 0, and from area 0 out to the other areas. An ABR sends area 0 only the routes of its own areas, never the ones it learned from area 0.
  • An ABR uses only the summaries it hears in area 0. ABR-1A also hears ABR-1B's summary of 10.2.100.0/24 inside area 1, and ignores it.
  • The areas therefore form a star around area 0. A route passes through area 0 once and cannot come back to where it started. This is also why every area must touch area 0, directly or through a virtual link.

Choosing an exit from area 1

Area 1 has two ABRs, and the same two summaries give different routers different answers:

Routervia ABR-1Avia ABR-1BLeaves by
R1A15 + 40 = 5520 + 40 = 60ABR-1A
R1B10 + 40 = 5015 + 40 = 55ABR-1A
R1C25 + 40 = 6525 + 40 = 65both
R1D15 + 40 = 5510 + 40 = 50ABR-1B
  • Each router leaves by the exit nearest itself. Beyond the ABR, the packet follows that ABR's table.
  • A tie keeps both exits. R1C is 25 from each ABR, so it shares the traffic between them.
  • The same happens in the other direction. ABR-1A summarises R1A's LAN, 10.1.100.0/24, into area 0 at 25, and ABR-1B at 30; ABR-2 adds 10 to each and takes ABR-1A at 35.
  • An intra-area route always wins. A router prefers a path inside its own area to one through another, whatever their costs; routes from summaries show as O IA in its table.

Area ranges: summarising addresses

An area range makes the ABR send one summary LSA for a whole block of prefixes instead of one per prefix. With area 1 range 10.1.0.0/16 configured on both area-1 ABRs:

  • Area 0 holds 2 summaries for area 1 instead of 18. All nine of area 1's prefixes fall inside 10.1.0.0/16, and each ABR now advertises the range alone.
  • The range costs as much as the most distant network inside it. RFC 2328 sets its cost to the largest of the costs it covers: 45 from ABR-1A (the direct R1A–R1D link, 10.1.7.0/30) and 40 from ABR-1B (the same link).
  • Routing outside area 1 gets coarser. ABR-2 compares 10 + 45 with 10 + 40 and sends everything for 10.1.0.0/16 through ABR-1B. Traffic to R1A's LAN now costs 10 + 30 = 40, five more than through ABR-1A: the range hides which ABR is nearer to each network.
  • A change inside area 1 stays inside. When a link in area 1 fails, the range is advertised again only if its largest cost changes; without the range, every prefix whose cost moved would be.

Simplifications in the demo

  • Only type-3 summaries appear: there are no external routes, so no ASBR and no type-4 or type-5 LSAs.
  • The area range is configured on both ABRs at once. Most implementations also install a discard route for the range on the ABR, so traffic to an unused address inside it is dropped there; the demo leaves that out.
  • Ties go to both next hops, as OSPF does; the drawing shows one of them.