RFC 2328: OSPFv2: Link-state routing in IPv4 networks

Summary

In April 1998, John Moy published RFC 2328, the still valid version of OSPF version 2, one of the most widely used interior routing protocols for IPv4. Every router knows the complete topology of its area and uses Dijkstra’s algorithm to compute the shortest paths from it. At 244 pages, the document is one of the most extensive protocol specifications of the IETF.

Everyone knows everything about their area

OSPF is a link-state protocol: every router describes its connections in link state advertisements, which are flooded to all routers in the area. This produces the same database in every router and, with Dijkstra, the same shortest-path tree. OSPF runs directly over IP with protocol number 89, without TCP or UDP.

To keep this affordable in large networks, OSPF divides the network into areas connected through the backbone area 0.0.0.0. On broadcast networks such as Ethernet, the Hello protocol elects a designated router and a backup, so that not every router has to maintain an adjacency with every other.

Fixed times in the background

Appendix B lists the architectural constants: every router refreshes its LSAs after 30 minutes at the latest (LSRefreshTime), an LSA loses its validity after one hour (MaxAge), and new instances of the same LSA may be originated at most every five seconds. As a sample value for the HelloInterval on local area networks, the text gives ten seconds.

All OSPF packets carry authentication; the cryptographic variant of 1998 used a message digest with a shared key. RFC 5709 added HMAC-SHA in 2009. For IPv6 there is a separate OSPFv3 in RFC 5340 from 2008.

Ideas

  • Routers distribute the state of their links to everyone in the area.
  • Every router computes shortest paths itself from the same database.
  • Areas limit flooding and computation.
  • The backbone area 0.0.0.0 connects all other areas.
  • A designated router reduces adjacencies on broadcast networks.
  • LSAs are refreshed at least every 30 minutes.

Insights

  • Shared knowledge of the topology allows fast, decentralised decisions but costs memory and computing time that hierarchy has to limit.
  • Many operational problems with OSPF are not protocol errors but inconsistencies in MTU, timers or area assignment between neighbours.

Facts

  • OSPF uses IP protocol number 89.
  • LSRefreshTime is 30 minutes, MaxAge one hour.
  • RFC 2328 is Internet Standard (STD 54) and replaces RFC 2178.
  • OSPFv3 for IPv6 is described in RFC 5340 from July 2008.

References

Remarks

  • On Linux, FRRouting and BIRD implement OSPFv2 and OSPFv3; many home and lab routers running OpenWrt can be connected to an OSPF network with them.

Recommendations

  • Plan areas along stable topology and keep the backbone small.
  • Secure adjacencies with cryptographic authentication and set passive interfaces for end-device networks.
  • If adjacencies get stuck in the ExStart state, first compare the MTU on both sides.

Read the RFC at the RFC Editor

Search the Web Archive

Found a mistake or have something to add? Get in touch.