What DR and BDR Are
On a network where three or more routers sit on a single segment, such as Ethernet (a multi-access network), every router would otherwise try to become adjacent with every other router. With n routers that means n x (n - 1) / 2 adjacencies, a number that grows quickly as routers are added.
Every adjacency has to be kept in sync and have its LSA retransmissions tracked, so this wastes both router resources and traffic on the segment. OSPF therefore elects one router per segment to act on behalf of the others, and LSAs are exchanged through it. That router is the DR (Designated Router). A standby is elected at the same time so that the role can be taken over immediately if the DR fails: the BDR (Backup Designated Router). Routers that become neither are called DROTHERs.
DROTHERs do not become adjacent with each other; they stop at 2-Way. The adjacencies form a star centred on the DR and the BDR, and their number drops from n x (n - 1) / 2 to 2 x n - 3.
| Routers on the segment | Without DR/BDR | With DR/BDR |
|---|---|---|
| 3 | 3 | 3 |
| 5 | 10 | 7 |
| 10 | 45 | 17 |
| 20 | 190 | 37 |
With three routers there is no difference, but the gap widens as routers are added.
Roles of the DR, the BDR and a DROTHER
| Role | Becomes adjacent with | How it handles LSAs |
|---|---|---|
| DR | Every router on the segment | Relays the LSAs it receives from each router to the whole segment. Originates the Network-LSA (Type 2) that represents the segment. |
| BDR | Every router on the segment | Receives LSAs just like the DR but does not relay them. Takes over the relaying if the DR goes down. |
| DROTHER | The DR and the BDR only | Sends LSAs only to the DR and the BDR. Stays at 2-Way with the other DROTHERs. |
This shows up as a difference in the multicast address each router sends to.
When a DROTHER sends an LSA, it uses 224.0.0.6, which only the DR and the BDR receive.
The DR that received it re-sends the LSA to 224.0.0.5, which every router on the segment receives.
| Address | Name | Routers that receive it | Routers that send to it |
|---|---|---|---|
| 224.0.0.5 | AllSPFRouters | Every OSPF router | Every router (for Hellos), plus the DR and the BDR (when sending LSAs) |
| 224.0.0.6 | AllDRouters | The DR and the BDR only | A DROTHER (when sending LSAs) |
Every router sends its Hellos to 224.0.0.5 whatever its role. 224.0.0.6 is used only when a DROTHER sends an LSU or an LSAck. The BDR also uses 224.0.0.5 when it sends an LSA, but it never relays another router’s LSA.
The Network-LSA (Type 2) that the DR originates will be covered in a separate article.
Electing the DR and the BDR
The election is decided by the priority and the router ID carried in the Hello packets.
- The router with the highest priority becomes the DR
- The router with the next highest becomes the BDR
- If the priorities are equal, the higher router ID wins
The default priority is 1, and a router with a priority of 0 becomes neither the DR nor the BDR (it is always a DROTHER).
The Election Is Non-preemptive
Once the DR and the BDR are decided, a router with a higher priority that joins later does not take over. The DR changes only when the current DR goes down; the BDR is then promoted to DR and a new BDR is elected from the remaining routers.
The reason is that changing the DR is an expensive operation: it means resynchronizing the LSDB across the whole segment. If the role changed every time a higher-priority router appeared, the network would never settle.
The Wait Timer
When OSPF is enabled on an interface, the router does not start the election straight away. For the duration of the Wait timer (40 seconds by default, the same as the Dead interval) it listens to the Hellos from the other routers. show ospf interface reports State WAITING during this time. If all the routers start at roughly the same time, they learn each other’s priorities within this window before the election runs.
A router that joins a segment where the DR is already decided, on the other hand, simply accepts the DR and BDR carried in the Hellos it receives.
Verification on Real Devices
Test Environment
Four Cisco IOS XR routers (XRd 26.1.1) are connected to a single Ethernet segment (10.0.0.0/24), with different priorities, to see how the election turns out.
| Router | Router ID | Priority | Expected role |
|---|---|---|---|
| R1 | 1.1.1.1 | 100 | DR |
| R2 | 2.2.2.2 | 50 | BDR |
| R3 | 3.3.3.3 | 0 | DROTHER (not eligible) |
| R4 | 4.4.4.4 | 1 (default) | DROTHER |
R4 is expected to become a DROTHER even though it has the highest router ID. That is what shows that the priority takes precedence over the router ID.
The test runs in seven stages (STEP 0 to 6), changing priorities and shutting an interface along the way. The show output, syslog and running-config collected from all four routers at every STEP are gathered per STEP under Configurations Used and show Output at the end of the article. The sections below quote only part of them.
| STEP | Operation | Result (DR / BDR) |
|---|---|---|
| 0 | Initial state, the four routers simply brought up | R1 / R2 |
| 1 | R4’s priority changed to 255 | R1 / R2 (unchanged) |
| 2 | OSPF process restarted on all four at once | R4 / R1 |
| 3 | R4’s priority returned to the default, then all four restarted at once | R1 / R2 |
| 4 | Gi0/0/0/0 on R1 shut down | R2 / R4 |
| 5 | Gi0/0/0/0 on R1 brought back with no shutdown | R2 / R4 (R1 is a DROTHER) |
| 6 | OSPF process restarted on all four at once | R1 / R2 (back to the initial state) |
Election Result (STEP 0)
When the four routers come up, R1 becomes the DR and R2 the BDR, as the priorities dictate. The tabs below show how each of the four sees the same segment.
RP/0/RP0/CPU0:R1#show ospf interface
Sat Sep 5 14:03:16.746 UTC
Interfaces for OSPF 1
Loopback0 is up, line protocol is up
Internet Address 1.1.1.1/32, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Multi-area interface Count is 0
GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.0.0.1/24, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 100, MTU 1500, MaxPktSz 1500
Forward reference No, Unnumbered no, Bandwidth 1000000
RIB LC sync Yes
Designated Router (ID) 1.1.1.1, Interface address 10.0.0.1
Backup Designated router (ID) 2.2.2.2, Interface address 10.0.0.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:09:514
Index 1/1, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 1
Neighbor Count is 3, Adjacent neighbor count is 3
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Adjacent with neighbor 3.3.3.3
Adjacent with neighbor 4.4.4.4
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Segment Routing Forwarding MPLS enabled: Yes
Adjacency hold timer expired last : Never
Exchange timer expired last : Never
RP/0/RP0/CPU0:R1#show ospf neighbor
Sat Sep 5 14:03:18.071 UTC
* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up
Neighbors for OSPF 1
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 50 FULL/BDR 00:00:34 10.0.0.2 GigabitEthernet0/0/0/0
Neighbor is up for 00:01:59
3.3.3.3 0 FULL/DROTHER 00:00:31 10.0.0.3 GigabitEthernet0/0/0/0
Neighbor is up for 00:01:53
4.4.4.4 1 FULL/DROTHER 00:00:32 10.0.0.4 GigabitEthernet0/0/0/0
Neighbor is up for 00:01:43
Total neighbor count: 3RP/0/RP0/CPU0:R2#show ospf interface
Sat Sep 5 14:03:36.667 UTC
Interfaces for OSPF 1
Loopback0 is up, line protocol is up
Internet Address 2.2.2.2/32, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Multi-area interface Count is 0
GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.0.0.2/24, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 50, MTU 1500, MaxPktSz 1500
Forward reference No, Unnumbered no, Bandwidth 1000000
RIB LC sync Yes
Designated Router (ID) 1.1.1.1, Interface address 10.0.0.1
Backup Designated router (ID) 2.2.2.2, Interface address 10.0.0.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:04:016
Index 1/1, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 3
Neighbor Count is 3, Adjacent neighbor count is 3
Adjacent with neighbor 1.1.1.1 (Designated Router)
Adjacent with neighbor 3.3.3.3
Adjacent with neighbor 4.4.4.4
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Segment Routing Forwarding MPLS enabled: Yes
Adjacency hold timer expired last : Never
Exchange timer expired last : Never
RP/0/RP0/CPU0:R2#show ospf neighbor
Sat Sep 5 14:03:37.996 UTC
* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up
Neighbors for OSPF 1
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 100 FULL/DR 00:00:37 10.0.0.1 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:24
3.3.3.3 0 FULL/DROTHER 00:00:31 10.0.0.3 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:12
4.4.4.4 1 FULL/DROTHER 00:00:31 10.0.0.4 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:03
Total neighbor count: 3RP/0/RP0/CPU0:R3#show ospf interface
Sat Sep 5 14:03:55.806 UTC
Interfaces for OSPF 1
Loopback0 is up, line protocol is up
Internet Address 3.3.3.3/32, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 3.3.3.3, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Multi-area interface Count is 0
GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.0.0.3/24, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DROTHER, Priority 0, MTU 1500, MaxPktSz 1500
Forward reference No, Unnumbered no, Bandwidth 1000000
RIB LC sync Yes
Designated Router (ID) 1.1.1.1, Interface address 10.0.0.1
Backup Designated router (ID) 2.2.2.2, Interface address 10.0.0.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:01:667
Index 1/1, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 0, maximum is 3
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 4
Neighbor Count is 3, Adjacent neighbor count is 2
Adjacent with neighbor 1.1.1.1 (Designated Router)
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Segment Routing Forwarding MPLS enabled: Yes
Adjacency hold timer expired last : Never
Exchange timer expired last : Never
RP/0/RP0/CPU0:R3#show ospf neighbor
Sat Sep 5 14:03:57.362 UTC
* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up
Neighbors for OSPF 1
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 100 FULL/DR 00:00:37 10.0.0.1 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:34
2.2.2.2 50 FULL/BDR 00:00:32 10.0.0.2 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:38
4.4.4.4 1 2WAY/DROTHER 00:00:31 10.0.0.4 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:22
Total neighbor count: 3RP/0/RP0/CPU0:R4#show ospf interface
Sat Sep 5 14:04:15.082 UTC
Interfaces for OSPF 1
Loopback0 is up, line protocol is up
Internet Address 4.4.4.4/32, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 4.4.4.4, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Multi-area interface Count is 0
GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.0.0.4/24, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DROTHER, Priority 1, MTU 1500, MaxPktSz 1500
Forward reference No, Unnumbered no, Bandwidth 1000000
RIB LC sync Yes
Designated Router (ID) 1.1.1.1, Interface address 10.0.0.1
Backup Designated router (ID) 2.2.2.2, Interface address 10.0.0.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:02:933
Index 1/1, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 4
Neighbor Count is 3, Adjacent neighbor count is 2
Adjacent with neighbor 1.1.1.1 (Designated Router)
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Segment Routing Forwarding MPLS enabled: Yes
Adjacency hold timer expired last : Never
Exchange timer expired last : Never
RP/0/RP0/CPU0:R4#show ospf neighbor
Sat Sep 5 14:04:16.748 UTC
* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up
Neighbors for OSPF 1
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 100 FULL/DR 00:00:37 10.0.0.1 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:44
2.2.2.2 50 FULL/BDR 00:00:32 10.0.0.2 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:48
3.3.3.3 0 2WAY/DROTHER 00:00:39 10.0.0.3 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:42
Total neighbor count: 3R1 (DR) and R2 (BDR) both report Adjacent neighbor count is 3: they are adjacent with everyone on the segment. R3 and R4 (DROTHER) report Neighbor Count is 3, Adjacent neighbor count is 2: they see three neighbors but are adjacent with only two of them, the DR and the BDR.
A DROTHER’s show ospf interface has no Designated Router (ID) line. That is simply because it does not hold the role, not a fault.
| Router | Priority | Router ID | Result |
|---|---|---|---|
| R1 | 100 | 1.1.1.1 | DR |
| R2 | 50 | 2.2.2.2 | BDR |
| R3 | 0 | 3.3.3.3 | DROTHER (not eligible, priority 0) |
| R4 | 1 | 4.4.4.4 | DROTHER |
R4’s router ID of 4.4.4.4 is the highest of the four, but its priority is the default of 1, so it is a DROTHER. The priority takes precedence over the router ID, exactly as expected.
DROTHERs Stop at 2-Way with Each Other (STEP 0)
Comparing the R3 and R4 tabs above, the State column of show ospf neighbor looks like this.
| Seen from | R1 (DR) | R2 (BDR) | R3 | R4 |
|---|---|---|---|---|
| R1 | - | FULL/BDR | FULL/DROTHER | FULL/DROTHER |
| R2 | FULL/DR | - | FULL/DROTHER | FULL/DROTHER |
| R3 | FULL/DR | FULL/BDR | - | 2WAY/DROTHER |
| R4 | FULL/DR | FULL/BDR | 2WAY/DROTHER | - |
The State column reads “the state of the neighbor as this router sees it / the role of that neighbor”. R3 and R4, both DROTHERs, leave each other at 2WAY. This is not a fault: DROTHERs are designed not to synchronize their LSDBs with each other.
The Wait Timer in Action (start of STEP 2)
This is the state right after restarting the OSPF process on all four routers at once with clear ospf 1 process.
RP/0/RP0/CPU0:R4#show ospf interface GigabitEthernet0/0/0/0
Sat Sep 5 14:08:24.096 UTC
GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.0.0.4/24, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State WAITING, Priority 255, MTU 1500, MaxPktSz 1500
Forward reference No, Unnumbered no, Bandwidth 1000000
RIB LC sync Yes
No designated router on this network
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:06:809
Wait time before Designated router selection 00:00:37
Index 1/1, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 4
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Segment Routing Forwarding MPLS enabled: Yes
Adjacency hold timer expired last : Never
Exchange timer expired last : NeverR4’s show output at that moment
State WAITING, and no DR or BDR has been decided yet (No designated router on this network). Wait time before Designated router selection is the time left until the election, counting down from the 40-second Wait timer. During this window the router listens to the other routers’ Hellos and learns their priorities before the election runs.
Note that this output was taken with R4’s priority set to 255, as in the next section.
Which Multicast Address Is Used
With STEP 6 finished and R1 back as the DR and R2 as the BDR, a capture was taken on the R3-SW link and the OSPF process on R3 alone (a DROTHER) was restarted to make it exchange LSAs. R3’s priority is 0, so restarting it does not change who holds the DR and BDR roles.
1 0.000000 10.0.0.3 → 224.0.0.5 OSPF 122 Hello Packet
2 0.203569 10.0.0.2 → 224.0.0.5 OSPF 122 Hello Packet
3 1.238195 10.0.0.1 → 224.0.0.5 OSPF 122 Hello Packet
4 1.337437 10.0.0.4 → 224.0.0.5 OSPF 122 Hello Packet
5 7.288566 10.0.0.3 → 224.0.0.6 OSPF 110 LS Update
6 7.288871 10.0.0.3 → 10.0.0.4 OSPF 78 DB Description
7 7.295265 10.0.0.1 → 224.0.0.5 OSPF 110 LS Update
8 7.301454 10.0.0.3 → 224.0.0.5 OSPF 110 Hello Packet
9 7.357886 10.0.0.1 → 224.0.0.5 OSPF 98 LS Update
10 9.299194 10.0.0.2 → 224.0.0.5 OSPF 98 LS Acknowledge
11 9.300248 10.0.0.4 → 224.0.0.6 OSPF 98 LS AcknowledgeAll four routers send their Hellos to 224.0.0.5 (No.1-4). Only the DROTHERs R3 and R4 use 224.0.0.6 when they send LSAs (No.5, No.11); the DR R1 and the BDR R2 use 224.0.0.5 (No.7, No.10).
First, the Hello sent by the DR, R1.
Ethernet II, Src: 52:54:00:fa:11:84, Dst: 01:00:5e:00:00:05
Internet Protocol Version 4, Src: 10.0.0.1, Dst: 224.0.0.5
Message Type: Hello Packet (1)
Source OSPF Router: 1.1.1.1
Network Mask: 255.255.255.0
Hello Interval [sec]: 10
Router Priority: 100
Router Dead Interval [sec]: 40
Designated Router: 10.0.0.1
Backup Designated Router: 10.0.0.2
Active Neighbor: 2.2.2.2
Active Neighbor: 3.3.3.3
Active Neighbor: 4.4.4.4The Hello carries the Router Priority used in the election and the result of that election, Designated Router and Backup Designated Router. Note that the DR and BDR are written as interface addresses, not router IDs.
Next, the LSU in which the DROTHER R3 sends its own Router-LSA.
Ethernet II, Src: 52:54:00:d5:27:8b, Dst: 01:00:5e:00:00:06
Internet Protocol Version 4, Src: 10.0.0.3, Dst: 224.0.0.6
Message Type: LS Update (4)
Source OSPF Router: 3.3.3.3
LSA-type 1 (Router-LSA), len 48
Link State ID: 3.3.3.3
Advertising Router: 3.3.3.3
Sequence Number: 0x80000002The destination is 224.0.0.6, and the Ethernet destination MAC address is 01:00:5e:00:00:06 to match. Only the DR and the BDR pick this packet up; R4, the other DROTHER, does not.
Seven milliseconds later, the DR R1 sends the same LSA again, this time to 224.0.0.5.
Ethernet II, Src: 52:54:00:fa:11:84, Dst: 01:00:5e:00:00:05
Internet Protocol Version 4, Src: 10.0.0.1, Dst: 224.0.0.5
Message Type: LS Update (4)
Source OSPF Router: 1.1.1.1
LSA-type 1 (Router-LSA), len 48
Link State ID: 3.3.3.3
Advertising Router: 3.3.3.3
Sequence Number: 0x80000002The Source OSPF Router is R1 (1.1.1.1), but the LSA inside is Advertising Router: 3.3.3.3 with sequence number 0x80000002 - exactly the same LSA as in No.5. The packets show the DR relaying an LSA received from a DROTHER out to the whole segment, unchanged.
Finally, the LSAck returned by the BDR, R2.
Ethernet II, Src: 52:54:00:58:41:41, Dst: 01:00:5e:00:00:05
Internet Protocol Version 4, Src: 10.0.0.2, Dst: 224.0.0.5
Message Type: LS Acknowledge (5)
Source OSPF Router: 2.2.2.2
LSA-type 1 (Router-LSA), len 48
Link State ID: 3.3.3.3
Advertising Router: 3.3.3.3
Sequence Number: 0x80000002
LSA-type 2 (Network-LSA), len 36
Link State ID: 10.0.0.1
Advertising Router: 1.1.1.1
Sequence Number: 0x80000004The BDR does not relay anything, but the packets it sends itself go to 224.0.0.5. Remembering that only a DROTHER uses 224.0.0.6 will keep this straight.
Raising the Priority Later Does Not Change the DR (STEP 1-2)
R4, a DROTHER, is given a priority of 255, the highest of the four (STEP 1).
router ospf 1
area 0
interface GigabitEthernet0/0/0/0
priority 255
!
!
!After waiting 60 seconds, the state is checked.
RP/0/RP0/CPU0:R4#show ospf interface
Sat Sep 5 14:07:49.089 UTC
Interfaces for OSPF 1
Loopback0 is up, line protocol is up
Internet Address 4.4.4.4/32, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 4.4.4.4, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Multi-area interface Count is 0
GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.0.0.4/24, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DROTHER, Priority 255, MTU 1500, MaxPktSz 1500
Forward reference No, Unnumbered no, Bandwidth 1000000
RIB LC sync Yes
Designated Router (ID) 1.1.1.1, Interface address 10.0.0.1
Backup Designated router (ID) 2.2.2.2, Interface address 10.0.0.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:07:642
Index 1/1, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 4
Neighbor Count is 3, Adjacent neighbor count is 2
Adjacent with neighbor 1.1.1.1 (Designated Router)
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Segment Routing Forwarding MPLS enabled: Yes
Adjacency hold timer expired last : Never
Exchange timer expired last : NeverThe priority is 255, yet the state is still DROTHER, and the DR is still R1. On a segment where the election has already run, a router that turns up later with a higher priority does not trigger a re-election.
Next, clear ospf 1 process is run on all four routers so that they all redo the election together (STEP 2).
| Router | Priority | STEP 1 (before) | STEP 2 (after) |
|---|---|---|---|
| R1 | 100 | DR | BDR |
| R2 | 50 | BDR | DROTHER |
| R3 | 0 | DROTHER | DROTHER |
| R4 | 255 | DROTHER | DR |
This time R4 becomes the DR, as its priority says it should. Changing the configuration alone does not switch the roles; they only follow the priorities once the election is redone. In practice, if a particular device is meant to be the DR, the priority has to be set before OSPF is enabled.
After this check, R4’s priority was returned to the default and clear ospf 1 process was run on all four again, putting R1 back as the DR and R2 as the BDR (STEP 3).
What Happens When the DR Goes Down (STEP 4-5)
Gi0/0/0/0 on R1, the DR, is shut down (STEP 4). A capture was running on the R2-SW link at the time.
interface GigabitEthernet0/0/0/0
shutdown
!This is R2 80 seconds later.
RP/0/RP0/CPU0:R2#show ospf interface
Sat Sep 5 14:16:17.513 UTC
Interfaces for OSPF 1
Loopback0 is up, line protocol is up
Internet Address 2.2.2.2/32, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Multi-area interface Count is 0
GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.0.0.2/24, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 50, MTU 1500, MaxPktSz 1500
Forward reference No, Unnumbered no, Bandwidth 1000000
RIB LC sync Yes
Designated Router (ID) 2.2.2.2, Interface address 10.0.0.2
Backup Designated router (ID) 4.4.4.4, Interface address 10.0.0.4
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:06:731
Index 1/1, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 4
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 3.3.3.3
Adjacent with neighbor 4.4.4.4 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Segment Routing Forwarding MPLS enabled: Yes
Adjacency hold timer expired last : Never
Exchange timer expired last : NeverR2, which was the BDR, has been promoted to DR, and R4 has been elected as the new BDR from the remaining routers. R3 cannot become the BDR because its priority is 0, so R4 with its priority of 1 is chosen.
The log records only that R1 was declared down when the Dead timer expired.
RP/0/RP0/CPU0:Sep 5 14:15:01.234 UTC: ospf[1035]: %ROUTING-OSPF-5-ADJCHG : Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0/0/0 in area 0 from FULL to DOWN, Neighbor Down: dead timer expired, vrf default vrfid 0x60000000 R1 was shut down at 14:14:21 and R2 detected it at 14:15:01: exactly 40 seconds, the Dead interval. R1 only brought its own interface down, and from the other routers behind the switch the link is still up, so the only way to notice is for the Hellos to stop arriving and the Dead interval to expire.
The capture shows the same thing. Here are R1’s last Hello and the Hellos after the change.
No. 時刻 送信元 Designated Router Backup Designated Router
7 11.600 10.0.0.1 10.0.0.1 10.0.0.2
19 28.165 10.0.0.4 10.0.0.1 10.0.0.2
26 38.737 10.0.0.2 10.0.0.1 10.0.0.2
30 47.909 10.0.0.2 10.0.0.1 10.0.0.2
31 48.293 10.0.0.3 10.0.0.1 10.0.0.2
42 56.270 10.0.0.4 10.0.0.2 10.0.0.2
43 57.811 10.0.0.2 10.0.0.2 10.0.0.4
44 58.246 10.0.0.3 10.0.0.2 10.0.0.4 Download the pcap of the packet in the table above (No.7 R1's last Hello)
Download the pcap of the packet in the table above (No.43 Hello after the change)
No.7 is R1’s last Hello; after it, R1 stops sending. Even so, up to No.31 (about 37 seconds later) the other routers keep advertising 10.0.0.1 as the DR in their Hellos. Only after the Dead interval expires, from No.42 onwards, does the DR change to 10.0.0.2 and the BDR to 10.0.0.4.
Finally, R1’s interface is brought back with no shutdown (STEP 5).
RP/0/RP0/CPU0:R1#show ospf interface
Sat Sep 5 14:19:37.643 UTC
Interfaces for OSPF 1
Loopback0 is up, line protocol is up
Internet Address 1.1.1.1/32, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1
Loopback interface is treated as a stub Host
Multi-area interface Count is 0
GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.0.0.1/24, Area 0, SID 0, Strict-SPF SID 0
Label stack Primary label 0 Backup label 0 SRTE label 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DROTHER, Priority 100, MTU 1500, MaxPktSz 1500
Forward reference No, Unnumbered no, Bandwidth 1000000
RIB LC sync Yes
Designated Router (ID) 2.2.2.2, Interface address 10.0.0.2
Backup Designated router (ID) 4.4.4.4, Interface address 10.0.0.4
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:06:225
Index 1/1, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 0, maximum is 2
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 5
Neighbor Count is 3, Adjacent neighbor count is 2
Adjacent with neighbor 2.2.2.2 (Designated Router)
Adjacent with neighbor 4.4.4.4 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0
Segment Routing Forwarding MPLS enabled: Yes
Adjacency hold timer expired last : Never
Exchange timer expired last : NeverEven with a priority of 100, R1 comes back as a DROTHER: the DR is still R2 and the BDR still R4. No re-election happens here either. Because the roles shift every time a DR goes down, on a running segment you cannot tell which router is the DR from the configuration alone.
clear ospf 1 process was then run on all four once more, returning R1 to DR and R2 to BDR (STEP 6).
The two full captures are these.
Download the capture on the R3-SW link (ospf-dr-bdr-multicast.pcap)
Download the capture on the R2-SW link (ospf-dr-bdr-failover.pcap)
Configurations Used and show Output
At every STEP the following three files were collected from each of the four routers. The ..._run.txt files are the configurations used (the final state is the one from STEP 6). The article quotes only part of them.
| File | Contents |
|---|---|
..._show.txt | show version / show interface description / show route / show route ospf / show ospf / show ospf interface / show ospf interface brief / show ospf neighbor / show ospf neighbor detail / show ospf database / show ospf database router / show ospf database network / show ospf statistics interface |
..._log.txt | show logging narrowed to that STEP. A marker is written with logmsg at the start of each STEP and its timestamp passed to show logging start (STEP 0 alone holds the whole history since boot). |
..._run.txt | show running-config at that STEP (that is, the configuration used at that STEP) |
STEP 0: initial state - R1 is the DR, R2 the BDR (in the article: Election Result, DROTHERs Stop at 2-Way with Each Other)
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 1: R4’s priority changed to 255 - R1 stays the DR and R2 the BDR (in the article: Raising the Priority Later Does Not Change the DR)
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 2: OSPF process restarted on all four routers at once - R4 becomes the DR, R1 the BDR (in the article: The Wait Timer in Action, Raising the Priority Later Does Not Change the DR)
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 3: R4’s priority returned to the default, then all four restarted at once - R1 is the DR again, R2 the BDR (in the article: -)
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 4: Gi0/0/0/0 on R1 shut down - R2 is promoted to DR, R4 becomes the new BDR (in the article: What Happens When the DR Goes Down)
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 5: Gi0/0/0/0 on R1 brought back with no shutdown - R1 returns as a DROTHER (R2 stays the DR) (in the article: What Happens When the DR Goes Down)
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 6: OSPF process restarted on all four at once - back to the initial state, R1 as DR and R2 as BDR (in the article: the final state; these running-configs are the configurations used)
| Router | show output | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
How to configure the DR/BDR priority will be covered in a separate article.
References
| RFC | Title | Summary |
|---|---|---|
| RFC 2328 | OSPF Version 2 | The DR/BDR election procedure is defined in Section 9.4 (Electing the Designated Router). The multicast addresses are in Section A.1. |