Thursday, 21 January 2016

DR BDR Election explained.

Click Figure to Enlarge.  

DR/BDR election is per multi access segment.

Look at the figure.There are three segments.

Segment 1 is the Green one.
This contains interfaces g0/0 ,g0/1 on Router 0
and interfaces g0/0 ,g0/1 on Router 1.

Segment 2 is the Purple one.
This contains interfaces g0/0 ,g0/1 on Router 1
and interfaces g0/0  , g0/1 on Router 2.

Segment 3 is the Blue one.
This contains interfaces g0/0 ,g0/1 on Router 2
and interfaces g0/0 , g0/1 on Router 0.

Now I ran show ip ospf neighbor on all the Routers.

Router1#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.3.1       1   FULL/DR         00:00:31    192.168.1.1     GigabitEthernet0/0
192.168.3.2       1   FULL/DR         00:00:37    192.168.2.2     GigabitEthernet0/1
Router#

Router2#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.1       1   FULL/BDR        00:00:31    192.168.2.1     GigabitEthernet0/0
192.168.3.1       1   FULL/BDR        00:00:31    192.168.3.1     GigabitEthernet0/1


Router0#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.1       1   FULL/BDR        00:00:39    192.168.1.2     GigabitEthernet0/0
192.168.3.2       1   FULL/DR         00:00:35    192.168.3.2     GigabitEthernet0/1

This is the output.

Note show ip ospf neighbor  shows the router-id of 
neighbouring routers.
 router-id is assigned/selected as follows:
1.Manually using router-id command , if not than
2.The highest ip of a loopback interface ,if not than
3.The highest IP of a physical interface .


The command show ip ospf neighbor shows the highest IP on its
neighbouring Routers.And it shows in each segment and I mean
specifically in that segment what state that neighbouring Router
is in DR or BDR.

For example in Router1 on the top it shows in segment 1 which is
the green one that Router0 with associated IP 192.168.3.1 is the
DR as in that segment 192.168.3.1 is the highest IP.


In segment 2 the purple one , Router2 with associated IP 192.168.3.2
is the DR as 192.168.3.2 is the highest IP in that segment.

Next running command on Router2:
This shows its neighbours Router1 and Router0.
Router1 along with Router2 comes in segment 2 and 192.168.2.1
is the BDR . Note there is IP 192.168.2.2 in this segment , but this
is on the same Router as the DR .Cannot have DR and BDR on the
same router.The idea of having a BDR is if the DR goes down.

Again same output of Router2 192.168.3.1  is the BDR as on that
segment which is segment 3 the blue one 192.168.3.1 is the second
highest IP and 192.168.3.2 is the first highest or simply highest IP.
Therefore 192.168.3.2 is the DR and 192.168.3.1 is the BDR.

Next I added a loopback interface on Router1 and the DR/BDR
election process is influenced as the loopback interface takes
precedence.

Output on Router2
Router2#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.10.10     1   FULL/DR      00:00:30   192.168.2.1     GigabitEthernet0/0
192.168.3.1       1   FULL/BDR        00:00:30    192.168.3.1     GigabitEthernet0/1



DR/BDR election is per multi-access segment not per area!.
This is the reason we see multiple  DR's and BDR's.


NOTE:
OSPF sends multicast traffic using a TTL of 1.This can be a issue 
in an Hub and Spoke Network(Frame Relay).Hence in a hub and 
spoke network if Multicast traffic traverses more than one Router 
than the packet TTL is decremented to zero and dropped.
In such cases certain Routers must be configured never to 
become DR/BDR  by setting interface priority to 0.

No comments:

Post a Comment