Description

This article explains the OSPF DR Election process 

Symptoms

Customer Reported the device with lower OSPF Priority is becoming DR .Please refer below for more details 

 

Customer Topology :

L3 Switch 1.............>>L2 Switch ..........>>>L3 Switch 2

                                    I

                             L3 Switch 3 

Switch 1 OSPF Priority is 128 and Router ID is 1.1.1.1
Switch 2 OSPF Priority is 128 and Router ID is 2.2.2.2
Switch 3 OSPF Priority is 1 and Router ID is 3.3.3.3

 

The expected  Output:

SW1 and SW2 should be in DR/BDR Role .SW3 in DROther Role as like below output 

labroot@sw1> show ospf neighbor detail          

Address         Interface             State          ID              Pri Dead

192.168.20.2    ge-0/0/0.0            Full           2.2.2.2         128   34

 Area 0.0.0.0, opt 0x52, DR 192.168.20.2, BDR 192.168.20.1

 Up 00:04:30, adjacent 00:04:30

192.168.20.3    ge-0/0/0.0            Full           3.3.3.3           1   39

 Area 0.0.0.0, opt 0x52, DR 192.168.20.2, BDR 192.168.20.1

 Up 00:04:30, adjacent 00:04:20

 

labroot@sw2> show ospf neighbor detail   

Address         Interface             State    ID              Pri Dead

192.168.20.1    ge-0/0/1.0            Full     1.1.1.1         128   33

 Area 0.0.0.0, opt 0x52, DR 192.168.20.2, BDR 192.168.20.1

 Up 00:05:03, adjacent 00:05:03

192.168.20.3    ge-0/0/1.0            Full     3.3.3.3           1   33

 Area 0.0.0.0, opt 0x52, DR 192.168.20.2, BDR 192.168.20.1

 Up 00:06:32, adjacent 00:05:53

 

labroot@sw3> show ospf neighbor detail           

Address         Interface             State          ID              Pri Dead

192.168.20.1    xe-0/0/0.0            Full           1.1.1.1         128   39

 Area 0.0.0.0, opt 0x52, DR 192.168.20.2, BDR 192.168.20.1

 Up 00:05:15, adjacent 00:05:05

192.168.20.2    xe-0/0/0.0            Full           2.2.2.2         128   31

 Area 0.0.0.0, opt 0x52, DR 192.168.20.2, BDR 192.168.20.1

 Up 00:06:44, adjacent 00:06:05

 

 

    Customer Output

    Instead of SW1 and SW2 the switch3 with lower priority (Priority 1) has become DR as below 

    labroot@sw1> show ospf neighbor detail

    Address         Interface             State          ID              Pri Dead

    192.168.20.3    ge-0/0/0.0            Full           3.3.3.3           1   34

     Area 0.0.0.0, opt 0x52, DR 192.168.20.3, BDR 192.168.20.2

     Up 00:06:09, adjacent 00:06:00

    192.168.20.2    ge-0/0/0.0            Full           2.2.2.2         128   35

     Area 0.0.0.0, opt 0x52, DR 192.168.20.3, BDR 192.168.20.2

     Up 00:06:09, adjacent 00:06:09

     

    labroot@sw2> show ospf neighbor detail

    Address         Interface             State    ID              Pri Dead

    192.168.20.1    ge-0/0/1.0            Full     1.1.1.1         128   30

     Area 0.0.0.0, opt 0x52, DR 192.168.20.3, BDR 192.168.20.2

     Up 00:06:02, adjacent 00:06:02

    192.168.20.3    ge-0/0/1.0            Full     3.3.3.3           1   30

     Area 0.0.0.0, opt 0x52, DR 192.168.20.3, BDR 192.168.20.2

     Up 00:07:26, adjacent 00:07:26

     

    labroot@sw3> show ospf neighbor detail   

    Address         Interface             State          ID              Pri Dead

    192.168.20.1    xe-0/0/0.0            Full           1.1.1.1         128   35

     Area 0.0.0.0, opt 0x52, DR 192.168.20.3, BDR 192.168.20.2

     Up 00:01:58, adjacent 00:01:49

    192.168.20.2    xe-0/0/0.0            Full           2.2.2.2         128   36

     Area 0.0.0.0, opt 0x52, DR 192.168.20.3, BDR 192.168.20.2

     Up 00:03:21, adjacent 00:03:21


     

    Solution

    Reason for the Customer observation where SW3 is DR (SW3 has lower OSPF priority 1)
    • Initially SW1 was DR , SW2 was BDR and SW3 was DROther
    • In customer setup both DR[SW1] and BDRSW2] went down at the same time. As a result SW3 which was DROther with priority 1 became DR, and the SW3 was retaining the DR role even after older DR and BDR(SW1 and SW2)came up 
    • As the OSPF DR election process is non-preemptive, the above behaviour is expected .
    • There are no new DR/BDR elections held every time a new OSPF router joins the OSPF Domain late.
    • Preemption would be disruptive to the data-plane and cause SPF calculation overhead so OSPF DR election is kept as non-preemptive


    The above seen customer behaviour is expected ,If it is required to make higher priority switch to become DR/BDR, clear the OSPF neighbor sessions as below 

     clear (ospf | ospf3) neighbor
    
    

    After clearing Customer OSPF neighbor sessions, SW1 and SW2 took DR/BDR Role and SW3 with lower priority become DROther

    labroot@sw3> show ospf neighbor detail   

    Address         Interface             State          ID              Pri Dead

    192.168.20.2    xe-0/0/0.0            Full           2.2.2.2         128   34

     Area 0.0.0.0, opt 0x52, DR 192.168.20.2, BDR 192.168.20.1

     Up 00:00:06, adjacent 00:00:02

       Link state retransmission list: 1 entries

     

    192.168.20.1    xe-0/0/0.0            Full           1.1.1.1         128   34

     Area 0.0.0.0, opt 0x52, DR 192.168.20.2, BDR 192.168.20.1

     Up 00:00:06, adjacent 00:00:06

       Link state retransmission list: 1 entries


     

    Modification History

    2023-09-06: Initial version