In the previous blog post, we looked at a few fundamental OSPF concepts, including neighbor and adjacency formation. As we continue through the basics of OSPF, this post will examine router roles, timers, and metric calculation.
Designated Router (DR) and Backup Designated Router (BDR)
A designated router (DR) is the router interface that wins an election among all routers on a multiaccess network segment such as Ethernet. A backup designated router (BDR) is the router that becomes the designated router if the current designated router has a failure on the network. The BDR is the OSPF router with the second highest priority at the time of the last election. OSPF uses the DR and BDR concept to assist with efficiencies in the operations of OSPF.
Keep in mind that a given OSPF speaker in your network can have some interfaces that are designated and others that are backup designated, and others that are non-designated. If no router is a DR or a BDR on a given subnet, the BDR is first elected, and then a second election is held for the DR.
What are the criteria for the DR election process? The DR is elected based on the following default criteria:
- If the priority setting on an OSPF router is set to 0, it can never become a DR or BDR.
- When a DR fails and the BDR takes over, there is another election to see who becomes the replacement BDR.
- The router sending the Hello packets with the highest priority wins the election.
- If two or more routers tie with the highest priority setting, the router sending the hello with the highest Router ID wins.
- Typically, the router with the second highest priority number becomes the BDR.
- The priority values range between 0 – 255, with a higher value increasing its chances of becoming DR or BDR.
- If a higher priority OSPF router comes online after the election has taken place, it will not become DR or BDR until there is a failure with an existing DR or BDR. We call this non-preemptive in networking.
Remember, all routers in a multiaccess network segment will form an adjacency with the DR and BDR. Every time a router sends an update, it sends it to the DR and BDR on the multicast address 220.127.116.11. The DR will then send the update out to all other routers in the area using the multicast address 18.104.22.168.
Thanks to this process, all routers do not have to constantly update each other and can get all their updates from a single source. Note that the use of multicasting further reduces the network load.
DRs and BDRs are always elected on OSPF broadcast networks as described above. DRs can also be elected on NBMA (Non-Broadcast Multi-Access) networks such as Frame Relay or ATM. DRs or BDRs are not elected on point-to-point links.
Example 1 shows how you can set the priority for the DR election process. This example also shows a sample verification.
Example 1: Setting the Priority of an OSPF Interface
While there are many timer values with OSPF, there are two that are critical for you to understand. The hello timer controls how often the router sends routine messages to its neighbors to indicate its continued health. If the neighbors don’t hear any hello messages for a length of time defined by the dead-interval, they assume that the router is no longer reachable and drop it from the adjacency table.
The default values are:
- 10 seconds for the hello time
- 40 seconds for the dead time
While you can lower the timer values from their defaults, you will generate more traffic on the link. Also realize that if you set the dead time too aggressively small, you could run the risk of declaring a neighbor down when the only true issue on the link was temporary congestion.
Example 2 shows a setting of the OSPF timer values. Keep in mind you would set the timers to match on your neighboring devices as well.
Example 2: Setting the OSPF Timers
Remember, the OSPF metric is the costwhich is based on bandwidth by default. The formula to calculate the cost is reference bandwidth divided by interface bandwidth. OSPF uses a reference bandwidth of 100 Mbps for cost calculation. For example, in the case of Ethernet, it is 100 Mbps / 10 Mbps = 10.
You can change the reference bandwidth for the cost calculation. Be sure to do this for all of your OSPF speakers should you decide to manipulate it. You do this with the ospf auto-cost reference-bandwidth command. Example 3 shows this command in action.
Example 3: Setting the Reference Bandwidth for OSPF
NOTE: You can override the OSPF cost calculation for interfaces by setting the cost directly on the interface. You do this with the ip ospf cost command under the interface.
That’s going to wrap up Part 2 of our OSPF Basic Concepts series. Before we move on to advanced concepts, next time we’ll cover OSPF LSA Types and Area Types in Part 3. Until then, take good care.