2

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.

  • Hi Luca. These two articles answer your questions exactly: EIGRP Metric and EIGRP Terminology. I'll summarize and and provide an answer to your questions specifically in this thread, but first, please post the output of show ip eigrp topology 192.169.2.0/24 -- that output will help when I answer your question. – Eddie May 8 '16 at 20:24
  • Thanks EddieRouter>sh ip ei top 192.168.2.0 IP-EIGRP (AS 1): Topology entry for 192.168.2.0/24 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 30720 Routing Descriptor Blocks: 192.168.1.2 (FastEthernet0/0), from 192.168.1.2, Send flag is 0x0 Composite metric is (30720/28160), Route is Internal Vector metric: Minimum bandwidth is 100000 Kbit Total delay is 200 microseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 1 – BabyPython May 8 '16 at 21:33
  • Yikes. Any chance you could edit that in to your original question and use markup?. And highlight exactly the questions you are looking answers for? – Eddie May 9 '16 at 4:52
4

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://tools.ietf.org/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.

  • Great information Eddie. You've really helped me to understand this a lot better with the calculations. Just one question though, with the formula of 'Bandwidth = 10^7 / BW in Kbps', what does the ^ symbol signify between the 10 and 7? I thought it may be 10 to the power of 7 at first. If you could clear that up, that would be great. It's little things like this that help my understanding even more. – BabyPython May 9 '16 at 20:48
  • @LucaA That is exactly what it means. 10^7 = Ten to the power of seven, or a 1 with seven zeros, aka 10,000,000. Glad the information helped. If it answers your questions and or you appreciated the time it took to write it, please don't forget to upvote and/or select an answer. – Eddie May 9 '16 at 20:57
  • 1
    thanks for clearing that up for me. It makes sense now. I appreciate you taking the time to write the explanation and answering my questions. I'll close off this thread now. – BabyPython May 9 '16 at 21:04
2

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

You simply cannot compare metrics between different routing protocols. That is the reason for the creation of administrative distance.

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

EIGRP uses a complex calculation to come up with its metric. It involves the bandwidth, delay, reliability, load and MTU of a link, but, by default, it only uses the bandwidth and delay. The calculation can include many things that other routing protocols simply don't include, so you can get a very granular metric on which is the best path.

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

The metric for EIGRP has not changed since IGRP (it is 256 times the IGRP value), so it is unlikely to ever change.

Cisco has many documents available on EIGRP. For instance, Enhanced Interior Gateway Routing Protocol:

EIGRP Metrics

EIGRP uses the minimum bandwidth on the path to a destination network and the total delay to compute routing metrics. Although you can configure other metrics, we do not recommend it, as it can cause routing loops in your network. The bandwidth and delay metrics are determined from values configured on the interfaces of routers in the path to the destination network.

For instance, in Figure 2 below, Router One is computing the best path to Network A.

enter image description here

It starts with the two advertisements for this network: one through Router Four, with a minimum bandwidth of 56 and a total delay of 2200; and the other through Router Three, with a minimum bandwidth of 128 and a delay of 1200. Router One chooses the path with the lowest metric.

Let us compute the metrics. EIGRP calculates the total metric by scaling the bandwidth and delay metrics. EIGRP uses the following formula to scale the bandwidth:

  • bandwidth = (10000000/bandwidth(i)) * 256

    where bandwidth(i) is the least bandwidth of all outgoing interfaces on the route to the destination network represented in kilobits.

EIGRP uses the following formula to scale the delay:

  • delay = delay(i) * 256

    where delay(i) is the sum of the delays configured on the interfaces, on the route to the destination network, in tens of microseconds. The delay as shown in the show ip eigrp topology or show interface commands is in microseconds, so you must divide by 10 before you use it in this formula. Throughout this paper, we use delay as it is configured and shown on the interface.

EIGRP uses these scaled values to determine the total metric to the network:

  • metric = ([K1 * bandwidth + (K2 * bandwidth) / (256 - load) + K3 * delay] * [K5 / (reliability + K4)]) * 256

Note: These K values should be used after careful planning. Mismatched K values prevent a neighbor relationship from being built, which can cause your network to fail to converge.

Note: If K5 = 0, the formula reduces to Metric = ([k1 * bandwidth + (k2 * bandwidth)/(256 - load) + k3 * delay]) * 256.

The default values for K are:

  • K1 = 1
  • K2 = 0
  • K3 = 1
  • K4 = 0
  • K5 = 0

For default behavior, you can simplify the formula as follows:

metric = bandwidth + delay

Cisco routers do not perform floating point math, so at each stage in the calculation, you need to round down to the nearest integer to properly calculate the metrics. In this example, the total cost through Router Four is:

In this example, the total cost through Router Four is:

minimum bandwidth = 56k 

total delay = 100 + 100 + 2000 = 2200 

[(10000000/56) + 2200] x 256 = (178571 + 2200) x 256 = 180771 x 256 = 46277376  

And the total cost through Router Three is:

minimum bandwidth = 128k 

total delay = 100 + 100 + 1000 = 1200 

[(10000000/128) + 1200] x 256 = (78125 + 1200) x 256 = 79325 x 256 = 20307200  

So to reach Network A, Router One chooses the route through Router Three.

Note the bandwidth and delay values we used are those configured on the interface through which the router reaches its next hop to the destination network. For example, Router Two advertised Network A with the delay configured on its Ethernet interface; Router Four added the delay configured on its Ethernet, and Router One added the delay configured on its serial.

Your bandwidth is 100000K so the bandwidth the calculation uses is 10000000 / 100000 = 100. The delay is 200 microseconds, so the delay the calculation uses is 20. This bring us to 120 * 256 = 30720, and that is the value you report.

Plugging your numbers into the example that Cisco has given above:

[(10000000/100000) + 20] x 256 = (100 + 20) x 256 = 120 x 256 = 30720
  • 1
    I was hoping for your own explanation. Rather than showing me a link of what's already out there. I'm looking for a simplified explanation of how this all works. Thanks anyway for your input. – BabyPython May 8 '16 at 18:53
  • @LucaA, If you notice, I actually answered the questions you posed. What else it is you don't understand? – Ron Maupin May 8 '16 at 22:01
2

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.

You're right - it is like comparing apples and oranges :) For exmaple, RIP's maximum metric is 15 but doesn't mean anything when compared to an EIGRP metric of 30720.

In regards to the EIGRP metric being so high - part of the reason is because EIGRP multiplies its metric by 256 in order to be backward compatible with IGRP (EIGRP's predecessor). As per this Wikipedia entry:

IGRP uses the same basic formula for computing the overall metric, the only difference is that in IGRP, the formula does not contain the scaling factor of 256. In fact, this scaling factor was introduced as a simple means to facilitate backward compatility between EIGRP and IGRP: In IGRP, the overall metric is a 24-bit value while EIGRP uses a 32-bit value to express this metric. By multiplying a 24-bit value with the factor of 256 (effectively bit-shifting it 8 bits to the left), the value is extended into 32 bits, and vice versa. This way, redistributing information between EIGRP and IGRP involves simply dividing or multiplying the metric value by a factor of 256, which is done automaticall

In regards to how the metric is calculated, I wrote a detailed blog post about it a little while back. The short of it is that the metric is calculated by using this formula:

256*[(10000000/)+(/10)]

When we run the figures you provided (Vector metric: Minimum bandwidth is 100000 Kbit Total delay is 200 microseconds) through this formula, we get the correct metric:

10000000 / 100000 = 100

200 / 10 = 20

100 + 20 = 120

256 * 120 = 30720

  • 1
    Also good information! I'll check out your detailed blog post for a further explanation. Good to have multiple sources when it comes to stuff like this. Thanks. – BabyPython May 10 '16 at 7:30
  • No worries at all @LucaA. Let me know if you have any other questions and I'd be happy to help. – OzNetNerd May 11 '16 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.