Table of Contents
- What is a Designated Router or DR?
- What is a Backup Designated Router or BDR?
- DR BDR Election Process
- Why does OSPF elect the BDR before the DR?
- What is a DR Other?
- What happens after the election?
- How BDR will know DR is alive?
- OSPF Network types and DR BDR election
- How many Designated Routers can be there in an Area?
Understanding OSPF DR and BDR Election Process
In OSPF (Open Shortest Path First), the Designated Router (DR) and Backup Designated Router (BDR) play a critical role in managing the communication within a multi-access network, ensuring efficient routing and minimizing unnecessary traffic. The election of these routers is an important process that determines which routers take charge of distributing OSPF routing information. In this guide, we’ll explore the DR and BDR election process, the reasons behind electing a BDR before the DR, and how these routers interact to maintain the stability of the OSPF network. We’ll also cover topics like DR Others, the role of the BDR in detecting the DR’s status, and the different OSPF network types that impact the election process.
What is a Designated Router or DR?
In OSPF, routers need to form adjacencies with neighbors to exchange network information. When a router connects via an interface such as Ethernet or Frame Relay, where multiple neighbors might be present, it will elect one router as the leader. We call this router the Designated Router (DR)
Every router in that network will then form an adjacency only with the DR. This setup avoids the need for each router to form a full mesh of adjacencies. Without a DR, routers would otherwise need to maintain direct connections with each other, complicating the network structure.
In the above topology, an Ethernet switch connects five routers. If OSPF does not use a DR, each router would need to form an adjacency with every other, resulting in a full mesh of adjacencies. The problem here isn’t just the number of adjacencies.”
If the topology changes, the router must share the updated LSA with all neighbors For example, if R2 adds a new interface, it has to generate an updated router LSA (LSA1) and share it with its neighbors: R1, R3, R4, and R5. Then, these routers also need to share it with their neighbors, including the same routers which R2 has already updated. This leads to a lot of duplicate LSAs in the network due to this full mesh adjacency.
This is where the DR becomes very useful. It not only reduces the number of adjacencies but also prevents the duplication of LSAs in these types of shared networks.”
Here, you can see that R1 was elected as the DR, and the other routers formed adjacencies only with R1. Now, if R2 gets a new interface, it only has to share the updated router LSA (LSA1) with R1. It will then be R1’s responsibility to share this with other devices in the network. So you can see here, by electing R1 as the DR and forming adjacencies only with R1, the network has reduced the number of adjacencies and prevented the sending of duplicate LSAs
What is a Backup Designated router or BDR?
Imagine the network elects only the DR. If the link to the DR disconnects or the DR goes down, all routers will suffer because they rely on the DR to share information with each other. To prevent this single point of failure, OSPF implements the Backup Designated Router, or BDR.
In every shared network where OSPF elects a DR, it also elects a BDR. Each router must form an adjacency with both the DR and the BDR. The BDR acts like a silent partner to the DR, maintaining all the information in its database just as the DR does.
When the DR disconnects, the BDR takes over as DR and starts sharing information among the routers. This transition keeps the network’s adjacencies stable despite the DR’s disconnection.
OSPF DR BDR Election Process
The OSPF DR BDR election uses either the interface priority or the router ID. OSPF assigns a priority to every interface, which ranges from 0 to 255, with the default being 1. A router participates in the OSPF DR BDR election if its priority is not set to 0.
Let’s check a simple explanation of DR BDR election first. The router with the highest priority wins the OSPF DR BDR election and becomes the DR, while the router with the second highest priority becomes the BDR. If the priorities are identical, the router with the highest router ID wins the DR role, and the one with the next highest router ID becomes the BDR.
This overview covers the basics of how to elect DR and BDR, but the OSPF RFC outlines a few additional steps. Let’s break down those steps from R1’s perspective.
- When R1 connects, it starts the wait timer (typically 40 seconds), sends Hello packets, and listens to the Hello packets from its neighbors
- R1 initially sets the DR and BDR values to 0.0.0.0 in the Hello packet, indicating they are unknown.
- If R1’s priority is not 0, it will try to participate either for DR election or BDR election based on its configuration.
- To participate as a DR, R1 will place its router ID in the DR field of the Hello packet. To participate as a BDR, it will place its router ID in the BDR field.
- During the wait timer, R1 will receive the DR and BDR participant lists. Those who have priority set as zero are ineligible for the election.
- If R1 observes that the DR and BDR fields in the Hello packets are stable, it will understand that others have already elected their DR and BDR. R1 will respect this decision and accept the current DR and BDR.
- If the DR and BDR fields are not stable during the wait timer, R1 will start the BDR election.
- Routers that place their router ID in the BDR field are BDR participants, and those in the DR field are DR participants.
- R1 will get the list of routers participating in the BDR election. The router with the highest priority becomes the BDR. If there is a tie, the router with the highest router ID wins the election.
- A BDR is not mandatory. If all routers participate in the DR election, they will only elect a DR
- After electing the BDR, the network follows the same process for the DR election. From the DR participant list, the router with the highest priority becomes the DR. If priorities are the same, the router with the highest router ID wins the election.
- Repeat these steps if R1 becomes the new DR or BDR, or if R1 is no longer the DR or BDR.
- After this process, the interface state changes according to the assigned role. It can be DR, BDR, or DR Other.
- Reconsider adjacencies after the election. Create new adjacencies as needed and remove those no longer required
Why does OSPF elect the BDR before the DR?
RFC 2328 states that the OSPF DR BDR election process elects the BDR before the DR. The RFC mentions electing the BDR first to ensure an orderly transition and stability, but it does not explain why this specific order is necessary in detail.
Both election orders (BDR first or DR first) theoretically ensure a smooth transition in the event of DR failure. In both cases, a BDR would be available to take over. While electing the BDR first might help ensure that there is always a ready backup without any gap, this alone does not provide an unquestionable proof of the superiority of this sequence. Until more detailed explanations are provided by the designers of OSPF or other authoritative sources, it is reasonable to conclude that RFC 2328 does not give an unquestionable proof for why the BDR is elected first
What is the Wait Timer in OSPF?
The wait timer in OSPF is a countdown period, typically set to 40 seconds, that begins when a router first connects to a broadcast or NBMA network. During this time, the router transitions to the Waiting state, sends Hello packets, and listens to Hello packets from its neighbors. The primary purpose of the wait timer is to gather information about the existing Designated Router (DR) and Backup Designated Router (BDR) before participating in the election process. This ensures that the router does not prematurely attempt to become DR or BDR without understanding the current network state.
During the wait timer, the router collects Hello packets to determine if the DR and BDR roles are already stable. If the DR and BDR fields in the Hello packets remain consistent, the router will accept the existing roles. If not, the router will participate in the election process to establish the DR and BDR. This mechanism ensures a well-informed and stable election process, preventing unnecessary disruptions in the network.
What is a DR Other?
DR Other is an interface state in OSPF indicating that the interface is not acting as the Designated Router or Backup Designated Router on that network segment. We can consider a DR Other as a router that is neither the Designated Router nor the Backup Designated Router. These routers form full adjacencies only with the DR and BDR, reducing the number of required adjacencies
What Happens After the Election?
The DR and BDR have a special multicast group address, 224.0.0.6. They both listen to updates coming to this address. DR Others send their update packets to this address to ensure the updates reach both the DR and BDR. The DR will take these updates, create a new update packet with the destination IP 224.0.0.5, and send it back to the same link. This method ensures that other DR Others receive only one copy of the update directly from the DR.
How Does the BDR Know the DR is Alive?
The DR also sends Hello packets every 10 seconds, just like other devices. If the DR disconnects, the BDR waits for the dead interval of 40 seconds. After this interval, the BDR will take over the responsibility of the DR . It’s not just the BDR, every router recognizes when the DR disconnects within these 40 seconds. They promote the BDR to DR and then hold a reelection for a new BDR
OSPF Network types and DR-BDR election
OSPF shows different behaviors on different L2 technologies. For example, the way OSPF works on Ethernet links is slightly different from the way it works on a Frame Relay link. We consider these different behaviors as the different ‘Network Types’ of OSPF. Routers elect DR and BDR only when an interface or L2 technology supports more than two devices, like Ethernet or Frame Relay. An interface that allows only one neighbor, such as a T1/E1 link, does not require DR and BDR.
Network Type | DR-BDR election |
---|---|
Broadcast Network (Ethernet, Tokenring, FDDI) | Required |
NBMA or Nonbroadcast Multiaccess Network (Framerelay, ATM) | Required |
Point to Point (T1/E1 leased lines) | Not Required |
Point to Multipoint (Framerelay, ATM) | Not Required |
Virtual link | Not Required |
How many Designated Routers can be there in an Area?
In OSPF, a Designated Router is not elected for the entire area to reduce the number of adjacencies. Instead, a DR is elected for each interface where multiple neighbors are connected. According to OSPF network classifications, Broadcast and Non-Broadcast Multiple Access (NBMA) networks are the types where multiple neighbors can exist. Therefore, the number of DRs and Backup Designated Routers in an area or topology depends on the number of shared networks present.
For example, in the following topology, there are three networks in Area 1: two Ethernet networks and one T1-E1 network. As a result, two Designated Routers will be elected, one for each Ethernet network.
Next >>> Understanding OSPF Redistribution
Previous >>> OSPF Configuration Example 1 : Adjacency Formation
Further Reading : Wiki
We’d love to hear your feedback and suggestions about this article. Feel free to reach out to us using the WhatsApp number below.
About The Author:
Sajith Achipra has been a trainer and testing consultant at Zframez Technologies since 2009. With 15+ years of experience, he specializes in networking, Python, development, and testing. He conducts online courses to help students and professionals enhance their skills. You can reach him on WhatsApp at +91 8884 884 844 for your training and testing requirements.