EIGRP and OSPF Metric Calculation – Path Calculation Methods
Metric calculation is a critical component for any routing protocol. OSPF metric calculation is used to find the shortest path by using cost as a metric and determining the cost of paths to know the best path to the destination. Before understanding the OSPF and EIGRP Metric calculation, you need to know that: The automatic and dynamic exchange of routing information between routers is made possible by the use of routing protocols. Numerous routing protocols exist, each with its own set of advantages and disadvantages due to being tailored to perform best in a certain kind of network deployment. Open Shortest Path First (OSPF) and Enhanced Interior Gateway Routing Protocol (EIGRP) are two of the most widely deployed routing protocols. In this article, we’ll explain and comprehend the two best-path-calculating routing protocols. To learn more about these protocols, you can take part in our OSPF BGP Training. OSPF stands for Open Shortest Path First, is a dynamic routing protocol commonly used in large-scale networks, such as the internet or enterprise networks. It is an interior gateway protocol (IGP) designed to determine the most efficient routes for IP packet forwarding within a network. OSPF Protocol operates by exchanging link-state advertisements (LSAs) between routers to build and maintain a topology database of the network. Each router uses this database to calculate the shortest path to reach a destination network, taking into account factors like link costs and network congestion. As we know, OSPF is a link state protocol, so the router learns all the paths and their costs to the destination and selects the routes with the lowest costs to the destination. This is known as OSPF Metric calculation. Metric – It is a parameter that OSPF uses to choose its best path. OSPF metrics are calculated using a cost-based algorithm. For any given interface, the cost is always inversely proportional to the bandwidth. So, the path with the lowest cost will be the best path for OSPF. Now, as we know, OSPF utilizes link-state advertisements for network destinations, and it is known as a link-state routing protocol. For this reason, the (shortest path first) SPF algorithm is used for routing calculations based on link-state information. With OSPF, all routers share metrics and link-state information about their connected interfaces with each other. Let’s move on to know more about the shortest-path-first algorithm. Specifically, OSPF employs a (shortest-path-first) SPF algorithm to determine and construct the shortest route to all known destinations. We hope you have a good overview of the SPF Algorithm. Let’s understand the OSPF cost formula now. The formula used by OSPF to determine cost is as follows: Cost = Reference bandwidth/Interface bandwidth In OSPF’s documentation (RFC 2338), reference bandwidth was given a completely random number. Each manufacturer must determine its reference bandwidth. When referring to bandwidth, Cisco uses 100 Mbps (108) as reference bandwidth. With this, the equation would be: Some of the key points to follow while calculating cost is discussed below. Key points – Now that we have the formula let’s perform the arithmetic and get the base cost of the necessary interfaces. Default cost of essential interfaces. The image below shows the default OSPF Cost values for various interface bandwidths. #show ip ospf interface fa0/0 | include cost Router(config)#Router ospf 1 Router(config)#auto-cost reference-bandwidth 10000 (in Mbps) #Show ip ospf | include reference #Show ip ospf interface fa0/0 | include BW This is everything you need to learn about OSPF Metric Calculation. Moving on to the EIGRP Section. EIGRP stands for Enhanced Interior Gateway Routing Protocol. It is a dynamic routing protocol developed by Cisco Systems and is primarily used in enterprise networks offering advanced features for efficient and scalable routing. EIGRP is a hybrid routing protocol that incorporates elements of both distance vector and link-state protocols. It uses the Diffusing Update Algorithm (DUAL) to calculate the shortest path to a destination network and maintain a routing table. In EIGRP, K-Values are parameters that determine how different network characteristics contribute to the overall metric calculation. There are 5 K-Values used by EIGRP to weigh various factors while calculating metric. These K-Values allow network admins to customize the metric calculation according to the specific network requirements. Here is the explanation of these 5 K-Values – Network admins can change the values and prioritize the K-values as per needs when calculating metric. It’s important to note that the default values for the K-values in EIGRP are 1 for K1, K3, K5, and 0 for K2 and K4. However, these values can be modified to suit specific network requirements. Just like OSPF, EIGRP also has a metric calculation. The Metric of EIGRP depends on five parameters which are considered as K-Values as discussed above. These parameters are: So, EIGRP uses these five factors (Bandwidth, Delay, Reliability, Load, and MTU) to calculate its metric, i.e., cost. CISCO technically calls these five factors K Values which are represented as shown in the image below – Because load and reliability are dynamic variables, EIGRP’s default metric calculation values are (K1 & K3). However, the EIGRP procedure will become a more over-headed protocol if these values are constantly updated. You should also check out – OSPF vs EIGRP Formula used for EIGRP Metric = (10^7/BW + Delay/10)} *256 Now that we have learned about EIGRP Metric Calculation, it is time to under the EIGRP dual-diffused update algorithm. The default K-values for the route’s EIGRP metric calculation algorithm are K1 and K3, which should always be 1, and K2, K4, and K5, which should always be 0. The IGRP metric formula is used to create the EIGRP formula, which is then multiplied by 256 to increase the calculation’s precision from 24 to 32 bits. When we calculate the above equation with default K-Values, we will get the EIGRP Metric Formula. DUAL Algorithm uses four parameters – The Feasibility Condition states that a route will not be accepted if the Reported Distance exceeds the best path’s Feasible Distance. The 5 metrics used by EIGRP to calculate the route are also known as composite metrics or components of the EIGRP metric. These are Bandwidth, Delay, Reliability, Load and MTU (Maximum Transmission Unit). Yes, in EIGRP, a lower metric is considered better. The metric in EIGRP represents the overall cost or desirability of a route. When multiple paths are available to reach a destination, EIGRP selects the path with the lowest metric as the best route. K-Values in EIGRP are parameters used to determine the importance or weight of different network characteristics when calculating the overall metric for a route. EIGRP uses 5 K-Values from K1 to K5. The Hop count in EIGRP refers to the number of routers or network segments that a packet must traverse to reach its destination. However, it’s important to note that hop count is not the primary metric used by EIGRP for route selection. Now, we have discussed both EIGRP and OSPF Metric Calculation. Open Shortest Path First (OSPF) and the extended Interior Gateway Routing Protocol (EIGRP) are two of the most widely deployed IGPs today. Both are commonly used in various business networks and have shown to be stable and reliable options throughout the years. The OSPF metric calculation depends on a metric known as cost; the lower the cost, the more suitable path will be. At the same time, EIGRP Metric Calculation is dependent on five factors.Introduction
About OSPF
OSPF Metric Calculation
SPF Algorithm
OSPF Cost Formula
Cost = 108/interface bandwidth in bps
Interface type Bandwidth Metric Calculation Cost Serial Link 1544Kbps 100000000/1544000 = 64.76 64 Ethernet Link 10Mbps 100000000/10000000 = 10 10 FastEthernet Link 100Mbps 100000000/100000000 = 1 1 How to check the cost of a link?
How to change the reference bandwidth?
How to check reference bandwidth?
How to check the bandwidth of a link?
About EIGRP
What are EIGRP K-Values?
EIGRP Metric Calculation
EIGRP Metric calculation formula
EIGRP Classic Metric Formula with Default K-values
EIGRP DUAL–DIFFUSED UPDATE ALGORITHM
Frequently Asked Questions
Q1. What are the 5 metrics used by EIGRP to calculate the route?
Q2. Is lower metric better for EIGRP?
Q3. What is K value in EIGRP?
Q4. What is the hop count for EIGRP?
Conclusion