Home Network Layer OSPF Version 2 OSPF DR/BDR Election: Process, Configuration, and Tuning

OSPF DR/BDR Election: Process, Configuration, and Tuning

OSPF DR/BDR election is a process that occurs on multi-access data links. It is intended to select two OSPF nodes: one to be acting as the Designated Router (DR), and another to be acting as the Backup Designated Router (BDR).

A multi-access network segment, like an Ethernet LAN/VLAN, is a network part that can include more than two devices and where each device can connect to all devices using their layer 2 addresses. Additionally, a multiaccess network can or not support Layer 2 broadcasts. For example, Frame Relay does not support layer 2 broadcasting, while Ethernet does.

In the next sections, I will explain how the OSPF DR and BDR election works, and to tune it. Upon the completion of this tutorial, you will be able to answer the following questions:

  • What is DR in OSPF?
  • What is the priority in OSPF?
  • What is the default DR BDR priority?
  • How are DR and BDR elected?
  • How to check the DR and BDR in OSPF?
  • How do I set the DR’s priority in OSPF?
  • How many DR and BDR are in an OSPF area?
  • In which state do the DR and BDR establish adjacency?
  • In which state DR and BDR election takes place?
  • What happens when priority zero is assigned to the OSPF router?
  • Which are the 2 main functions of the DR in OSPF?
  • Which is elected first the DR or BDR in OSPF?
  • Which OSPF network type requires the election of a DR BDR?
  • Does the DR/BDR election happen in OSPF point-to-point networks?

To demonstrate the different facts of the DR and BDR roles, I will be using the following network diagram. The routing domain consists of four routers. They are all included in OSPF area 0.

Figure 1 – The Network topology of our routing domain

Here are the links to download the initial configurations applied to the routers:

Router R1 Router R2 Router R3 Router R4

OSPF DR/BDR Election Process

On a multi-access network, whether it is broadcast or non-broadcast, OSPF routers use the Hello protocol to elect one Designated Router and one Backup Designated router with which the remaining routers on the current network link build OSPF adjacencies.

It is the first step they have to accomplish before start building OSPF relationships in the actual network segment. Moreover, the DR and BDR also build up a full OSPF neighbor relationship.

The OSPF node that has the highest OSPF priority on the current network segment becomes the DR. If there is a tie, the Hello protocol chooses the router with the highest OSPF router ID to become the DR. For example, Router R4 is the DR on subnets 10.0.0.0/24 and 10.0.14.0/24 (Example 1), while R3 is the DR for in subnet 10.0.23.0/24 (Example 2).

R1# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   2WAY/DROTHER    00:00:38    10.0.0.2        GigabitEthernet0/0
3.3.3.3           1   FULL/BDR        00:00:38    10.0.0.3        GigabitEthernet0/0
4.4.4.4           1   FULL/DR         00:00:38    10.0.0.4        GigabitEthernet0/0
4.4.4.4           1   FULL/DR         00:00:37    10.0.14.4       GigabitEthernet0/4

Example 1 – Displaying router R1’s OSPF neighbors

R2# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   2WAY/DROTHER    00:00:33    10.0.0.1        GigabitEthernet0/0
3.3.3.3           1   FULL/BDR        00:00:36    10.0.0.3        GigabitEthernet0/0
4.4.4.4           1   FULL/DR         00:00:38    10.0.0.4        GigabitEthernet0/0
3.3.3.3           1   FULL/DR         00:00:35    10.0.23.3       GigabitEthernet0/3

Example 2 – Displaying router R2’s OSPF neighbors

Similarly, the router with the highest OSPF priority among all OSPF nodes except the DR gets elected as the BDR by the Hello Protocol. If there’s a tie, the non-DR router with the highest router ID becomes the BDR. For instance, routers R1, R2, and R3 are BDRs in subnets 10.0.14.0/24, 10.0.23.0/24, and 10.0.0.0/24, respectively (Examples 3 and 4).

R3# show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DROTHER    00:00:37    10.0.0.1        GigabitEthernet0/0
2.2.2.2           1   FULL/DROTHER    00:00:35    10.0.0.2        GigabitEthernet0/0
4.4.4.4           1   FULL/DR         00:00:31    10.0.0.4        GigabitEthernet0/0
2.2.2.2           1   FULL/BDR        00:00:31    10.0.23.2       GigabitEthernet0/2

Example 3 – Displaying router R3’s OSPF neighbors

R4# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DROTHER    00:00:33    10.0.0.1        GigabitEthernet0/0
2.2.2.2           1   FULL/DROTHER    00:00:31    10.0.0.2        GigabitEthernet0/0
3.3.3.3           1   FULL/BDR        00:00:36    10.0.0.3        GigabitEthernet0/0
1.1.1.1           1   FULL/BDR        00:00:30    10.0.14.1       GigabitEthernet0/1

Example 4 – Displaying router R4’s OSPF neighbors

Non-DR and non-BDR routers in a particular subnet are called DROthers. However, a router can play different roles. It can be DR in subnet A, BDR in subnet B, and DROther in subnet C at the same time.

For example, R1 is the BDR in subnet 10.0.14.0/24, while it is DROther in subnet 10.0.0.0/24. Besides, an OSPF node cannot play more different roles on the same subnet.

Finally, the following table lists all OSPF network types. For each type, it is indicated whether or not DR/BDR election takes place.

OSPF Network Type Does The DR/BDR Election Occur?
Point-to-point No
Point-to-multipoint No
Point-to-multipoint non-broadcast No
Broadcast Yes
Non-broadcast Yes

How Do OSPF Routers Behave in a Multi-Access Network?

On a multi-access network, the DR and BDR are the only OSPF nodes forming OSPF adjacencies with all routers on the current network segment. For example, on subnet 10.0.0.0/24, routers R3 and R4 are forming OSPF adjacencies with each other and with routers R1 and R2 (Examples 5 and 6).

R3# show ip ospf interface gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up 
  Internet Address 10.0.0.3/24, Area 0, Attached via Network Statement
  Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 4.4.4.4, Interface address 10.0.0.4
  Backup Designated router (ID) 3.3.3.3, Interface address 10.0.0.3
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:02
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/2/2, flood queue length 0
  Next 0x0(0)/0x0(0)/0x0(0)
  Last flood scan length is 2, maximum is 2
  Last flood scan time is 1 msec, maximum is 2 msec
  Neighbor Count is 3, Adjacent neighbor count is 3 
    Adjacent with neighbor 1.1.1.1
    Adjacent with neighbor 2.2.2.2
    Adjacent with neighbor 4.4.4.4  (Designated Router)
  Suppress hello for 0 neighbor(s)

Example 5 – Displaying OSPF data of R3’s G0/0 interface

R4# show ip ospf interface gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up 
  Internet Address 10.0.0.4/24, Area 0, Attached via Network Statement
  Process ID 1, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 4.4.4.4, Interface address 10.0.0.4
  Backup Designated router (ID) 3.3.3.3, Interface address 10.0.0.3
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:02
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  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 2 msec
  Neighbor Count is 3, Adjacent neighbor count is 3 
    Adjacent with neighbor 1.1.1.1
    Adjacent with neighbor 2.2.2.2
    Adjacent with neighbor 3.3.3.3  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)

Example 6 – Displaying OSPF data of R4’s G0/0 interface

In addition, neighbor relationships between DROther routers (non-DR/BDR routers) get stuck at the 2-way state. For instance, routers R1 and R2, which are DROthers in subnet 10.0.0.0/24, have their OSPF relationship stuck at the 2-way state (Examples 7).

R1# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   2WAY/DROTHER    00:00:37    10.0.0.2        GigabitEthernet0/0
3.3.3.3           1   FULL/BDR        00:00:34    10.0.0.3        GigabitEthernet0/0
4.4.4.4           1   FULL/DR         00:00:39    10.0.0.4        GigabitEthernet0/0
4.4.4.4           1   FULL/DR         00:00:36    10.0.14.4       GigabitEthernet0/4

Example 7 – Displaying Router R1’s OSPF neighbors

Note that all router interfaces, attached to the subnet 10.0.0.0/24, have the same priority value equal to 1 (check the second field in the output of the show ip ospf neighbor command).

The DR and BDR receive LS updates from all routers, but only the DR is responsible for sharing those updates with all OSPF nodes on the current network segment. If the DR is down, the BDR takes over as the DR and routers select a new BDR.

Non-DR routers send LS updates to the AllDRouters IP address (224.0.0.6) in order to forward routing information with the DR and BDR. Additionally, the DR flood LSA updates to the AllSPFRouters address (224.0.0.5) in order to send routing information to all routers in the current segment.

Building up Full OSPF Neighbor Relationships on Broadcast and NBMA Networks

On a broadcast or NBMA data link, OSPF neighbor relationships go through these steps:

Step 1. Routers elect a Designated Router and Backup Designated Router. Besides, the neighbor relationships between all the routers reach the 2-WAY state.

Step 2. The Designated Router decides to build up OSPF adjacencies with all neighbor routers using a similar process to steps 3 to 7, in the previous section.
Besides, the DR is responsible to generate the network LSA of the broadcast/NBMA data link.

Likewise, the Backup Designated Router decides to form full neighbor relationships with all OSPF neighbors using the DR’s procedure. Also, the BDR takes over as the DR if the current DR goes down.

Finally, note that OSPF neighbor relationships between DROther routers get stuck at the 2-WAY neighbor state.

Why Do OSPF Routers Elect a Designated Router?

In a broadcast/non-broadcast data link consisting of N routers, we would have N-2 DROthers, and each DROther forms 2 OSPF adjacencies —one with the DR and another with the BDR.

Adding to that the neighbor adjacency between the DR and BDR, then the network has 2x(N-2) + 1 full OSPF neighbor adjacencies.

Now, imagine that routers on a broadcast/non-broadcast data link do not want to elect a DR. Instead, routers decided to form OSPF adjacencies with each other. In this case, the total of those full neighbor relationships is N x (N-1) / 2, where N is the router count on the data link.

For N=10, electing a DR and BDR decreases the number of OSPF full neighbor relationships from 45 to 17, which diminishes the amount of OSPF traffic exchanged between nodes on the current network segment, especially DBD packets, LS updates, and acknowledgments.

When to Disable OSPF DR/BDR Election?

The OSPF DR/BDR election process can sometimes be useless. For example, when the multi-access network does not include more than two OSPF routers. In this case, one router gets selected DR, while the other gets chosen as the BDR, and thus selecting a DR and BDR won’t have any benefit.

In the network diagram (Figure 1), there is no need to elect a DR and a BDR in subnets 10.0.14.0/24 and 10.0.23.0/24, while a DR/BDR election must occur in subnet 10.0.0.0/24.

To disable this behavior, change the OSPF network type of the interfaces connecting the routers to the subnets in question to point-to-point, point-to-multipoint, or point-to-multipoint non-broadcast, as shown in these examples.

Router R1

R1(config)# interface gigabitEthernet 0/4
R1(config-if)# ip ospf network point-to-point

Router R2

R2(config)# interface gigabitEthernet 0/3
R2(config-if)# ip ospf network point-to-point

Router R3

R3(config)# interface gigabitEthernet 0/2
R3(config-if)# ip ospf network point-to-point

Router R4

R4(config)# interface gigabitEthernet 0/1
R4(config-if)# ip ospf network point-to-point

In Examples 8 and 9, routers R1, R2, R3, and R4 no longer elect DRs and BDRs on subnets 10.0.14.0/24 and 10.0.23.0/24.

R1# show ip ospf neighbor gigabitEthernet 0/4

Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           0   FULL/  -        00:00:32    10.0.14.4       GigabitEthernet0/4

Example 8 – Displaying R1’s OSPF neighbors discovered on the GigabitEthernet0/4 interface

R2# show ip ospf neighbor gigabitEthernet 0/3

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   FULL/  -        00:00:33    10.0.23.3       GigabitEthernet0/3

Example 9 – Displaying R2’s OSPF neighbors discovered on the GigabitEthernet0/3 interface

Note that the default OSPF network type of an interface depends on its Layer 2 configuration. However, you should pay attention to whether the interface allows layer 2 broadcasts or not. If it doesn’t, like the point-to-multipoint non-broadcast OSPF network type, you should use the neighbor command so that OSPF sends unicast Hello packets to neighbors.

OSPF DR/BDR Election Tuning

The Hello protocol relies on interface priority and router ID to select the DR and BDR among eligible OSPF nodes (nodes with OSPF priority greater than zero). To influence the network to choose a particular router as the DR, we can configure its priority to be the highest among all DR-eligible routers, or increase its router ID if many routers share the highest priority value in the current network segment.

Using The ip ospf priority Command

In Figure 1, router R4 is the DR and R3 is the BDR. Using the ip ospf priority command, we set R1’s G0/0 interface’s OSPF priority to 200 so that R1 has the highest priority in subnet 10.0.0.0/24.

R1(config)# interface gigabitEthernet 0/0
R1(config-if)# ip ospf priority 200

Example 10 shows that router R4 is still the DR. This behavior is normal since OSPF DR/BDR election process is not preemptive.

R1# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   2WAY/DROTHER    00:00:37    10.0.0.2        GigabitEthernet0/0
3.3.3.3           1   FULL/BDR        00:00:34    10.0.0.3        GigabitEthernet0/0
4.4.4.4           1   FULL/DR         00:00:39    10.0.0.4        GigabitEthernet0/0
4.4.4.4           1   FULL/ -         00:00:36    10.0.14.4       GigabitEthernet0/4

Example 10 – Displaying Router R1’s OSPF neighbors

To fix this issue, we restart OSPF processes on the DR and BDR (routers R4 and R3) using the clear ip ospf process command in enable mode. Clear R4’s OSPF process only will make R3 the DR and R1 the BDR. Therefore, we need to restart R3’s OSPF process too.

We can also force the routers to elect new DR and BDR by restarting routers R2, R3, and R4. It is not necessary in this case to reboot router R1. In the following example, router R1 becomes the DR after restarting OSPF on R3 and R4.

R1# show ip ospf interface gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up 
  Internet Address 10.0.0.1/24, Area 0, Attached via Network Statement
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State DR, Priority 200
  Designated Router (ID) 1.1.1.1, Interface address 10.0.0.1
  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
    oob-resync timeout 40
    Hello due in 00:00:08
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/2/2, flood queue length 0
  Next 0x0(0)/0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 3
  Last flood scan time is 1 msec, maximum is 1 msec
  Neighbor Count is 3, Adjacent neighbor count is 3 
    Adjacent with neighbor 2.2.2.2
    Adjacent with neighbor 3.3.3.3
    Adjacent with neighbor 4.4.4.4  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)

OSPF priority ranges from 0 to 255, and it is set to 1 by default. 0 means the router does not participate in electing a DR/BDR. For example, the following commands configure router R3 to never become DR or BDR in subnet 10.0.0.0/24.

R3(config)# interface gigabitEthernet 0/0
R3(config-if)# ip ospf priority 0

In this example, router R3 still builds up OSPF adjacencies in subnet 10.0.0.0/24, but it does play one role: it is a DROther.

R3# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1         200   FULL/DR         00:00:32    10.0.0.1        GigabitEthernet0/0
2.2.2.2           1   2WAY/DROTHER    00:00:36    10.0.0.2        GigabitEthernet0/0
4.4.4.4           1   FULL/BDR        00:00:30    10.0.0.4        GigabitEthernet0/0
2.2.2.2           0   FULL/  -        00:00:38    10.0.23.2       GigabitEthernet0/2

Adjusting IP Addressing

The other way to influence the election of the DR and BDR is by adjusting the router ID. We can accomplish this either using the router-id command or by adding/modifying a new IP address.

Related Lessons to OSPF DR/BDR Election

Conclusion

I hope this blog post helps you learn something.
Now I’d like to turn it over to you:
What did you like about this tutorial?
Or maybe you have an excellent idea that you think I need to add.
Either way, let me know by leaving a comment below right now.

Mohamed Ouamer is a computer science teacher and a self-published author. He taught networking technologies and programming for more than fifteen years. While he loves to share knowledge and write, Mohamed's best passions include spending time with his family, visiting his parents, and learning new things.

Exit mobile version