An animated OSPF network of eleven routers in four areas — Hellos flowing, neighbor states moving from Down to Full, the DR/BDR election on a shared segment, and what happens when the DR fails.
The Hello protocol is how OSPF routers find each other, agree that they can talk, and elect a Designated
Router on a shared segment. This demo runs it on a fixed network of eleven routers; there is nothing to
configure, only a scenario to watch.
The network in the demo
- Area 0 is one switched segment joining the four ABRs. The switch floods every frame, so it is one
broadcast network,
10.0.0.0/24, and OSPF elects a DR and a BDR on it. - Area 1 is a mesh: four internal routers, R1A to R1D, linked to each other and to the backbone
through two ABRs, ABR-1A and ABR-1B, by seven links in all.
- Area 2 is a loop: ABR-2, R2A and R2B joined in a triangle, so a later demo has two paths for SPF to
choose between.
- Area 3 hangs off ABR-3 alone, through R3.
- Every link between two routers is a
/30 with OSPF network type point-to-point, and every area ends in
a user LAN with no OSPF router on it (a passive interface).
Hover over an interface dot for its address, over a network for its prefix, and over a packet for what it
carries. Click a router for its interface and neighbor tables; the timeline jumps to any point of the
scenario.
- Step (or →) runs until the next Hello arrives and pauses there. The caption then shows what that
Hello listed and which states it changed. Prev (or ←) goes back one step.
- The election panel shows how the selected router elected its DR and BDR: the candidates, what each
one's last Hello declared, and the rule that settled each choice. Clicking a role badge on an area-0
wire opens it for that router.
Reading the drawing
- Orange
H packets are Hellos, sent every 10 s to 224.0.0.5 on each OSPF interface. On area 0 one
Hello leaves the router and the switch delivers a copy to each of the other three. - Purple packets (
D, R, U) are the database exchange that follows once two routers decide to
become adjacent: DBD packets list what each database holds, an LSR asks for what is missing, and an
LSU delivers it. They play no part in the DR election, which uses Hellos only. The next demo in the
series,
Database Exchange
, takes them apart; here they only
move the states from ExStart to Full. - The card beside each router is its neighbor table: one row per neighbor, coloured by state, and
flashing when the state changes.
- The badge on each area-0 wire is that interface's role:
Wait, then DR, BDR or DROther. - A point-to-point wire turns green once both ends are Full.
The neighbor states
A Hello carries the sender's Router ID and the list of neighbors it has heard. That list drives the first
two states:
- Down — no Hello heard from the neighbor within the dead interval (40 s).
- Init — a Hello arrived, but the receiver's own Router ID is not in it: the neighbor has not heard
this router yet.
- 2-Way — the receiver found its own Router ID in the neighbor's Hello, so each has heard the other.
Two routers only get this far if their Hellos agree on the area, the hello and dead intervals, and on
a shared segment the subnet mask.
- ExStart → Exchange → Loading → Full — the adjacency: the two routers synchronise their link-state
databases. On a point-to-point link every neighbor goes on to Full. On a shared segment only pairs
that include the DR or the BDR do; two DROthers stay in 2-Way for good.
The DR/BDR election
A DR exists so that a shared segment with n routers needs about 2n adjacencies instead of
n(n−1)/2. The election runs on every router separately, from what its Hellos tell it:
- The Wait timer holds a new interface in
Wait for 40 s before it elects, so the election sees
every router on the segment. It ends early (the event called BackupSeen) when a Hello shows the
segment already has a BDR, or a DR and no BDR. - The highest priority wins, then the highest Router ID. All priorities here are the default 1, so
ABR-3 (
3.3.3.3) becomes DR and ABR-2 (2.2.2.2) BDR. - The BDR is elected first, from the routers not claiming to be DR, and becomes DR itself when no
DR is declared. That order is why, for a moment after the DR dies, a router may list the same router
as both DR and BDR, until that router's next Hello announces the new BDR.
The scenario
- Boot (0–6 s). The routers power on half a second or so apart. Point-to-point neighbors go Init, 2-Way
and on to Full within one Hello interval.
- Election (≈40 s). ABR-3's Wait timer expires first and it elects itself DR, with ABR-2 as BDR.
When ABR-2 announces itself as BDR, ABR-1A and ABR-1B stop waiting early (BackupSeen).
- ABR-3 fails (100 s). Nobody is told. Its neighbors keep it Full until 40 s pass without a Hello
from it, then take it Down together.
- Re-election (≈132 s). The BDR, ABR-2, becomes DR at once, and ABR-1B (
1.1.1.2) is elected the
new BDR. ABR-1A forms an adjacency with its new BDR. - ABR-3 returns (170 s). It hears a DR and a BDR already in place and becomes a DROther, although
its Router ID is the highest on the segment: the election is not preemptive. A running DR keeps
its role until it fails.