This tutorial explains what K Values (K1– Bandwidth, K2-Load, K3-Delay, K4-Reliability, and K5-MTU) are and how EIGRP uses them in the composite metric calculation formula.
EIGRP routing protocol calculates the cost of each route. This feature helps EIGRP in selecting the best route for each destination. To calculate the cost of a route, EIGRP uses a composite metric calculation formula. The formula can use five components in the calculation. These components are Bandwidth, Delay, Load, Reliability, and MTU.
By default, the formula uses only Bandwidth and Delay. If you want to include the remaining components in the formula, you have to enable them. In simple words, the formula uses only the enabled components in the calculation and by default, only the Bandwidth and Delay are enabled.
To enable or disable components, the formula uses K-values. K-values are the placeholder or influencer in the formula. When you enable or disable a K-value, the formula adds or removes the component associated with the K-value in the formula.
The following table lists all K-values and their associated components.
K-Value | Component | Description |
K1 | Bandwidth | Lowest bandwidth of the route |
K2 | Load | Worst load on the route based on the packet rate |
K3 | Delay | Cumulative interface delay of the route |
K4 | Reliability | Worst reliability of the route |
K5 | MTU | Smallest MTU in the route [Not used in route calculation] |
Bandwidth (K1)
Bandwidth is the amount of data that can be transferred over a link within a given amount of time. It is a static value. It changes only when you make some physical (layer1) changes in the route such as changing a cable or upgrading a link' type. To know more about the bandwidth, you can check the following tutorial.
Bandwidth Explained through examples
EIGRP picks the lowest bandwidth from all outing going interfaces of the route. Let's take an example. The following image shows a network. In this network, Router0 has two routes: Route1 and Route2 to reach Router5.
EIGRP uses Update messages to share routing information. An EIGRP message includes the value of all metric components. From EIGRP update messages, all EIGRP routers can learn the value of all components for each subnet.
From EIGRP update messages, Router0 can learn the bandwidth of each link on a route. The bandwidths of exit interfaces on Route1 are 72Kbps, 28Kbps, and 28Kbps. EIGRP will pick 28Kbps to calculate the cost of Route1. The bandwidths of the exit interfaces on Route2 are 56Kbps, 56Kbps, and 64Kbps. EIGRP will pick 56Kbps to calculate the cost of Route2.
You may think, why does EIGRP pick the lowest bandwidth instead of the highest bandwidth?
If EIGRP picks the maximum bandwidth of the route, it will get the equivalent or lower bandwidth throughout the route. But if it picks the minimum bandwidth of the route, it will get equivalent or higher bandwidth throughout the route. Picking the lowest bandwidth is the guarantee of equivalent or higher bandwidth throughout the route.
Load (K2)
Load is the volume of traffic passing through the interface in comparison to the maximum capacity. It is expressed on a scale of 255 where 1 represents that an interface is empty and 255 represents that an interface is fully utilized. It is a dynamic value that changes frequently. It is based on the packet rate and bandwidth of the interface.
Since data flows from both directions, the router maintains two separate load counters: -
- Txload for the outgoing traffic
- Rxload for the incoming traffic
If K2 is enabled, the maximum Txload value will be used in the composite metric calculation formula.
Delay (k3)
Delay is the time taken by a packet in crossing the interface. It is measured in fractions of a second and is expressed as tens of microseconds. It is a static value. You can configure this value by using the 'delay' command.
EIGRP uses total delay in the metric calculation formula. Total delay is the sum of the delay received from the neighboring router and the delay configured on the interface. For example, if EIGRP receives a delay value of 1000 from the neighboring router and the value of delay is configured 2000 on the local interface, then the total delay will be 3000 (1000 + 2000).
To view the configured delay on an interface, you can use the 'show interface' command. The output of the 'show interface' command displays the value of all components used in the EIGRP metric calculation formula.
The following image shows an example output of the 'show interface' command.
Reliability (K4)
Reliability is a dynamic value. It compares all successfully received frames against all received frames. 100% reliability indicates that all received frames are good. If the reliability is less than 100%, it indicates that some frames have been received as corrupt.
Reliability is expressed on a scale of 0 to 255. 255 expresses 100% reliability while 0 represents 0% reliability. If K4 is enabled in the metric calculation formula, it will use the minimum reliability.
MTU (K5)
MTU stands for Maximum Transmission Unit. It is advertised with the routing update but does not actively participate in the metric calculation. EIGRP uses it when the number of similar cost paths to the same destination exceeds the number of allowed paths. For example, the maximum allowed paths for the load balancing is 5, and the metric counts 6 identical cost paths to the same destination. In this case, EIGRP ignores the path that has the lowest MTU.
EIGRP supports the load balancing feature. The load balancing feature allows a routing protocol to use more than one path for the same destination. EIGRP can use a maximum of 32 paths for the same destination. By default, it uses only 4 paths for a single destination. You can configure the number of allowed paths by the "maximum-paths" command.
EIGRP Metric Calculation Formula
EIGRP uses five components in the metric calculation formula. If all five components are enabled, it uses the following formula to produce a single 32 bits metric.
As mentioned earlier, by default Load, Reliability, and MTU are disabled. If a component is disabled, EIGRP does not use its value in the formula. If we exclude the disabled components, the above-listed formula changes into the following formula.
Cisco uses following the configuration values for Bandwidth and Delay.
Bandwidth = 10^{7}/ least bandwidth of the route [Lowest bandwidth from all interfaces between source and destination.]
Delay = cumulative delay of the route [Sum of all outgoing interfaces' delay.]
Let's take an example to understand how this formula works.
The following image shows an example EIGRP network created on Packet Tracer. You can download this network topology from the following link.
Packet Tracer Lab for EIGRP metric calculation formula
Run 'show ip route eigrp' command on Router0 to view all routes in the routing table added by EIGRP. The following image shows the output of this command.
As we can in the above output, there are four routes added by EIGRP. The destination subnet of the first route is 30.0.0.0/8. The destination subnet of the second route is 40.0.0.0/8. The destination subnet of the third route and fourth route is 50.0.0.0/8. Since the third and fourth routes have the same metric, they both are added for the load balancing. The value after the forward-slash in the square bracket is the metric of the route. For example, the metric of the first route (30.0.0.0/8) is 2681856.
Let's understand how the metric is calculated for each route.
EIGRP metric calculation example 1
The destination subnet of the first route (30.0.0.0/8) is available between Router1 and Router2. There are two exit points (interfaces) between the source and the destination. These exit points are Router0's S0/0/0 and Router1's S0/0/1.
Since we didn't change the default values of the bandwidth and delay on both interfaces, EIGRP will use the default values in the formula. Default bandwidth and delay of a serial interface are 1544Kbps and 2000, respectively.
To view the value of all metric components, you can use the 'show interface' command.
The formula uses the least bandwidth from all interfaces between the source and the destination. Since both interfaces have equal bandwidth, the least bandwidth is 1544Kbps.
The formula uses the sum of delay configured on all interfaces between the source and the destination. The sum of delay configured on both interfaces is 4000(2000+2000).
The output of the "show interface" command shows the delay in tens of microseconds. Because of this, the delay is shown as 20000 (2000x10 = 20000) in the above output.
As we know, unless we enable Load, Reliability, and MTU, EIGRP uses the following formula.
For the above formula, we only need the least bandwidth and cumulative delay. The least bandwidth and cumulative delay of the first route are 1544Kbps and 4000, respectively. Let's put both values in the formula.
Metric = ((10000000/1544) +4000)*256 Metric = ((6476.6839) +4000)*256
If the result of an operation is in decimal, the formula rounded it back to the nearest integer before performing the rest of the equation. Because of this, the value 6476.6839 will be rounded back to 6476.
Metric = ((6476) +4000)*256 Metric = (10476)*256 Metric = 10476*256 Metric = 2681856
Thus, the cost of the first route (30.0.0.0/8) is 2681856.
EIGRP metric calculation example 2
Let's calculate the cost of the second route (40.0.0.0/8).
This route has two exit points (interfaces) till the destination subnet. Both exit interfaces have default bandwidth and delay. Because of this, the least bandwidth and cumulative delay will be 1544Kbps and 4000, respectively.
Let's put these values in the equation.
Metric = ((10000000/1544)+4000)*256 Metric = ((6476.6839) +4000)*256 Metric = (6476 + 4000) * 256 Metric = 10476 * 256 Metric = 2681856
Thus, the cost of the second route (40.0.0.0/8) is 2681856.
EIGRP metric calculation example 3
There are two routes to the subnet 50.0.0.0/8. Both routes have the equal least bandwidth and cumulative delay. Since their least bandwidth and cumulative delay are the same, their cost will also be the same. The equal cost routes are automatically used in the load balancing. Because of this, EIGRP added both routes to the routing table.
The following image shows the least bandwidth and cumulative delay of both routes.
The following steps calculate the metric for both routes.
Metric = ((10000000/1544) + 4010) * 256 Metric = (6476 + 4010) * 256 Metric = 10486 * 256 Metric = 2684416
Thus, the cost of both routes is 2684416.
That's all for this tutorial. In this tutorial, we discussed the meaning of K-values and learned how EIGRP calculates the cost of each route.