OSPF Database Exchange

Two OSPF neighbors that have agreed to become adjacent still hold different link-state databases. The database exchange makes them identical: each describes what it holds, asks for what it lacks, and receives it. This demo runs that exchange on the same network as the Hello protocol demo , one adjacency at a time.

The starting point

The demo starts where the Hello demo ends:

  • Every pair of neighbors is in 2-Way. On area 0, ABR-3 is DR and ABR-2 BDR, and the badges on the area-0 wires show those roles throughout: they decide which pairs exchange databases, and who floods to whom.
  • Each router's database holds one LSA: its own router LSA, listing its stub networks. An ABR keeps one database per area, so ABR-1A starts with two.
  • The adjacencies come up one at a time, simplest first: area 3, area 2's triangle, area 1's mesh, then the shared area-0 segment. A real network runs them all at once.

Step (or โ†’) runs until the next packet arrives, and the caption then says what arrived and what the receiver did. The Exchange panel lists every packet of the current adjacency as a ladder, and the router panel shows the selected router's databases, with new or changed LSAs highlighted.

The exchange packets

PacketWhat it carriesWhat it moves
DBD (Database Description)LSA headers only: type, LS ID, advertising router, sequence numberExStart โ†’ Exchange โ†’ Loading or Full
LSR (Link State Request)the headers of the LSAs the sender wantsnothing on its own
LSU (Link State Update)the full LSAsLoading โ†’ Full, once the request list is empty
LSAckthe headers of the LSAs receivedstops the sender from sending the LSU again

A DBD is the table of contents of a database, not the database: the headers are enough to tell which LSAs the other side has, and which of its copies are newer.

Master and slave

The two routers first agree which of them numbers the DBDs. Each sends an empty DBD with three bits set โ€” I (initial), M (more to follow) and MS (master) โ€” and a DD sequence number of its own:

  • The higher Router ID becomes master. The other router accepts it, takes the master's DD sequence number, and answers with MS clear. That answer already carries the slave's headers.
  • The master numbers every DBD, and the slave echoes each number back. The echo is the acknowledgment: a DBD with no echo is sent again.
  • The exchange ends when both sides send a DBD with M clear. Here each database fits in one DBD, so the descriptions take one DBD each way after the negotiation.

The request list

Each router compares the headers it receives with its own database. An LSA goes on its request list when it does not have it, or holds an older copy: the higher sequence number is the newer copy. With the descriptions done:

  • A non-empty one means Loading: an LSR names the LSAs, the LSU that answers carries them, and an LSAck confirms delivery. The neighbor is Full once the last requested LSA is installed. A router that joins late has the most to ask for: R1C, first adjacent to R1A, requests five LSAs in one LSR.
  • An empty request list takes the neighbor straight from Exchange to Full. Flooding has already brought both sides up to date: R2A and R2B, the last pair in area 2, find nothing to ask for, and neither do the last two pairs of area 1's mesh, or ABR-2 with the two DROthers at the end of area 0.

What follows Full: new LSAs and flooding

An adjacency changes the LSAs that describe it, so reaching Full sets off flooding (the teal packets):

  • Both routers issue a new router LSA. A router LSA lists a point-to-point link to a neighbor only once that neighbor is Full, so each side writes a new copy with the sequence number one higher.
  • Flooding sends each new copy to every other Full neighbor in the area. A router that receives a newer copy installs it, acknowledges it, and floods it on; a copy it already holds is only acknowledged. Around area 2's triangle that means some LSAs arrive twice, and the second copy stops there.
  • Flooding stays inside the area. ABR-2's area-2 LSAs never enter its area-0 database.

The shared segment and the DR

Area 0 follows the same exchange, with the DR at the centre of it:

  • Only pairs that include the DR or the BDR form adjacencies. ABR-1A and ABR-1B stay in 2-Way with each other for good: the DR keeps both of them in sync.
  • The DR issues a network LSA for 10.0.0.0/24, listing itself and every router Full with it. Each router's own LSA then shows the segment as a transit network instead of listing the others one by one.
  • A DROther floods to the DR and BDR only, and the DR repeats the LSA to the rest of the segment.

Simplifications in the demo

  • The adjacencies run one after another rather than in parallel, and every packet is slowed to take 1.2 s on the wire.
  • Hellos keep running in a real network throughout; the demo leaves them out.
  • LSAcks are sent at once and one per LSU; real routers often delay them and bundle several.
  • The ABRs' summary LSAs (type 3), which describe other areas, are left out. They belong to inter-area routing , a later demo in the series.