A shared topology
Routers describe links, then calculate locally.
OSPF routers advertise the state and cost of their links. Each router builds a link-state database that represents the area, then runs a shortest-path calculation from itself to choose forwarding entries.
Build the model
Four OSPF ideas
Link state
Describes which neighbours and links are present.
Cost
Weights links for path calculation.
LSDB
Stores the shared link-state database.
SPF
Computes shortest paths from the local router.
The OSPF cycle
An LSA becomes a route through three steps.
First, a router creates a link-state advertisement (LSA) describing its links, neighbours, and relevant costs. Routers flood that information through the OSPF area so other routers can learn the same topology facts.
Each router stores the received LSAs in its link-state database (LSDB). The LSDB is the local topology graph, not the forwarding table itself. The router then runs shortest path first (SPF) from its own position through that graph and installs the resulting next hops in its forwarding table.
Mini experiment
Choose a topology change
Observe how a link-state update affects the local calculation.
The router selects the path whose link costs add up to the smallest total.
OSPF prefers the lowest calculated cost, not necessarily the fewest physical hops.
Knowledge check
Test your OSPF model
Answer five questions.