OSPF DR/BDR Election explained

Hello Miguel

The next hop IP is always the IP of the router that leads to the destination network in question. In a network where there are three or more routers connected to a switch, that is, to a single network segment, then the DR may or may not be the next hop IP. There is no direct correlation between the DR and the next hop IP in the routing table. Next hop IP and the DR are two different concepts that are not directly related.

In a point to point Ethernet connection, one router is elected as a DR and the other as the BDR. In this case, for all routes shared between the two routers, the DR (or the BDR, depending on your point of view) will always be the next hop simply because there is no other option. There is only a single router on the specific segment.

Just to clarify, DRs and BDRs will only be elected on Ethernet links and not on point to point connections using other technologies such as serial links.

I hope this has been helpful!

Laz

Hello Networklessons Team

Can you please describe the process how we minimize trafic when using DR and BDR? In the process of becoming neighbors the Database Description and LSUs are sent to 224.0.0.6. The switch in this case will flood the packets to all other routers but only the DR and BDR will not discard it, But also the DRothers will receive the LSUs and DDs. After the neighborships are established and a new LSU is sent by a DRother to DR/BDR how is the LSU packet is sent only to them and not the other DRothers? And what would happen if we did not elect DR and BRD? Thank you

Regards
Markos

Hi Rene,

I have one question regarding DR AND BDR ELECTION PROCESS.

if two router connected to each other and are in area 0.R1 has router id 1.1.1.1 and other one is 2.2.2.2.
I activate ospf in router 1 first and then in router 2.After that they became neighbours.
But as per my understanding r2 will be the DR and r1 will be the bdr but when I check by sh ip ospf nei command.
It showing R1 is DR and R2 is BDR.
Can you tell me why.

Hello Markos

The DR and BDR will reduce traffic on any network segment where there are three or more OSPF routers. In other words, if you have a switch with five routers connected to it, for example, where each of the routers has an interface in the same subnet. This is a situation where the DR/BDR will indeed reduce OSPF traffic.

So let’s use a network of five routers as our example network. If we have no DR/BDR, this means that we have ten distinct neighbor adjacencies as shown below:


This means that if each device sends an update to all its neighbors, that’s 5 routers each sending out an update to 4 neighbours each, resulting in 20 updates.

If we have a DR, the neighbor adjacencies are the same number, however, the updates function differently. If we have the same scenario where each router wants to send an update, they will send it ONLY to the DR (Let’s leave the BDR out of it for a bit) and the DR will relay it to all of the other routers. So each router sends one update to the DR (that’s 4 updates) the DR sends each of those to all other routers. Now these can be sent as consolidated updates, containing updates from multiple routers. So the DR need only send an update to each of the OSPF routers (including any updates that the DR itself originates) with four additional packets, for a grand total of 8 updates. In this whole procedure, the BDR just gets a copy of all updates that are sent to the DR. It doesn’t send out any updates beyond those that it generates itself.

As segments get larger, the overhead of the number of updates being sent increases exponentially.

Now keep in mind that OSPF updates to non-DR/BDR routers go to the multicast address of 224.0.0.5, which is all OSPF routers. The destination multicast address 224.0.0.6 which is the DR and BDR address, will only go to DR and BDR routers. This is the notion of multicast. It is not like broadcast where all OSPF routers will receive it. Otherwise if OSPF routers were to receive such packets and just discard them because they don’t belong to them, then OSPF traffic is not being reduced on the segment.

I hope this has been helpful!

Laz

1 Like

Hello Naman

If the priority is the same on both OSPF routers, then the router ID is used to determine the DR. The higher router ID should become the DR. So in your case, R2 should be the DR. However, if for whatever reason R2 failed as a DR, R1 will take over as DR. Even if R2 recovers, R1 will still remain DR until it fails and R2 takes over. The priority and router ID values only play a role in the election during the initial formation of the adjacency. After that, if the roles change due to a failure, those roles will remain as they are even if the failure has been rectified.

I believe that in your case something like this took place, where R2 did fail as a DR (maybe the cable was disconnected or the interface was shut down) and R1 took over. Test it out again to see if you get the same results.

I hope this has been helpful!

Laz

sir
i want to ask few questions
1> sir when i connect 2 ospf router directly without between switch then between these 2 routers one router is becoming a DR and other is becoming 2WAY other but why they are selecting each other DR because it is not a multi access network please explain this thing

Hello Harshit

When two routers are connected directly using Ethernet, then you will still have a DR and a BDR. This is because even through there are only two routers connected, Ethernet itself is a multiaccess technology. If they were connected using a serial link, as is the case in the last example in the lesson, then you would have no DR or BDR, because the technology is not multiaccess.

So a DR and BDR will be elected whenever a multi access technology is used, even if there are only two routers involved.

I hope this has been helpful!

Laz

thanks lazaros agapides very well answer

1 Like

I Dont understand why in the example “DR/BDR election is per multi-access segment” Rene said that
"R1 is the DR for the 192.168.12.0/24 segment ", based on the output it is incorrect.

Can you explain this please?

Hello Giovanni

What Rene is stating here is that there is a DR/BDR election for every network segment. This is similar to saying that there is a DR/BDR election within each broadcast domain. Any set of routers that have interfaces on the same subnet will have a DR/BDR election. This means that five routers connected to a switch (on the same VLAN) will have an election among themselves. Also, two routers connected using an Ethernet connection will also hold an election between themselves.

Take a look at this diagram:
image
Each orange area is a network segment or a broadcast domain. The router interfaces connected to each of those segments are on the same subnet. Each segment will hold its own elections.

So a single router may be DR on one interface, BDR on another, and neither on a third interface.

Now the important thing here is that this is the case for multi-access technologies. So if all of the connections in the above diagram were Ethernet, elections would take place as described. If however the point to point connections between the routers are PPP connections, elections would not take place, because PPP is not a multiaccess technology. If the connections between the routers used frame relay, once again, DR/BDR elections would not take place, because the technology is not multi-access.

The reason DR/BDR elections take place is because in multiaccess technologies such as Ethernet is because in such network segments, with multiple routers, you get an exponentially increasing number of LSAs being exchanged. DR/BDRs resolve this issue.

I hope this has been helpful!

Laz

Hi all!

I’m reading this chapter and I have a question. Should the following topology work?

RT1 - > SW1 -> RT2 -> RT3 -> RT4

RT4 is the DR and RT3 is BDR and all routers in Area 0. I did the test on packet tracer and I cannot ping RT1 from RT4. I think is because RT2 is not a DR, so it cannot flood with LSA type 2. It is correct?

Regards.

Hello Marco

Keep in mind that a DR/BDR election will take place for each network segment and not for each OSPF area. In your topology here, you have three network segments:

  • The link between RT1 and RT2
  • The link between RT2 and RT3
  • The link between RT3 and RT4

So here you will have three DR/BDR elections. So RT1 may be the DR and RT2 the BDR (or visa versa) for the first segment, RT2 may be the DR and RT3 the BDR (or visa versa) for the second segment, and RT3 may be the DR and RT4 the BDR (or visa versa) for the third segment.

You can confirm this by issuing the show ip ospf neighbors command on all routers and examining the roles of each router.

In other words, for each subnet to which routers are connected, you have a DR/BDR election.

Now if you have enabled OSPF on all routers and all routers are advertising their networks, then you should have connectivity. The reasons for R1 not reaching R4 can be many, but are probably not related to the DR/BDR election.

I hope this has been helpful!

Laz

1 Like

Hi Laz!

Thank you very much for your help. I just realized that there is a DR per subnet, not per area :fearful:

I will build same topology on GNS3 as soon as I get a faster machine.

Thanks!

1 Like

If DR is down and no BDR is configured what will happen?

One more doubt in OSPF:

A major network is advertised as summary in one area
and few of the routes from that network is configured in
another area. What will happen in that case?

Hello Siji

Whenever a DR/BDR election takes place, there is always a DR and a BDR chosen. If a DR fails, and a BDR takes over and becomes DR, elections take place in the background to obtain a new BDR. The only time you will not have a BDR is if you have only one OSPF router in the network segment and there is no second router to be come BDR. However, this situation means there is no second router to create an OSPF neighbourhoodship, so OSPF would not actually function, so you wouldn’t need a DR or BDR… :stuck_out_tongue:

Each router will create a routing table based on the LSAs that it receives. As a rule, when routers receive a more specific destination, that choice will be preferred in the routing table. For example, if the summary indicates a destination of 10.10.0.0/16, and there is a more specific route to 10.10.10.0/24, then the more specific route would be chosen.

I hope this has been helpful!

Laz

Hi Guys - after the DR/BDR election has taken place and all routers in the OSPF segment are up and running, I understand that if the DR router reloads then it will not come back online as the DR even if it has a higher interface priority.
In your opinion, why is the process designed this way?
Is there a way of forcing it to become the DR router on the segment again?
Thanks,
Gareth.

Hello Gareth

The reason this is design this way is to minimize the number of elections that take place. If a router comes up and goes down continually, DR/BDR elections would have to take place continually, especially if that router had the highest priority on the segment. This could be devastating to an OSPF topology since the flapping router would also cause OSPF reconvergence, and if there is a continuously DR/BDR election taking place, LSA exchanges would be delayed and could be lost in the process.

As far as I know there is no way to preemptively have a specific router become the DR (like you would with HSRP active devices) except for shutting down and restarting the OSPF process.

I hope this has been helpful!

Laz

Hey Laz,

Thanks - that makes sense. I guess on a broadcast network it’s not massively important who the DR/BDR is unless you have one device with a more CPU resources etc who you would like to take on the extra load.

Thanks a lot,

Gareth.

1 Like

Hi,
What is master slave concept in ospf
Thanks