CCNP ROUTE Study – OSPF DR/BDR Elections (and how to rig them….)

When multiple OSPF routers are connected to a multi-access medium such as Ethernet, a Designated Router (DR) and a Backup Designated Router (BDR) are elected. DR’s reduce network traffic as only they maintain the complete ospf database and then send updates to the other routers on the shared network segment.

The other routers become ‘slaves’ to the ‘master’ DR. ‘Slave’ routers only become FULL neighbours with the DR and BDR, remaining at the 2-WAY state with the other non-DR/BDR routers. The BDR takes over should the DR fail, and then there is another election for the role of BDR.

The router with the highest priority on the data link wins the election, but by default priorities are set to zero, so we end up with a tie. In this case the router with the highest Router ID will win.

Here’s our network to illustrate this:

In our network with default settings, assuming all OSPF router processes start at the same time, R4 and R3 win the election for DR and BDR respectively because they have the highest Router ID’s on the segment.

There are a couple of good commands we can use to verify this, the first one being show ip ospf neighbor. From the output below, we can see that R4 has FULL relationships with all of the other routers and that R3 is the BDR:

And finally, let’s get a detailed picture of R1’s ospf neighbour relationships, with the show ip ospf neighbor detail command:

R1#show ip ospf neighbor detail
Neighbor 192.168.1.2, interface address 192.168.1.2
In the area 0 via interface FastEthernet0/0
Neighbor priority is 50, State is FULL, 6 state changes
DR is 192.168.1.1 BDR is 192.168.1.2
Options is 0x52
LLS Options is 0x1 (LR)
Dead timer due in 00:00:39
Neighbor is up for 00:15:50
Index 1/1, retransmission queue length 0, number of retransmission 1
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 1, maximum is 1
Last retransmission scan time is 0 msec, maximum is 0 msec
Neighbor 192.168.1.3, interface address 192.168.1.3
In the area 0 via interface FastEthernet0/0
Neighbor priority is 1, State is FULL, 6 state changes
DR is 192.168.1.1 BDR is 192.168.1.2
Options is 0x52
LLS Options is 0x1 (LR)
Dead timer due in 00:00:30
Neighbor is up for 00:15:49
Index 3/3, retransmission queue length 0, number of retransmission 1
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 1, maximum is 1
Last retransmission scan time is 0 msec, maximum is 0 msec
Neighbor 192.168.1.4, interface address 192.168.1.4
In the area 0 via interface FastEthernet0/0
Neighbor priority is 1, State is FULL, 6 state changes
DR is 192.168.1.1 BDR is 192.168.1.2
Options is 0x52
LLS Options is 0x1 (LR)
Dead timer due in 00:00:37
Neighbor is up for 00:15:52
Index 2/2, retransmission queue length 0, number of retransmission 1
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 1, maximum is 1
Last retransmission scan time is 0 msec, maximum is 0 msec

I hope this has been a useful explanation. Thanks for reading, and good luck with your CCNP studies!

About Rich Bibby

Rich Bibby is a UK based Network Engineer, working mainly with Cisco, Juniper and Arista gear in the enterprise LAN, WAN and Data Centre space. Aside from route/switch/firewalling, he is interested in open source network monitoring and management tools, and exploring the possibilities that automation and programmability bring to networking.
Follow Rich on Twitter