OSPF DR and BDR election Explained

In this lesson, I have to explain to you about the DR (Designated Router) and BDR (Backup Designated Router) election process. Let’s say that we have this scenario: we have one switch, and inside this switch, we have 8 routers. These routers are all on OSPF Area 0, which is the backbone area for OSPF.

Once we enable OSPF on all these routers, they will form neighborships and start sending LSAs (Link-State Advertisements) to each other. In a broadcast network, every router sends LSAs to every other router.

This means that if there are n routers, the formula for calculating the total number of LSAs exchanged is:

LSAs=n×(n−1)2

For example, if we have 8 routers:

LSAs=8×72=28\

So, 28 LSAs are exchanged. Now imagine if we had 40 routers:

LSAs=40×392=780

This is a huge number, and since LSAs are multicast, it puts a significant burden on the network.

The Solution: DR and BDR

To solve this problem, OSPF uses a mechanism to elect a Designated Router (DR) and a Backup Designated Router (BDR).

Without DR and BDR

In a scenario without DR and BDR, all routers form neighborships with every other router, resulting in a full mesh topology. This is inefficient and leads to excessive LSA flooding.

With DR and BDR

When a DR is elected:

  1. All routers send their LSAs to the DR.
  2. The DR consolidates and sends the LSAs to the other routers.

This way, the routers don’t form full neighborships with each other but instead communicate via the DR.

Why Have a BDR?

The BDR is a backup in case the DR fails. If the DR goes down, the BDR automatically takes over as the new DR. This ensures network continuity.

  • DR: Forms full neighborships with all routers.
  • BDR: Forms full neighborships with all routers but remains passive unless the DR fails.
  • DR Others: Routers that are neither DR nor BDR. These only form two-way neighborships with each other.

Election Criteria

On Juniper, the election of DR and BDR is based on different criteria as the below:

  1. Priority
    • The router with the highest OSPF priority becomes the DR.
    • Default priority is 128 on Juniper routers.
  2. Router ID
    • If priorities are tied, the router with the highest Router ID becomes the DR.

Router ID Selection Process:

  1. Manually configured Router ID (preferred).
  2. Highest IP address on a loopback interface.
  3. Highest IP address on an active physical interface.
  4. Priority 0
    • Routers with a priority of 0 do not participate in DR/BDR elections.

Lab: DR and BDR Election

Let’s set up a simple lab to demonstrate DR and BDR election.

Step 1: Check Current DR and BDR

On Router 1 (R1):

R1# show ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.10.10.2 128 Full/DR 00:00:39 10.10.10.2 ge-0/0/1.0

On Router 2 (R2):

R2# show ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.10.10.1 128 Full/BDR 00:00:37 10.10.10.1 fe-0/0/1.0

We can see clearly that R2 is the DR and R1 is the BDR. Let’s change that:

Step 2: Change Priority

On R1: Increase the priority to make R1 the DR.

R1# edit protocols ospf area 0

R1# set interface gigabit-ethernet 0/0/1 priority 150

R1# commit

On R2: Exclude R2 from the election by setting priority to 0.

R2# edit protocols ospf area 0

R2# set interface fast-ethernet 0/0/1 priority 0

R2# commit

Verify the updated election:

R1# show ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.10.10.2 0 Full/BDR 00:00:39 10.10.10.2 ge-0/0/1.0

I can clearly see that R1 has became the DR because it shows that R2 is the BDR

Step 3: Configure Router IDs

I have put the priorities back to 1 on both R1 and R2. I want to change manually now the Router ID. Remember, the highest Router ID is the one which becomes the DR. Let’s do this experiment and check:

On R1: Set a manual Router ID.

R1# edit protocols ospf

R1# set router-id 1.1.1.1

R1# commit

On R2: Set a manual Router ID.

R2# edit protocols ospf

R2# set router-id 2.2.2.2

R2# commit

Verify the updated Router IDs:

R1# show ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

2.2.2.2 0 Full/DR 00:00:39 10.10.10.2 ge-0/0/1.0

I can see clearly that R2 is now the DR because he has the highest Router ID. If this doesn’t work directly with you, you need to reset the OSPF process.

Key Notes

  1. If you want a specific router to always be the DR, increase its priority above the others.
  2. To exclude a router from the election, set its priority to 0.
  3. In point-to-point networks, DR/BDR elections are unnecessary. Set the network type to point-to-point to bypass elections.

Conclusion

In this lesson, I explained the DR and BDR election process, its importance in reducing LSA overhead, and how to control the election process. In the upcoming lecture, I’ll perform more advanced manipulations and demonstrate scenarios involving multiple network segments and OSPF areas. I hope this lesson was informative, and I’ll see you next time.

0 Comments

Submit a Comment

About