OSPF MASTERCLASS · CHAPTER 6

DR and BDR election: what the books don’t tell you

The highest priority does not always win. Learn how the DR is really elected, how to design priorities over Metro Ethernet and how to read type 1 and 3 LSAs.

13 min readVideos: Day 2, parts 2 and 3Level: intermediate

From point A to point B

Point A: you know that OSPF elects a DR and a BDR on Ethernet, and you learned the usual rule: the highest priority wins. Yet on your network the DR is exactly the router you did not expect. Point B: by the end of this chapter you will predict which router becomes DR, design the priorities of a provider network and read in the LSDB what each router advertises.

In the class we said it plainly: the rule “the highest priority wins” is incomplete. We proved it live with four routers and a configuration mistake that turned out to be the best lesson.

What you will see
  1. A DR with priority 150 against a router with 250
  2. How the election really works: BDR first, no preemption
  3. A router with priority 255 that stays a DROTHER
  4. When 224.0.0.6 is used, seen in Wireshark
  5. A priority plan for Metro Ethernet
  6. Type 1 and type 3 LSAs in the database

The highest priority does not always win

First, the cleanup: shutting down serial 0/0 on R3 drops the EIGRP neighbor and ends the redistribution into the NSSA. The focus moves to area 40: a broadcast segment, 10.10.10.0/24, with R8, R9, R10 and R11 connected to a switch. OSPF is removed from all four and rebuilt. The plan: R8 will be the DR with priority 250.

R8# configure terminal
R8(config)# no router ospf 1
R8(config)# interface loopback 0
R8(config-if)# ip address 8.8.8.8 255.255.255.255
R8(config-if)# ip ospf 1 area 40
R8(config-if)# interface GigabitEthernet0/1
R8(config-if)# ip address 10.10.10.8 255.255.255.0
R8(config-if)# ip ospf priority 250
R8(config-if)# shutdown
R8(config-if)# router ospf 1
R8(config-router)# router-id 0.0.0.8
R8(config-router)# do debug ip ospf adj
R8(config-router)# interface GigabitEthernet0/1
R8(config-if)# no shutdown
! Missing: Gi0/1 is not in any OSPF area yet

Next comes R9, with priority 150, meant to be the BDR. Since it is an internal router, all its interfaces go into area 40 with a single network statement.

R9(config)# no router ospf 1
R9(config)# router ospf 1
R9(config-router)# router-id 0.0.0.9
R9(config-router)# network 0.0.0.0 255.255.255.255 area 40
R9(config-router)# interface loopback 0
R9(config-if)# ip address 9.9.9.9 255.255.255.255
R9(config-if)# interface GigabitEthernet0/0
R9(config-if)# ip address 10.10.10.9 255.255.255.0
R9(config-if)# ip ospf priority 150
R9(config-if)# do debug ip ospf adj
R9(config-if)# no shutdown

The neighbor does not come up. Wireshark only shows Hellos from R9. On R8, show run | section router reveals the problem: Gi0/1 is not in any area. ip ospf 1 area 40 is all it takes.

R8# show run | section router
R8# configure terminal
R8(config)# interface GigabitEthernet0/1
R8(config-if)# ip ospf 1 area 40
! debug: DBD, LSR, LSU, LSAck ... neighbor 0.0.0.9 goes FULL
R8(config-if)# do show ip ospf neighbor
R8(config-if)# do show ip ospf interface GigabitEthernet0/1 | include priority
R8(config-if)# do show ip ospf interface GigabitEthernet0/1
! DR: 0.0.0.9 (priority 150) · BDR: 0.0.0.8 (priority 250)

Now it works: the debug shows DBD, LSR, LSU and LSAck, and the neighbor reaches FULL. But there is a surprise. The DR is R9, with priority 150. R8, with 250, ended up as BDR.

How the election really works

Peter found the clue in the chat: R8 was out of the game. R9 arrived alone on the segment, found nobody and named itself DR.

This is the logic we explained in the class. Once routers reach 2-Way they are neighbors, and the election starts. The BDR is calculated first. If there is no DR, the BDR is promoted to DR and a new BDR is calculated. A router that arrives alone proposes itself as BDR, then as DR, and ends up as DR.

And the key rule: once elected, the DR does not change. It only changes if it fails or if the OSPF process restarts. When R8 came in with 250 and asked for the role, the segment already had a DR. Only one seat was free: BDR.

What RFC 2328 says. When a router’s interface comes up, it first checks whether the network already has a DR. If so, it accepts it, regardless of its own priority. The RFC’s reason: the DR changes less often. If there is no DR, the interface waits for the wait timer, equal to the dead interval (40 seconds on broadcast), before electing. So if several routers start within that window, the highest priority does win, and on a tie the highest router ID. Priority ranges from 0 to 255 and defaults to 1.
DR and BDR election in the area 40 lab, step by step Four routers share the broadcast segment 10.10.10.0/24 in area 40: R9 with priority 150, R8 with 250, R10 with 255 and R11 with 0. Step 1: R9 is the only active OSPF router on the segment, because R8's interface is not in any OSPF area yet; after the wait timer R9 becomes DR. Step 2: R8's interface is added to area 40; a DR already exists, so R8 becomes BDR despite its higher priority. Step 3: R10 with priority 255 and R11 with priority 0 join; both become DROTHER. Step 4: R9's interface is shut down; the BDR, R8, becomes DR and R10 is elected BDR. Step 5: R9 comes back and stays DROTHER. There is no preemption. 1 · R9 up alone wait timer → DR 2 · R8 interface added to area 40 3 · R10 and R11 join the segment 4 · R9 Gi0/0 shutdown 5 · R9 back no shutdown R9 priority 150 DR DR DR down DROTHER R8 priority 250 no area BDR BDR DR DR R10 priority 255 — — DROTHER BDR BDR R11 priority 0 — — DROTHER DROTHER DROTHER No preemption: priority only matters inside an election. A DR keeps its role until it fails or OSPF restarts. When the DR fails, the BDR becomes DR and a new BDR is elected. Priority 0 never becomes DR or BDR.

The election in area 40, step by step: priority only matters inside the same election. Diagram: The House of Routing.

Priority 255 and still a DROTHER

Next question for the audience: if R10 joins with priority 255, the maximum, what happens? A good practice from the class: in production, shut the interface, configure it, then bring it up. You should know what will happen before it happens.

R10(config)# interface GigabitEthernet0/0
R10(config-if)# shutdown
R10(config-if)# ip address 10.10.10.10 255.255.255.0
R10(config-if)# ip ospf 1 area 40
R10(config-if)# ip ospf priority 255
R10(config-if)# do debug ip ospf adj
R10(config-if)# no shutdown
R10(config-if)# do show ip ospf neighbor
! R10 is DROTHER: FULL/DR with 0.0.0.9, FULL/BDR with 0.0.0.8
R10(config-if)# router ospf 1
R10(config-router)# router-id 0.0.0.10
R10(config-router)# do clear ip ospf process

R11(config)# router ospf 1
R11(config-router)# router-id 0.0.0.11
R11(config-router)# network 0.0.0.0 255.255.255.255 area 0
R11(config-router)# interface GigabitEthernet0/0
R11(config-if)# shutdown
R11(config-if)# ip address 10.10.10.11 255.255.255.0
R11(config-if)# ip ospf priority 0
R11(config-if)# no shutdown
R11(config-if)# do debug ip ospf adj
! debug: mismatch area -> the network statement says area 0
R11(config-if)# router ospf 1
R11(config-router)# no network 0.0.0.0 255.255.255.255 area 0
R11(config-router)# network 0.0.0.0 255.255.255.255 area 40
R11(config-router)# do show ip ospf neighbor
! FULL/DR (R9), FULL/BDR (R8), 2WAY/DROTHER (R10)

R10’s debug shows the Wait state and, in 2-Way, the existing roles: DR 9, BDR 8. R10 has 255, but it arrived late and stays a DROTHER, FULL with the DR and the BDR.

Then R11 joins with priority 0: it does not take part in the election. There was a hiccup, “mismatch area”, because the network statement said area 0. Once fixed to area 40, R11 is FULL with R9 and R8, and in 2-Way with R10.

That 2-Way between DROTHERs is not an error. They are neighbors, not adjacent. A neighbor shows up in the Hellos. An adjacent router reaches FULL and exchanges routing information. That is exactly why the DR exists: DROTHERs send it their information and the DR advertises it to everyone. This way not every router forms an adjacency with every other.

224.0.0.5 and 224.0.0.6 in Wireshark

Many texts say that DROTHERs talk to the DR through 224.0.0.6, and you picture that traffic flowing all the time. The capture from the class shows something else.

Unicast, 224.0.0.5 and 224.0.0.6 when a DROTHER joins Sequence captured in Wireshark when R10 joins the segment as a DROTHER. Hellos go to 224.0.0.5, all OSPF routers. During the adjacency, the Database Description packets with the LSA headers, the link state request, the link state update with the full type 1 LSA and the acknowledgment travel as unicast between R10 and the DR and BDR, for example to 10.10.10.8. After that, R10 sends its new link state update and acknowledgment to 224.0.0.6, the address only the DR and BDR listen to, and the DR floods to 224.0.0.5. Then only Hellos to 224.0.0.5 remain every 10 seconds, until something changes. R10 DROTHER · prio 255 DR and BDR R9 (DR) · R8 (BDR) 2-WAY Hello → 224.0.0.5 (AllSPFRouters) EXCHANGE DBD · unicast to 10.10.10.8 · LSA headers (type 1) LOADING LSR · unicast · send me the full LSA LSU · unicast · full type 1 LSA (links, cost) LSAck · unicast FULL LSU / LSAck → 224.0.0.6 (AllDRouters) · only DR and BDR listen Hello every 10 s → 224.0.0.5 · until something changes show ip interface: the DR and BDR joined 224.0.0.5 and 224.0.0.6; a DROTHER joined only 224.0.0.5.

What the capture shows when R10 joins as a DROTHER: unicast during the adjacency, 224.0.0.6 for flooding, then only Hellos. Diagram: The House of Routing.

  • R10 sends its Hello to 224.0.0.5.
  • It sends its DBD as unicast to 10.10.10.8, with the header of its type 1 LSA. In a type 1 LSA, the Link State ID is the router ID of its originator.
  • R8 answers with an LSR: “send me what you said you had”.
  • R10 replies with a unicast LSU carrying the full LSA: its links and its cost, the missing information.
  • After the LSAck, R10 sends its update and its acknowledgment to 224.0.0.6.
  • Then everything goes back to Hellos to 224.0.0.5, every 10 seconds.

How do you check who listens to 224.0.0.6? With show ip interface. The DR’s interface has joined the groups 224.0.0.5 and 224.0.0.6. R10’s, a DROTHER, only 224.0.0.5.

R9# show ip interface GigabitEthernet0/0
! DR: joined multicast groups 224.0.0.5 and 224.0.0.6
R10# show ip interface GigabitEthernet0/0
! DROTHER: joined 224.0.0.5 only
When 224.0.0.6 shows up. According to RFC 2328, a router that is neither DR nor BDR sends its LSUs and LSAcks to 224.0.0.6 (AllDRouters); the DR floods them back to 224.0.0.5 (AllSPFRouters). It happens whenever there is something to flood: a new adjacency, a change or the 30-minute LSA refresh. On a stable network, only Hellos travel. OSPF does not use TCP: its reliability comes from its own acknowledgments.

The DR fails: the BDR steps up

Jorge asked whether the DR was not simply the router with the highest router ID. The answer sums it all up: there is only one DR and one BDR per broadcast or NBMA segment, even if you have 10 routers with high priorities.

There is no preemption either, neither for the DR nor for the BDR. If the DR fails, priorities are not renegotiated: the BDR is promoted to DR and a new BDR is elected. If the old DR comes back, it stays a DROTHER until the next failure.

The test in the lab: Gi0/0 is shut down on R9, the DR.

R9(config)# interface GigabitEthernet0/0
R9(config-if)# shutdown
R11# show ip ospf neighbor
! After the dead interval: R8 FULL/DR, R10 FULL/BDR
R9(config)# interface GigabitEthernet0/0
R9(config-if)# no shutdown
R11# show ip ospf neighbor
! R9 is back, but as 2WAY/DROTHER

R11 does not notice right away: it is connected to a switch and its link stays up. This is an indirect failure, and you have to wait for the dead interval. To detect it sooner, Jesús mentioned BFD (Bidirectional Forwarding Detection).

When the timer expires, R8 goes from BDR to DR, and R10, the DROTHER with 255, becomes BDR. When R9 returns with no shutdown, the debug shows 2-Way with R8, R10 and R11, and the election says: DR 8, BDR 10. R9, the former DR, stays a DROTHER. It lost the throne.

Priority design over Metro Ethernet

What happens if you do not define the DR and BDR properly? Jesús answered on the whiteboard. Picture your provider connecting your branches with a VPLS service. For OSPF it is one big switch: a broadcast segment. The DR and BDR are decided before you type the first command.

Designing OSPF priorities over a Metro Ethernet VPLS Four customer routers connect through a provider VPLS service, which behaves like one big switch and therefore is an OSPF broadcast segment with DR and BDR election. Router 1 gets priority 200 and is the intended DR, router 2 gets 190 as BDR, router 3 gets 180 and router 4 gets 170 as the next in line. Priorities go down in steps of 10 and the routers are powered on in that same order. The common real-world problems are indirect failure, where neighbors wait for the dead interval of 40 seconds unless BFD is used, and MTU changes in the provider network that leave neighbors stuck in EXSTART. PROVIDER VPLS one big switch · broadcast segment OSPF elects a DR and a BDR ROUTER 1 · 200 DR · power on 1st ROUTER 2 · 190 BDR · power on 2nd ROUTER 3 · 180 next BDR · power on 3rd ROUTER 4 · 170 next in line · 4th Steps of 10 are easy to read. Power on in priority order so you never have to restart OSPF to fix the roles. Watch for: indirect failure (dead interval 40 s, or BFD) · MTU changes in the provider → stuck in EXSTART

A stepped priority plan over VPLS: the power-on order follows the priority order. Diagram: The House of Routing.

  • Step by 10: 200, 190, 180 and 170. It is easy to read and you do not need to go up to 255.
  • Decide who comes next. The third and fourth routers have no “BDR 2” role in OSPF: they will be DROTHERs. But with a priority above zero they take over in order if the first ones fail.
  • Power on in order. If you power on the 170 router first and it is alone, it becomes DR. Power on the intended DR first and continue in order, so you never have to restart OSPF to fix the roles.

Jesús applied this model for more than 8 years with service providers, on networks of more than 10 branches: DR, BDR, two backups in line and the rest at priority 0. The real problems were two:

  • Indirect failure: neighbors are slow to detect a failure behind a switch.
  • MTU changes in the provider network, for example during a maintenance window with MPLS or an overlay port left misconfigured. The neighbor gets stuck in ExStart.

Cisco confirms it: with mismatched MTUs the neighbor stays in ExStart or Exchange. The fix is to match the MTU on both ends; ip ospf mtu-ignore is for rare cases. Behind that network there is a customer making sales: every outage costs.

Type 1 and type 3 LSAs in the lab

R10 gets a loopback, 10.10.110.10/32, in area 40, and R11 can already ping it.

R10(config)# interface loopback 0
R10(config-if)# no ip address
R10(config-if)# ip address 10.10.110.10 255.255.255.255
R10(config-if)# ip ospf 1 area 40
R11# ping 10.10.110.10
R11# show ip ospf database
R11# show ip ospf database router 0.0.0.8

Everything in area 40 is type 1 LSAs (router LSAs). Every OSPF router in the area originates one, and its Link State ID is the router ID. With show ip ospf database router you see what each one describes. R11’s has two links: a stub network, its loopback, and a connection to a transit network, the broadcast segment with a DR. It is the same content that traveled inside the LSU.

Now the design. R8 connects area 40 with area 32, but area 40 does not touch area 0. Every area must connect to the backbone: area 40 is discontiguous and needs a virtual link. Jesús was emphatic: it is a tool in your kit, like a screwdriver, not part of a native design. You configure it in chapter 7.

First, R8 has to talk to R7 in area 32. When its Gi0/0 comes up, the debug warns “Mismatched authentication type”: R7 uses type 2 (MD5) and R8 none. It is removed on R7 and the neighbor comes up; authentication returns in chapter 8.

R8(config)# interface GigabitEthernet0/0
R8(config-if)# ip ospf 1 area 32
R8(config-if)# no shutdown
! debug ip ospf adj: Mismatched authentication type. Input packet specified type 2
R7(config)# interface GigabitEthernet0/1
R7(config-if)# no ip ospf authentication
R8# show ip ospf neighbor
R8# show ip route
! O IA 1.1.1.1, O IA 2.2.2.2 ... learned through the ABR 0.0.0.1
R8# show ip ospf database
! Summary Net Link States (type 3) advertised by 0.0.0.1

Now R8 sees O IA routes: 1.1.1.1, 2.2.2.2 and the rest of area 0. In the LSDB they appear as Summary Net Link States, type 3 LSAs, advertised by 0.0.0.1, the ABR. Type 4 LSAs show up too.

The ABR translates the type 1 and 2 LSAs of one area into type 3 LSAs for another. A type 3 LSA does not describe the topology of area 0; it says “to reach this network, go toward 0.0.0.1”. R7, sitting in the middle, does not even appear. That is why we say that, between areas, OSPF follows a distance vector principle: direction and distance.

Class videos

These are the two videos from the 2nd OSPF Marathon that this chapter covers. They were recorded live with Cisco IOSv routers in GNS3, debug and Wireshark; the audio is in Spanish, with subtitles in Spanish, English, French and Portuguese.

Recorded live; Spanish audio with Spanish, English, French and Portuguese subtitles. When you play it, the video loads from YouTube. Day 2 playlist on YouTube

Test what you learned

1. R9 (priority 150) is DR. You enable OSPF on R8 (priority 250). Who is DR one minute later?

Answer. Still R9. The election is not preemptive: R8 accepts the existing DR and becomes BDR. It would only become DR if R9 fails or the OSPF process restarts.

2. The DR fails. The BDR has priority 250 and a DROTHER has 255. Who becomes the new DR?

Answer. The BDR. It is promoted to DR without comparing priorities. Then a new BDR is elected, and that is where the DROTHER with 255 wins.

3. Two DROTHERs see each other as 2WAY/DROTHER. Is there anything to fix?

Answer. No. They are neighbors, not adjacent. Each DROTHER only reaches FULL with the DR and the BDR. This prevents every router from forming an adjacency with every other.

4. How do you check that a router listens to 224.0.0.6?

Answer. With show ip interface on the segment interface. The DR and BDR have joined 224.0.0.5 and 224.0.0.6; a DROTHER only 224.0.0.5.

5. A router sees O IA routes advertised by 0.0.0.1. What LSA type are they and who is 0.0.0.1?

Answer. They are type 3 LSAs (Summary Net Link States). 0.0.0.1 is the ABR that translates the type 1 and 2 LSAs of another area into type 3 LSAs.

Your takeaways

  • Priority only decides inside the same election; if a DR already exists, the new router accepts it.
  • No preemption: the DR only changes if it fails or OSPF restarts. Then the BDR steps up and a new BDR is elected.
  • Priority 0 means staying out. DROTHERs are FULL with the DR and BDR, and 2-Way among themselves.
  • Only the DR and BDR listen to 224.0.0.6, and it is used when there is something to flood; at rest there are only Hellos to 224.0.0.5.
  • Over VPLS or Metro Ethernet, design priorities in steps of 10 and power on the routers in that order.
  • Real problems with providers: indirect failure (think BFD) and mismatched MTU, which leaves the neighbor in ExStart.
  • A type 1 LSA describes a router’s links; a type 3, created by the ABR, only says where to go.

Official resources

Source and credits. Chapter written from the OSPF Masterclass that Jesús Espinoza recorded live in 2021. Text drafted with AI assistance and reviewed; original diagrams by The House of Routing. Technical details and configuration were checked against official Cisco documentation and IETF RFCs.

Navigate