OSPF DR BDR Selection Process Explained

OSPF routers share routing information differently on different network types. On an Ethernet broadcast network, they first elect a DR (Designated Router) and a BDR (backup Designated Router) and then share routing information via them.

On each Ethernet broadcast segment, OSPF implements a client/server design. In this design, a router called DR acts as a server. The server is responsible for keeping and providing updated routing information. If a client has updated routing information, it shares that with the server. The server updates its database and shares that with other clients.

Since the DR plays the lead role in how the database exchange process works, OSPF implements one more router as a backup for the server. This router is called BDR. A BDR keeps the same routing information the DR keeps. If the DR fails, it immediately becomes the DR. It acts as a hot standby for the DR. Apart from the DR and BDR, all remaining routers are clients. They are known as DROTHERs.

DR BDR exchange process

OSPF routers select a DR and a BDR for every Ethernet broadcast segment. For example, if you have twenty VLANs in your switched area, you’ll have twenty DRs and twenty BDRs. An OSPF router talks to a DR using the IP multicast address 224.0.0.6. The DR and the BDR talk to all OSPF routers using the 224.0.0.5 multicast IP address.

DR and BDR Election process criteria

OSPF routers use OSPF priority and RID to elect a DR and BDR. The router with the highest OSPF priority on a segment becomes the DR for that segment. The router with the second highest priority becomes the BDR for that segment. If we do not change the default priority, routers use RID to elect a DR and BDR. The router with the highest RID becomes the DR. The router with the second highest RID becomes the BDR. All other routers become DROTHERs.

DR and BDR Election process example

Create a practice lab, as shown in the following image and enable OSPF processes on all routers.

Download the Packet Tracer practice lab with IP configurations

ospf dr bdr selection process example lab

Enabling OSPF process

Use the following commands to enable OSPF processes.

R1

Router>enable
Router#configure terminal
Router(config)#router ospf 1
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 10.0.0.0 0.255.255.255 area 0
Router(config-router)#exit
Router(config)#exit
Router#

ospf configuration r1

R2

Router>enable
Router#configure terminal
Router(config)#router ospf 1
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 20.0.0.0 0.255.255.255 area 0
Router(config-router)#exit
Router(config)#exit
Router#

ospf configure on r2

R3

Router>enable
Router#configure terminal
Router(config)#router ospf 1
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 30.0.0.0 0.255.255.255 area 0
Router(config-router)#exit
Router(config)#exit
Router#

ospf configuration r3

R4

Router>enable
Router#configure terminal
Router(config)#router ospf 1
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 40.0.0.0 0.255.255.255 area 0
Router(config-router)#exit
Router(config)#exit
Router#

ospf configuration r4

Download the Packet Tracer practice lab with OSPF configurations.

Since we did not change the default priority of any router, routers will use the RID to elect a DR and BDR. A router uses the following options in a sequence to select an RID. If it finds a value in an option, it does not check the next option. It checks the following option when it does not see a value in the current option.

  • Custom RID value configured by using the router-id command.
  • The highest IP address among all IP addresses configured on loopback interfaces.
  • The highest IP address among all IP addresses configured on physical interfaces.

Since we did not configure a custom RID and loopback interfaces on any router, all routers will use the highest IP address among all IP addresses configured on physical interfaces to select their RIDs.

ospf rid selection

After selecting RIDs, OSPF routers select a DR and a BDR for each broadcast segment. Since all routers have default OSPF priority ID, they use their RIDs to select the DR and BDR. The router with the highest RID becomes the DR. The router with the second highest RID becomes the BDR. The remaining routers become DROTHERs.

dr and bdr selection

Verifying the DR and BDR election

The show ip ospf neighbor command lists all OSPF neighbors. The output of this command has the following six fields.

Field Description
Neighbor ID The RID of the neighbor
Pri OSPF priority of the neighbor
State Routing information exchange state / Router's role
Dead Time Dead interval
Address IP address of the neighbor
Interface Local interface connected to the neighbor

We can use the State field to verify the DR and BDR election process. It displays the routing information exchange state and the router's role in the segment.

The following image shows the output of this command on R1.

show ip ospf neigbor output on r1

The following image shows the output of this command on R2.

show ip ospf neigbor output on r2

The following image shows the output of this command on R3.

show ip ospf neigbor output on r3

The following image shows the output of this command on R4.

show ip ospf neigbor output on r4

Influencing the DR and BDR selection process

We can manipulate the DR and BDR selection process by changing the OSPF priority. The following command changes the default OSPF priority.

Router(config-if)#ip ospf priority [value]

We can set any value between 0 to 255. The default value is one. The router with the value zero never becomes a DR or BDR. The router with the highest priority value becomes the DR. The router with the second highest priority value becomes the BDR. In our example network, currently, routers have the following roles.

R4 is DR, R3 is BDR, R2 and R1 are DROTHERs.

Now, suppose we want to configure R1 as DR, R2 as BDR, and R3 and R4 as DROTHERs. For this, we need to change the default OSPF priority on R1 and R2. We need to change the R1's OSPF priority higher than all other routers. We need to change the R2's OSPF priority higher than R3 and R4 but less than R1. We can keep the default priority on R3 and R4 or change it to zero. A router with priority zero always becomes DROTHER.

Changing default priority

OSPF runs processes on an interface basis. We can use a different OSPF priority on all interfaces. We must change the default priority on the interface connected to the broadcast segment to influence the DR and BDR selection process. In our example network, the Fa0/0 interface on all routers is connected to the broadcast network. We need to change the default OSPF priority on this interface.

R1

Router(config)#interface fastethernet 0/0
Router(config-if)#ip ospf priority 4
Router(config-if)#exit
Router(config)#exit
Router#

changing default ospf priority on r1

R2

Router(config)#interface fastethernet 0/0
Router(config-if)#ip ospf priority 3
Router(config-if)#exit
Router(config)#exit
Router#

changing default ospf priority on r2

R3

We configured OSPF priority three on R2 and four on R1. If we do not change OSPF priority on this router, the router will use the default priority. As we know, the default OSPF priority is one. One is less than three and four. With default priority, it will become DROTHER.

R4

With the current configuration, this router is DR. To make it DROTHER, we can change its priority to zero. A router with priority zero always becomes DROTHER.

Router(config)#interface fastethernet 0/0
Router(config-if)#ip ospf priority 0
Router(config-if)#exit
Router(config)#exit
Router#

changing default ospf priority on r4

Download the Packet Tracer practice lab with manipulated OSPF priority.

Verifying the DR and BDR selection process

We can use the show ip ospf neighbor command again on all routers to verify how the OSPF priority value manipulates the DR and BDR selection process.

The following image shows the output of this command R1.

show ip ospf neighbor command output on r1

The following image shows the output of this command R2.

show ip ospf neighbor command output on r2

The following image shows the output of this command R3.

show ip ospf neighbor command output on r3

The following image shows the output of this command R4.

show ip ospf neighbor command output on r4

As the above output shows, now, R1 is the DR, R2 is the BDR, and R3 and R4 are DROTHERs on the network. This way, by changing the default OSPF priority, we can prompt any router as the DR, BDR, or DROTHER.

ComputerNetworkingNotes CCNA Study Guide OSPF DR BDR Selection Process Explained