Wednesday, July 17, 2013

OSPF DR Configuration


Pic. 1 - Topology Diagram.

Task 1
Configure R3 to be the DR and R4 to be BDR in Vlan 100. Do not shut down any interface, reload any of the devices or clear OSPF process on any device to accomplish this.

Questions
Try to answer the following questions:
  1. What is the role of DR/BDR in the broadcast and NBMA networks?
  2. What are the pre-requisites to make a router eligible to become DR/BDR?
  3. What is the order of operations when it comes to DR/BDR election?
  4. In the previous lab we have configured R1 to be elected the DR in the Frame-Relay hub-ans-spoke network. We made sure that neither of the spokes became the BDR. Can you explain why?
Study Drill

Before we start the configuration, let's see what the current state of things regarding DR/BDR in Vlan 100 is. Do not worry if your output is different. Take a look at pic. 2.


Pic. 2.


Here's an interesting question for you: based on what Pic.2 represents, would you be able to tell which device is the DR and which is the BDR in Vlan 100 (FastEthernet0/0 interface)?

Stop reading now, and give it a shot! If you can't answer the questions, read on!

OSPF neighbor output on R6 (id=10.0.6.6) has three neighbors in Vlan 100:

  1. 10.0.3.3 (R3) is DROTHER.
  2. 10.0.4.4 (R4) is DROTHER.
  3. 10.0.7.7 (SW1) is BDR.
Most likely, R6 who's the neighbor of all of them is the DR in Vlan 100. In order to support this hypothesis, let's prove it it in two different ways:

Pic. 3.

Clearly, OSPF neighbor output on R3 confirms that R6 (10.0.6.6) is the DR. You can also check the status of OSFP interface on R6, like shown below:


Pic. 4.

The 5th line of the output says: State DR.

Now, recall that the purpose of DR/BDR roles in broadcast and NBMA network is to reduce the number of LSA exchanges. The exchanges must happen between all neighbors in FULL state. In the aforementioned networks, FULL adjacency is built only with DR/BDR, so DR becomes the only representative to send update on behalf of other routers. Both DR, and its sidekick, BDR must have layer 2 connectivity to all OSPF enabled routers in the same broadcast/NBMA network. If the routers are in the same Vlan this is not a problem. But consider Frame-Relay hub-and-spoke topology in which there is not layer 2 PVC provisioned between spokes. In such situation only the hub router can become DR (has layer 2 connectivity with all other routers) and spokes should never become BDR. We will take a closer look at this after we have solved the problem presented in the task 1.

As for the order of DR/BDR election, the routers follow the order of:

  1. Prefer the highest OSPF priority on the interfce (exchanged in 'hello' packets)
  2. In case of a tie (the same priority), prefer the highest OSPF router ID.

However, the thing to realize is that the DR role does not allow preemption. Once the router is elected DR it will stay as such even if we introduce a router with higher priority later (after the election has been completed). Only its failure or bringing its interface down will result in re-election. This means that election of DR/BDR may be unpredictible at times

Now, let's configure the solution.

Lab Solution

Solution configuration below:
https://docs.google.com/file/d/0BwE5C95tpjZOMVRXRUlXVG9IYVU/edit?usp=sharing

Task 1
Configure R3 to be the DR and R4 to be BDR in Vlan 100.  Do not shut down any interface, reload any of the devices or clear OSPF process on any device to accomplish this.

R3 Config:
!
interface fa0/0
 ip ospf priority 255
!

In my case, R6 is still DR (non preemptive role)


Pic. 5.

Now, in order to create re-election, as per the stipulation, I will make R6, R4 and SW1 temporarily ineligible of becoming DR/BDR by introducing OSPF priority 0 on their respective interfaces, and then after few seconds bringing the default priority of 1 on them.

R4 Config:
!
interface f0/1.100
 ip ospf priority 0
!

R6
!
interface f0/0
 ip ospf priority 0
!

SW1 Config:
!
interface vlan 100
 ip ospf priority 0
!

Now, let's put thing back to where they should be.

R4 Config:

interface fa0/1.100
 ip ospf priority 254
!

R6 Config:
!
interface f0/0
 ip ospf priority 1
!

SW1 Config:
!
interface vlan 100
 ip ospf priority 0
!

What You Should See
With this little acrobatics we should complete the task properly. Here's the result:


Pic. 6.


Study Drill
Let's tinker with Frame-Relay network and the problem of just having DR (R1) with no BDR. Let's leave the election of DR/BDR without interfering (all routers have default OSPF priority 1). Shut the interfaces down and bring them back up.

R1, R3, and R4 Config:
!
interface serial0/0
 ip ospf priority 1
!

After the interfaces have been brought up the DR is R4 (10.0.4.4) and BDR is R1 (10.0.1.1). In order to see this just give it a moment. 


Pic. 7.

Let's see how R3 learns 10.0.1.1/32. I have issued: show ip ospf database router 10.0.1.1 (which displays LSA type-1):

Pic. 8.

It is apparent that Stub Network 10.0.1.1/32 has been learned from R1 (Advertising Router: 10.0.1.1). It is easy to predict what is going to happen if I shut the interface serial0/1 on R3. It is going to remove 10.0.1.1/32 from its routing table since the next hop 172.16.13.1 (advertising router 10.0.1.1) is no longer available. 

Pic. 9.


It will still be available on R4 though.

Pic. 10.

Even though R3 could have reached 10.0.1.1 through R1, it does NOT know the second path exists. The reason is, that current DR on Frame-Relay link is R4. This one cannot send LSA about 10.0.1.1/32 towards R3 since it has no layer 2 connectivity withR3!

If you make R1 DR on the Frame-Relay link, R3 can reach 10.0.1.1 through its serial0/0 link). In the picture below, R1 is DR again, the R3's serial0/1 interface is still down (no OSPF neighbor there), but the connectivity to 10.0.1.1 is restored.

Pic. 11.

This little study drill clear proves that in a hub-and-spoke topology, the DR should be the hub router. In order to avoid the situation that the spoke becomes the BDR, they should always be DROTHERs.