OSPF DR/BDR Election explained

Hello Sai

On a multi access broadcast network segment, OSPF routers will go through the various stages of becoming OSPF neighbors. During the process, all OSPF routers on the segment will reach the 2-way state with all other OSPF routers on the segment. They will remain in the 2-way state with all OSPF routers except for the DR and BDR. With those two routers, they will continue the process until they get to a Full state. The process goes like this:

  1. Down
  2. Init
  3. 2-Way

DR/BDR Election - All subsequent stages occur only between DR - OSPF routers and between BDR - OSPF routers

  1. Exstart
  2. Exchange
  3. Loading
  4. Full

I hope this has been helpful!

Laz

Hi Rene,
I made a lab 1 x switch with 4 x routers in same area 0 and the ip addresses for the router as below 10.1.1.1 , 10.1.1.2, 10.1.1.3 , 10.1.1.4 and I suspect the 10.1.1.4 will become DR as it’s the highest IP but I saw 10.1.1.1 become DR so how this elected DR

Hello Sameh

Remember the method of electing a DR and BDR. The criteria are:

  1. Router with the highest OSPF priority will become DR. If the priorities are the same, then…
  2. The router with the highest Router ID will become the DR

But remember that the Router ID is not always the IP address of the router interface connected to the segment in which an election takes place. The router ID is chosen like so:

  1. The manually configured router ID will be used. If there is no manually configured router ID then…
  2. The router ID is the highest IP address on a loopback interface. If there are no loopback interfaces, then…
  3. The router ID is the highest IP address on an active non-loopback interface.

So looking at your situation, you must first check to see if priorities have been set. If priorities are all the same, then the router IDs of the routers must be examined to see which will indeed become DR.

I hope this has been helpful!

Laz

1 Like

Thanks Laz for the answer But from where I can see the Priority of the router

Hello Sameh

There are a couple of ways you can see the priority. To see the priority of the local router, you can simply take a look at the configuration of the particular interface that you are interested in, such as the following:

interface fastEthernet 0/0
  ip ospf priority 200

If you want to see the priority of the OSPF neighbors, you can do so using the show ip ospf neighbor command like so:

R3#show ip ospf neighbor
Neighbor ID     Pri  State        Dead Time   Address         Interface
192.168.123.1   200  FULL/DR      00:00:30    192.168.123.1 FastEthernet0/0
192.168.123.2   1    FULL/DROTHER 00:00:31    192.168.123.2 FastEthernet0/0

You can see the priority value under the Pri heading in the table. In the table you can also see whether than neighbor is the DR, BDR, or neither.

I hope this has been helpful!

Laz

1 Like

Thanks Laz useful info.

1 Like

Hi Laz,
which command you type to see below info. of the interface:

interface fastEthernet 0/0
  ip ospf priority 200

Hello Sameh

In order to determine the OSPF priority on a particular interface, you must issue the following command

show ip ospf interface

This will give you, among other things, the configured OSPF priority for the router for the network segment connected to that interface.

You can find this command being used extensively in the following lesson:


You can also find out more about the output of this command in extensive details at the following Cisco documentation:

I hope this has been helpful!

Laz

In EXstart state both DR/BDR elections and Master/Slave election will happen!!
please describe the flow

Hello Vinoth

Yes, you are correct that both the DR/BDR elections and the Master/Slave selection take place in the EXstart state. Specifically, however, the DR/BDR elections take place first, and then the Master/Slave selection. This is also stated in the following lesson:

The flow is described in detail there.

I hope this has been helpful!

Laz

Good explanation Laz. I was racking my brain as to why directly connected routers had DR/BDR. They were GigE. Since most connections are now Ethernet (aren’t serial interfaces becoming scarce?), maybe this should be highlighted early in the tutorial. This text should be updated: “We only use a DR/BDR on a multi-access network. An example of a multi-access network is using a switch. There is no need to do this on a point-to-point link. There is only one other router on the other side so there is no reason to select a DR/BDR.” Thoughts?

Hello Jimmy

Yes, it’s a good idea to clarify that point in the lesson. I’ll let Rene take a look so that he can make any necessary modifications.

And yes it is true that serial connections are becoming less and lesson common, however, point to point connections are not. Even though Ethernet is the primary technology being used, there are often cases where OSPF will be used in a logical point to point topologies where DR/BDR elections are unnecessary. Such topologies include GRE tunnels, Hub and spoke topologies such as those used in DMVPN, as well as in PPP connections, all of which are in extensive use today.

I hope this has been helpful!

Laz

Hello Jimmy,

Thanks for sharing your input!

I changed the sentence at the beginning to add something about what a multi-access network is. In most of the courses, DR/BDR is explained first and later we look at the OSPF network types.

Keep in mind that OSPF doesn’t know whether the interface is connected to a switch or directly to another router. It looks at the interface and selects the network type.

Rene

1 Like

Hi there

I’m trying to understand the network downtime when the DR fails and the BDR takes over as the new DR. Could you please point me in the right direction?

While I understand there won’t need to be new adjacencies formed, reducing network downtime, but I’m keen to assess what the down time will be based on in this scenario

Hello Yash

Remember that the BDR forms adjacencies with all other routers in the network segment including the DR. That means that all updates exchanged between the DR and DROTHER routers in a particular network segment are also simultaneously received by the BDR. So at any given time the BDR is completely up to date.

Now if the DR fails, it will take the same amount of time for the network to reconverge as it takes for the adjacency to be detected. If the DR and BDR routers are directly connected and the interface goes down, this will be detected immediately since the BDR will detect the interface going down and it will immediately become the DR. If they are connected via a switch, then the detection will take longer, on the order of the hello and dead intervals.

But even if a DR goes down, the network will still be functioning assuming it is a stable OSPF topology. If the network is stable during the whole duration of the detection of the DR going down, hosts should not realize that any failure has occurred (except for routes that may require the use of the failed DR router to be routed)

If during that time between the DR going down and the BDR detecting it there is a change in the network, then convergence may take longer.

In order to speed convergence up, you can always use Bidirectional Forwarding Detection (BFD), a super-fast protocol used to detect failed router adjacencies in milliseconds or less! You can find out more about that here:

I hope this has been helpful!

Laz

Hi Lazaros

Thanks so much for your response - that was very helpful.

Can you please help clarify one thing? Not sure if this is a silly question.

If the DR goes down and there were routes that required the use of the DR, would that still be a “stable OSPF” topology? or would the network be in a state of convergence and consequently everything else on the network is inaccessible for that period?

Cheers
Yash

Hello Yash

This is not a stupid question at all! We must look at the DR not only as far as its role in performing the functions of the DR, but also as just another router that is performing routing and sharing its own routes to particular destinations using OSPF.

So if a DR goes down, then yes, for the specific routes that are served by this DR, the OSPF topology will indeed be unstable. For other routes however that are not served by this router, communication will continue as normal, thus being unaffected by the failure of the DR.

The result is as I mentioned in the previous post. In the event of a link failure, directly connected routers will immediately know the DR has failed since their own interfaces will go down, so reconvergence will begin immediately. If not, then the timers must expire. The alternative is to use BFD as described.

I hope this has been helpful!

Laz

1 Like

Thanks so much - lot clearer now. Appreciate it very much :slight_smile:

1 Like

Why BDR elects first instead of DR ?.

There would be no LSa exchange between the drothers but there will be a hello packet will be exchanged between all the routers in the segment on 224.0.,0.5 …Right ??

Hello Narad

Take a look at this post:

Actually, hello packets will also use the following multicast addresses:

  • hello from DROTHER to DR/BDR: 224.0.0.6
  • hello from DROTHER to DR/BDR: 224.0.0.5

These are the same addresses used for the LSAs as well. This is confirmed by the fact that you will never see an adjacency between two DROTHER OSPF routers. More info can be found at the following Cisco documentation:

I hope this has been helpful!

Laz