cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7370
Views
10
Helpful
13
Replies

OSPF DR/BDR Election

NBenat
Level 1
Level 1

I have 2 routers R1and R3: R1 G0/1 connected to R3 G0/0, both routers run OSPF, broadcast network type (on both), the priority is left at default 1 on both routers for that link. R1 router ID is 1.1.1.1 and R3 is 3.3.3.3. The question is: why is R1 the DR and R3 the BDR? Thanks in advance.

R1#sh ip ospf int g0/1
GigabitEthernet0/1 is up, line protocol is up
Internet Address 10.1.1.14/30, Area 0, Attached via Interface Enable
Process ID 10, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 10.1.1.14
Backup Designated router (ID) 3.3.3.3, Interface address 10.1.1.13

R3#sh ip ospf int g0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.1.1.13/30, Area 0, Attached via Interface Enable
Process ID 10, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 10.1.1.14
Backup Designated router (ID) 3.3.3.3, Interface address 10.1.1.13

1 Accepted Solution

Accepted Solutions

Martin L
VIP
VIP

 

because R1 came up first, or ospf started before R3, and ospf election is not preemptive.  you must clear ip ospf process to reflect changes or after editing anything related to router id. Sometimes even clearing process does not changes anything; reboot does.

also there is a Wait timer for that purpose. if you reboot them now, they will do election and R3 will win.  Wait timer prevents battle of routers to win election.  

I think at very beginning during Wait timer period, BDRs are elected first, then "highest" IP of those will be DR (is promoted to DR) while other one stays as BDR. Once DR fails, BDR becomes DR but when original DR comes back, it is not DR.

And, yes, priority matters, higher is better, and priority is preferred over router id.  if you add another router with better ID, there is no re-election or any DR/BDR changes; new router will be BDR until they all reboot or you clear ospf process.

Where you do clear ospf process matters as well.

Finally, loopback interface are preferred over regular interfaces even if it has lower IP.  But Highest IP among loopbacks becomes router id.

 

Regards, ML
**Please Rate All Helpful Responses **

View solution in original post

13 Replies 13

Martin L
VIP
VIP

 

because R1 came up first, or ospf started before R3, and ospf election is not preemptive.  you must clear ip ospf process to reflect changes or after editing anything related to router id. Sometimes even clearing process does not changes anything; reboot does.

also there is a Wait timer for that purpose. if you reboot them now, they will do election and R3 will win.  Wait timer prevents battle of routers to win election.  

I think at very beginning during Wait timer period, BDRs are elected first, then "highest" IP of those will be DR (is promoted to DR) while other one stays as BDR. Once DR fails, BDR becomes DR but when original DR comes back, it is not DR.

And, yes, priority matters, higher is better, and priority is preferred over router id.  if you add another router with better ID, there is no re-election or any DR/BDR changes; new router will be BDR until they all reboot or you clear ospf process.

Where you do clear ospf process matters as well.

Finally, loopback interface are preferred over regular interfaces even if it has lower IP.  But Highest IP among loopbacks becomes router id.

 

Regards, ML
**Please Rate All Helpful Responses **

Hi Martin,

Thank you for your reply. I left everything at their default values except router IDs. I did clear the OSPF process on both routers, R3 went back to a BDR state. I understand that the BDR is elected first. I'm not sure yet what the Wait timer does and its impact on the DR/BDR election. According to almost all literature, R3, because of its higher router ID than R1, should become the DR and R1, the BDR.

 

is this a simulator like PT, GNS3 or real ios?  if real ios, reboot them, then try.  maybe there is a bug in ios.  What is ios version?  BDR is elected first only in case when there are no DR/BDR at all.  Clear ospf process on DR then should promote BDR to DR.

I would not worry too much about; if you study for exam, just remember the rules from the book.

 

Regards, ML
**Please Rate All Helpful Responses **

I would like to be sure that I am understanding this correctly. When you clear the OSPF process on R1 the result is that R1 is still the DR and R3 is still BDR? Certainly the expected behavior is that if you clear the OSPF process on R1 that the BDR (R3) should become the DR.

 

The suggestion that this might be an emulator is an interesting possibility. The behavior suggests that the DR/BDR election may be based on IP address (where R1 is higher and R3 lower) rather than based on Router ID (where R3 is higher and R1 is lower). I can believe that an emulator might do this. I would be very surprised if real hardware did this.

HTH

Rick

 

I forgot to mentioned that you must reboot router sometimes to reflect ospf config changes and force proper ospf election.  Reading other topic -link below- and seeing log message "Remember old DR", It just came back to me.  I have to check my notes for exact details but I think this happens in a case when interface used as router id goes down. Clearing ospf process does not help. Reboot does.

did you by any chance remove interface that was used as ospf router id ?  

 

https://community.cisco.com/t5/routing/ospf-neighborship-keeps-dropping-and-reforming/m-p/4402897#M350720

 

Regards, ML
**Please Rate All Helpful Responses **

Hi,

Both routers have same Interface address...?
Best regards.

Ciro Gustavo Mele.

 

The BDR is elected first

A list of neighbors on the multiaccess network is established that are eligible for being DR/BDR (their priority is higher than zero)

The router with the highest OSPF priority will become a DR. By default, all routers have a priority of 1.

The Router with the highest priority/RID/loopback/address to be the DR

Ciro Gustavo Mele

Hi Ciro,

 

Thank you foor your reply. Unless I missed it, I don't hink I have any duplicate interface address

 

R1#sh ip int b | in up
FastEthernet0/0 10.1.1.14 YES NVRAM up up
Loopback1 100.100.100.100 YES manual up up
R1#
R1#
R1#sh ip os int f0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 10.1.1.14/30, Area 0, Attached via Network Statement
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 10.1.1.14
Backup Designated router (ID) 3.3.3.3, Interface address 10.1.1.13
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:02
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
R1#

 

Hello
Looks like R3 came up after the initial DR/DBR election or its ospf process was cleared thus making R1 the DR.

Quite positive if you clear R1 ospf process or both rtrs then R3 would become the DR given its highest RID


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Thank you Paul for your reply, I did clear the ospf process on both routers but R3 went back to a BDR state and R1 went back to DR. I did not pay attention to the order, I will try to clear first R1then R3 and vice versa to see if I get a change. I will update if there is an impact.

mohAmed khAdr
Level 1
Level 1

In a prod network, always force whatever area 0 router(s) to be DR by adding higher cost and priority on the interfaces connected to other routers. This way you will never have any issues as far as traffic flow goes.

HTH

mohamed

Review Cisco Networking products for a $25 gift card