Why link-state routing
The link-state IGP that runs inside most networks: neighbour adjacencies, LSA flooding, SPF, costs, DR/BDR, areas and LSA types, a hands-on FRR lab, and how OSPF underpins BGP.
By the end you will be able to:
- Explain how link-state routing differs from distance-vector and path-vector (BGP) routing
- Walk through adjacency formation and diagnose a neighbour stuck in any state
- Run Dijkstra's SPF by hand and predict OSPF's routing table, including ECMP
- Choose sensible interface costs and avoid the reference-bandwidth trap
- Explain DR/BDR election, areas, ABRs, ASBRs and the main LSA types
- Configure and verify multi-area OSPF in FRRouting, and explain how OSPF supports iBGP
Inside a single network — one autonomous system — you want routing that is fast, automatic and loop-free, and you trust every router. That's the job of an Interior Gateway Protocol (IGP). The two you will meet in practice are OSPF (Open Shortest Path First, RFC 2328 for IPv4, RFC 5340 for IPv6) and IS-IS. This lesson covers OSPFv2.
Routing protocols come in two broad families:
| Distance vector (RIP, EIGRP-ish) | Link state (OSPF, IS-IS) | Path vector (BGP) | |
|---|---|---|---|
| What neighbours share | "I can reach X at distance d" | "Here are my links and their costs" | "I can reach X via this AS path" |
| What each router knows | Only its neighbours' opinions | The full topology of the area | Paths and attributes per prefix |
| Route computation | Bellman-Ford, hop by hop | Dijkstra (SPF) run locally | Best-path decision process + policy |
| Convergence | Slow, can count to infinity | Fast, loop-free once databases agree | Slow by design, stable |
The link-state idea in one sentence: every router floods a description of its own links to everyone, so every router ends up with the same map, and each one independently calculates the shortest path from itself to everywhere.
Step through how that map gets built.
- Each router describes itself. R1 builds a Router LSA: "I am 10.255.0.1, I have links to R2 (cost 10), R4 (cost 10) and R3 (cost 30), plus my loopback." Every router does the same for itself.
- Flood to every neighbour. R1 sends its LSA to all its neighbours. Unlike BGP, there is no policy and no best-path choice here — the LSA is passed on unchanged.
- Neighbours re-flood. R2 and R4 forward the LSA out of their other interfaces. R3 receives it twice; the sequence number tells it the second copy is a duplicate, so it is acknowledged and dropped.
- Identical map everywhere. Once every router's LSA has been flooded, all four routers hold the same link-state database (LSDB) — a complete map of the area, costs included.
- Each router computes its own tree. R4 runs Dijkstra (SPF) with itself as the root: R1 and R3 at cost 10, R2 at cost 20 via both R1 and R3 (equal cost, so both are used). The expensive R1–R3 link is not in R4's tree.
Check your understanding
A link between two routers in area 0 goes down. What does a router three hops away do?
- Waits for its neighbours to send it new distances, then updates its own
- Receives the updated Router LSAs flooded from the routers on that link, then re-runs SPF itself
- Nothing — only the two routers attached to the link recompute
- Withdraws the routes and waits for a hold timer before re-learning them