cancel
Showing results for
Did you mean:
cancel
Announcements
8390
Views
20
12
Replies
Beginner

## Who is selected first, DR or BDR?

Who is selected first, DR or BDR?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Beginner

## Who is selected first, DR or BDR?

The election procedure of the DR and BDR is as follows:

1- After 2-Way communication has been established with one or more neighbors, examine the Priority, DR, and BDR fields of each neighbor's Hello. List all routers eligible for election (that is, routers with priority greater than 0 and whose neighbor state is at least 2-Way); all routers declaring themselves to be DR (their own interface address is in the DR field of the hello packet); and all routers declaring themselves to be the BDR (their own interface address is in the BDR field of the Hello packet). The calculating router will include itself on the list unless it is ineligible.

2- From the list of eligible routers, create a subset of all routers not claiming to be the DR (routers declaring themselves to be the DR cannot be elected BDR).

3- If one or more neighbors in this subset include its own interface address in the BDR field, the neighbor with the highest priority will be declared the BDR. In a tie, the neighbor with the highest router ID will be chosen.

4- If no router in the subset claims to be the BDR, the neighbor with the highest priority will become the BDR. In a tie, the neighbor with the highest router ID will be chosen.

5- If one or more of the eligible routers include their own address in the DR field, the neighbor with the highest priority will be declared the DR. In a tie, the neighbor with the highest router ID will be chosen.

6- If no router has declared itself the DR, the newly elected BDR will become the DR.

7- If the router performing the calculation is the newly elected DR or BDR, or if it is no longer the DR or BDR, repeat steps 2 through 6.

Hope this helps

- Eehab

12 REPLIES 12
Hall of Fame Cisco Employee

## Who is selected first, DR or BDR?

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

Engager

## Who is selected first, DR or BDR?

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?

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

Hall of Fame Cisco Employee

## Who is selected first, DR or BDR?

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

Hall of Fame Master

## Who is selected first, DR or BDR?

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

HTH

Rick

Hall of Fame Cisco Employee

## Who is selected first, DR or BDR?

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

Hall of Fame Master

## Who is selected first, DR or BDR?

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.

Beginner

## Who is selected first, DR or BDR?

the process of selecting DR/BDR is based on router's priority ID (RID), highest RID is selected as DR and the device with 2nd highest RID is selected as BDR.

Beginner

## Who is selected first, DR or BDR?

Also, OSPF sends hello packet to all the routers in an area to build the database that contains the RID of the devices.

Highlighted
Beginner

## Who is selected first, DR or BDR?

The election procedure of the DR and BDR is as follows:

1- After 2-Way communication has been established with one or more neighbors, examine the Priority, DR, and BDR fields of each neighbor's Hello. List all routers eligible for election (that is, routers with priority greater than 0 and whose neighbor state is at least 2-Way); all routers declaring themselves to be DR (their own interface address is in the DR field of the hello packet); and all routers declaring themselves to be the BDR (their own interface address is in the BDR field of the Hello packet). The calculating router will include itself on the list unless it is ineligible.

2- From the list of eligible routers, create a subset of all routers not claiming to be the DR (routers declaring themselves to be the DR cannot be elected BDR).

3- If one or more neighbors in this subset include its own interface address in the BDR field, the neighbor with the highest priority will be declared the BDR. In a tie, the neighbor with the highest router ID will be chosen.

4- If no router in the subset claims to be the BDR, the neighbor with the highest priority will become the BDR. In a tie, the neighbor with the highest router ID will be chosen.

5- If one or more of the eligible routers include their own address in the DR field, the neighbor with the highest priority will be declared the DR. In a tie, the neighbor with the highest router ID will be chosen.

6- If no router has declared itself the DR, the newly elected BDR will become the DR.

7- If the router performing the calculation is the newly elected DR or BDR, or if it is no longer the DR or BDR, repeat steps 2 through 6.

Hope this helps

- Eehab

Hall of Fame Cisco Employee

## Who is selected first, DR or BDR?

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

Cisco Employee

## Who is selected first, DR or BDR?

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

Hall of Fame Master

## Who is selected first, DR or BDR?

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