cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11882
Views
15
Helpful
9
Replies

Who is selected first, DR or BDR?

Murugan Pambulu
Level 1
Level 1

Who is selected first, DR or BDR?

9 Replies 9

Peter Paluch
Cisco Employee
Cisco Employee

Hi Murugan,

They are elected at the same time. The election procedure in OSPF consists of several steps but once finished, both DR and BDR are elected. Internally, the procedure first selects a candidate BDR and potentially promotes it to DR and then selects another BDR, but this is an internal sequence of steps which is done in the moment of elections, and once completed, both DR and BDR are identified.

Best regards,

Peter

hi peter,

wow! this info gave me a different perspective on OSPF's DR/BDR election process.

was recently reading/reviewing this for my FIREWALL. do you have a link where i can further read on what you've recently posted?

ASA# debug ospf adj

OSPF adjacency events debugging is on

ASA# debug ospf events

OSPF events debugging is on

ASA# conf t

ASA(config)# int g1

ASA(config-if)# no shut

ASA(config-if)#

OSPF: Interface inside going Up

OSPF: Send with youngest Key 1

OSPF: Build router LSA for area 0, router ID 192.168.1.2, seq 0x80000002

OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2

OSPF: End of hello processing

OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2

OSPF: 2 Way Communication to 172.16.1.2 on inside, state 2WAY

OSPF: Backup seen Event before WAIT timer on inside

OSPF: DR/BDR election on inside

OSPF: Elect BDR 192.168.1.2

OSPF: Elect DR 172.16.1.2

OSPF: Elect BDR 192.168.1.2

OSPF: Elect DR 172.16.1.2

       DR: 172.16.1.2 (Id)   BDR: 192.168.1.2 (Id)

OSPF: Send DBD to 172.16.1.2 on inside seq 0x1237 opt 0x2 flag 0x7 len 32

OSPF: Send with youngest Key 1

OSPF: End of hello processing

OSPF: Rcv DBD from 172.16.1.2 on inside seq 0x2283 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART

OSPF: First DBD and we are not SLAVE

OSPF: Rcv DBD from 172.16.1.2 on inside seq 0x1237 opt 0x52 flag 0x2 len 92  mtu 1500 state EXSTART

OSPF: NBR Negotiation Done. We are the MASTER

OSPF: Send DBD to 172.16.1.2 on inside seq 0x1238 opt 0x2 flag 0x3 len 52

OSPF: Send with youngest Key 1

OSPF: Send with youngest Key 1

OSPF: Database request to 172.16.1.2

OSPF: sent LS REQ packet to 172.16.1.2, length 36

OSPF: Rcv DBD from 172.16.1.2 on inside seq 0x1238 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE

OSPF: Send DBD to 172.16.1.2 on inside seq 0x1239 opt 0x2 flag 0x1 len 32

OSPF: Send with youngest Key 1

OSPF: Send with youngest Key 1

OSPF: Rcv DBD from 172.16.1.2 on inside seq 0x1239 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE

OSPF: Exchange Done with 172.16.1.2 on inside

OSPF: Synchronized with 172.16.1.2 on inside, state FULL

OSPF: Send with youngest Key 1

OSPF: Build router LSA for area 0, router ID 192.168.1.2, seq 0x80000003

OSPF: Send with youngest Key 1

OSPF: Send with youngest Key 1

OSPF: Send with youngest Key 1

OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2

OSPF: Neighbor change Event on interface inside

OSPF: DR/BDR election on inside

OSPF: Elect BDR 192.168.1.2

OSPF: Elect DR 172.16.1.2

       DR: 172.16.1.2 (Id)   BDR: 192.168.1.2 (Id)

OSPF: End of hello processing

ASA(config-if)# no debug ospf

Hello John,

The procedure is described in RFC 2328 Section 9.4.

Also, there is the Ask the Expert session currently running on CSC that is focused specifically on OSPF. Perhaps we should move our questions there.

Best regards,

Peter

Richard Burts
Hall of Fame
Hall of Fame

The BDR is elected first. You can use this link to see some discussion about that.

https://learningnetwork.cisco.com/thread/33560

HTH

Rick

HTH

Rick

Hi Rick,

Now we've confused the guy Yeah, the RFC 2328 does internally select the BDR first, as I noted originally, but from a higher-level overview, you have the elections, and out of those elections, you get both DR and BDR. We do not consider the elections to be finished until a DR and optionally BDR are elected, and while a candidate BDR gets elected sooner, it is a transitory state inside the election algorithm, not a possibly stable state you could dwelve in for some time.

Best regards,

Peter

Peter

Perhaps we have confused the original poster. But I continue to believe that one of the great strengths of this forum is that multiple people may propose answers and that sometimes the proposed answers represent somewhat different perspectives about the issue. That is the case here.

The perspective that you offer is that it is not so significant how the mechanics of the election work. It is only important to understand that OSPF will do its thing and that a DR and perhaps a BDR will be elected. I agree that for some engineers this is a sufficient thing to understand.

But the original poster asked a specific question about which one comes first. I infer from this that he wants a deeper understanding of the election. From my perspective this is a reasonable question and it does have a reasonable answer. The debugs in John"s post do make it evident that the election of BDR does come first. There are some of us who want to understand the subtlties of how the election works.

HTH

Rick

And perhaps my perspective is influenced by the fact that I have just been going through the -process of preparing to take the test to recertify my CCIE and I have been looking for lots of details about how protocols work. Perhaps I assume that the original poster is interested in a similar level of detail.

HTH

Rick

Hello Rick,

I absolutely agree with you. I hope I have not come off as a person spreading superficial, shallow information just for "some engineers" - by now, I am sure you know I am not that kind of person.

To me, the simplicity of the original poster's question suggested something else than what it suggested to you - I had a feeling that the original poster believes that the DR and BDR are elected independently and individually, so I tried to explain that OSPF does both the DR and BDR elections in one round. I would expect that if people are interested in deeper detail they usually quote some debugs, parts of RFCs etc. suggesting they are actually digging deep. I did not have the same feeling here but I may be totally wrong.

In any case, this thread already contains both the high-level overview and deep dive into details so now it is really up to the original poster to take the necessary information.

I always welcome your comments and I appreciate them very much! And please allow me to wish you good luck in your CCIE recert preparations - although I strongly doubt there is anything you would not be adequately prepared in the CCIE exam.

Best regards,

Peter

Appriciate Peter,Rick and John for there view on this. All of them are 100% correct.

I wish Rick good luck for your CCIE recert prepartation.

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.

REgards

Inayat

Hello Peter

Sorry for somewhat delayed response but participation at Cisco Live got in the way of keeping up with my posting.

Let me be clear that characterizations of superficial or shallow are about the last things that come to my mind when I think about you. Your posts clearly show depth and attention to detail for networking knowledge. You interpreted the question in one way while I interpreted it is a different way. As I said before I believe that one of the strengths of the forum is having multiple people respond and that frequently means that different perspectives and interpretations come into play. As you say the original poster now has multiple answers with varying degrees of depth and he can now choose the one that fits his needs the best.

Thanks to all who wished me well in my CCIE recert test. I am glad to report that I did pass it at Cisco Live (and must admit that it took me a couple of tries at it this year to achieve the passing mark).

HTH

Rick

HTH

Rick
Review Cisco Networking for a $25 gift card