OSPF Flooding

When a link fails, the routers at its two ends describe the network afresh and flood the news to everyone in the area; every router then reruns SPF on the new database. The demo cuts the R1B–R1D link in area 1 of the network from the earlier demos, while a host on R1A's LAN sends a steady stream of packets to ABR-1B, and follows both the flooding and what happens to the stream.

Open full screen ↗ recommended: the drawing is large

New router LSAs from both ends

  • Both ends see the failure at once. The line itself goes down, so R1B and R1D lose each other without waiting for the Hello dead interval.
  • Each issues a new copy of its router LSA, without the link to the other and without the link's subnet, 10.1.6.0/30. The sequence number goes up by one (#04 to #05), which is how every other router recognises the copy as news.
  • Each floods its copy to its remaining neighbors: R1B to R1A and ABR-1A, R1D to R1A, R1C and ABR-1B.

Flooding: install, acknowledge, pass on

A router that receives a newer copy than the one it holds does three things with it:

  • It installs the copy in its database for the area.
  • It acknowledges it to the sender with an LSAck. Without the acknowledgment, the sender would send the LSU again.
  • It floods it on to every other neighbor in the area, never back to the sender.

The news therefore moves one hop at a time: R1A receives both new LSAs in the first round, R1C and R1D the other end's in the second, the ABRs the far end's in the third. The ABRs pass area 1's router LSAs no further: those never leave area 1.

Duplicates: where flooding stops

A router that is sent a copy it already holds drops it and floods it no further, and that is what ends the flood. R1A gets R1D's new LSA from R1D itself, then again from R1C; the second copy goes no further. When two routers send each other the same copy at the same moment, as R1C and R1D do, each copy counts as the acknowledgment of the other, so neither needs an LSAck.

The SPF delay

A router does not run SPF the moment an LSA arrives. It waits a short, configurable delay, from tens of milliseconds to several seconds depending on the implementation, so that a burst of LSAs goes into one run. Until then it forwards by its old routing table.

  • One end's new LSA is enough to take a link out. SPF uses a link only if the router LSAs at both ends list it, so R1A's SPF drops the R1B–R1D link as soon as either new copy is in.
  • Routers run SPF at different moments, because the news reaches them at different moments: R1B and R1D first, at the failure, R1A and the others a round later.

The stream during convergence

The stream runs R1A → R1B → R1D → ABR-1B at a cost of 20 before the failure, and R1A → R1C → R1D → ABR-1B at 35 after it. In between, it loses packets three ways:

  • Lost on the wire. A packet on the R1B–R1D link when it fails is gone.
  • Dropped at R1B. Until R1B's SPF runs, its table still sends the stream out of the failed interface, and it drops every packet that arrives.
  • Looped between R1A and R1B. Once R1B has rerouted through R1A, but R1A has not yet run SPF, each router sends the stream to the other: a micro-loop. The packets bounce, one TTL lower each time, until R1A's SPF sends them through R1C.

The micro-loop lasts from R1B's SPF run to R1A's, the time the news takes to cross one more hop. The two packets caught in it arrive late, by a path that visits R1A twice; the packets after them take the new path from the start.

The change beyond area 1

Areas 0, 2 and 3 learn of the failure only as new costs in summary LSAs:

  • The ABRs send area 0 new summaries for the area-1 prefixes whose cost changed: three from ABR-1A, five from ABR-1B.
  • The failed link's subnet at first only costs more. When an ABR first runs SPF it holds just one end's new LSA, and the other end's old one still lists 10.1.6.0/30. When the second new LSA arrives, the next SPF removes the subnet, and the ABR withdraws its summary by flooding it at MaxAge.
  • Areas 2 and 3 see a single lasting change. ABR-2 and ABR-3 take the cheaper of the two ABRs for each prefix, and that cost changes for no prefix but the failed subnet, which disappears. What reaches R2A, R2B and R3 is one summary with a higher cost, then its withdrawal.

Simplifications in the demo

  • Time is slowed down: a hop takes 1.2 s and the SPF delay is 2 s, where a real network converges in well under a second.
  • Hellos are not drawn, and no packet is lost, so no LSU is ever sent again.
  • An LSAck is sent at once for each LSU; real routers often delay them and bundle several.
  • The failure is seen at once because the line goes down. A failure the line does not show waits for the dead interval of the Hello demo , 40 s by default, or for a faster detector such as BFD.