<!--[if !supportLists]-->第5章 <!--[endif]-->EIGRP
<!--[if !supportLists]-->5.1 <!--[endif]-->概述
综合了距离矢量和链路状态协议的特点比OSPF占用CPU资源少,是IGRP增强版,支持VLSM,扩展性好,增强在下面4个方面:
<!--[if !supportLists]-->l <!--[endif]-->Neighbor router discovery/recovery
<!--[if !supportLists]-->l <!--[endif]-->RTP
<!--[if !supportLists]-->l <!--[endif]-->DUAL有限状态机
<!--[if !supportLists]-->l <!--[endif]-->协议相关模块
和其它routing protocol相比优势:
<!--[if !supportLists]-->l <!--[endif]-->支持VLSM 无类路由选择协议,路由的subnet masket随同更新信息一起传输。
<!--[if !supportLists]-->l <!--[endif]-->快速收敛 扩散更新算法(DUAL)定义可行备选(feasible successson)路由器,预先选出下一条最佳路径。
<!--[if !supportLists]-->l <!--[endif]-->低CPU占用 通常只有hello和部分更新信息传输,更新不扩散(snooping),周期性处理更新。
<!--[if !supportLists]-->l <!--[endif]-->增量更新信息 只发送有变化的route information
<!--[if !supportLists]-->l <!--[endif]-->可扩展性
<!--[if !supportLists]-->l <!--[endif]-->配置简单 支持分层结构,不像OSPF需要严格的配置规则
<!--[if !supportLists]-->l <!--[endif]-->Auto summary 在主网边界上
<!--[if !supportLists]-->l <!--[endif]-->MD5认证 IOS 11.3 over or late 。
EIGRP基于协议传输,IP协议号为88。采用多播地址224.0.0.10进行hello信号和路由更新信息,采用hello机制和抑制计时器维持邻居router。
<!--[if !supportLists]-->5.1.1 <!--[endif]-->EIGRP度量
采用组合度量(带宽、延时、负载、可靠性及MTU),和IGRP相同,在IGRP基础上×256。计算公式如下:
Metric=256{[k1×BW(min]+(k2×BW(min])/(256-Load)+k3×延时总和]×[k5/(Reliability+k4)]}
BW(min]=10<!--[if !supportFields]-->7<!--[endif]-->/整个路径中最慢链路带宽
延时总和=∑(路径中的所有延时) ***输出接口延时的总和。
k值默认:k1=k3=1,k2=k4=k5=0
Metric=256(BW(min]+BW(min))
参考图5-1 计算度量,在这个拓扑中,R3到R1之间的最低带宽是56Kbit/s。这样BW(min]=10<!--[if !supportFields]-->7<!--[endif]-->/56=17857。延时总和=20000+100+100=22000。把这两个值带进公式中,Metric=256(BW(min]+BW(min)),Metric=256×(17857+22000)=46277485。这个在路由器上可以使用show ip route显示出来EIGRP的度量值。
图5-1 EIGRP路由的度量
<!--[endif]-->
改变度量值的方法:
<!--[if !supportLists]-->l <!--[endif]-->使用接口命令Delay x 改变出接口的延时从而改变度量,注意要在链路两端都配置,对称路由。这样路由才会安原路返回。
<!--[if !supportLists]-->l <!--[endif]-->使用接口命令bandwidth y 改变出接口bandwidth,不建议改此参数,会影响到其它路由协议的路由选择。
<!--[if !supportLists]-->l <!--[endif]-->改变k值 使用metric weghts tos k1 k2 k3 k4 k5命令修改k值,直接影响EIGRP对所有路由的计算,不建议使用。
注:改变延时和bandwidth均不影响实际接口的延时和带宽,只是对路由协议选择路由起作用。
<!--[if !supportLists]-->5.1.2 <!--[endif]-->EIGRP的可靠传输协议(RTP)
确保EIGRP数据包的正常接收、发送、处理以及确认。
邻居router接收可靠多播数据包后要求用一个单播确认数据包应答。在更新当中还使用了序列号确保更新包安照正常顺序发送。有5种数据包类型,如下:
<!--[if !supportLists]-->l <!--[endif]-->Hello 发现和维护邻居,使用组播不可靠方式发送。
<!--[if !supportLists]-->l <!--[endif]-->确认应答(ACK) 对数据包确认,没有数据的hello,总是使用不可靠单播方式发送。
<!--[if !supportLists]-->l <!--[endif]-->路由更新 路由更新信息,必要时才更新,当某一指定router需要更新时使用单播更新,当有多台路由器需要更新时使用multicast。可靠方式发送。
<!--[if !supportLists]-->l <!--[endif]-->查询 DUAL进程用来查找路由的可行备选的数据包。单播or multicast。可靠方式发送。
<!--[if !supportLists]-->l <!--[endif]-->应答 DUAL进程用来帮助查找路由的可行备选的数据包。总是单播可靠方式传输。
<!--[if !supportLists]-->l <!--[endif]-->请求报文 给路由服务器使用,从未用过。
如果任何报文以可靠方式组播出去后没有收到邻居的ACK报文,那么这个报文会再次以单播方式再次发送给没有响应的neighbor,经过16times,还没有收到ACK,This neighbor被宣告无效。
<!--[if !supportLists]-->5.1.3 <!--[endif]-->EIGRP邻居的发现和恢复
EIGRP初始化时发送hello包到组播224.0.0.10(广播介质上),在NBMA介质上、X.25、帧中继、和ATM上60s以单播发送一次hello包。可以使用接口命令ip hello-interval eigrp 进行更改。Hello包的时间间隔和介质有关:
在下列介质上5s发送一次hello:
<!--[if !supportLists]-->l <!--[endif]-->LAN的广播:以太网、令牌环和FDDI
<!--[if !supportLists]-->l <!--[endif]-->高速串行接口:高于T1的线路,帧中继,HSSI
<!--[if !supportLists]-->l <!--[endif]-->点对点串行链路:PPP ,HDLC
<!--[if !supportLists]-->l <!--[endif]-->ATM和帧中继点对点子接口。
在下列介质上60s发送一次hello:
<!--[if !supportLists]-->l <!--[endif]-->低速串行接口:低于T1,帧中继和X.25
<!--[if !supportLists]-->l <!--[endif]-->ATM和帖中继的点对多点接口及ATM的SVC
<!--[if !supportLists]-->l <!--[endif]-->ISDN的BRI
同一网络的router接收hello后应答形成邻接关系。图5-2是邻接关系的形成过程。
图5-2 邻居路由器的建立
<!--[endif]-->
<!--[if !supportLists]-->1. <!--[endif]-->在A路由器上,除passive接口,所有参与EIGRP的接口都发送hello包
<!--[if !supportLists]-->2. <!--[endif]-->同一IP子网中的B router收到hello后,发送一个完整的路由更新做为应答。在EIGRP报头中的INITialization位来实现。这个更新包在hello信号的收发双方建立邻接关系(adjacentcy)。Hello中包括一个等待计时器,设定在router收到hello之前将其定为不可达之前等待的时间,设定为hello计时器的3倍,通常是15s or 180s。
<!--[if !supportLists]-->3. <!--[endif]-->A路由器收到初始化更新数据包后,发送设置一个ACK位的hello包来响应。可靠传输。
<!--[if !supportLists]-->4. <!--[endif]-->接下来A路由器更新自己的路由表,并发送更新信息到所有邻居路由器。
<!--[if !supportLists]-->5. <!--[endif]-->接收到中由器A更新信息的路由器用确认数据包应答。
<!--[if !supportLists]-->6. <!--[endif]-->router之间通过交换hello保持邻接关系。如果在等待时间里没有收到hello则标记为邻居不可达。
当一台路由器从neighbor收到一个hello报文时,这个报文包含一个抑制时间(holdtime)。告诉本路由器,在它收到后续的hello报文之前等待的最长时间,如果抑制计时器超时了,还没收到hello报文,则宣告邻居不可达。抑制时间是hello间隔的3倍长。缺省值可以使用接口命令ip hold-time eigrp来更改。
路由器使用下列信息创建邻接表:
<!--[if !supportLists]-->l <!--[endif]-->接收hello的源IP
<!--[if !supportLists]-->l <!--[endif]-->保持计时器的值
<!--[if !supportLists]-->l <!--[endif]-->SRTT(Smooth rund-trip time) or往返时间
<!--[if !supportLists]-->l <!--[endif]-->邻居路由器的正常运行时间。
使用show ip eigrp neighbors命令查看邻居的状态。例5-1所示,邻居正常运行时间就是邻接关系建立的时间,可以判断出邻居是否正常工作。
例5-1 sho ip eigrp neighbors的结果
A#sho ip eigrp nei
IP-EIGRP neighbors for process 65001
H Address Interface Hold Uptime SRTT RTO Q Seq Type
(sec) (ms) Cnt Num
0 192.168.1.2 Se0.1 148 00:01:27 92 552 0 2
A#
注:检查EIGRP工作情况第一步就是检查邻接关系。
RTO(重传超时)是指在一个组播方式的报文发送失败后,路由器等待一个单播方式发送的报文的确认报文的霎时间,单位是 ms。
SRTT(smooth round-trip time)平均往返时间是指一个路由器发送报文到邻居和从邻居接收到该报文的确认报文为止所花费的平均时间。
队列计数(Q Count)标识在重传队列中等待发送的报文数量。
H列记录本台路由器所学到的neighbor的顺序号。
<!--[if !supportLists]-->5.1.4 <!--[endif]-->扩散算法(Diffusing Update Algorithm)
运行DUAL的低层协议必须满足条件:
<!--[if !supportLists]-->1. <!--[endif]-->一个节点需要在有限时间内检测到一个新的neighbor存在 or a neighbor lossed。
<!--[if !supportLists]-->2. <!--[endif]-->正在运行的链路上传送的所有消息应该在一个有限的时间内正确收到,并包含正确序列号。
<!--[if !supportLists]-->3. <!--[endif]-->所有消息,包括改变链路代价、链路失效和发现新邻居的通告,都应该在一个有限的时间内一次一个地处理,并应该有顺序的检测到。
<!--[if !supportLists]-->1、 <!--[endif]-->概念:
<!--[if !supportLists]-->l <!--[endif]-->邻接(Adjacency) 启动后,router使用hello报文发现neighbor和标识自己给邻居识别。当neighbor被发现时EIGRP试图和其形成一个邻接。邻接是指两个互相交换路由更新信息的邻居之间形成一条虚链路,一旦邻接形成即可接收路由更新。
<!--[if !supportLists]-->l <!--[endif]-->可行距离(Feasible distance) 到达每一个目的地的最小度量。
<!--[if !supportLists]-->l <!--[endif]-->可行性条件(Feasibility condition) 本地路由器的一个邻居路由器所通告的到达一个目的网络的距离是否小于本地路由器到达相同目的网络的可行距离FD,满足这样的条件就是FC。
<!--[if !supportLists]-->l <!--[endif]-->可行后继路由器(Feasible successor) 本地路由器的邻居路由器通过的到达目的网络的距离满足FC,那么这个邻居即为那个目的网络的一个FS。
<!--[if !supportLists]-->l <!--[endif]-->后继路由器(Successor) 在拓扑结构表中,选用到达目的网络最小度量的路由放置到路由选择表中,通告这条路由的neighbor即为Successor。
<!--[if !supportLists]-->2、 <!--[endif]-->EIGRP需要维护的三个数据库
参看图5-3 EIGRP的拓扑
图5-3 EIGRP的拓扑图
<!--[endif]-->
<!--[if !supportLists]-->l <!--[endif]-->邻接表 记录邻接关系,记录所有邻居,show ip eigrp neighbors。例5-2所示显示所有的邻居信息。
<!--[if !supportLists]-->l <!--[endif]-->拓扑表 所有从neighbors学习到的路由信息及与路由相关联的度量和可行距离。Show ip eigrp topology AS_number。在拓扑结构表中包括了
<!--[if !supportLists]-->1) <!--[endif]-->可行距离
<!--[if !supportLists]-->2) <!--[endif]-->可行后继路由
<!--[if !supportLists]-->3) <!--[endif]-->可行后继路由器通告的通告距离
<!--[if !supportLists]-->4) <!--[endif]-->本地路由器到目的网络的距离(可行后继路由器通告的距离+本地路由器到可行后继路由器的距离)。
<!--[if !supportLists]-->5) <!--[endif]-->与发现每一个可行后继路由器的网络相连的接口。
参看例5-3中所示的拓扑表。
<!--[if !supportLists]-->l <!--[endif]-->路由表/转发表 具有最低组合度量值的路由会成为最终路由表,例5-4给出了路由表。
例5-2 show ip eigrp neighbors结果
R1#sho ip eigrp nei
R1#sho ip eigrp ne
IP-EIGRP neighbors for process 2001
H Address Interface Hold Uptime SRTT RTO Q Seq Type
(sec) (ms) Cnt Num
2 172.16.101.2 Se1/1 12 00:03:44 659 3954 0 7
1 172.16.2.4 Se1/0.2 148 00:07:40 284 2280 0 4
.0 172.16.1.2 Se1/0.1 135 00:07:55 320 2280 0 8
<!--[if !supportLists]-->例5-3 <!--[endif]-->show ip eigrp topology执行的结果
R1#show ip eigrp topology
IP-EIGRP Topology Table for AS(2001)/ID(172.16.1.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
via 172.16.2.4 (40537600/1683456), Serial1/0.2
P 172.16.5.0/24, 1 successors, FD is 2172416
via 172.16.101.2 (2172416/28160), Serial1/1 <-为后继路由器
via 172.16.1.2 (40514560/28160), Serial1/0.1 <-为FS
P 172.16.6.0/24, 1 successors, FD is 40514560
via 172.16.2.4 (40514560/28160), Serial1/0.2
P 172.16.1.0/24, 1 successors, FD is 40512000
via Connected, Serial1/0.1
via 172.16.101.2 (2681856/2169856), Serial1/1
P 172.16.2.0/24, 1 successors, FD is 40512000
via Connected, Serial1/0.2
P 172.16.101.0/30, 1 successors, FD is 2169856
via Connected, Serial1/1
R1#
<!--[if !supportLists]-->例5-4 <!--[endif]-->路由表
R1#sho ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
D EX
172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
D 172.16.5.0/24 [90/2172416] via 172.16.101.2, 00:06:53, Serial1/1
D 172.16.6.0/24 [90/40514560] via 172.16.2.4, 00:10:48, Serial1/0.2
C 172.16.1.0/24 is directly connected, Serial1/0.1
C 172.16.2.0/24 is directly connected, Serial1/0.2
C 172.16.101.0/30 is directly connected, Serial1/1
R1#
<!--[if !supportLists]-->3、 <!--[endif]-->DUAL有限状态机
当EIGRP不执行扩散时,每条路由都处于passive state。参见前面的拓扑表,每条路由最前面的关键字指出路由的被动状态。
产生输入事件(input event)的任何时候,路由器都会重新评估一条路由的可行后继路由器的列表,包括:
<!--[if !supportLists]-->l <!--[endif]-->直连链路代价发生变化
<!--[if !supportLists]-->l <!--[endif]-->直连链路状态变化
<!--[if !supportLists]-->l <!--[endif]-->收到更新报文
<!--[if !supportLists]-->l <!--[endif]-->收到查询报文
<!--[if !supportLists]-->l <!--[endif]-->收到答复报文
当路由器执行计算进,router依然保持passive state,如果发现了可行后继路由器,则发送更新报文给all neighbors,但不改变topology。
如果拓扑结构表中没有发现FS,则进行扩散计算,router的状态变成活动状态(Active state)。在扩散完成和路由状态返回被动状态前,路由器不能:
<!--[if !supportLists]-->l <!--[endif]-->改变FS
<!--[if !supportLists]-->l <!--[endif]-->改变正在通告的路由距离
<!--[if !supportLists]-->l <!--[endif]-->改变路由的可行距离FD
<!--[if !supportLists]-->l <!--[endif]-->开始进行另一个计算
例5-5是EIGRP发送hello和更新报文的调试信息。
<!--[if !supportLists]-->例5-5 <!--[endif]-->Debug eigrp packets的信息
debug eigrp packet
00:33:15: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
00:33:16: EIGRP: Sending HELLO on Serial1/0 <-发送hello
00:33:16: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
00:33:16: EIGRP: Received UPDATE on Serial1/0 nbr 172.16.4.1 <-接收到完整更新
00:33:16: AS 100, Flags 0x1, Seq 34/0 idbQ 0/0
00:33:16: EIGRP: Neighbor(172.16.4.1) not yet found
00:33:18: EIGRP: Received HELLO on Serial1/0 nbr 172.16.4.1 <-接收到hello
00:33:18: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0
00:33:18: EIGRP: Enqueueing UPDATE on Serial1/0 nbr 172.16.4.1 iidbQ un/rely 0/1 peerQ un/rely 0/0 serno 2-10
00:33:18: EIGRP: Requeued unicast on Serial1/0
00:33:18: EIGRP: Sending UPDATE on Serial1/0 nbr 172.16.4.1 <-发送完整更新(单播)
00:33:18: AS 100, Flags 0x1, Seq 6/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 2-10 <-初始化
00:33:18: EIGRP: Packet from ourselves ignored
00:33:18: EIGRP: Received UPDATE on Serial1/0 nbr 172.16.4.1
00:33:18: AS 100, Flags 0x1, Seq 34/6 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1
00:33:18: EIGRP: Enqueueing ACK on Serial1/0 nbr 172.16.4.1 <-接收到ACK
00:33:18: Ack seq 34 iidbQ un/rely 0/0 peerQ un/rely 1/0
00:33:18: EIGRP: Sending ACK on Serial1/0 nbr 172.16.4.1
00:33:18: AS 100, Flags 0x0, Seq 0/34 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 1/0
00:33:18: EIGRP: Enqueueing UPDATE on Serial1/0 iidbQ un/rely 0/1 serno 11-15
00:33:18: EIGRP: Enqueueing UPDATE on Serial1/0 nbr 172.16.4.1 iidbQ un/rely 0/0 peerQ un/rely 0/0 serno 11-15
00:33:18: EIGRP: Sending UPDATE on Serial1/0 nbr 172.16.4.1 <-发送更新后的完整更新
00:33:18: AS 100, Flags 0x0, Seq 7/34 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 11-15
00:33:19: EIGRP: Received UPDATE on Serial1/0 nbr 172.16.4.1
00:33:19: AS 100, Flags 0x0, Seq 35/7 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1
00:33:19: EIGRP: Serial1/0 multicast flow blocking cleared
00:33:19: EIGRP: Enqueueing ACK on Serial1/0 nbr 172.16.4.1 <-接收到ACK
00:33:19: Ack seq 35 iidbQ un/rely 0/0 peerQ un/rely 1/0
00:33:19: EIGRP: Sending ACK on Serial1/0 nbr 172.16.4.1
00:33:19: AS 100, Flags 0x0, Seq 0/35 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 1/0
00:33:21: EIGRP: Sending HELLO on Serial1/0
00:33:21: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
00:33:23: EIGRP: Received HELLO on Serial1/0 nbr 172.16.4.1 <-进入正常的hello
00:33:23: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
00:33:23: EIGRP: Packet from ourselves ignored
00:33:26: EIGRP: Sending HELLO on Serial1/0
00:33:26: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
00:33:27: EIGRP: Received HELLO on Serial1/0 nbr 172.16.4.1 <-进入正常的hello
注:
<!--[if !supportLists]-->l <!--[endif]-->标记(flags) EIGRP报文头部的标记状态,0x0表示没有标记被设置,0x1表示设置了初始化位,0x2表示设置了条件接收位。
<!--[if !supportLists]-->l <!--[endif]-->序列号(Seq) 报文序列号和确认报文序列号
<!--[if !supportLists]-->l <!--[endif]-->idbq 表示在接口上的输入队列报文数/输出队列报文数
<!--[if !supportLists]-->l <!--[endif]-->iidbq 表示在接口上等待传送的不可靠组播报文数/等待传送的可靠组播报文数
<!--[if !supportLists]-->l <!--[endif]-->peerQ 表示在接口上等待传送的不可靠单播报文数/等待传送的可靠单播报文数
<!--[if !supportLists]-->l <!--[endif]-->serno 表示一个指向某条路由的双重连接的序列号的指针。

