OSPF DR/BDR Election explained

Hello Sims

When a new OSPF neighbor relationship is created, the first thing that happens is an exchange of information to determine who is the master and who is the slave. Each OSFP neighbor relationship between two OSPF routers has a master and a slave. The purpose of this determination is to decide who speaks first.

The master/slave negotiation in OSPF happens during the exstart state : both neighbors will claim to be the master by sending an empty database description packet with the Master Slave bit (MS-bit) set to one indicating that both routers believe they are the master. The neighbor with the lower Router ID will become the slave and will reply with a DD packet in which the MS-bit is zero and the DD sequence number is set to the master’s sequence number.

From there on in, the master will always speak first in subsequent communications.

I hope this has been helpful!

Laz

Hi,

I have a question, It was mentioned that the router-ID is favor to use the loopback interface over active interface, because it does not crash or anything. What if I manually configure the router ID, is there a reason why I should use the loopback interface over the manually configured Router-ID, or what is the difference in usage between them?

Thank you.

Hello Christopher

An OSPF router must have a router ID to function. If it does not, it cannot participate in OSPF. For this reason, the specific methodology has been employed for a router to obtain a router ID even if it hasn’t been configured explicitly.

Best practice dictates that you should always configure a router ID so that you have complete control over its value and so that you can avoid depending on the values used on the loopback or physical interfaces. But what if you forget to configure it or you simply choose not to? What then? OSPF will automatically choose an IP address from one of its interfaces.

Now the configuration is such that it prefers to use loopback addresses as these are less likely to go down and require a change in router ID and a rerunning of the SPF algorithm. They are more stable and result in a more stable routing topology. They are preferred over the physical interfaces, but are they ever preferred over the manual configuration of a router ID? No I don’t believe so.

There is no benefit to using a loopback instead of using a manually configured router ID. The only benefit is that if a router ID is not manually configured, whether accidentally or not, the use of a loopback is preferable to that of a physical interface.

I hope this has been helpful!

Laz

Hi Rene,
In your OSPF DR/BDR election lesson, as a final example you showed 2 Routers connected with a Serial link which does not have DR/BDR election.

  1. You have mentioned the serial link connection as a Point to Point link. Is there a difference between Point to Point Link and Point to point Network Type? If yes, what is the difference between them?
  2. Also, what if i use Ethernet links between the 2 Routers instead of serial links? Will it still be called point to point link and no DR/BDR election happens?
  3. What is the use of command “ip ospf network point-to-point”?

Hello Kamal

When we talk about point to point connections in OSPF we can be talking about several different, but related things.

The first has to do with the physical type of connection being used, as is the case in this lesson. When you use a serial connection, the physical type of connection is point to point. In such a connection, there can only be two hosts, one on either end of the physical link. When such a connection is made and OSPF neighbors are created across this link, there is no DR/BDR election. This is what is being described in the lesson.

Contrary to this, if the connection between the two devices was Ethernet, then the connection is not considered a point to point connection, even though there are only two routers involved. This is because the technology being used to connect them (Ethernet) is by definition a multi access technology, allowing for multiple devices to be connected on that same network segment (such as if you had a single L2 switch and three or more routers connected to it on the same subnet). So if Ethernet was used, a DR/BDR election would still take place, even if only two routers are present on the link.

Now the OSFP network type is different from (but related to) the point to point and multi access designations of specific technologies mentioned above. This has to do with configuring OSPF to function in a particular way to accommodate the type of network being used. These network types include non-broadcast, broadcast, point to multipoint, point to multipoint non broadcast, and point to point. All of these are covered in Unit 3 of the OSPF series of lessons.

Specifically, the ip ospf network point-to-point command causes OSPF to function such that the following features are enabled or disabled:

  • Automatic neighbor discovery is enabled so there is no need to configure OSPF neighbors yourself.
  • No DR/BDR election take place since OSPF sees the network as a collection of point-to-point links.
  • Normally used on point-to-point sub-interfaces with an IP subnet per link.
  • Can also be used with multiple PVCs using only one subnet.

The network topology being used must be appropriate for the particular command to be implemented. This is most often implemented in a non-broadcast point to point topology such as that used in Frame Relay. You can find out about this command and the related topologies it accommodates in detail at the following lesson:

I hope this has been helpful!

Laz

Is it just me, or are the networks incorrect in this example? it mentions 192.168.13.0 and 192.168.23.0

maybe i am missing something.

actually, the more i look at this example, the more confused i get.

It is intended to show that their will be 2 DRs and 2 BDRs because of the 2 multi-access segments, and then proceeds to show 1 of each on each side of R2. Is it just me or is this a bit misleading?

Hello Austin

You are correct, in the text following the output from the router should be rewritten to say:

“In the example above you can see that R1 is the DR for the 192.168.12.0/24 segment and R2 is the DR for the 192.168.23.0/24 segment.”

I’ll let @ReneMolenaar know to change that.

In the meantime, what this section is describing is the fact that each multi-access segment goes through a DR/BDR election. This means that each subnet/segment that has two or more OSPF routers connected to it will have a DR and a BDR. In the above example, we have two such subnets/segments, therefore each one will have a DR and a BDR.

According to the output, we can see that R2 is the DR of the 192.168.23.0/24 segment and it is the BDR of the 192.168.12.0/24 segment, which makes R1 the DR of that segment.

It is a bit confusing but the important thing here is that from the output you can see which router is the DR and BDR for each segment.

I hope this has been helpful!

Laz

1 Like

@ReneMolenaar @lagapidis Dont you think this is a confusing way to show this? The idea is to show that even though this is one area, there are 2 DR/BDR election processes, 1 for each Multi-access segment.

The output shows a DR on one side of the network and a BDR on the other side. I think it would be better, to reduce confusion, to show the neighbors on R1 and R3 so the output shows that R2 is serving as both a DR and BDR.

Hello Austin

Thanks for the feedback, it always helps us to clarify and improve content. I think the important thing here is to understand what the show ip ospf neighbor command output actually shows. The output shows information about the OSPF neighbors from the point of view of the local router. This means that in the State column, you will see the state of the neighbor relationship and the role of the local router. From this output, and keeping in mind that in the specific topology there are only two routers per multi-access segment, you can determine conclusively which router will be in which role for which subnet/segment.

If R2 is the DR for subnet 192.168.23.0/24 as the output shows, then R3 must be the BDR for that same subnet. Similarly, if R2 is the BDR for the 192.168.12.0/24 subnet, then R1 must be the DR for that subnet/segment.

I understand that adding the output of this command on the other routers as well will clarify this point even more. I will let @ReneMolenaar know so he can take a look.

I hope this has been helpful!

Laz

1 Like

Thanks for the clarification!

1 Like

Hi Austin,

I completely agree that showing R3 as the DR and R1 as the BDR is confusing. Just changed the example so that both R1 and R3 show up as the DR.

Seeing two DRs on R2 helps to emphasize the point that we have a DR/BDR election for each segment.

Rene

1 Like

I find this lesson a bit confusing. It starts with the DR/DBR election through router-IDs and then all of a sudden the priority pops-up with not much explanation. Is the priority by default 1 for all interfaces on all routers or do routers with the highest (loopback) interface IP address receive a higher priority? How does this work?

Hmm, now that I’m re-reading, I think that the main function of ‘priority’ is that it provides us a way for the manipulation of the election process?

Hello Marit

During a DR/BDR election, there are two criteria that are used to determine the role of each router. The first is router priority. By default, the priority is set to 1 for all OSPF routers. If the priority for some routers is the same and there’s a tie, then the next criterion is used, which is router ID. Since router IDs must be unique in an OSPF area, it is assumed that there will never be a tie. So, the highest router ID becomes the DR.

But what if you haven’t configured a router ID? Well, the router ID is obtained from the highest IPv4 address on a loopback interface. If there is no loopback interface, then the router ID is obtained from the highest IPv4 address on any active interface. You’ll always have at least one active interface with an IPv4 address to use as a router ID right? Otherwise you wouldn’t have any network connectivity to require routing!

But what if you’re using IPv6? Then you can have a router without any IPv4 addresses on an active interface. In this case, OSPF would just fail. Even when you’re using pure IPv6, you still need a router ID in the form of an IPv4 address to get it to function. I know this is more information than you asked for but, I though it would be interesting to include here.

Oh yeah, one more thing, if you don’t want a router to become a DR or a BDR, just set its priority to 0 and it will not participate in any elections.

I hope this has been helpful!

Laz

2 Likes

Hi ,

I have a question , if on the below topology BDR/DR election is going on and 1 more ospf router R4 we have attached to the switch , how the process will react to this ?

Regards,
Sameer.

Hello Sameer

A DR/BDR election does not function with preemption. This means that if an additional router is added to the switch with an IP address in the range of 192.168.123.0/24, no new election takes place. The current DR and BDR keep their roles. The only times an election will take place is:

  1. when the OSPF area is first created
  2. when a DR or BDR fails

I hope this has been helpful!

Laz

1 Like

Hi Rene

  1. DROTHER sends update to DR and DR then send update to other DROTHER and BDR router.
  2. DROTHER sends update to DR and BDR at same time and DR send it to DROTHER only.
    Which one will be accurate. Plz calrify

Hello Muhammad

On networks where a DR and BDR exist, all routers send their LSA updates to the 224.0.0.6 multicast address. This address is the DR and BDR address, so only the DR and BDR receive the LSA updates. It is only the DR then that sends the updates to the rest of the OSPF routers on the segment.

The reason the updates are sent to both the DR and the BDR is so that if the DR fails, the BDR will have a complete and updated topology table such that it can take over immediately as a DR.

So to answer your question, number 2 is correct.

I hope this has been helpful!

Laz

Hello

A quick clarification, so in a broadcast network all the routers form adjacencies with DR/BDR while they are neighbors to each other (DROTHER routers)…so routers complete all six adjacency steps with DR/BDR and stop at 2-Way with DROTHER routers?

Thank you
Sai