OSPF v2 ( DR and BDR Selection)

Answered Question
Oct 21st, 2008

Hi,

The query here is what is selected first: The DR or the BDR?

From the selection process, it seems that the BDR is selected first and then DR. If there is no DR present, then the BDR becomes the DR.

My second question is, how do the routers vote to become a DR or a BDR?

Jeff Doyle in his book says that some routers claim to be DRs and some for being a BDR. How?

Awaiting a reply.

Thank you.

-/ Kiran Cherian

I have this problem too.
0 votes
Correct Answer by Giuseppe Larosa about 8 years 1 month ago

Hello Adam,

>> this process will be done for all the routers in a particular area,

Actually, DR and BDR election is performed on each LAN segment: if there 4 Vlans then 4 DRs and 4 BDRs are elected.

to take part in election and to build adjacencies with the elected DR and BDR all routers must agree on some parameters that are present in Hello packets:

Hello timer

Dead interval

Area-id: a 4 byte value

Area flag: = type of area

Authentication: if used must match

OSPF router-id have to be unique to avoid problems.

So in an OSPF area many DRs and BDRs can exist.

The usage of ip ospf priority is recommended to avoid to have the same router acting as DR in multiple LAN segments that will increase its CPU load.

(without changing priority the highest OSPF RID will win in all LAN interfaces it is heard by other routers)

The suggestion is to distribute the workload of DR and BDR roles on different routers.

The DR will build a Network LSA (type 2) to describe the multiaccess segment that includes a list of OSPF RIDs of routers that are connected to the LAN.

This allows distant routers in the same OSPF area to know the topology in detail.

Hope to help

Giuseppe

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 3.5 (7 ratings)
Loading.
Giuseppe Larosa Tue, 10/21/2008 - 09:16

Hello Kiran,

the election process uses the OSPF hello packet that has two fields:

DR field

BDR field

the Hello packet has also a field that is a list of OSPF RID heard on wire

each router starts claiming it is the DR, but then based on Hellos received from other routers:

if another has better attributes the DR field will be filled with that router OSPF router-id.

the attributes used are:

OSPF router-id : ipv4 address unique for each OSPF process should be unique in the OSPF domain

ip ospf priority: default 1 can be changed on a per interface basis with

ip ospf priority

highest priority and then if there is a tie highest OSPF RID wins

to be noted in OSPF there is no preemption and the current DR keeps its role even if a router with better attributes is connected to the lan.

So without any priority tuning:

the first router active in LAN is likely the DR.

of all the other routers the one with the best attributes is the BDR.

If a new router with even better attributes joins if cannot become DR. If an event happens that triggers a new BDR election:

if the current DR fails the BDR is promoted DR and a new BDR is elected.

Hope to help

Giuseppe

k.cherian Tue, 10/21/2008 - 19:59

Hi Giuseppe,

Thank you for the time to reply to my query.

It is correct that in the Hello packets the DR and BDR will get updated when the DR or BDR is available.

My query is ,during the selection process how do the routers decide who want to stand up for the DR election and who for a BDR? or is it that all the routers are looking to be a DR and the 2nd best becomes the BDR?

Awaiting a reply.

Thank you.

-/ Kiran

adam.sin85 Tue, 10/21/2008 - 20:26

I think Giuseppe has already answer the question in a very good manner,but for ur convienience,

routers in a particular area will exchange hello packets,hello packets contain priority & Router id field,

the router which will recieve the hello packet will compare the router id & priority,to it's own,this process will be done for all the routers in a particular area,

ALL the routers in an area will participate in the election,

router having the highest configured router id will become the DR,

All other routers in that area will communicate with the DR & BDR,

next thing is that you can manually configure the DR, by changing the priority

Router(config-if)#ip ospf priority number,

This number could be between 0-255,the higher the number,the better is the chances

of the router becoming the DR,

The router with a priority of 0 will neither be a DR or BDR.

If the DR goes down then BDR will become new DR.

Correct Answer
Giuseppe Larosa Tue, 10/21/2008 - 22:40

Hello Adam,

>> this process will be done for all the routers in a particular area,

Actually, DR and BDR election is performed on each LAN segment: if there 4 Vlans then 4 DRs and 4 BDRs are elected.

to take part in election and to build adjacencies with the elected DR and BDR all routers must agree on some parameters that are present in Hello packets:

Hello timer

Dead interval

Area-id: a 4 byte value

Area flag: = type of area

Authentication: if used must match

OSPF router-id have to be unique to avoid problems.

So in an OSPF area many DRs and BDRs can exist.

The usage of ip ospf priority is recommended to avoid to have the same router acting as DR in multiple LAN segments that will increase its CPU load.

(without changing priority the highest OSPF RID will win in all LAN interfaces it is heard by other routers)

The suggestion is to distribute the workload of DR and BDR roles on different routers.

The DR will build a Network LSA (type 2) to describe the multiaccess segment that includes a list of OSPF RIDs of routers that are connected to the LAN.

This allows distant routers in the same OSPF area to know the topology in detail.

Hope to help

Giuseppe

mheusing Tue, 10/21/2008 - 23:19

Hi,

just a note regarding DR/BDR election. This will be non-preemptive, which means: if there is a DR/BDR already present then it will not change it's role, even if a router with higher priority joins the LAN.

Thus you can see from the Hellos sent:

The first hello sent by an OSPF router on the LAN is with 0.0.0.0 in the DR and BDR fields of the hello. Basically the router waits to get the info, if there is already a DR/BDR, which can be learned by any other hello.

If no other Hello with DR/BDR is received, then the next Hello will be sent with the router's RID as DR and 0.0.0.0 for BDR. The router is the first on the LAN and thus declares itself to be the DR.

If a Hello with DR/BDR is received, then the router picks it up and tries to form an adjacency with DR/BDR.

If another Hello with 0.0.0.0 in the DR/BDR field is received - because two routers were starting at the same time - then the election process based on priority and RID is performed.

So in most cases the first router on a LAN segment is the DR, the second one is BDR.

And a last note: a priority of 0 will prevent a router to become DR or BDR.

Hope this helps! Please use the rating system.

Regards,

Martin

k.cherian Wed, 10/22/2008 - 09:18

Hi,

Just for my understanding, wanted to sum things up.

1) If there is only one router and none else replies back to his query on the DR/BDR selection process, then he takes over as the DR.

2) If there are multiple replies, then based on the Priority (if necessary the Router ID), the DR and then BDR selection takes place.

3) O means no participation.

Hope i summed it up.

Thank you for the help.

-/ Kiran

mheusing Wed, 10/22/2008 - 22:40

Hi Kiran,

just a slight clarification: there are no "DR/BDR queries" in OSPF. All a router does is to listen to hellos from other OSPF routers on the LAN. Hellos contain a DR and a BDR field.

So:

1) correct, if there is no existing DR on a LAN and no other OSPF router, then the router declares itself as DR.

2a) If there is already a DR and a BDR no change will occur, independent of priority. DR and BDR will keep their role, even if they have a smaller priority.

2b) If there is no BDR but a DR then the router will become BDR.

2C) If there is no DR and no BDR and several Hellos are seen (all with 0.0.0.0 in the DR and BDR field) then election takes place.

3) correct, a priority of 0 means no DR or BDR role.

Hope this helped. Please use the rating system.

Regards,

Martin

bagvanliju Wed, 10/22/2008 - 23:42

hai martin,

nicly xplaned ..informative ..i ve givn my ratings

ujil

Actions

This Discussion