OSPF Designated Router Election
Today we'll look at a few ways to influence the designated router (DR) and backup DR (BDR) elections on a multi-access segment of five OSPF routers. Due to my IPv6 resolution, we'll be using OSPFv3 in this article, but the election process works pretty much the same for both OSPFv2 and OSPFv3.

Default Configurations
By default, all IOS OSPF routers are assigned a DR priority of 1. Ties among routers with equal DR priorities are broken by router ID, with the highest RID being preferred.
In our topology, R5 (0.0.0.5) will be elected as the DR and R4 (0.0.0.4) the BDR (assuming that all routers come online at roughly the same time).
R1# show ipv6 ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Link Local Address FE80::1, Interface ID 4
Area 0, Process ID 1, Instance ID 0, Router ID 0.0.0.1
Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DROTHER, Priority 1
Designated Router (ID) 0.0.0.5, local address FE80::5
Backup Designated router (ID) 0.0.0.4, local address FE80::4
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:03
Index 1/2/2, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 3
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 4, Adjacent neighbor count is 2
Adjacent with neighbor 0.0.0.5 (Designated Router)
Adjacent with neighbor 0.0.0.4 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
R1# show ipv6 ospf neighbor
Neighbor ID Pri State Dead Time Interface ID Interface
0.0.0.2 1 2WAY/DROTHER 00:00:34 4 FastEthernet0/0
0.0.0.5 1 FULL/DR 00:00:38 4 FastEthernet0/0
0.0.0.4 1 FULL/BDR 00:00:37 4 FastEthernet0/0
0.0.0.3 1 2WAY/DROTHER 00:00:36 4 FastEthernet0/0

Manual Priority Configurations
We can influence the DR election process by administratively configuring higher priorities for routers we want to win the DR election. Suppose we wanted R1 to become the DR and R2 to become the BDR:
R1(config)# interface f0/0 R1(config-if)# ipv6 ospf priority 100
R2(config)# interface f0/0 R2(config-if)# ipv6 ospf priority 90
DRs cannot be preempted by routers with a higher priority once they have been elected, so we'll need to disconnect all routers from the network in order to force a new election. When the interfaces come back online, we see that R1 and R2 have been elected as the DR and BDR, respectively.
R1# show ipv6 ospf neighbor Neighbor ID Pri State Dead Time Interface ID Interface 0.0.0.4 1 FULL/DROTHER 00:00:38 4 FastEthernet0/0 0.0.0.2 90 FULL/BDR 00:00:38 4 FastEthernet0/0 0.0.0.5 1 FULL/DROTHER 00:00:38 4 FastEthernet0/0 0.0.0.3 1 FULL/DROTHER 00:00:38 4 FastEthernet0/0
Notice that R1 does not report any OSPF neighbor as a DR; this is because R1 itself is the DR. This is akin to the saying, "If you can't spot the sucker at a card game, you are the sucker." This isn't always the case, though, as we'll see shortly. Always verify whether the local router is fulfilling the DR or BDR role with show ip[v6] ospf interface:
R1# show ipv6 ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Link Local Address FE80::1, Interface ID 4
Area 0, Process ID 1, Instance ID 0, Router ID 0.0.0.1
Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DR, Priority 100
Designated Router (ID) 0.0.0.1, local address FE80::1
Backup Designated router (ID) 0.0.0.2, local address FE80::2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
Index 1/2/2, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 2, maximum is 6
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 4, Adjacent neighbor count is 4
Adjacent with neighbor 0.0.0.4
Adjacent with neighbor 0.0.0.2 (Backup Designated Router)
Adjacent with neighbor 0.0.0.5
Adjacent with neighbor 0.0.0.3
Suppress hello for 0 neighbor(s)

No BDR Router
The backup DR is just that: a backup. In some situations, such as a hub-and-spoke topology with a single hub, it doesn't make sense to have a BDR at all. We can prevent routers from ever becoming a DR or BDR by configuring a priority of zero. So long as one router on the network has a non-zero priority, it will become the DR.
R2(config)# interface f0/0 R2(config-if)# ipv6 ospf priority 0
R3(config)# interface f0/0 R3(config-if)# ipv6 ospf priority 0
R4(config)# interface f0/0 R4(config-if)# ipv6 ospf priority 0
R5(config)# interface f0/0 R5(config-if)# ipv6 ospf priority 0
R1# show ipv6 ospf neighbor Neighbor ID Pri State Dead Time Interface ID Interface 0.0.0.2 0 FULL/DROTHER 00:00:38 4 FastEthernet0/0 0.0.0.4 0 FULL/DROTHER 00:00:38 4 FastEthernet0/0 0.0.0.3 0 FULL/DROTHER 00:00:38 4 FastEthernet0/0 0.0.0.5 0 FULL/DROTHER 00:00:38 4 FastEthernet0/0
Note that in this case we are not required to disconnect and reconnect the interfaces to force a new election. Although a new DR or BDR cannot be chosen without a new election, a DR or BDR can resign from its current role without an election.

No DR or BDR
What happens if we set the priority of R1 (the DR) to zero as well?
R1(config)# interface f0/0 R1(config-if)# ipv6 ospf priority 0 R1(config-if)# ^Z R1# show ipv6 ospf neighbor Neighbor ID Pri State Dead Time Interface ID Interface 0.0.0.2 0 2WAY/DROTHER 00:00:33 4 FastEthernet0/0 0.0.0.4 0 2WAY/DROTHER 00:00:36 4 FastEthernet0/0 0.0.0.3 0 2WAY/DROTHER 00:00:36 4 FastEthernet0/0 0.0.0.5 0 2WAY/DROTHER 00:00:35 4 FastEthernet0/0
There are no longer any established OSPF adjacencies among any of the routers. Interestingly, this does not immediately affect the routing topology:
R1# show ipv6 route ospf
IPv6 Routing Table - 8 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route, M - MIPv6
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
D - EIGRP, EX - EIGRP external
O 2001:DB8:0:1::2/128 [110/10]
via FE80::2, FastEthernet0/0
O 2001:DB8:0:1::3/128 [110/10]
via FE80::3, FastEthernet0/0
O 2001:DB8:0:1::4/128 [110/10]
via FE80::4, FastEthernet0/0
O 2001:DB8:0:1::5/128 [110/10]
via FE80::5, FastEthernet0/0
However, the LSAs for these routes will eventually expire, and no changes in the routing topology can be advertised. If we were to disconnect and reconnect all router interfaces again, all neighbors would remain in the 2WAY/DROTHER state. None would be elected as the DR on the network and no routes could be advertised among the routers.

Comments
Hey Stretch,
great article and timely too as I'm studying ospf. I like the use of IPv6 also as it's starting to sink in through osmosis :-)
So the router id or RID is basically the highest IP address on the Router correct?
Thanks,
Paul
To answer Joey's question, DR/BDR elections are only on NBMA and Broadcast network types. Of those 2, only NBMA (ip ospf network non-broadcast) is allowed to use the neighbor statement. If you debug the ospf adjacency this is what you will see if the priorities on all are set to 0 even with the neighbor statement:
*Jun 3 10:09:04.675: OSPF: Neighbor change Event on interface FastEthernet0/0 *Jun 3 10:09:04.675: OSPF: DR/BDR election on FastEthernet0/0 *Jun 3 10:09:04.675: OSPF: Elect BDR 0.0.0.0 *Jun 3 10:09:04.675: OSPF: Elect DR 0.0.0.0 *Jun 3 10:09:04.675: DR: none BDR: none
Neighbors will still be stuck in ATTEMPT/DROTHER state.
Correct Paulkil, the selection of RID by default will be the highest in difference but if there is a loopback configures it will prefer it.
Great article Stretch!
Really all what i can say about this post is "FANTASTIC"
Yes great !! but you are using the fastethernet interface there elected DR/ BDR election process DR/BDR elected as 224.0.0.6 in your lab format . But i created as a serial interfaces without using the NBMA there is no election process.
They shows as Full/-
Why it can't forms.Normally NBMA is not elected DR/BDR they are point to point or point-to-multipoint.
can you clarify my doubt.I posted a topic in the same question. plz.. answer that if you know.
Thank you...
Great article. I never thought about what would happen if you withdrew the DR from the OSPF topology with all the routers set to not participate in the election process.
@yesudas
It helps to think of it this way:
All multiaccess networks need the DR/BDR election process in order to have a central point to transmit LSAs. One of the reasons, if not THE reason for this is to prevent LSA flooding. You can approximate NBMA networks with point-to-point serial interfaces by using a frame relay switch in the middle and having the broadcast command configured in your frame-relay map. Perhaps you have confused NBMA with point-to-point serial interfaces due to the interface type used? If you connect routers to other routers using a serial link then they're point-to-point networks, not NBMA networks.
Hello,
I have created an ISATAP tunnel connecting 2 IPv6 islands(over an IPv4 network) in the lab. Since, in NBMA networks if the priority of all OSPF neighbors are set to 0, adjacency will not be formed and would be stuck in 'ATTEMPT/DROTHER' state. Would changing the OSPF priority at one of the interface end points of the tunnel result in the adjacency being formed?
I am not able form OSPFv3 adjacency between the 2 end points of the tunnel. Any suggestions?
Cheers,
Kaustubh
All, I got it working. It was due to a rogue static route pointing to one of the tunnel interfaces. Thanks.
Hi, about modifying the priority Id in specifying the DR and BDR, does it always have to be on F0/0 or could it be on F0/1 also?
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:00:38 20.20.20.1 FastEthernet1/0
1.1.1.1 1 FULL/DR 00:00:37 10.10.10.1 FastEthernet0/0
i have 2 DR in area 0, what happened????


But you could assign neighbors within your ospf statements with all set to zero and still establish adjacencies, correct?