Networks Training

  • About
  • My Books
  • SUGGESTED TRAINING
  • HOME
  • Cisco Networking
    • Cisco General
    • Cisco IOS
    • Cisco VPN
    • Cisco Wireless
  • Cisco ASA
    • Cisco ASA General
    • Cisco ASA Firewall Configuration
  • Certifications Training
    • CCNA Training
    • Cisco Certifications
    • I.T Training
  • General
    • General Networking
    • IP Telephony
    • Network Security
    • Product Reviews
    • Software
  • Cisco Routers
  • Cisco Switches
You are here: Home / Cisco Routers / Cisco OSPF DR-BDR Election in Broadcast Networks – Configuration Example

Cisco OSPF DR-BDR Election in Broadcast Networks – Configuration Example

Written By Harris Andrea

The OSPF (Open Short Path First) dynamic routing protocol is probably the most popular and most used IGP routing protocol in TCP/IP networks.

DR and BDR selection in OSPF

Because OSPF is supported by all networking vendors, it does not have the restrictions of proprietary protocols like Cisco EIGRP for example (in terms of multi-vendor environments etc).

The new Cisco CCNA exam (200-301) requires knowledge of OSPF (specifically OSPFv2 in single Area configuration), which shows the importance that Cisco places in this dynamic routing protocol.

Table of Contents

  • Importance of DR/BDR
  • Factors affecting DR/BDR Election
  • Selection Rules for DR/BDR
  • Configuration Example
  • Configure OSPF Priority and Router ID for DR Election
    • Change DR Election with Router-ID
    • Change DR Election using OSPF priority
    • Related Posts

Importance of DR/BDR

One of the concepts that you need to learn about OSPF is DR/BDR election in broadcast network types (multi-access network such as Ethernet LAN).

So, if two or more routers are connected on a broadcast network (e.g an Ethernet LAN) and are configured for OSPF, they must select a DR (Designated Router) and a BDR (Backup Designated Router).

Note that DR/BDR is done on a per-segment basis and NOT on per-area basis.

All routers in the broadcast network must form an OSPF adjacency with all other routers. The goal of DR and BDR is to reduce the complexity of the multi-access network from a link state database point-of-view.

The DR/BDR act as central points of exchanging link-state information instead of having to exchange info with all other routers in the broadcast network (mesh). This reduces greatly the link-state database of routers.

Note that there is no DR/BDR elected in point-to-point networks (e.g on serial links).

Factors affecting DR/BDR Election

There are two factors that influence DR/BDR election:

  1. Router ID: The Router ID is the highest IP address of the device or the highest IP address among loopback addresses (if one is configured) on the Cisco router or can be configured manually by “router-id a.b.c.d” command under the OSPF process.
  2. OSPF Priority: This is by default 1 for all routers. The OSPF priority is configured per interface.

Selection Rules for DR/BDR

  1. The router with the highest OSPF Priority on a specific segment (router interface) will become the DR.
  2. In case of a tie (i.e same OSPF Priority), the router with the highest Router ID will become the DR. The next biggest Router ID will become the BDR.

Since by default all routers have OSPF Priority of 1, it means that the router which has the highest IP address (i.e highest Router ID) will become the DR.

We can influence the election of DR and BDR by configuring explicit Router ID or OSPF priority on the routers.

Configuration Example

Let’s see an example topology below with 4 routers (R1 connected to R2 via point-to-point link and R2, R3, R4 connected to a broadcast multi-access network).

network diagram for ospf dr bdr

Step 1: Configure IP Addresses on Routers

R1#conf t
R1(config)#interface serial 0/0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.252
R1(config-if)#clock rate 2000000
R1(config-if)#no shut
R1(config-if)#exit

R1(config)#interface GigabitEthernet0/0
R1(config-if)#ip address 192.168.4.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#

R2#conf t
R2(config)#interface serial 0/0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.252
R2(config-if)#no shut
R2(config-if)#exit

R2(config)#interface GigabitEthernet0/0
R2(config-if)#ip address 192.168.1.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#

R3#conf t
R3(config)#interface GigabitEthernet0/0
R3(config-if)#ip address 192.168.1.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit

R3(config)#interface GigabitEthernet0/1
R3(config-if)#ip address 192.168.2.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit
R3(config)#

R4#conf t
R4(config)#interface GigabitEthernet0/0
R4(config-if)#ip address 192.168.1.3 255.255.255.0
R4(config-if)#no shut
R4(config-if)#exit

R4(config)#interface GigabitEthernet0/1
R4(config-if)#ip address 192.168.3.1 255.255.255.0
R4(config-if)#no shut
R4(config-if)#exit
R4(config)#

Step 2: Configure All Routers in OSPF Area 0

R1(config)#router ospf 1
R1(config-router)#network 192.168.12.0 0.0.0.3 area 0
R1(config-router)#network 192.168.4.0 0.0.0.255 area 0
R1(config-router)#end
R1#wr

R2(config)#router ospf 1
R2(config-router)#network 192.168.12.0 0.0.0.3 area 0
R2(config-router)#network 192.168.1.0 0.0.0.255 area 0
R2(config-router)#end
R2#wr

R3(config)#router ospf 1
R3(config-router)#network 192.168.1.0 0.0.0.255 area 0
R3(config-router)#network 192.168.2.0 0.0.0.255 area 0
R3(config-router)#end
R3#wr

MORE READING:  Configuring PPPoE for Cisco Router 520 and for series 850 and 870

R4(config)#router ospf 1
R4(config-router)#network 192.168.1.0 0.0.0.255 area 0
R4(config-router)#network 192.168.3.0 0.0.0.255 area 0
R4(config-router)#end
R4#wr

Step 3: Verification – DR/BDR – Neighbor Adjacencies

R1#show ip ospf neighbor

Neighbor ID    Pri       State    Dead Time      Address           Interface

192.168.12.2   0          FULL/ – 00:00:35      192.168.12.2             Serial0/0/0

The above shows the OSPF neighbor of R1 which (as shown in our diagram) is router R2 with Neighbor ID “192.168.12.2”.

The Neighbor ID is the Router ID of the neighbor router. The Router ID is the highest IP address of the device or the highest IP address among loopback addresses (if one is configured) on the Cisco router or can be configured manually by “router-id a.b.c.d” command under the OSPF process.

The “State” shows that this router has established a “FULL” OSPF relationship with the neighbor router. This is the normal state for an OSPF router.

R1#show ip ospf interface serial 0/0/0

Serial0/0/0 is up, line protocol is up
Internet address is 192.168.12.1/30, Area 0
Process ID 1, Router ID 192.168.12.1, Network Type POINT-TO-POINT, Cost:64
Transmit Delay is 1 sec, State POINT-TO-POINT,
[output omitted]

The above shows that the OSPF network type running on the Serial Interface is “Point-to-Point”. Moreover, the Router ID of R1 is “192.168.12.1”.

R2#show ip ospf neighbor

Neighbor ID    Pri       State                Dead Time      Address             Interface

192.168.3.1       1          FULL/BDR      00:00:38           192.168.1.3 GigabitEthernet0/0
192.168.2.1       1          FULL/DROTHER 00:00:38    192.168.1.2 GigabitEthernet0/0
192.168.12.1     0          FULL/ –           00:00:38           192.168.12.1 Serial0/0/0

Router R2 connects to both a Point-to-Point connection link (Serial Interface to R1) and also to a Multi-Access Network (Broadcast Domain) via interface Gi0/0 which connects via an Ethernet switch (Broadcast network) to the other routers R3 and R4.

As explained above, Routers connected to a Multi-Access network (such as Ethernet), will elect a DR (Designated Router) and a BDR (Backup Designated Router). A router that is not elected a DR or a BDR is called a DROTHER.

The router with the Highest OSPF Priority value will become the DR. In the event that the priorities are the same (Default priority is 1 for all routers), the Router ID becomes the tie breaker.  The router with the highest Router ID (Neighbor ID- 192.168.12.2) becomes the DR. The router with the next biggest IP (Neighbor ID-192.168.3.1) becomes the BDR.

In our topology above, Router R2 will be elected to be the DR because it has the highest Router ID of 192.168.12.2. Moreover, Router R3 will be the BDR because it has the next highest Router ID of 192.168.3.1.

R2#show ip protocols

Routing Protocol is “ospf 1”
[output omitted]
Router ID 192.168.12.2

R2#show ip ospf interface gigabitEthernet 0/0

GigabitEthernet0/0 is up, line protocol is up
Internet address is 192.168.1.1/24, Area 0
Process ID 1, Router ID 192.168.12.2, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 192.168.12.2, Interface address 192.168.1.1
Backup Designated Router (ID) 192.168.3.1, Interface address 192.168.1.3
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:00
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 192.168.3.1 (Backup Designated Router)
Adjacent with neighbor 192.168.2.1
Suppress hello for 0 neighbor(s)

In our example above, Router R2 has Router ID of 192.168.12.2 which is the highest Router ID in the Multi-Access network (BROADCAST type), thus R2 will be elected as the DR in OSPF. Moreover, the BDR has Router ID of 192.168.3.1.

R3#show ip ospf neighbor

Neighbor ID    Pri       State                Dead Time     Address             Interface

192.168.3.1       1          FULL/BDR      00:00:36           192.168.1.3 GigabitEthernet0/0
192.168.12.2     1          FULL/DR        00:00:36           192.168.1.1 GigabitEthernet0/0

The above shows the OSPF neighbors of R3. This router has established FULL OSPF relationships with the BDR Router (192.168.3.1) and with the DR Router (192.168.12.2).

MORE READING:  The Protocol of the Internet - eBGP and iBGP Tutorial and Configuration

R4#show ip ospf neighbor

Neighbor ID    Pri       State                Dead Time     Address             Interface

192.168.2.1       1    FULL/DROTHER 00:00:36           192.168.1.2 GigabitEthernet0/0
192.168.12.2     1          FULL/DR        00:00:36           192.168.1.1 GigabitEthernet0/0

The above shows the OSPF neighbors of R4. This router has established FULL OSPF relationships with router 192.168.2.1 that is not a DR/BDR (DROTHER) and with the DR Router (192.168.12.2).

Configure OSPF Priority and Router ID for DR Election

Let’s now see how to influence the DR election by changing either the OSPF Priority or the Router ID:

As seen in the previous section, Router R2 is elected as the DR because it has the highest Router-ID (192.168.12.2) and since OSPF priority is by default 1 on all routers, this means that R2 will be the DR.

We can influence the DR election by using two methods (as explained above):

1) Configure a higher Router-ID than any other router in the network.

2) Configure OSPF priority bigger than 1 (the default).

We will select R3 to become the new DR elected router by changing the above parameters.

Change DR Election with Router-ID

Let’s modify the Router-ID on R3 to make it bigger:

R3#conf t
R3(config)#router ospf 1
R3(config-router)#router-id 192.168.255.1

Reload or use “clear ip ospf process” command, for this to take effect
R3(config-router)#end

R3#clear ip ospf process

Reset ALL OSPF processes? [no]: yes

After setting the Router-ID of R3 (as 192.168.255.1), you will get a message that you need to reload all routers or run the command “clear ip ospf process” for this to take effect. This new Router-ID is the highest IP number in the whole network, therefore R3 will become the new DR.

Let’s now see which router is the new DR:

R3#show ip ospf interface gigabitEthernet 0/0

GigabitEthernet0/0 is up, line protocol is up
Internet address is 192.168.1.2/24, Area 0
Process ID 1, Router ID 192.168.255.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 192.168.255.1, Interface address 192.168.1.2
Backup Designated Router (ID) 192.168.3.1, Interface address 192.168.1.3
From above, you can see that R3 has been elected as the new DR router.

R2#show ip ospf neighbor

Neighbor ID   Pri       State              Dead Time     Address             Interface

192.168.255.1   1          FULL/DR        00:00:38           192.168.1.2 GigabitEthernet0/0
192.168.3.1       1          FULL/BDR      00:00:39           192.168.1.3 GigabitEthernet0/0
192.168.12.1     0          FULL/ –            00:00:38           192.168.12.1 Serial0/0/0

Now, looking from router R2 perspective above, you can see that the new DR router has Neighbor ID (Router-ID) of 192.168.255.1 which is the one configured on Router R3.

Change DR Election using OSPF priority

Let’s now see how to influence DR election by increasing the OSPF priority on the interface of R3. We will change the OSPF priority on interface GigEthernet0/0 which is the one connected to the multi-access network.

First, let’s remove the Router-ID from R3:

R3#conf t
R3(config)#router ospf 1
R3(config-router)#no router-id 192.168.255.1
R3(config-router)#end
R3#wr
R3#reload

Note: It is better to reload all other routers as well.

If you run “show ip ospf neighbor” on R3 you will see that the DR now is again router R2 as before.

Now, let’s configure an OSPF priority on R3 which must be higher than 1 (the default):

R3#conf t
R3(config)#interface GigabitEthernet0/0
R3(config-if)#ip ospf priority 10
R3(config-if)#end

R3#clear ip ospf process

Let’s verify again which is the new DR router:

R2#show ip ospf neighbor

Neighbor ID   Pri       State              Dead Time     Address             Interface

192.168.3.1       1          FULL/BDR       00:00:39           192.168.1.3   GigabitEthernet0/0
192.168.2.1       10         FULL/DR        00:00:33           192.168.1.2   GigabitEthernet0/0
192.168.12.1     0         FULL/ –            00:00:30           192.168.12.1 Serial0/0/0

From Router R2, you can see that the DR is now R3 (192.168.2.1) with a Priority (Pri) of 10.

Related Posts

  • How to Configure a Loopback Interface on Cisco Router & Switch
  • Comparison of Static vs Dynamic Routing in TCP/IP Networks
  • How to Configure Port Forwarding on Cisco Router (With Examples)
  • Adjusting MSS and MTU on Cisco 800 routers for PPPoE over DSL
  • The Most Important Cisco Show Commands You Must Know (Cheat Sheet)

Filed Under: Cisco Routers

Download Free Cisco Commands Cheat Sheets

Enter your Email below to Download our Free Cisco Commands Cheat Sheets for Routers, Switches and ASA Firewalls.

We use Elastic Email as our marketing automation service. By submitting this form, you agree that the information you provide will be transferred to Elastic Email for processing in accordance with their Terms of Use and Privacy Policy. Also, you allow me to send you informational and marketing emails from time-to-time.

About Harris Andrea

Harris Andrea is an Engineer with more than two decades of professional experience in the fields of TCP/IP Networks, Information Security and I.T. Over the years he has acquired several professional certifications such as CCNA, CCNP, CEH, ECSA etc.

He is a self-published author of two books ("Cisco ASA Firewall Fundamentals" and "Cisco VPN Configuration Guide") which are available at Amazon and on this website as well.

Comments

  1. Deepak Kumar says

    May 26, 2021 at 2:15 am

    Hello Harris,
    Nice article but there are fundamentals mistakes in the technical background. DR and BDR election does not only depend on the Router ID or Priority but also depends on which router is started process first. It is no preemptive. What is the role of the Hold timer in it? When this will be elected? Why is it required etc. I have a lot more topic on it.

  2. Harris Andrea says

    May 26, 2021 at 6:40 am

    Deepak, thanks for the feedback. You are right, there are many little details in OSPF in general, however for the general purpose of this tutorial and for the CCNA exam I believe it is not necessary to know all these little details.

    Thanks again for your feedback.

    Harris

  3. Abhishek Mohapatra says

    June 2, 2021 at 2:41 pm

    Hi Harris,
    Nice explaination.but I have one question that someone asked me in interview. When u power on all the devices in broadcast network who will elected first dr or bdr. The ans is bdr , how . Please suggest.

  4. Harris Andrea says

    June 2, 2021 at 3:45 pm

    Abhishek, the BDR is elected first when all routers are powered on. This is according to the RFC, see section 9.4 (https://datatracker.ietf.org/doc/html/rfc2328#page-75)

    “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.”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search this site

About Networks Training

We Provide Technical Tutorials and Configuration Examples about TCP/IP Networks with focus on Cisco Products and Technologies. This blog entails my own thoughts and ideas, which may not represent the thoughts of Cisco Systems Inc. This blog is NOT affiliated or endorsed by Cisco Systems Inc. All product names, logos and artwork are copyrights/trademarks of their respective owners.

Amazon Disclosure

As an Amazon Associate I earn from qualifying purchases.
Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.

Search

BLOGROLL

Tech21Century
Firewall.cx

Copyright © 2023 | Privacy Policy | Terms and Conditions | Hire Me | Contact | Amazon Disclaimer | Delivery Policy

0 shares