Dynamic routing and OSPF fundamentals: how routers learn paths from each other
A static route never notices a failure; a routing protocol lets routers repair the path.

A static route is an instruction the router never revisits: when a link fails elsewhere, nothing recalculates it, and the entry stays until someone edits it. Dynamic routing closes that gap — routers find each other, describe the topology they see, and each builds a forwarding table from the shared description. OSPF (Open Shortest Path First) is the link-state interior gateway protocol enterprise networks run for this: RFC 2328 for IPv4, RFC 5340 for IPv6, which keeps the mechanisms “unchanged” but runs “on a per-link basis” (rfc5340.txt lines 31–45). How does a router that has never seen a destination learn a path to it?
Why a dynamic protocol exists
Static routing is the L2 sheet’s subject here: the administrator writes the prefix and the next hop, and the entry lives until it is changed — correct only while the topology stops changing. A protocol replaces it with a process. RFC 2328 defines OSPF as “a dynamic routing protocol” that “quickly detects topological changes in the AS (such as router interface failures) and calculates new loop-free routes after a period of convergence” (lines 280–283). The cost is recurring protocol traffic; the return is a repair nobody makes by hand.
Two families, one difference
Protocols divide into two families by what each router knows. A distance-vector protocol of the Bellman-Ford family — RIP is the classic example — exchanges a view of the table, measured in hops (Cisco OSPF Design Guide, line 100). A link-state protocol inverts that: each router describes its own links, and every router builds the map itself. RFC 2328 marks the break — “This is a departure from the Bellman-Ford base used by traditional TCP/IP internet routing protocols” (lines 262–263). “Each participating router has an identical database” (lines 289–290) — the property this sheet rests on.
How OSPF builds one shared map
Every router runs this cycle alone. Two routers on a common link become neighbours once each sees itself in the other’s Hello packet (lines 2581–2583). The pair then forms an adjacency, the conversation that synchronises their databases (Design Guide, lines 452–453). Changes travel by flooding, not as a copy of the table: “LSAs are flooded throughout the area. The flooding algorithm is reliable, ensuring that all routers in an area have exactly the same link-state database” (lines 1989–1991). Each router then decides alone, “Using the Dijkstra algorithm” (lines 8034–8035) to build “a shortest-path tree, with itself as root” (lines 1992–1994).
discovery adjacency shared map decision
───────── ───────── ────────── ────────
Hello packets ─▶ database exchange ─▶ identical LSAs ─▶ SPF (Dijkstra)
on each (ExStart → Full) for the area self as the root
interface │
▲ │
└────────── a change is flooded, and every router recalculates ◀─────┘
Neighbours must agree before anything is exchanged
A Hello packet states the link’s configuration, and the receiver checks it: “the values of the Network Mask, HelloInterval, and RouterDeadInterval fields in the received Hello packet must be checked against the values configured for the receiving interface” — any mismatch drops the packet (lines 4784–4788). “Both HelloInterval and RouterDeadInterval must be the same for all routers attached to a common network” (lines 3860–3862), and Cisco names the commands that break it: “ip ospf hello-interval seconds and ip ospf dead-interval seconds” (Design Guide, lines 411–414). The dead interval is also the detection time — “The number of seconds before the router’s neighbors will declare it down, when they stop hearing the router’s Hello Packets” (lines 3211–3212) — so this timer sets how long a broken link takes to be noticed.
Cost: what “shortest” means
An interface cost decides what “shortest” means: a path costs the sum of its links (lines 8081–8083). OSPF keeps that number dimensionless — “The cost of a route is described by a single dimensionless metric” (lines 312–313) — so the designer decides what a link is worth. By default the value comes from the bandwidth: “By default, the cost of an interface is calculated based on the bandwidth” (Design Guide, lines 178–179), written as “cost= 10000 0000/bandwith in bps” (line 175), and ip ospf cost <value> overrides it (lines 178–179).
Areas and the backbone
An area groups networks and their routers: “Each area runs a separate copy of the basic link-state routing algorithm” (lines 1273–1274), over its own database, so that “Areas are introduced to put a boundary on the explosion of link-state updates” and “Flooding and calculation of the Dijkstra algorithm on a router is limited to changes within an area” (Design Guide, lines 199–201). One area is reserved — “The OSPF backbone is the special OSPF Area 0” (line 1312) — carried by routers “that belong to multiple areas, and connect these areas to the backbone area are called area border routers (ABR)” (Design Guide, lines 201–202).
What convergence does and does not fix
Convergence is work, not a switch: detection waits for the dead interval, the change is flooded, every router recalculates its tree, while the network forwards on two different maps. The protocol never judges whether a path is good, only which is cheapest under the costs it was given, so a mis-set cost converges to a stable, wrong answer. The static part of the network does not become dynamic either.
Level and prerequisites
L3 — current routing practice, read after the L1 forwarding model and the L2 sheets on the routing table, static routes and inter-VLAN routing. It assumes the reader can read a prefix and a next hop and knows a router forwards one hop at a time; no prior routing protocol is assumed.
Where to go next
References
- RFC 2328 — J. Moy, OSPF Version 2, IETF, Standards Track, April 1998. https://www.rfc-editor.org/rfc/rfc2328.txt (local copy
rfc2328.txt). - RFC 5340 — R. Coltun, D. Ferguson, J. Moy, A. Lindem (Ed.), OSPF for IPv6, IETF, Standards Track, July 2008. https://www.rfc-editor.org/rfc/rfc5340.txt (local copy
rfc5340.txt). - Cisco Systems, OSPF Design Guide, Document ID 7039, updated 10 August 2005. https://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/7039-1.html (vendor documentation; see
sources.mdfor the copy actually read).