OSPF DR/BDR election

Published on by dellpe

Question:

I am unable to understand the ospf DR/BDR election process on which is elected first. I got a fair idea from some of the previous discussions in this forum that elections is done for BDR first, i need to know in depth about the process of this election, kindly help me in understanding the same.

Answer:

OSPF election process happens in the Init phase during wich OSPF Hello protocol (multicast) is in charge of the DR/BDR elections for a network segment combining various factors in the following order:

1- Choose the highest OSPF priority (default is 1, note that if you configure priority of 0 that router or 3 layer switch like WS-C3560X-48T-L wont enter the election process - used on FR networks.)

2- Choose the highest router-id

3- Choose the highest loopback interface

4- Choose the highest configured physical interface (must be up/up)

Mind that there is no preemption meaning that when a DR goes ofline, the BDR takes his place and when it comes back online it wont be the DR again, for it to be considered for another election process in a network segment, all DR/BDR must go offline so that one router can become the DR again for that segment.

Although a bit dry, reading the RFC (RFC 2328 - OSPF Version 2) does help understand the process. Look at section 9.4 - Electing the Designated Router. According to the RFC, the BDR is actually elected first, followed by the DR. The RFC explains why:

"The reason behind the election algorithm's complexity is the desire for an orderly transition from Backup Designated Router to Designated Router, when the current Designated Router fails. This orderly transition is ensured through the introduction of hysteresis: no new Backup Designated Router can be chosen until the old Backup accepts its new Designated Router responsibilities."

And further:

"The above procedure may elect the same router to be both Designated Router and Backup Designated Router, although that router will never be the calculating router (Router X) itself."

You can see the effects of the last statement if you debug ip ospf events and watch the election process. When the router runs its election process the first time, you'll sometimes see it elect the same router to both the BDR and DR slots. When it repeats the election process (per step (4) in section 9.4 of RFC) the router it elected to BDR and DR is no longer eligible for BDR (because it is DR), and so the "correct" BDR is elected.

DR Election

DR and BDR election is done via the Hello protocol. Hello packets are exchanged via IP multicast packets (Appendix B) on each segment. The router with the highest OSPF priority on a segment will become the DR for that segment. The same process is repeated for the BDR. In case of a tie, the router with the highest RID will win. The default for the interface OSPF priority is one. Remember that the DR and BDR concepts are per multiaccess segment. Setting the ospf priority on an interface is done using the ip ospf priority <value> interface command.

A priority value of zero indicates an interface which is not to be elected as DR or BDR. The state of the interface with priority zero will be DROTHER. The following diagram illustrates the DR election:"

source: http://www.cisco.com/en/US/tech/tk365/technologies_white_paper09186a0080094e9e.shtml#t21

i dont know, but if a similar question would appear in any exam, i would go by what cisco says, afterall its a cisco exam. In page 143 of the CCNP ocg does not say much:

"Designated Router (DR) On multiaccess data links like LANs, an OSPF router elected by the routers on that data link to perform special functions. These functions include the generation of LSAs representing the subnet, and playing a key role in the database

exchange process.Backup Designated Router (BDR) A router on a multiaccess data link that monitors the DR and becomes prepared to take over for the DR, should the DR fail."

Published on Cisco 3560X

To be informed of the latest articles, subscribe:
Comment on this post
D
Any data is sent or received through the network by the OSI model. The 7 layers in the OSI model have their own separate functions, due to which data can be easily sent from one device to another.
Reply
C
Thank to Information
Reply
O
Nice Post. Your Information Sangat Membantu
Reply