CCIE SP-EIGRP 小结
lo0:172.16.2.1/24 lo1: 10.1.1.1 /30 ---------+------- | +-+-+ |R2 | S1/0 *---* S1/1 / \ 172.16.3.0/30 / \ 192.168.10.8/30 / \ S1/0 / \ S1/1 +---+ S1/1 S1/0 *---+ |R1 |--------------|R3 | +-+-+ +-+-+ | 192.168.10.4/30 | -----------+----- ---------+-------- lo0:172.16.1.1/24 lo0:192.168.1.1/24
Configuration
R1:
interface Loopback0 ip address 172.16.1.1 255.255.255.0 ! interface Serial1/0 ip address 172.16.3.1 255.255.255.252 ! interface Serial1/1 ip address 192.168.10.5 255.255.255.252 ! router eigrp 1 network 172.16.0.0 network 192.168.10.4 0.0.0.3
R2:
interface Loopback0 ip address 172.16.2.1 255.255.255.0 ! interface Loopback1 ip address 10.1.1.1 255.255.255.252 ! interface Serial1/0 ip address 172.16.3.2 255.255.255.252 ! interface Serial1/1 ip address 192.168.10.9 255.255.255.252 ! router eigrp 1 network 172.16.0.0 network 192.168.10.8 0.0.0.3
R3:
interface Loopback0 ip address 192.168.1.1 255.255.255.0 ! interface Serial1/0 ip address 192.168.10.6 255.255.255.252 ! interface Serial1/1 ip address 192.168.10.10 255.255.255.252 ! router eigrp 1 network 192.168.1.0 network 192.168.10.0
EIGRP度量值的计算
EIGRP度量值计算需要以下几个要素:分为带宽、延迟、可靠性、负载,一般常用带宽和延迟。
可以用“bandwidth”更改带宽度量值,这里的bandwidth只是更改BW的值,对实际带宽没有任何影响。
度量值的计算公式:
简化公式:[(10^7)/带宽(最小)]*256 + [总延迟/10]*256
注意10的7次方没有任何意义,只是一个参量。
256也没有任何意义,只是增大EIGRP度量值的颗粒度。
注:默认只有带宽和延迟(k1和k3)是1,其他都是0,所以计算EIGRP时,只用带宽和延迟
2013-11-09 更新:Wide Metrics
在现有10G或更高带宽的网络环境下,老的Metric显然没有任何优势,如下所示:GigabitEthernet: Scaled Bandwidth = 10,000,000 / 1,000,000 Scaled Delay = 10 / 10 Composited Metric = (10 + 1) * 256 = 2816 10 GigabitEthernet: Scaled Bandwidth = 10,000,000 / 10,000,000 Scaled Delay = 10 / 10 Composited Metric = (1 + 1) * 256 = 512 20 GigabitEthernet: Scaled Bandwidth = 10,000,000 / 20,000,000 Scaled Delay = 10 / 10 Composited Metric = (1/2 + 1) * 256 = 512 40 GigabitEthernet: Scaled Bandwidth = 10,000,000 / 40,000,000 Scaled Delay = 10 / 10 Composited Metric = (1/4 + 1) * 256 = 512所以当在混合(既有Gi也有10Gi)的网络中,可能造成不优选10Gi,因为从Gi开始,delay都是10,带宽用的是mini bandwidth,因此老的Metric在现有网络中已经不再适用。思科在新的版本中已经推出了Wide Metric,不过说实话,弄得太复杂了,还引入了皮秒(picoseconds: 1,000,000 皮秒 = 1微秒),把原来的256变成了65535,从而导致计算出来metric远远大于RIB表中的32bit,因此算出来的结果也跟RIB表中显示的不一样,弄这么复杂,如何维护。。。
下面是具体的公式:
跟老的metric一样,默认只用到k1和k3,另外还多了很多参考量:EIGRP_BANDWIDTH 10,000,000 EIGRP_DELAY_PICO 1,000,000 EIGRP_INACCESSIBLE -1 EIGRP_MAX_HOPS 100 EIGRP_CLASSIC_SCALE 256 EIGRP_WIDE_SCALE 65536 EIGRP_RIB_SCALE 128下面是1G和10G两种端口Metric的计算方法
1 GigabitEthernet: Delay = Interface Delay * EIGRP_DELAY_PICO = 10 * 1,000,000 = 10,000,000 Latency = (Delay * EIGRP_WIDE_SCALE) / EIGRP_DELAY_PICO = (10,000,000 * 65536) / 1,000,000 = 655,360 Throughput = (EIGRP_BANDWIDTH * EIGRP_WIDE_SCALE) / Interface Bandwidth = (10,000,000 * 65536) / 1,000,000 Kbits/sec = 655,360 Metric = (K1 • min(Throughput)) + (K3 • ∑ Latency) = 655,360 + 655,360 = 1,310,720 RIB Metric = Wide Metric / EIGRP_RIB_SCALE = 1310,720 / 128 = 10240 RP/0/RSP0/CPU0:ASR9K.18#show eigrp topology 30.0.0.0/24 Sat Nov 9 13:00:23.165 UTC IPv4-EIGRP AS(1): Topology entry for 30.0.0.0/24 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 1310720, RIB is 10240 Routing Descriptor Blocks: 0.0.0.0 (GigabitEthernet0/2/0/9), from Connected, Send flag is 0x0 Composite metric is (1310720/0), Route is Internal Vector metric: Minimum bandwidth is 1000000 Kbit Total delay is 10000000 picoseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 0 Originating router is 10.246.0.1 10 GigabitEthernet: Delay = Interface Delay * EIGRP_DELAY_PICO = 1 * 1,000,000 = 1,000,000 Latency = (Delay * EIGRP_WIDE_SCALE) / EIGRP_DELAY_PICO = (1,000,000 * 65536) / 1,000,000 = 65,536 Throughput = (EIGRP_BANDWIDTH * EIGRP_WIDE_SCALE) / Interface Bandwidth = (10,000,000 * 65536) / 10,000,000 Kbits/sec = 65,536 Metric = (K1 • min(Throughput)) + (K3 • ∑ Latency) = 65,536 + 65,536 = 131,072 RIB Metric = Wide Metric / EIGRP_RIB_SCALE = 131,072 / 128 = 1024 RP/0/RSP0/CPU0:ASR9K.18#show eigrp topology 1.1.1.0/24 Sat Nov 9 12:57:36.567 UTC IPv4-EIGRP AS(1): Topology entry for 1.1.1.0/24 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 131072, RIB is 1024 Routing Descriptor Blocks: 0.0.0.0 (TenGigE0/2/1/0), from Connected, Send flag is 0x0 Composite metric is (131072/0), Route is Internal Vector metric: Minimum bandwidth is 10000000 Kbit Total delay is 1000000 picoseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 0 Originating router is 10.246.0.1
下面拿R1收到的路由192.168.1.0/24举例说明:
R1#sh int s1/1 Serial1/1 is up, line protocol is up Hardware is M4T Internet address is 192.168.10.5/30 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, reliability 255/255, txload 1/255, rxload 1/255
------------------------------------------------------------ R3#sh int lo0 Loopback0 is up, line protocol is up Hardware is Loopback Internet address is 192.168.1.1/24 MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec, reliability 255/255, txload 1/255, rxload 1/255 !---注意在计算度量值时,只考虑路由进入端口的参数,例如要计算192.168.1.0/24的度量值 !---只需考虑R3的lo0,R1的S1/1两个端口的带宽和延迟参数 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 192.168.10.0/24 is variably subnetted, 3 subnets, 2 masks D 192.168.10.0/24 is a summary, 00:06:56, Null0 C 192.168.10.4/30 is directly connected, Serial1/1 D 192.168.10.8/30 [90/2681856] via 192.168.10.6, 00:06:56, Serial1/1 172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks D 172.16.0.0/16 is a summary, 00:07:02, Null0 C 172.16.1.0/24 is directly connected, Loopback0 D 172.16.2.0/24 [90/2297856] via 172.16.3.2, 00:08:09, Serial1/0 C 172.16.3.0/30 is directly connected, Serial1/0 D 192.168.1.0/24 [90/2297856] via 192.168.10.6, 00:06:55, Serial1/1 !---根据公式,1544Kbit是最小BW,所以[(10^7)/1544]*256 = 1657856 !---延迟部分为[(20000 + 5000)/10]*256 = 640000 !---度量值= 1657856 + 640000 = 2297856
DUAL算法的术语
2011-02-06 更新:
1. 增加对术语的解释。
2. 修正实例中的个别解释。
1. 后继路由器(Successor):FS中FD最小的就是后继路由器,如果有相等的,就负载分担。
2. 可行距离(FD):到目的网段的最小度量值。
3. 可行后续路由器(FS):到达目的网段的下一跳路由器,并符合FC。
4. 报告距离(RD),或称通告距离(AD):每个FS的可行距离。
5. 可行性条件(FC):当RD小于FD时,符合条件;如果大于,就没有资格成为FS。
常用到的命令:
1. show inter x/x >>>查看mtu、带宽、延迟、可靠性、负载
2. show ip route >>>确认后继路由和可行距离(FD)
3. show ip eigrp topology >>>可查看可行后续路由器的信息(FS),不包括不符合FC的路由器
4. show ip eigrp topology all-link >>>包括所有可能链路,即时不符合FS
下面还是拿R1学到的路由192.168.1.0/24举例
R1#sh ip eigrp topology IP-EIGRP Topology Table for AS(1)/ID(172.16.1.1) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 192.168.10.0/24, 1 successors, FD is 2169856 via Summary (2169856/0), Null0 P 192.168.10.4/30, 1 successors, FD is 2169856 via Connected, Serial1/1 P 192.168.1.0/24, 1 successors, FD is 2297856 via 192.168.10.6 (2297856/128256), Serial1/1 !---1个后继路由器,符合FC,到目的网段的下一跳路由器,就是R3 !---2297856是FD;128256是R3到此路由的FD,在这里叫RD !---所谓FC就是RD要小于最优路由的FD,即时等于也不行 !---根据topology,R1可以通过R2到达R3,但为什么没在表中? P 192.168.10.8/30, 1 successors, FD is 2681856 via 192.168.10.6 (2681856/2169856), Serial1/1 P 172.16.0.0/16, 1 successors, FD is 128256 via Summary (128256/0), Null0 P 172.16.1.0/24, 1 successors, FD is 128256 via Connected, Loopback0 P 172.16.2.0/24, 1 successors, FD is 2297856 via 172.16.3.2 (2297856/128256), Serial1/0 P 172.16.3.0/30, 1 successors, FD is 2169856 via Connected, Serial1/0 R1#sh ip eigrp topology all IP-EIGRP Topology Table for AS(1)/ID(172.16.1.1) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 192.168.1.0/24, 1 successors, FD is 2297856, serno 17 via 192.168.10.6 (2297856/128256), Serial1/1 via 172.16.3.2 (2809856/2297856), Serial1/0 !---这里可以看到通过R2学来的路由信息 !---明显R2学来的路由的RD等于最优路由的FD,所以不满足FC !---因此不会加到topology表中,也就不会成为可行后继路由FS
那么可行后继路由FS到底起到什么作用呢?
当存在可行后继路由时,不用DUAL计算,直接用后继路由替换当前失效路由,速度非常快。
在此例中,可以通过更改BW使其满足FC并把路由存入topology表中。
由于R3环回口的带宽是8,000,000,所以忽略R3,直接更改R1的S1/0和R2的S1/1两个端口的带宽
R2#sh int s1/1 Serial1/1 is up, line protocol is up Hardware is M4T Internet address is 192.168.10.9/30 MTU 1500 bytes, BW 10000 Kbit, DLY 20000 usec, reliability 255/255, txload 1/255, rxload 1/255 R1#sh int s1/0 Serial1/0 is up, line protocol is up Hardware is M4T Internet address is 172.16.3.1/30 MTU 1500 bytes, BW 10000 Kbit, DLY 20000 usec, reliability 255/255, txload 1/255, rxload 1/255 R1#sh ip eigrp topology 192.168.1.0 IP-EIGRP (AS 1): Topology entry for 192.168.1.0/24 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 1408000 Routing Descriptor Blocks: 172.16.3.2 (Serial1/0), from 172.16.3.2, Send flag is 0x0 Composite metric is (1408000/896000), Route is Internal !---1408000是FD,896000是R2的RD Vector metric: Minimum bandwidth is 10000 Kbit !---最小带宽 Total delay is 45000 microseconds !---总共的延迟 Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 2 192.168.10.6 (Serial1/1), from 192.168.10.6, Send flag is 0x0 Composite metric is (2297856/128256), Route is Internal !---2297856是FD,128256是R3的RD Vector metric: Minimum bandwidth is 1544 Kbit Total delay is 25000 microseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 1 R1#sh ip eig to IP-EIGRP Topology Table for AS(1)/ID(172.16.1.1) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 192.168.1.0/24, 1 successors, FD is 1408000 via 172.16.3.2 (1408000/896000), Serial1/0 via 192.168.10.6 (2297856/128256), Serial1/1 !---这回可以看到,从R2学来的路由已经加进topology表中了 !---因为AD 128256 < FD 1408000满足FC !---另外从R2学来的路由反而成了后续路由(1408000<2297856) !---现在的路径是R1--->R2--->R3,显然它不是最优路径
2013-3-9 更新: External Metric
当从一个eigrp域A red到另一个eigrp域B时,在eigrp 域B中能看到“External Metric”,这个类似于OSPF的E1吧,ASBR到外部的meric和域内到ASBR的metric。
非等价负载均衡
根据上面的实验,192.168.1.0在topology表中已经有后继路由和可行后继路由,但是路由表中只有后继路由,如何把可行后继路由加入路由表中呢?这就需要EIGRP的负载均衡特性。
EIGRP的负载均衡与其他协议的负载均衡不太一样,它是唯一一个支持非等价负载均衡的路由协议。
可以通过“variance”来进行配置,这个参数只是一个差额 = (大的metric)/(小的metric)
咱们继续拿上面的例子,2297856/1408000=1.632,约等于2
R1#sh run | b r e router eigrp 1 variance 2 network 172.16.0.0 network 192.168.10.4 0.0.0.3 auto-summary R1#sh ip route 192.168.1.0 Routing entry for 192.168.1.0/24 Known via "eigrp 1", distance 90, metric 1408000, type internal Redistributing via eigrp 1 Last update from 192.168.10.6 on Serial1/1, 00:01:15 ago Routing Descriptor Blocks: 192.168.10.6, from 192.168.10.6, 00:01:15 ago, via Serial1/1 Route metric is 2297856, traffic share count is 49 Total delay is 25000 microseconds, minimum bandwidth is 1544 Kbit Reliability 255/255, minimum MTU 1500 bytes Loading 1/255, Hops 1 * 172.16.3.2, from 172.16.3.2, 00:01:15 ago, via Serial1/0 Route metric is 1408000, traffic share count is 80 Total delay is 45000 microseconds, minimum bandwidth is 10000 Kbit Reliability 255/255, minimum MTU 1500 bytes Loading 1/255, Hops 2 !---关于CEF负载均衡的问题,可以参考我以前的文章
EIGRP其他的特性
1. 通过“ip bandwidth-per eigrp as-num per”来调整EIGRP使用的带宽百分比
2. 通过“ip hello-inter eigrp as-num sec”来调整Hello间隔时间
(不同链路,默认的hello间隔和保持时间也是不同的)
3. 通过“no auto”来关闭自动汇总
4. 通过“ip summary-address eigrp as-num x.x.x.x x.x.x.x”
配置手动汇总(与RIP一样),注意此命令在端口下配置
5. 把其他协议重分发到EIGRP时,必须指定metric,RIP也一样