OSPF routing protocol network tuning and optimization can be achieved through deliberate OSPF path selection using the OSPF SPF algorithm. The Shortest Path First (SPF) calculations compute the SPT (Shortest Path Tree) to find the shortest path to destinations. The concepts below are utilized in enhancing an OSPF network to perform optimally.
OSPF Link Costs
The router builds the SPT and will build the routing table afterward. The directly connected networks have a cost of 0, and the other networks are reached based on the calculated cost in the SPT.
The total interface cost between the router and the destination is an important part of OSPF SPF calculation since it is the basis of the shortest path metric. The OSPF interface cost can be determined using the following formula:
Cost = Reference Bandwidth/Interface Bandwidth
100 Mbps is the default reference bandwidth, and it can be adjusted to allow for cost differentiation between faster interfaces. Due to the inability to differentiate between low-bandwidth connections, raising the value too high might lead to problems. The interface cost must not exceed 65,535 since the OSPF LSA metric field is 16 bits.
The cost can be manipulated to optimize the OSPF network using the command ‘auto-cost reference-bandwidth <bandwidth>’ under the OSPF process. It sets the reference bandwidth for all OSPF interfaces associated with that process. It is best practice to configure the same reference bandwidth for all OSPF routers to avoid routing loops. The OSPF cost can be manually configured using the ‘ip ospf cost <1–65535>’ command under the interface configuration mode.
OSPF hello IP packets ensure that your neighbors are still active and working. By default, the OSPF dead interval timer is four times the hello timer. The OSPF dead timer resets to its starting value after receiving a hello packet from a nearby router and then decreases once more.
The neighbor state will be set to ‘down’ if the OSPF router does not get a hello packet before the dead interval timer hits 0. Then, the router sends the appropriate LSA to reflect the network topology change, and the SPF algorithm processes it on all OSPF routers in the area.
The hello and dead timer intervals can have a value of 1 to 65,535 seconds. Therefore, changing the hello timer interval will also change the default dead interval. The ‘ip ospf hello-interval <value>’ command is entered under the interface configuration mode to configure the hello dead timer interval. The command ‘ip ospf dead-interval <value>’ is used for the dead interval timer value.
DR and BDR Roles
The host routers’ CPU and memory are utilized by the DR and BDR roles for a broadcast network to maintain states with all the other routers in a particular segment. It is best practice to assign the DR and BDR roles to routers with sufficient resources.
The DR and BDR election happens during the last phase of the 2-Way state of the OSPF neighbor process. When a router joins a network, it will receive a hello packet from the neighbor that contains a Router ID (RID). If the DR or BDR RID is not 0.0.0.0, the router considers the neighbor router the DR or BDR.
The hello packet from the neighbor also includes the OSPF priority. A router interface can have a priority between 0 to 255. A priority of 0 means it will never be elected as the DR or BDR. The default priority is 1 in all OSPF interfaces, and 255 is the highest and most favorable priority.
Changing the router RID to influence the DR placement is not a good practice. Instead, a more effective method is setting the interface OSPF priority higher than the current DR’s OSPF priority.
The command to configure the OSPF interface priority is ‘ip ospf priority <value>’, entered under the interface configuration mode. The OSPF process must be restarted on the current DR or BDR for the configurations to happen since the DR or BDR roles are not pre-empted automatically. The OSPF process can be restarted using the ‘clear ip ospf process’ under the privileged exec mode.
Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.
We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: