Octet

How does OSPF work, at a high level?

Show the answer

Say this first

OSPF is a link-state IGP. Every router describes its own links in LSAs and floods them to every router in the area, so all routers in an area hold an identical link-state database. Each router then runs Dijkstra's SPF algorithm on that database with itself as the root and installs the shortest paths in the routing table.

Go deeper

The steps

  1. Discover neighbors with Hello packets (IP protocol 89, multicast 224.0.0.5).
  2. Form adjacencies and synchronize databases with DBD, LSR, LSU and LSAck packets.
  3. Flood LSAs reliably. Every LSA is acknowledged, has a sequence number and an age.
  4. Run SPF. Each router builds a shortest-path tree from the LSDB, with itself as root.
  5. Install routes with administrative distance 110 and the summed cost as the metric.

What makes it link state

Routers do not pass routes to each other as distance vector protocols do. They pass topology facts ("I am R1, I have a link to R2 with cost 10, and a stub network 10.1.1.0/24") and each router computes routes itself. That is why every router in an area must have the same LSDB, and why you cannot summarize or filter LSAs inside an area.

Why areas

SPF cost grows with the size of the database. Areas limit flooding and SPF to one area. Between areas, ABRs advertise summaries (Type 3 LSAs), so inter-area routing behaves more like distance vector.

Traps

  • Saying OSPF routers exchange routing tables. They exchange LSAs and each router computes its own table.
  • Saying OSPF runs over TCP or UDP. It runs directly over IP as protocol 89 and does its own reliability.
How did you do?Book 3.4 Routing