Meaning of the default EIGRP metric

Introduction and motivation

I have always felt the EIGRP metric as being really overwhelming. I see values like «2820096» and instead of understanding it, I always end up asking what the hell does that number mean.

For example, in RIP:

R    192.168.0.0/24 [120/3] via 172.16.1.1, 00:00:15, FastEthernet0/0

Just by looking at the metric of «3» I immediately know what is means: there are three steps between the announced network and the router receiving the advertisement. Easy, right? «Understanding the number» makes it easy for me to manage and diagnose it.

In OSPF, the metric (cost) is still not as cumbersome as EIGRP’s. However, in the following example, can you identify what does «66» mean? For you, is it «just a number» that won over another because of its numerical value being lower? How do you know if the number is right or not?

O   192.168.0.0/24 [110/66] via 172.16.1.1, 00:00:82, FastEthernet0/0

The EIGRP metric formula is better, functionally speaking. It is calculated from various components. As a result, it is more complex. Furthermore, the resulting value is bigger. When you try to read the number in the route table, it is no longer obvious.

D   192.168.0.0/24 [90/2820096] via 172.16.1.1, 00:00:12, FastEthernet0/0

So, what does «2820096» mean? Well, it’s pretty simple. Take 2820096 and divide it by / 25600 and you get the estimated travel time in milliseconds: 2820096 / 25600 = 110.16 ms.

The EIGRP metric is an approach to calculating the total travel time. By default, EIGRP calculates the packet travel time like is: take the transmission delay in all hops in the path (the famous «delay» part) and —instead of adding all of the serialization delays— add only that of the bottleneck bandwidth for a 100 Kilobit sample.

The goal of this article is to show you how to mathematically get to that conclusion in the particular case of the default K values. This will allow the article to be much shorter and understandable, because the rest of the terms that compose the complete EIGRP metric are more complex and there is less on-line documentation reference for those. Also, Cisco doesn’t recommend changing the K values by default unless you REALLY know what you are doing.

Besides, we can get our engines started and warmed up for a later article with an analysis for the whole formula, don’t we?

Step 0: Starting to think

To put a «meaning» to this number, I will first ask you: if you designed your own «perfect» routing protocol, what would you use as a metric? What formula do you think would provide the routers with the best and closest to reality information in order to always take the most optimal routing decisions, at all times, and whatever the network circumstance is? It is not an easy question, though it is one that any protocol designer will never be able to escape. Think about this for a moment.

When I asked myself this question, my answer was: I think everybody wants the packets to get to its destination (unmodified, of course) as quickly as possible. I would like all participating routers to know the exact time it will take a packet to get to router B. Travel time should be used as *the* metric. In my «perfect» routing protocol, the metric would be measured in some submultiple of seconds. Even the Internet would be better if this were true, except that it’s way too expensive, complex, and difficult to manually control if done this way (that’s were BGP jumps in).

The EIGRP protocol gives it a shot at this approach.

Quoting complete the EIGRP metric formula, by Cisco

To analyze the default metric behavior I will start by quoting the complete EIGRP metric formula specified by Cisco1:

metric = [K_1 * bandwidth + {K_2 * bandwidth} / {256 - load} + K_3 * delay] * [K_5 / {reliability + K_4}]

where:

  • 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.
  • 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.
  • If K_5 = 0, the formula reduces to metric = K_1 * bandwidth + {K_2 * bandwidth}/{256 - load} + K_3 * 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.
  • The default values for K are:
    • K_1 = 1
    • K_2 = 0
    • K_3 = 1
    • K_4 = 0
    • K_5 = 0

For default behavior, you can simplify the formula as follows:
metric = bandwidth + delay

I found out that sentence to be a source of confusion for myself. Even the simplified, default-behavior metric formula is expressed in a way that assumes we can add apples and oranges, though this is impossible. Cisco wants us to add «bandwidth» with «delay». So, how do they actually do it? How much is «10 bps + 10 s»?

Step 1: Arranging the mathematical expression in its default K values

Let’s try to state the formula in its default behavior. I will use the following symbols:

  • M: metric.
  • B: resulting scaled bandwidth.[/pmath]
  • B_min: bandwidth(i), the least bandwidth of all outgoing interfaces on the route to the destination network represented in kilobits.
  • D: resulting scaled delay.[/pmath]
  • sum{}{}{d}: delay(i), the sum of the delays configured on the interfaces, on the route to the destination network, in tens of microseconds.
  • 10 * 10^6: 1000000 (as in 10 Mega-something).

Let’s arrange the formula in a way it really looks like a mathematical equation:

M = B + D

where:

B = 256 10 * 10^6 / {B_min}
D = 256 sum{}{}{d}

Step 2: moving the «256» out of the way and getting to the original IGRP metric formula

EIGRP metric is 256 times that of IGRP2. This is easily provable: as both, B and D are a multiple of 256, we can divide by it. The result is the exact original IGRP formula3. (Though this is also true in the complete formula, please remember we are only working with the particular case of the default metric behavior.)

This means that the EIGRP metric will be always inflated and will be a multiple of 256.

Let’s do the procedure. First, lets get all into one big formula. Let’s replace B and D for their corresponding formulas:

M = 256 10 * 10^6 / {B_min} + 256 sum{}{}{d}

There we can see how the 256 factor is present in the two terms. We could factor it out but for convenience I will divide everything by 256.

M / 256 = 10 * 10^6 / {B_min} + sum{}{}{d}

The right side is the default metric for IGRP.

Step 3: Unit analysis and T3

Or put another way: what is the resulting value measured in, is it Kilobits, seconds, hops, packets…?

The last formula from step 2 has the following form:

{M / 256} = T_1 + T_3

where:

  • M (metric)
  • T_1 = 10 * 10^6 / {B_min}
  • T_3 = sum{}{}{d}

The terms T_1 and T_3 must have the same units. Otherwise, addition couldn’t be possible.

The easiest term to analyze is T_3. According to Cisco sum{}{}{d} must be in tens of microsegundos. Therefore:

T_3: 10 {mu}s

And thus, T_1 units (and therefore the whole M units) must be tens of microseconds, also.

So:

  • T_1: 10 {mu}s (time)
  • T_3: 10 {mu}s (time)
  • M: 10 {mu}s (time)

So, given T_3 is a delay, the other term and the total metric must be a delay too in the same scale. Remember what I said at the beginning about using travel time as my «perfect» metric for a routing protocol? EIGRP is actually giving it a shot.

Step 4: Analyzing T1

In step 3 we let T_1 be defined as:

T_1 = 10 * 10^6 / {B_min}

And also that T_1 must be in tens of microseconds.

We know the units for T_1 and B_min, but what are the units for 10 * 10^6?

10 {mu}s = x / {kilobit/s} doubleleftright x = {10 {mu}s} {k bit/s} = {10 * 10^{-6} * 10^3 bit s}/s = 10 * 10^{-3} bit: tens of millibit

{10 milibit} / {k bit/s} = {10 * 10^{-3} bit} / {10^3 bit/s} = 10 / { 10^{-6} } s = 10 {mu}s

How many bits are (10 * 10^6) (10 milibit)?

(10 * 10^6) (10 milibit) = (10 * 10 * 10^6 * 10^-3 * bit) = 100 * 10^3 * bit = 100 Kilobit

So finally, T_1 is like this:

T_1 = {100 Kbits} / B_min

Just like time = distance / speed, also serialization delay = bits / bandwidth, so {100 Kbits} / {B_min} means «serialization delay for 100 Kbits under that bandwidth Bmin«.

Conclusion and interpretation

D   192.168.0.0/24 [90/2820096] via 172.16.1.1, 00:00:12, FastEthernet1/1

We know that 2820096 is given in 10 {mu}s and multiplied by 256.

So we take 2820096 / 256 = 11016.

To convert it to {mu}s instead, divide the metric / 25.6: 2820096 / 25.6 = 110160 {mu}s

Or to milliseconds, divide it by / 25600: 2820096 / 25600 = 110.16 ms

As I said, the EIGRP default metric is an approach to calculating the total travel time. By default, EIGRP calculates the packet travel time like is: take the transmission delay in all hops in the path (the famous «delay» part) and —instead of adding all of the serialization delays— add only that of the bottleneck bandwidth for a 100 Kilobit sample.

References

1 Cisco Document ID 16406, actualizado: Sep 09, 2005. Enhanced Interior Gateway Routing Protocol: http://www.cisco.com/en/US/tech/tk365/technologies_white_paper09186a0080094cb7.shtml

2 IP Routing, by Ravi Malhotra, January 2002. Chapter 4: Enhanced Interior Gateway Routing Protocol (EIGRP) http://oreilly.com/catalog/iprouting/chapter/ch04.html#45434

3 Cisco Document ID 13678, actualizado: Aug 10, 2005. IGRP Metric [IP Routing], http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a008009405c.shtml


Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *