Search This Blog

Monday, February 25, 2013

The way EIGRP calculate metric



Here is the following topology:



All routers are configured in EIGRP AS1, R1 is advertising subnet 192.168.11.0/24 while R4 is advertising subnet 192.168.41.0/24.

Let’s examine R1 routing table:

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
C    192.168.11.0/24 is directly connected, Loopback1
D    192.168.41.0/24 [90/158720] via 10.1.13.3, 00:00:17, FastEthernet0/1
                     [90/158720] via 10.1.12.2, 00:00:17, FastEthernet0/0
     10.0.0.0/24 is subnetted, 4 subnets
C       10.1.13.0 is directly connected, FastEthernet0/1
C       10.1.12.0 is directly connected, FastEthernet0/0
D       10.1.24.0 [90/30720] via 10.1.12.2, 00:00:17, FastEthernet0/0
D       10.1.34.0 [90/30720] via 10.1.13.3, 00:00:19, FastEthernet0/1

And EIGRP topology:

R1#sh ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(1.1.1.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 10.1.13.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet0/1
P 10.1.12.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet0/0
P 10.1.24.0/24, 1 successors, FD is 30720
        via 10.1.12.2 (30720/28160), FastEthernet0/0
P 10.1.34.0/24, 1 successors, FD is 30720
        via 10.1.13.3 (30720/28160), FastEthernet0/1
P 192.168.41.0/24, 2 successors, FD is 158720
        via 10.1.12.2 (158720/156160), FastEthernet0/0
        via 10.1.13.3 (158720/156160), FastEthernet0/1
P 192.168.11.0/24, 1 successors, FD is 128256
        via Connected, Loopback1

We can see that R1 is learning subnet 192.168.41.0/24 from both R2 and R3 with the same metric, note that two numbers are displayed here: 435200 and 409600, the first is FD and the second is RD.

Here is an explanation taken from Cisco CCNP ROUTE 642-902 Official Certification Guide:
Feasible Distance (FD): Integer metric for the route, from the local router’s perspective, used by the local router to choose the best route for that prefix.
Reported Distance (RD): Integer metric for the route, from the neighboring router’s perspective (the neighbor that told the local router about the route). Used by the local router when converging to new routes.

As you may recall the formula used by EIGRP to calculate the metric is using the least bandwidth and cumulative delay of the link. But which link exactly does it means?

Let’s try to change the delay on R3 Fa0/0 and see what happens:

R3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#interface fastEthernet 0/0
R3(config-if)#delay 5000
R3(config-if)#end
R3#
R3#clear ip eigrp neighbors

And now let’s look again on R1:

R1# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
C    192.168.11.0/24 is directly connected, Loopback1
D    192.168.41.0/24 [90/158720] via 10.1.13.3, 00:00:29, FastEthernet0/1
                     [90/158720] via 10.1.12.2, 00:00:29, FastEthernet0/0
     10.0.0.0/24 is subnetted, 4 subnets
C       10.1.13.0 is directly connected, FastEthernet0/1
C       10.1.12.0 is directly connected, FastEthernet0/0
D       10.1.24.0 [90/30720] via 10.1.12.2, 00:00:36, FastEthernet0/0
D       10.1.34.0 [90/30720] via 10.1.13.3, 00:00:36, FastEthernet0/1

R1#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(1.1.1.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 10.1.13.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet0/1
P 10.1.12.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet0/0
P 10.1.24.0/24, 1 successors, FD is 30720
        via 10.1.12.2 (30720/28160), FastEthernet0/0
P 10.1.34.0/24, 1 successors, FD is 30720
        via 10.1.13.3 (30720/28160), FastEthernet0/1
P 192.168.41.0/24, 2 successors, FD is 158720
        via 10.1.12.2 (158720/156160), FastEthernet0/0
        via 10.1.13.3 (158720/156160), FastEthernet0/1
P 192.168.11.0/24, 1 successors, FD is 128256
        via Connected, Loopback1

As you can see nothing changed! R1 is still learning subnet 192.168.41.0/24 from R2 and R3 with the same metric.

That’s because R1 is calculating the metric to this subnet in the following manner:
      1.       Least bandwidth on the link, in our topology the bandwidth is the same for all interfaces
      2.       Cumulative delay of the link

The link in this case is composed from link 13 + link 34 toward R4 subnet (upstream), so R1 is calculating the delay on the interfaces toward R4, using R1 Fa0/1 and R3 Fa0/1, as cumulative delay in the formula!

The blue dots indicate the interfaces which R1 used in his formula to calculate the delay toward R4:



Even configuring delay on R4 Fa0/1 won’t change the metric calculation for R1.
The only way to change the metric for this link will be on R1 Fa0/1 or R3 Fa0/1 interfaces.

R1 is looking on the link toward the advertising router, from his perspective, upstream.

Configuring bandwidth is the same beside the fact that the least bandwidth is taken into calculation and not in cumulative way as delay.


No comments:

Post a Comment