cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
616
Views
0
Helpful
2
Replies

ospf DR selection

willowklan1
Level 1
Level 1

Hi everyone, 

I got a question that might seem a bit lame, but I`m really confused: 

as far as I know, the process of electing a DR is: highest priority, highest RID, highest loopback address and highest IP address from all the interfaces. 

configuring one network worked fine, but when trying to configure the other one, the DR that was selected was the one with the LOWEST RID (they all got the same priority). 

as this things goes, it happens also to be the router with the LOWEST IP address (which doesn`t matter because it first checks the RID, but thought it`s worth mentioning).

the layout is pretty simple: a switch with four routers connected to it

90.0.0.1 

RID: 7.7.7.7

ׂ(that one got selected to be the DR)

90.0.0.2

RID: 8.8.8.8

90.0.0.3

RID: 9.9.9.9

90.0.0.4

RID: 10.10.10.10

another thing I noticed is that the router which got to be the DR (90.0.0.1) is also connected to an ABR via serial connection. can that be the case it was selected as a DR? 

added an image of the show ip ospf interface command from the router that should have been elected. notice it got a DROTHER while 7.7.7.7 was elected as DR and 8.8.8.8 was elected for BDR (which is also wrong). 

2 Replies 2

Peter Paluch
Cisco Employee
Cisco Employee

Hi,

The DR election process in OSPF is rather cumbersome, and it works according to the common textbooks explanation only if the elections occur during the same time window - specifically, the first 40 seconds (or less) after a router has come up on a multi-access network and has found out that the DR and BDR are not elected yet.

On switches, there is a hidden caveat in that all switches running STP will keep their ports blocked for 30 seconds before becoming forwarding. This means that even if you start your routers at the same time on the switch, out of the 40 seconds DR/BDR election period, the first 30 seconds are shaven off thanks to STP, and because OSPF Hello packets are sent in intervals of 10 seconds, it is easy to see that during the last 10 seconds, there is a chance that at least one of the neighbors won't send its Hello packet soon enough to still be a member of the elections. Thus, the elections often end up somewhat skewed.

If you want to really test this then this is what I suggest: Have your routers connected to the switch up and running, and then on the switch, issue these commands:

interface range fa0/1 - 4
spanning-tree portfast
shutdown
! Wait 5 to 10 seconds
no shutdown

Here, I am assuming that the four routers are connected to interfaces Fa0/1  through Fa0/4. First, you configure these ports as PortFast ports, meaning that they will become forwarding as soon as they come up. Then you shut them all down simultaneously, allow routers to detect the link down event, and after that, you again start the interfaces all at the same time. This should allow your routers to see each other at the same time, and the DR/BDR elections should now take place according to the usual rules: The highest priority is DR, the second highest priority is BDR, and whenever the priority is the same, use the higher RID to break the ties.

Best regards,
Peter

Hi Peter,

Thanks, that is a great time-syncing idea, but I`d rather not configure a portfast on a router, only on clients (old habits and all...)

anyhow, the thing I forgot to do is simply clear ip opsf process on all the routers on the segment. that fixed the problem cause it synced the router`s time to one another.

thanks again mate.