19.07.2013 Views

EIGRP Metric Calculation Demystified When it comes to determining ...

EIGRP Metric Calculation Demystified When it comes to determining ...

EIGRP Metric Calculation Demystified When it comes to determining ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>EIGRP</strong> <strong>Metric</strong> <strong>Calculation</strong> <strong>Demystified</strong><br />

<strong>When</strong> <strong>it</strong> <strong>comes</strong> <strong>to</strong> <strong>determining</strong> the <strong>EIGRP</strong> metric there seems <strong>to</strong> be many people who are<br />

confused in "how" <strong>it</strong> is actually calculated. I often times hear the following two questions, Can you<br />

just add the individual costs along the path <strong>to</strong> the destination like we do in OSPF? and Do we add the<br />

cost <strong>to</strong> the next-hop router <strong>to</strong> the reported distance (RD) as advertised by the next-hop router? The<br />

answer <strong>to</strong> both of these questions is absolutely and w<strong>it</strong>hout a doubt, No. Why then is there so much<br />

confusion? I believe part of the problem lies in the inaccurate way <strong>it</strong> is referenced by many of the<br />

documentation sources available <strong>to</strong> readers.<br />

For example, in the old Cisco Press book t<strong>it</strong>led, “CCNP Self Study: Building Scalable Cisco<br />

Internetworks (BSCI)”, by Catherine Paquet and Diane Teare, on page 362, <strong>it</strong> states the following in<br />

regard <strong>to</strong> the <strong>EIGRP</strong> metric:<br />

“The lowest-cost route is calculated by adding the cost between the next-hop router and the<br />

destination (referred <strong>to</strong> as the advertised distance [AD]) <strong>to</strong> the cost between the local router and the<br />

next-hop router. (The <strong>to</strong>tal is referred <strong>to</strong> as the feasible distance [FD].)”<br />

Upon first glance this seems correct, but this is clearly an incorrect statement regarding the<br />

<strong>EIGRP</strong> metric. In another example in the same book at the bot<strong>to</strong>m of page 362, <strong>it</strong> gives the following<br />

defin<strong>it</strong>ion for the feasible distance (FD).<br />

“FD or fd (feasible distance) - Equal <strong>to</strong> the sum of the costs of the links <strong>to</strong> reach network (a).”<br />

Again, an apparently inaccurate reference <strong>to</strong> the actual <strong>EIGRP</strong> metric. In add<strong>it</strong>ion, the examples<br />

that follow in the book, clearly show they are “adding” the individual link costs along the path from<br />

source <strong>to</strong> the destination <strong>to</strong> come up w<strong>it</strong>h the <strong>to</strong>tal <strong>EIGRP</strong> metric. An obvious oversight on the part of<br />

the author's resulting in an incorrect <strong>EIGRP</strong> calculation.<br />

Another source for the possible misunderstanding can be found in the new Cisco Press Book<br />

t<strong>it</strong>led “Implementing Cisco IP Routing (ROUTE) Foundation Learning Guide”, by Diane Teare, on<br />

page 62, <strong>it</strong> states the following regarding the <strong>EIGRP</strong> metric:<br />

© BTS Communications, LLC Page 1


<strong>EIGRP</strong> <strong>Metric</strong> <strong>Calculation</strong> <strong>Demystified</strong><br />

”The lowest-cost route is calculated by adding the cost between the next-hop router and the<br />

destination—referred <strong>to</strong> as the advertised distance (AD)—<strong>to</strong> the cost between the local router and the<br />

next-hop router. The sum of these costs is referred <strong>to</strong> as the feasible distance (FD).”<br />

In add<strong>it</strong>ion, on page 71 of the same book, the author states,<br />

”The AD is the <strong>EIGRP</strong> metric for an <strong>EIGRP</strong> neighbor router <strong>to</strong> reach a particular network.<br />

This is the metric between the next-hop neighbor router and the destination network.<br />

The FD is the <strong>EIGRP</strong> metric for this router <strong>to</strong> reach a particular network. This is the sum of the<br />

AD for the particular network learned from an <strong>EIGRP</strong> neighbor, plus the <strong>EIGRP</strong> metric <strong>to</strong> reach that<br />

neighbor (the metric between this router and the next-hop router).”<br />

Notice the author's use of the words “adding” and “sum” in the first reference as well as the use<br />

of “sum” in the second reference. I believe both of these references make an improper choice of the<br />

words <strong>to</strong> describe the calculation of the <strong>EIGRP</strong> metric and gives many readers an erroneous impression<br />

that you can simply “add” the AD of the neighboring router <strong>to</strong> the cost <strong>to</strong> reach the neighboring router.<br />

Resulting in a “sum” equal <strong>to</strong> the <strong>EIGRP</strong> metric. Again, this is incorrect and I will show this in an<br />

example later in the paper.<br />

Please, do not get me wrong, I am not trying <strong>to</strong> disrespect the authors' in any way. In fact, I am<br />

am very fond of both these author's and have several of their books in my own technical library. They<br />

are among my favor<strong>it</strong>e list of authors'. I am merely trying <strong>to</strong> show a possible cause <strong>to</strong> the misguided<br />

and misunderstanding others may have regarding the <strong>EIGRP</strong> metric calculation.<br />

Furthermore, in the following Cisco document on “Enhanced Interior Gateway Routing<br />

Pro<strong>to</strong>col (<strong>EIGRP</strong>)”, Document ID: 16406, <strong>it</strong> gives this defin<strong>it</strong>ion for the feasible distance:<br />

”Feasible distance is the best metric along a path <strong>to</strong> a destination network, including the metric<br />

<strong>to</strong> the neighbor advertising that path. Reported distance is the <strong>to</strong>tal metric along a path <strong>to</strong> a<br />

destination network as advertised by an upstream neighbor.”<br />

Many people confuse the phrase “including the metric” in the above passage <strong>to</strong> mean that you<br />

“add” the metric <strong>to</strong> reach the next-hop neighbor <strong>to</strong> the reported distance (RD) of the upstream neighbor<br />

© BTS Communications, LLC Page 2


<strong>EIGRP</strong> <strong>Metric</strong> <strong>Calculation</strong> <strong>Demystified</strong><br />

<strong>to</strong> arrive at the <strong>to</strong>tal metric along the path. Again, a seemingly misguided statement regarding the<br />

<strong>EIGRP</strong> metric, resulting in confusion and incorrect calculations.<br />

While <strong>it</strong> is true that the feasible distance (FD) is the <strong>to</strong>tal cost along a path from source <strong>to</strong><br />

destination. It is erroneous <strong>to</strong> say the <strong>to</strong>tal metric is equal <strong>to</strong> the “sum” of the individual link costs or <strong>to</strong><br />

say the <strong>to</strong>tal metric is equal <strong>to</strong> the cost <strong>to</strong> reach the next-hop neighbor “plus” the RD of the next-hop<br />

neighbor. You can verify this by using the <strong>EIGRP</strong> metric formula, shown below.<br />

METRIC=256∗[k1∗bandwidthk2∗bandwidth/256−load k3∗delay]∗[k5/reliabil<strong>it</strong>yk4]<br />

Remember the default “k-values” are k1=k3=1 and k2=k4=k5 =0. Looking at the equation and<br />

the “k-values”, if k2=k4=k5 = 0, then mathematically this equation reduces <strong>to</strong> zero. Which we know is<br />

not what happens. Therefore, the <strong>EIGRP</strong> formula must be a “cond<strong>it</strong>ional” formula, a sort of “If-then”<br />

type scenario where if k5=0, then we set the last part of the equation <strong>to</strong> “1”. This results in the<br />

mathematically sound, often reduced <strong>EIGRP</strong> formula shown below.<br />

METRIC=256∗[k1∗bandwidthk3∗delay]<br />

Recall the <strong>EIGRP</strong> formula uses the minimum bandwidth (in kbps) along the path from source <strong>to</strong><br />

destination and the <strong>to</strong>tal cumulative delay (in 10s of microseconds) along this same path from source <strong>to</strong><br />

destination. For example, take the following network:<br />

Figure 1 – <strong>EIGRP</strong> <strong>Metric</strong><br />

The metric (or cost) of each of the individual links can be calculated using the <strong>EIGRP</strong> formula. Shown<br />

© BTS Communications, LLC Page 3


<strong>EIGRP</strong> <strong>Metric</strong> <strong>Calculation</strong> <strong>Demystified</strong><br />

below is a simplified version of the <strong>EIGRP</strong> formula above.<br />

METRIC=256∗BW Delay<br />

where BW = (10^7 / interface BW) and Delay = (<strong>to</strong>tal path delay / 10). Using the network diagram<br />

above and the <strong>EIGRP</strong> formula, will we prove the answer <strong>to</strong> the two opening questions is in fact “No”<br />

and disprove the often misguided, inaccurate statements found in so many publications regarding the<br />

<strong>EIGRP</strong> metric calculation.<br />

Step 1 - calculate the individual link metric for R1-R2.<br />

On the R1 <strong>to</strong> R2 link we are using an interface BW of 1544kbps and a delay of 20000 microseconds.<br />

The metric is calculated as follows:<br />

METRIC=256∗[10,000,000/1,54420,000/10]<br />

METRIC=256∗64762000<br />

METRIC=256∗8476=2169856<br />

Step 2 - calculate the individual link metric for R2-R3.<br />

Likewise, on the R2 <strong>to</strong> R3 serial link we calculate the metric <strong>to</strong> be 2169856.<br />

Step 3 - calculate the individual link metric for R3 <strong>to</strong> the destination network 10.1.1.0/24.<br />

The Fast Ethernet interface on R3 is calculated using an interface BW of 100Mbps and a delay of 100<br />

microseconds. The metric is<br />

Step 4 - adding the individual link metrics.<br />

METRIC=256∗[10,000,000/100,000100/10]<br />

METRIC=256∗10010<br />

METRIC=256∗110=28160<br />

Adding the individual link metrics from the steps above results in a <strong>to</strong>tal <strong>EIGRP</strong> metric of 4367872.<br />

© BTS Communications, LLC Page 4


<strong>EIGRP</strong> <strong>Metric</strong> <strong>Calculation</strong> <strong>Demystified</strong><br />

METRIC=2169856216985628160=4367872<br />

Step 5 - calculate the metric using the <strong>EIGRP</strong> formula.<br />

Using the <strong>EIGRP</strong> formula <strong>to</strong> calculate the <strong>to</strong>tal metric from R1 <strong>to</strong> destination network 10.1.1.0/24<br />

results in metric of 2684416. In the above example the least BW is 1544kbps and the <strong>to</strong>tal cumulative<br />

delay is 20000 + 20000 + 100 = 40100. Using the <strong>EIGRP</strong> formula we get:<br />

METRIC=256∗[10,000,000/1,54440,100 /10]<br />

METRIC=256∗64764010<br />

METRIC=256∗10486=2684416<br />

Comparing the metrics calculated in Step 4 and Step 5, clearly shows these are not the same.<br />

Proving you can not simply “add” the individual link metrics <strong>to</strong> arrive at the <strong>to</strong>tal <strong>EIGRP</strong> metric.<br />

In add<strong>it</strong>ion, we can prove the <strong>to</strong>tal <strong>EIGRP</strong> metric is not equal <strong>to</strong> the cost <strong>to</strong> reach the next-hop<br />

neighbor “plus” the RD as advertised by the next-hop neighbor. Again, we can verify this using the<br />

<strong>EIGRP</strong> formula.<br />

Step 6 - calculate the individual link metric for R1-R2.<br />

As calculated in Step 1 above the cost or metric <strong>to</strong> reach the next-hop neighbor (R2 in our case) is<br />

2169856.<br />

Step 7 - calculate the FD for R2 <strong>to</strong> reach the destination network 10.1.1.0/24.<br />

The cost from R2 <strong>to</strong> destination network 10.1.1.0/24 is 2172416. This is the FD for R2 and is also the<br />

RD that is advertised <strong>to</strong> R1. The minimum BW is 1544kbps and the <strong>to</strong>tal cumulative delay is 20000 +<br />

100 = 20100. Using the <strong>EIGRP</strong> formula we get:<br />

METRIC=256∗[10,000,000/1,54420,100/10]<br />

METRIC=256∗64762010<br />

© BTS Communications, LLC Page 5


<strong>EIGRP</strong> <strong>Metric</strong> <strong>Calculation</strong> <strong>Demystified</strong><br />

METRIC=256∗8486=2172416<br />

Step 8 - adding the RD of the next-hop neighbor <strong>to</strong> the cost <strong>to</strong> reach the next-hop neighbor.<br />

Adding the metric calculated in Step 6 <strong>to</strong> the metric calculated in Step 7 yields a <strong>to</strong>tal metric of<br />

4342272.<br />

METRIC=21698562172416=4342272<br />

Again, adding these two metrics <strong>to</strong>gether clearly shows the “sum” is not the same as the actual<br />

<strong>EIGRP</strong> metric we calculated in Step 5.<br />

So, in conclusion, we just proved that the <strong>to</strong>tal cost or metric in <strong>EIGRP</strong> is not equal <strong>to</strong> the “sum”<br />

of the individual link metrics nor is <strong>it</strong> equal <strong>to</strong> the RD of the next-hop neighbor “plus” the link metric <strong>to</strong><br />

reach the next-hop neighbor. In all calculations of the <strong>EIGRP</strong> metric, you must use the <strong>EIGRP</strong> formula<br />

and calculate the metric from source <strong>to</strong> destination independently. Taking in<strong>to</strong> consideration the<br />

minimum bandwidth along the path and the cumulative delay along the path. Meaning the metric for<br />

R2 <strong>to</strong> the destination network is calculated using the <strong>EIGRP</strong> formula and the minimum bandwidth and<br />

cumulative delay along the path from R2 <strong>to</strong> the destination network. Likewise, the metric for R1 must<br />

also be calculated using the <strong>EIGRP</strong> formula and the minimum bandwidth and cumulative delay along<br />

the path from R1 <strong>to</strong> the destination network. You cannot calculate R1's metric by taking the metric as<br />

seen by R2 and simply add the cost <strong>to</strong> reach R2. As we have shown in the above calculations, this does<br />

not result in the correct <strong>EIGRP</strong> metric calculation.<br />

© BTS Communications, LLC Page 6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!