A shared map needs reliable updates

Open Shortest Path First (OSPF) is an interior gateway protocol. Routers describe their local connections, distribute those descriptions, and independently calculate shortest paths from the resulting database. Link State Routing and Dijkstra explains the underlying algorithm. This note describes OSPFv2 for IPv4; OSPFv3 has different details and commonly supports IPv6.

From neighbors to a shared database

On an enabled link, routers send Hello packets. These identify the sender and help discover neighbors, check compatible parameters, and confirm two-way communication. Seeing your own router ID in a neighbor’s Hello is evidence that the neighbor received your Hello. Area, timers and other relevant settings must be compatible. A neighbor relationship is not automatically a fully synchronized adjacency.

For routers that should become adjacent, synchronization proceeds conceptually:

  1. Database Description (DD): exchange summaries of link-state advertisements (LSAs) already held.
  2. Link State Request: ask for missing or newer LSAs.
  3. Link State Update: send the requested full LSAs; one update may carry several.
  4. Link State Acknowledgment: acknowledge LSAs so reliable flooding can retransmit when needed.

The DD exchange coordinates sequencing roles, not permanent network ownership. Subsequent changes are flooded and acknowledged. An LSA is the information record; an update packet is its carrier. The router recalculates relevant shortest paths when the topology changes.

A simplified state progression is Down → Init → 2-Way → ExStart → Exchange → Loading → Full. Not every neighbor on every network type forms a Full adjacency. A dead timer can detect missing Hellos; values and faster failure detection are configurable.

Freshness

An LSA header identifies its type, link-state ID and advertising router, and carries age, sequence number and checksum. Sequence numbers and other comparison rules identify newer instances; age supports expiration and flushing. The advertising router originated the record; the router that last forwarded it may be different. The slides’ 30-minute refresh and 60-minute maximum age describe base OSPFv2 behavior, not a universal timer for all protocols.

Shared Ethernet and the DR

On a broadcast LAN with many routers, a full mesh of adjacencies would be expensive. A designated router (DR) and backup designated router (BDR) coordinate important database exchange and flooding. The DR originates a network LSA representing the transit network. It is not necessarily the data-plane next hop for packets between all routers on the LAN.

The slide’s simple “highest router ID” description omits interface priority: eligible routers with higher priority are preferred, with router ID as a tie-breaker; priority zero is ineligible. An established DR is generally not displaced merely because a higher-priority router joins later. See RFC 2328 section 9.4.

OSPFv2 LSA types

TypeOriginMeaning and usual scope
1 routerEach routerIts area-local links and costs
2 networkDRRouters attached to a multiaccess transit network; area-local
3 network summaryArea border router (ABR)Reachability to a prefix in another area; may be aggregated
4 ASBR summaryABRReachability to an AS boundary router in another area
5 externalAS boundary router (ASBR)External destination; area-type restrictions apply
7 NSSA externalASBR in a not-so-stubby areaExternal route inside the NSSA; eligible advertisements can be translated to type 5 by an ABR

Type 3 “summary” is the LSA category; it does not mean every prefix is automatically aggregated. Type 4 identifies the ASBR by router ID, not the ABR’s IP address. Type 2 lists attached router IDs. The slides’ descriptions of some LSA fields and router-LSA B/E bits are reversed or imprecise; see RFC 2328 Appendix A for exact formats.

Follow two routers from discovery to a common map

Assume A and B share an OSPF-enabled point-to-point link in area 1. A already has a database; B has just started. Their area, timers and other required settings are compatible. An adjacency is the closer relationship in which neighbors synchronize their databases; discovering a neighbor alone does not mean synchronization is complete.

  1. A and B send Hello packets. Each Hello identifies its sender and lists neighbors recently heard. A receiving B’s Hello proves B can send to A; A seeing its own ID in B’s Hello also shows that B has heard A. That confirms two-way communication.
  2. A and B agree on the sequencing roles for their database exchange. Database Description (DD) packets carry LSA headers: an inventory of records and instances, not all the complete records. Both routers exchange descriptions.
  3. B compares the descriptions with its own database. If A has a missing or newer LSA, B sends a Link State Request (LSR) identifying it. A can also request information from B.
  4. A sends the complete requested LSA in a Link State Update (LSU). An update can carry multiple LSAs. B checks the records and installs the newer information where appropriate.
  5. LSAs are acknowledged. A required acknowledgment that does not arrive can lead to retransmission; OSPF can also acknowledge implicitly in specified flooding circumstances. After requests and synchronization finish, the adjacency can reach Full.

For example, if A has LSA-1, LSA-2 and LSA-3 while B has only LSA-1, the DD describes all three, B requests 2 and 3, and A supplies them in one or more updates. These labels are teaching placeholders, not LSA types. Afterward Hellos continue. New link changes trigger updated information and flooding rather than a full initial exchange every time.

Hello and dead intervals have different jobs: a 10-second Hello and 40-second dead interval would mean periodic Hellos and a 40-second absence threshold, not a promise that all failures take exactly 40 seconds to detect. Physical events or other configured mechanisms may detect failure sooner. Values depend on network type and configuration.

One shared LAN: neighbor versus Full adjacency

Suppose A, B, C and D share Ethernet. Without an optimization, four routers could need six full pairwise relationships: A-B, A-C, A-D, B-C, B-D and C-D. On an OSPF broadcast network, the DR and BDR reduce adjacency and flooding overhead. Ordinary routers can remain 2-Way with each other rather than all becoming Full. They still communicate with the DR/BDR according to network rules.

The DR and BDR are roles on this particular LAN, not titles for the entire OSPF domain. Priority is per interface; zero excludes an interface from election, higher priority takes precedence among eligible candidates, and router ID breaks ties. Election includes existing declarations and is normally non-preemptive: a late arrival with a higher priority does not automatically replace the DR. The BDR can take over after failure, but it does not guarantee zero disruption.

The topology model represents the shared LAN as a transit-network vertex connected to its routers. The DR originates the type 2 Network LSA for it. This model reduces control-plane complexity; an IP packet from A to B on the same Ethernet can be sent directly to B’s MAC without passing through the DR.

Recognizing and replacing an LSA

For OSPFv2, the combination LS type + Link State ID + Advertising Router identifies an LSA within its flooding scope. Consider R1 with router ID 1.1.1.1 in area 1. Its type 1 Router LSA has type 1, Link State ID 1.1.1.1, and Advertising Router 1.1.1.1. If R2 forwards that record to R3, R1 remains the advertising router. The Link State ID has type-specific meaning: a network LSA uses the DR’s interface address, and a summary LSA identifies a network.

If R1 loses a link, it originates an updated instance of the same LSA. Receivers compare its sequence number, checksum and age according to protocol rules, replace an older instance when appropriate, flood the change, and recalculate affected paths. The sequence number is not an ordinary clock timestamp. Age prevents a stale record surviving indefinitely; the checksum detects corruption but does not authenticate the sender.

OSPFv2’s LSRefreshTime is 30 minutes and MaxAge is one hour. Refresh and MaxAge concern LSAs, not the Hello dead interval: a neighbor can be declared dead and a topology change propagated much earlier. MaxAge flooding flushes an LSA; removal follows protocol rules rather than assuming every database deletes the entry simultaneously.

Read the map using LSA types

Imagine R1 in area 1, ABR connecting area 1 to area 0, and an ASBR in area 0 advertising external network X. R1’s type 1 LSA describes its area 1 links. A type 2, if a shared transit LAN has the required DR, describes its attached routers. The ABR’s type 3 advertises a network in another OSPF area. The ABR’s type 4 tells area 1 how to reach the ASBR; the ASBR’s type 5 describes external network X. In this simple example with no separate forwarding address, R1 can calculate a path to X through the ASBR. Type 4 identifies the ASBR, not the destination prefix; type 5 identifies the external destination.

A type 3 called “summary” need not be an aggregate. A type 7 is used for external routes inside an NSSA and eligible LSAs can be translated to type 5 by an ABR; the source mentions this briefly without a full NSSA lesson. Scope depends on area type. The packet destination, the next hop, the advertising router and the LSA’s described object are separate concepts.

Review with answers

B has an older copy of R1’s type 1 LSA. What happens when A describes a newer one? B requests the newer instance; A supplies it in an update. B compares freshness, installs it if newer and acknowledges/floods under OSPF rules. A’s DD is an inventory, not necessarily the complete LSA.

C becomes DR on a shared LAN. Must data packets from A to B go through C? No. The DR coordinates OSPF control exchanges; ordinary traffic can be delivered directly across the LAN to B when B is the chosen next hop.

A forwards an LSA originated by B. Which router is the Advertising Router? B. The identity refers to the originator, not the latest forwarder.

Lecture 05 - OSPF · OSPF Areas Costs and External Routes · Routing Forwarding and Convergence