EIGRP Metric – Explanation of EIGRP Metric

ciscoeigrprouting

I'm looking for an understanding of how the metrics are structured within EIGRP, this includes the routing table, and also the topology table. I'm sure I'm not the only one that finds the concepts of EIGRP a tad tricky to grasp.

My small network has been created and I've enabled an AS of 1 on both connections for an EIGRP neighbouring relationship. This is the output from both the routing table and the topology table:

Router#sh ip ro ei
     192.168.1.0/30 is subnetted, 1 subnets
D    192.168.2.0/24 [90/30720] via 192.168.1.2, 00:09:13, FastEthernet0/0

I know that 90 is the administrative distance, but the metric of 30720 seems high going over fast ethernet to only one hop. Could any light be shed on why this is so high in comparison to OSPF for example? I understand that this is probably a simple case of apples and oranges being two separate routing protocols, but I'm interested to know how this is calculated.

Router#sh ip ei top
IP-EIGRP Topology Table for AS 1/ID(192.168.1.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - Reply status

P 192.168.0.0/24, 1 successors, FD is 28160
         via Connected, FastEthernet0/1
P 192.168.1.0/30, 1 successors, FD is 28160
         via Connected, FastEthernet0/0
P 192.168.2.0/24, 1 successors, FD is 30720
         via 192.168.1.2 (30720/28160), FastEthernet0/0

As you can see from the above, the calculation is 30720/28160. The second part of this calculation also seems to be the feasible distance of 28160, with the first part being the metric of 30720 from the routing table.

Could someone please explain to me the purpose of this calculation? And will this figure change over time? Or is this now set in stone?

Thanks in advance.

Best Answer

EIGRP Metric Formula

The EIGRP Metric is a combination of a measure of the entire path's cumulative delay, and the minimum bandwidth across the entire path. The delay value is value assigned to each 'hop' based upon that interface's speed.

The metric can also include factoring the interface's load and reliability, but this is often left disabled.

This is all controlled by what is known as "K values", each "k value" controls weather each of the following are considered in the EIGRP metric calculation.

     K1 = Bandwidth  
     K2 = Load       
     K3 = Delay      
K4 & K5 = Reliability

By default, the K1 and K3 values are set to 1, and the K2/K4/K5 values are set to 0. These values can then be plugged into the full (rather complicated) EIGRP composite metric calculation:

256 * { K1*BW + [(K2*BW)/(256-load)] + (K3*delay) } * { K5/(reliability+K4) }

If you re-write it with different spacing and add pretty colors and apply the default K Values, you can see how it gets simplified to just Delay and Bandwidth:

EIGRP Default Metric calculation

Which means the simplified formula, with just the default K values applied ends up being this:

**256 * (Bandwidth + Delay)**

Values for Bandwidth and Delays

Bandwidth

The Bandwidth value is based upon the minimum bandwidth link across the entire path. But because metric values in any routing protocol consider a lower value to be superior, a formula has to be used to convert a higher bandwidth to a lower resulting metrics. That formula is as follows:

Bandwidth = 10^7 / BW in Kbps

So a path with a minimum bandwidth of 100 Mbps link, would equate to 100,000 Kbps, and it's calculation would look like:

Bandwidth value = 10,000,000 / 100,000 = 100 Delay

Delay

Delay is supposed to be a calculation of the amount of time it takes a bit to be transmitted to an adjacent neighbor. But in reality it is simply a constant value based upon the interface bandwidth. However, since this factor is additive, it essentially works as a hop count. Or maybe we should say a smart hop count, since it also factors each hop’s bandwidth.

The full list of each interface speed and delay value can be found here:
https://datatracker.ietf.org/doc/html/draft-savage-eigrp-00#section-5.5.1.2

Note that this table displays a value in Picoseconds (one trillionth of a second), and the delay value in show interface is displayed in usec, or microseconds (one millionth of a second).

The delay value used in the formula is the microsecond value divided by 10. For example, a path that consists of two links that are each 100mbps would equate to a total delay in usec of 200:

Delay Value = 200 / 10 = 20

Final Calculation

We can take the Bandwidth value determined above (100) and the Delay value determined above (20) and plug them into the simplified formula to get us the final EIGRP Metric for a link with a minimum path bandwidth of 100mbps, and who's full path crosses two 100mbps links:

EIGRP Metric = 256 * (Bandwidth + Delay)
EIGRP Metric = 256 * (100 + 20)
EIGRP Metric = 256 * 120
EIGRP Metric = 30720

Which interestingly enough is the exact same value you listed in your question:

Router#sh ip ro ei
     192.168.1.0/30 is subnetted, 1 subnets
D    192.168.2.0/24 [90/30720] via 192.168.1.2, 00:09:13, FastEthernet0/0

Feasible Distance vs Reported Distance

Which brings us back to another concept that you might have been confused about. Namely, it has to do with the output to this command:

Router#sh ip ei top
...
P 192.168.2.0/24, 1 successors, FD is 30720
         via 192.168.1.2 (30720/28160), FastEthernet0/0

There are two values provided for the route to 192.168.2.0/24 via 192.168.1.2: 30720 and 28160. Understanding these two values requires understanding two terms that EIGRP uses to describe cost.

The first value is what is known as the Feasible Distance. This is the Total EIGRP cost to the final destination. The value we calculated of 30720 above is the Feasible Distance to the 192.168.2.0/24 network.

The second value (28160) is what is known as the Reported Distance (also sometimes the Advertised Distance). This value represents the total EIGRP cost for my neighbor to get to the target network. This is the value the neighbor shares when advertising the route to the local Router.

It is possible to reverse deconstruct the Reported Distance (aka, the neighbor's cost) value of 28160.

We know the value for EIGRP Metric is 256 * (BW+Delay). If we take 28160 and divide it by 256, we get 110. Which means BW+Delay equated to 110.

We also know the full path is two 100mbps links, so obviously the neighbors path to the target network is one 100mbps link, or a total delay value of 10. Which means the Bandwidth value must have added up to 100, which we know it does when factoring a 100mbps link.

Which confirms the neighbor is one, 100mbps hop away from the target network -- which means the neighbor was directly connected to the target network with a 100mbps link.


Which finally lets us speak to your specific questions. At least the ones that haven't already been answered above:

Could any light be shed on why this is so high in comparison to OSPF for example?

The Metric value is a 32 bit value, which means it can be any number between 0 and 4.2~ billion. The Metric is only considered if the network is the the same size, and the route is learned from the same routing Protocol. Which means what EIGRP considers as a metric will never be compared to what OSPF will consider a network.

So their relative differences are irrelevant. Because if a route is learned from OSPF and EIGRP, the EIGRP route will always be preferred because its Administrative Distance is lower (90 vs 110).

I understand that this is probably a simple case of apples and oranges being two separate routing protocols, but I'm interested to know how this is calculated

Correct, the EIGRP and OSPF metric calculations are Apples and Oranges -- not to be compared. The EIGRP calculation is described thoroughly above, or in more detail in this article.

If you want a run down on the OSPF metric calculation, I'd suggest asking a new question.

As you can see from the above, the calculation is 30720/28160. The second part of this calculation also seems to be the feasible distance of 28160, with the first part being the metric of 30720 from the routing table.

Almost. The first part is the Feasible Distance (30720). The second part is the Reported Distance (28160). The EIGRP topology table will keep track of both of these values. And the Routing table will take only the Feasible Distance into consideration.

Could someone please explain to me the purpose of this calculation?

Keeping track of the Feasible Distance as well as the Reported Distance comes into play with a loop-prevention mechanism of EIGRP known as the Feasibility Condition. If multiple EIGRP routers share information about the same network, the Reported Distance of each incoming route can be compared to what the Router already knows as its best Feasible Distance to determine whether the newly learned path includes a routing loop.

And will this figure change over time? Or is this now set in stone?

The metric will not change unless the interface goes up or down, the interface speed changes, or the number of hops change. Since those are what goes into the calculation, those are the values that will affect a re-calculation. In a stable network, these typically will not change, and therefore the figure will not typically change.

Related Topic