1、EIGRP协议简述

EIGRP(Enhanced Inerior Gateway Routing Protocol,增强型内部网关路由协议)是一个平衡混合型路由协议,它融合了距离矢量和链路状态两种路由协议的优点,也是CISCO的私有协议。

EIGRP是一个高效的路由协议,它的特点是:

  • 通过发送和接收Hello包来建立和维持邻居的关系,并交换路由信息;

  • 采用组播(224.0.0.10)或单播进行路由更新;

  • EIGRP的管理距离为90和170;

  • 采用触发更新,减少带宽占用;

  • 支持可变长子网掩码(VLSM),默认开启自动汇总功能;

  • 支持IP、IPX、和Apple Talk等多种网络层协议;

  • 对每一种网络协议,EIGRP多维持独立的邻居表、拓扑表和路由表

  • EIGRP采用Diffusing Upadte算法(DUAL)来实现快速收敛并确保没有路由环路;

  • 存储整个网络拓扑结构的信息,一边快速适应网络变化;

  • 支持等价和非等价的负载均衡;

  • 使用可靠传输协议(RTP)保证路由信息传输的可靠性;

  • 无缝连接数据链路层协议和拓扑结构,EIGRP不要求对OSI参考模型的2层协议进行配置;

2、实验目的

简单理解EIGRP以下二个基础知识点。

  • 理解邻居表、拓扑表以及路由表;

  • EIGRP度量值的计算方法;

3、拓扑图

wKioL1Yfv7bjvIVRAAEXV6xteKE201.jpg

两台相邻的路由器要建立起邻接关系需要满足两个条件,为相同的AS号和相匹配的K值。可以通过Show ip protocols来查看,如下(此处以R2为例):

R2#show ip protocols

 

Routing Protocol is "eigrp 200 "

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Default networks flagged in outgoing updates

Default networks accepted from incoming updates

EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0

EIGRP maximum hopcount 100

EIGRP maximum metric variance 1

Redistributing: eigrp 200

Automatic network summarization is not in effect

Maximum path: 4   

Routing for Networks:   

192.168.10.0

192.168.20.0

192.168.40.0

192.168.50.0

0.0.0.0

Routing Information Sources:        

Gateway                            Distance                             Last Update

192.168.10.2                    90                               330051

192.168.20.2                    90                               356798

192.168.40.2                    90                               382527

192.168.50.2                    90                               418109

Distance: internal 90 external 170          

由于当前最大允许4条线路负载均衡,若路由器允许可继续增加线路,可用maximum-paths *来修改数量(*代表数量单位)。另外可以看到红色字体,“eigrp 200”代表当前EIGRP自制系统号为200;

EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0则为K值,其含义如下:

K1代表带宽

K2代表负载

K3代表延时

K4和K5代表可靠性

默认情况下EIGRP只使用了带宽和负载为度量值计算参数。若要修改K值可用metric weights tos k1 k2 k3 k4 k5命令,其中tos被用作服务质量区分服务等级,0为不启用,1为启用。

(1)、邻居表

R2#show ip eigrp neighbors

IP-EIGRP neighbors for process 100

H  Address      Interface  Hold  Uptime  SRTT  RTO  Q   Seq

                          (sec)          (ms)      Cnt  Num

0  192.168.10.2 Se1/1      12    00:11:47 40  1000  0   78

1  192.168.20.2 Se1/0      12    00:11:20 40  1000  0   80

2  192.168.40.2 Se1/2      11    00:10:54 40  1000  0   91

3  192.168.50.2 Se1/3      14    00:10:19 40  1000  0   94

“H”表示邻居被学到的先后顺序,0是最先学到的邻居;

“Address”是邻居路由接口IP;

“Interface”是本地路由和这个邻居相连的接口;

“Hold”是当前的保持时间,默认15秒,是一个递减的数值;

“Uptime”是邻居进入邻居表到当前经过了多长时间;

“SRTT”是指正常往返时间,它以毫秒计算报文在路由器间传送的平均往返时间的测量;

“RTO”是指确定重传间隔值;

“Q”是指队列计数,列是发送队列中等待报文数。此数值若高于0说明链路中有拥塞;

(2)、路由表

R2#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

i - IS-IS, 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

 

10.0.0.0/16 is subnetted, 5 subnets

D              10.2.0.0 [90/20640000] via 192.168.10.2, 00:13:00, Serial1/1

D              10.5.0.0 [90/20640000] via 192.168.20.2, 00:12:48, Serial1/0

C               10.6.0.0 is directly connected, Loopback0

D              10.11.0.0 [90/20640000] via 192.168.50.2, 00:12:23, Serial1/3

D              10.12.0.0 [90/20640000] via 192.168.40.2, 00:12:35, Serial1/2

192.168.10.0/30 is subnetted, 1 subnets

C               192.168.10.0 is directly connected, Serial1/1

192.168.20.0/30 is subnetted, 1 subnets

C               192.168.20.0 is directly connected, Serial1/0

192.168.30.0/30 is subnetted, 1 subnets

D              192.168.30.0 [90/21024000] via 192.168.40.2, 00:12:35, Serial1/2

[90/21024000] via 192.168.50.2, 00:12:23, Serial1/3

192.168.40.0/30 is subnetted, 1 subnets

C               192.168.40.0 is directly connected, Serial1/2

192.168.50.0/30 is subnetted, 1 subnets

C               192.168.50.0 is directly connected, Serial1/3

路由表中若出现"D *.*.*.*/* is a summary, 00:15:00, Null0",是一条自动汇总产生的路由,EIGRP和RIP默认都在主网边界自动汇总,而不同的是EIGRP会在本地产生一条自动汇总后的路由,目标指向空接口(Null0)发往空接口的数据会被丢弃。这可以有效的避免路由环路的产生,即每条链路都会有一条这样的自动汇总记录。其实这个可以用no auto-summary取消,不用自动汇总。

D 192.168.30.0 [90/21024000] via 192.168.40.2, 00:12:35, Serial1/2这是一条通过EIGRP学到的最终路由,D代表是通过EIGRP学到的,可以看到192.168.30.0/30这条链路是被汇总得来的,[90/21024000]中的90是EIGRP默认的管理距离,后面是度量值。从这条路由可以得知,去192.168.30.0/30这条链路可以从R4、R5任一一台路由器都可以到达。

(3)、拓扑表

R2#show ip eigrp topology

IP-EIGRP Topology Table for AS 200

 

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

r - Reply status

 

P 10.2.0.0/16, 1 successors, FD is 20640000

via 192.168.10.2 (20640000/128256), Serial1/1

P 10.5.0.0/16, 1 successors, FD is 20640000

via 192.168.20.2 (20640000/128256), Serial1/0

P 10.6.0.0/16, 1 successors, FD is 128256

via Connected, Loopback0

P 10.11.0.0/16, 1 successors, FD is 20640000

via 192.168.50.2 (20640000/128256), Serial1/3

via 192.168.40.2 (21152000/2297856), Serial1/2

P 10.12.0.0/16, 1 successors, FD is 20640000

via 192.168.40.2 (20640000/128256), Serial1/2

via 192.168.50.2 (21152000/2297856), Serial1/3

P 192.168.10.0/30, 1 successors, FD is 20512000

via Connected, Serial1/1

P 192.168.20.0/30, 1 successors, FD is 20512000

via Connected, Serial1/0

P 192.168.30.0/30, 2 successors, FD is 21024000

via 192.168.40.2 (21024000/2169856), Serial1/2

via 192.168.50.2 (21024000/2169856), Serial1/3

P 192.168.40.0/30, 1 successors, FD is 20512000

via Connected, Serial1/2

P 192.168.50.0/30, 1 successors, FD is 20512000

via Connected, Serial1/3

其中P表示被动路由,即路由是稳定可用的。

Successors是到达远程网络的主要路由,对任何特定的路由可以有多达标4条后继路由。

例如:192.168.10.0/30, 1 successors,为去往192.168.10.0/30的最佳路径,FD为可行距离。

(4)、EIGRP度量值的计算方法

EIGRP使用复合度量值计算到目的地址最佳路径,复合度量值是带宽、延时、可靠性和负载的组合。在K1、K2、K3、K4、K5都不为0的前提下,复合度量值的计算公式:

Metric=[K1*Bandwidth+(K2*Bandwidth)/(256-Load)+K3*Delay]*[K5/(Reliability+K4)]

其中K1影响的是带宽(Bandwidth),K2影响的是负载(Load),K3影响的是延时(Delay),K4和K5影响的是可靠性(Reliability);

一般情况下Cisco路由器只使用K1和K3来进行复合度量值的计算,所以公式同样可以使用如下公式:

Metric=(10000M/源和目的之间最低链路带宽+源和目的之间所有链路延时总和/10)*256

其中源和目的之间最低链路带宽,单位是M;源和目的之间所有链路延时总和,单位是微秒(usec);那么为什么我要用延时总和除以10,那是因为EIGRP度量值计算中是使用10微秒作为单位进行计算的。

下面我们看看实验,例如要计算R2到R1的loopback0接口的复合度量值,怎么计算?

首先我们要注意R2到R1的loopback0接口的度量值,要使用R2向R1的loopback0接口方向的出接口的带宽和延时作为参数来计算:

R2#show int se1/1

Serial1/1 is up, line protocol is up (connected)

Hardware is HD64570

Internet address is 192.168.10.1/30

MTU 1500 bytes, BW 128 Kbit, DLY 20000 usec,

如上可以查看到R2的Serial 1/1接口参数为BW带宽等0.128M,延时为20000微秒。

R1#show int loopback0

Loopback0 is up, line protocol is up (connected)

Hardware is Loopback

Internet address is 10.2.0.2/16

MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,

如上为R1的loopback0接口的参数,其带宽为8000M,延时为5000微秒。

那么我来根据公式“Metric=(10000M/源和目的之间最低链路带宽+源和目的之间所有链路延时总和/10)*256”,如果R2的Serial1/1去往R1的loopback0接口,最低链路带宽是0.128M,延时总和是Serial1/1的延时+R1的loopback0接口的延时=20000+5000,把它代入公式计算:

[10000/R2的serial1/1接口带宽(单位M)+(R2的serial1/1接口延时+R1的loopback0接口延时)/10]*256

即[10000/0.128+(20000+5000)/10]*256

[78125+2500]*256=20640000

下面我们来验证一下,R2去往R1的loopback0端口

R2#show ip eigrp topology

IP-EIGRP Topology Table for AS 200

 

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

r - Reply status

 

P 10.2.0.0/16, 1 successors, FD is 20640000

via 192.168.10.2 (20640000/128256), Serial1/1

P 10.5.0.0/16, 1 successors, FD is 20640000

via 192.168.20.2 (20640000/128256), Serial1/0

P 10.6.0.0/16, 1 successors, FD is 128256

via Connected, Loopback0

P 10.11.0.0/16, 1 successors, FD is 20640000

via 192.168.50.2 (20640000/128256), Serial1/3

via 192.168.40.2 (21152000/2297856), Serial1/2

P 10.12.0.0/16, 1 successors, FD is 20640000

via 192.168.40.2 (20640000/128256), Serial1/2

via 192.168.50.2 (21152000/2297856), Serial1/3

P 192.168.10.0/30, 1 successors, FD is 20512000

via Connected, Serial1/1

P 192.168.20.0/30, 1 successors, FD is 20512000

via Connected, Serial1/0

P 192.168.30.0/30, 2 successors, FD is 21024000

via 192.168.40.2 (21024000/2169856), Serial1/2

via 192.168.50.2 (21024000/2169856), Serial1/3

P 192.168.40.0/30, 1 successors, FD is 20512000

via Connected, Serial1/2

P 192.168.50.0/30, 1 successors, FD is 20512000

via Connected, Serial1/3