How Does OSPF DR Election Work? A Beginner’s Approach.
Introduction to OSPF DR Election
The OSPF DR election is crucial in multi-access OSPF networks like ethernet and Frame-relay, where more than one router is connected in the same segment. Its main aim is to reduce the traffic generated by OSPF’s enabled router.
OSPF DR and BDR election
Normally DR/BDR in OSPF takes place in a multi-access network. All the OSPF routers participate in an election and select one router as its leader router. This leader is called a designated router.
The purpose of the designated Router is that, if all the Routers in the broadcast network send their LSAs directly to each other, there is a chance of 100% bandwidth consumption. So OSPF introduces the concept of DR in broadcast networks to overcome this issue.
The DR router is important in the OSPF topology. If the DR fails, then the OSPF will not work smoothly. That’s why a redundant is also elected in the OSPF DR election process called a backup designated Router or BDR. The backup designated Router works, in case the designated Router fails. We call all the routers except DR/BDR as DR-other.
All the routers in the network except DR send their LSA to the multicast IP address 223.0.0.5, which is also called “All DR-other address”. The designated Router then sends those LSAs to the multicast IP address 224.0.0.6, which other Routers then receive in the network.
OSPF Priority
OSPF priority value is a number in the OSPF network environment that ranges from 0 to 255. There is a need for priority value in the DR/BDR election. A router with the highest priority value will become DR, while the second highest priority router will become BDR. Suppose all the routers have the same priority value. In that case, the Router with the highest router-id will become DR.
How to Set Manual DR and BDR
If a network engineer wants to set a router DR always so that no other router defeats it in the DR/BDR election, then he/she can set its priority value as 255. So no router will defeat it in the DR/BDR election. If he wants, a specific router should not participate in the DR/BDR election. Then he/she will set the router priority value as zero.
When the DR/BDR election is complete, then if a router with the highest priority wants to join the network, it will not replace the existing DR/BDR.
Lab Topology for DR election
There are four routers in our lab topology for the DR election. All the routers have connected to a Multi-access network through the switch.
Run the show IP OSPF neighbor command on R1 and check which router is DR, BDR, or DROther.
R4 is the DR, R2 is the BDR, and R1 and R3 are the DRother routers. Here, we will change the DR, BDR, and DROther through the value known as the priority value. Currently, R4 is DR, R2 is BDR, While R1 and R3 are DROthers. We will convert R4 and R2 to DROther While we will make R1 as DR and R3 as BDR.
Change the interface priority value of R1 to 200, R2 to 150, R3 to 100, and R4 to 50. In this way, R1 will be the DR, R2 BDR, while R3 and R4 DROthers.
Similarly, change the R2, R3 and R4 priority value as below;
We have changed the priority values of all the routers. Now run the neighbor command on R1, whether the priority values have affected the DR process.
The priority value didn’t change the DR process. But Why?
we have already studied earlier in this blog that once the DR/BDR election process is complete, it will remain unchanged until we restart the OSPF process or reboot the routers.
Run the “clear ip ospf process” command on each router. It will restart the ospf process on the routers.
Similarly, run the above process on every router.
Check the result on R1 through the neighbor command.
The DR process has changed DR, BDR, and DROther, when we restart the ospf processes on R1, R2, R3, and R4.
Run the neighbor command on R2;
R1 now acts as DR, R2 as BDR, and R3 and R4 as DROthers.
Now, if you don’t want a specific router doesn’t participate in the DR election, then we will decrease the priority value to zero of that specific router interface.
Restart the ospf instances on R1 via the “clear ip ospf process” command;
Verify the R1 priority value on R2 through neighbor command;
Now R1 will not take participants in the DR process.
run the above process on the other routers as well.