How OSPF areas and costs actually work
OSPF finds the cheapest path by cost. Two things decide whether it works: the area design, and what your costs actually mean.
OSPF floods link-state information so every router builds the same map, then each computes the shortest path across it. Areas exist to limit how far that flooding goes, so a change in one corner does not make every router in the network recalculate.
The backbone rule
Area 0 is the backbone and everything hangs off it. Inter-area routing goes through area 0 by design — there is no path from area 1 to area 2 that avoids it.
So every non-backbone area needs at least one router that is also in area 0. That router is an area border router, and it summarises routes between the areas it joins.
A virtual link can attach a stranded area through an intermediate one. It works, and it is a repair for a design that went wrong rather than a design. A network that depends on several is hard to reason about when something breaks.
The partition nobody sees coming
If area 0 itself splits into two groups that cannot reach each other within area 0, inter-area routing breaks — even though every area still looks correctly attached to a backbone. It is easy to create by losing one link and genuinely hard to spot from a configuration.
Cost, and the reference bandwidth problem
Cost is reference bandwidth divided by interface bandwidth, rounded down, with a floor of 1. The reference has defaulted to 100 Mbit/s since OSPF was specified, and on most platforms it still does.
Everything at or above 100 Mbit/s therefore gets cost 1. A 100 Mbit/s link, a gigabit link and a 100-gigabit link are indistinguishable. A path across three gigabit links costs 3; a single 100 Mbit/s link costs 1, and OSPF prefers the slow one.
The fix is to raise the reference — on every router. It is a per-router setting, so a mismatch means two routers compute different costs for the same link and pick different paths in each direction. That asymmetry is why so many networks left it alone.
When an adjacency will not form
The usual causes, roughly in order of how often they are the answer:
- Different areas on the two ends.
- Mismatched hello and dead timers.
- Different subnet masks on the same segment.
- MTU mismatch, which lets the adjacency reach exchange state and stick there.
- Authentication configured on one side only.
- Duplicate router IDs, which make adjacencies fail or flap in ways that point nowhere near the cause.
Frequently asked questions
Why does every area have to touch area 0?
Because inter-area routing goes through the backbone. An area with no router in area 0 has no path to the rest of the network.
Why do gigabit and 100-gigabit links have the same OSPF cost?
Because the default reference bandwidth is 100 Mbit/s and cost has a floor of 1. Everything at or above the reference computes to 1. Raising the reference restores the distinction, but it must be raised on every router.
What happens if I change the reference bandwidth on only some routers?
They compute different costs for the same links and choose different paths in each direction. Asymmetric routing follows, along with the troubleshooting difficulties that come with it.
Why is my adjacency stuck in exchange state?
Most often an MTU mismatch between the two interfaces. The neighbours find each other and then fail to exchange the database.
Open the OSPF area designer →