08-07-2019 04:15 AM
08-07-2019 04:31 AM - edited 08-07-2019 04:42 AM
Hello gowdakssujan,
OSPD DR and BDR are elected in each network segment by exchanging OSPF Hello messages on 224.0.0.5 All OSPF routers in the link.
The highest OSPF priority is preferred then the highest OSPF Router-ID.
OSPF priority is a 1 byte integer between 0 (means do not take part in election) and 255 with default value of 1 on Cisco routers.
OSPF RID is an IP address either the highest IP address on loopback or a manually configured value (or both).
However, there is a time window dictated by the wait time that is equal to 40 seconds by the default that is the time a router waits for other devices to join the election process.
After wait timer expiration the routers that are present on the LAN segment proceed to elect a DR and a BDR.
After election the DR and BDR fields in the OSPF hellos are populated with the IP addresses in LAN of the devices.
Note: each device lists in its own generated OSPF Hellos the OSPF RIDs of the devices it heard on wire.
The two way state in neighbor machine state is when both routers see each other OSPF RIDs in respective Hellos.
Only routers in two way state with non zero OSPF priority take part in OSPF DR/BDR election.
Of course, OSPF hello and dead intervals, area id , area flag and authentication primary address subnet and subnet mask must match.
If at a later time a new router is added to the LAN segment even if it has the highest OSPF priority and/or the highest OSPF RID it will not trigger a new election.
In this sense OSPF DR/BDR election is not deterministic and most of the times the router with the highest uptime on the link is the DR even if not designed to be.
There is no preemption in OSPF DR/BDR election.
On the other hand IS-IS DIS Designated Intermediate system supports pre-eemption and there is no backup DIS concept.
To be noted OSPF priority can be changed on each interface, OSPF RID is a global parameter per process.
Setting OSPF priority is recommended to avoid to have the same router to be elected DR in multiple LAN segments.
On client facing Vlans we should consider to use passive-interface to reduce OSPF load and activity on network devices.
Hope to help
Giuseppe
08-07-2019 09:08 AM
@Giuseppe Larosa has provided much good information about OSPF DR and BDR. I would add a few points to supplement that.
- OSPF uses DR and BDR on multi access network segments and does not use DR and BDR on non multi access segments.
- If a network segment has a single OSPF router then that router is DR and there is not a BDR. If a network segment has 2 OSPF routers then one router is DR and the other router is BDR. If a network segment has more than 2 OSPF routers then there will be a DR and a BDR and the other routers establish full adjacency with the DR and BDR.
- Once a router is elected DR it continues to be DR even if another router joins the segment and has a higher priority.
- If the DR stops working then the BDR immediately becomes DR and there is an election for a new BDR using the parameters that Giuseppe identified.
- When a new network segment is initialized the first election is for BDR. The elected BDR recognizes that there is not a DR and becomes DR and there is another election for a BDR.
- If you really care about which router is DR then you can give it a higher priority. But that does not guarantee that this router will be elected DR. You can give other routers on the segment a priority of zero and they will not participate in the election, allowing the router you want to become DR.
- In my experience most people are not very concerned about which router on the network segment is the DR.
HTH
Rick
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide