打印

EIGRP-2:EIGRP非等成本的负载均衡

EIGRP-2:EIGRP非等成本的负载均衡

EIGRP非等成本的负载均衡


——验证新版本IOS的“四舍五入”改进



一、实验拓扑图:




二、实验目的:
为了验证EIGRPCisco较新版本的IOS中,将链路开销的比值四舍五入的进行负载均衡传输,我们将链路的开销修改为1:1.65(其他也可以)。在R2的两个接口上采用访问控制链表的方式进行抓包验证,也可以通过在R1路由器上通过show ip route 2.2.2.2查看发包的顺序。
实验还要验证一个细节:Cisco的不同版本的IOSEIGRP关于非等开销的负载均衡处理方式是不同的。
三、具体配置:
R1
R2
!
no ip cef
!
interface Loopback0

ip address 1.1.1.1 255.255.255.0

!
interface FastEthernet0/0

ip address 20.0.0.1 255.255.255.0


delay 14262


duplex half

!
interface Serial1/0

ip address 10.0.0.1 255.255.255.0


no ip route-cache


serial restart-delay 0

……
!
router eigrp 10

variance 3


network 1.1.1.1 0.0.0.0


network 10.0.0.0 0.0.0.255

no auto-summary
!
interface Loopback0

ip address 2.2.2.2 255.255.255.0

!
interface FastEthernet0/0

ip address 20.0.0.2 255.255.255.0


ip access-group 20 in


delay 142620


duplex half

!
interface Serial1/1

ip address 10.0.0.2 255.255.255.0


ip access-group 10 in


serial restart-delay 0

!
router eigrp 10

variance 3


network 2.2.2.2 0.0.0.0


network 10.0.0.0 0.0.0.255


network 20.0.0.0 0.0.0.255


network 30.0.0.0 0.0.0.255


no auto-summary

注意:在R1中红字标识的配置尤为重要,本人就是因为没有想起来这点,直接导致整整搞了将近5个小时的这个“可恶”的负载均衡,闲话不说,no ip cef
这个命令的作用是关闭路由器的快速转发功能,禁用CEF快速转发,也就是说,这个CEF中保存着和路由表一样的信息,当有包要发的时候路由器首先查询CEF缓存,如果有同样的条目,则根据转发记录直接转发,而并不通过路由器的路由表,所以也就代表着,如果不关闭这个CEF,包永远从一个端口转发,而达不到负载均衡的效果。切记。。。。。。

四、实验现象:
1IOS版本7200 12.3 或者 12.2(T)
R1#sh ip rou

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BG

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

1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

D
1.0.0.0/8 is a summary, 00:24:09, Null0

C
1.1.1.0/24 is directly connected, Loopback0

D
2.0.0.0/8 [90/2297856] via 10.0.0.2, 00:21:54, Serial1/0


[90/3810560] via 20.0.0.2, 00:21:54, Ethernet0/0


20.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

D
20.0.0.0/8 is a summary, 00:22:04, Null0

C
20.0.0.0/24 is directly connected, Ethernet0/0


10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

D
10.0.0.0/8 is a summary, 00:21:54, Null0

C
10.0.0.0/24 is directly connected, Serial1/0



R1# sh ip ei to

IP-EIGRP Topology Table for AS(10)/ID(1.1.1.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,

r - reply Status, s - sia Status

P 1.0.0.0/8, 1 successors, FD is 128256

via Summary (128256/0), Null0

P 1.1.1.0/24, 1 successors, FD is 128256

via Connected, Loopback0

P 2.0.0.0/8, 1 successors, FD is 409600

via 10.0.0.2 (2297856/128256), Serial1/0


via 20.0.0.2 (3810560/128256), Ethernet0/0

P 10.0.0.0/8, 1 successors, FD is 2169856

via Summary (2169856/0), Null0

P 10.0.0.0/24, 1 successors, FD is 2169856

via Connected, Serial1/0

P 20.0.0.0/8, 1 successors, FD is 2870016

via Summary (3682560/0), Null0



via 10.0.0.2 (2195456/281600), Serial1/0

P 20.0.0.0/24, 1 successors, FD is 3682560

via Connected, Ethernet0/0


R1#sh ip rou 2.2.2.2
Routing entry for 2.0.0.0/8

Known via "eigrp 10", distance 90, metric 2297856, type internal


Redistributing via eigrp 10


Last update from 20.0.0.2 on Ethernet0/0, 00:22:29 ago


Routing Descriptor Blocks:


10.0.0.2, from 10.0.0.2, 00:22:29 ago, via Serial1/0


Route metric is 2297856, traffic share count is
2


Total delay is 25000 microseconds, minimum bandwidth is 1544 Kbit


Reliability 255/255, minimum MTU 1500 bytes


Loading 1/255, Hops 1


* 20.0.0.2, from 20.0.0.2, 00:22:29 ago, via Ethernet0/0


Route metric is 3810560, traffic share count is
1


Total delay is 6000 microseconds, minimum bandwidth is 700 Kbit


Reliability 255/255, minimum MTU 1500 bytes


Loading 1/255, Hops 1


可以看到,同样的配置,到了这个版本的IOS下面就会被四舍五入为1:2


这次用IOS版本为12.4
R1#sh ip ei 10 to
IP-EIGRP Topology Table for AS(10)/ID(1.1.1.1)

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

r - reply Status, s - sia Status


P 1.0.0.0/8, 1 successors, FD is 128256

via Summary (128256/0), Null0

P 1.1.1.0/24, 1 successors, FD is 128256

via Connected, Loopback0

P 2.0.0.0/8, 1 successors, FD is 156160

via 10.0.0.2 (2297856/128256), Serial1/0


via 20.0.0.2 (3787520/128256), FastEthernet0/0

P 10.0.0.0/8, 1 successors, FD is 2169856

via Summary (2169856/0), Null0

P 10.0.0.0/24, 1 successors, FD is 2169856

via Connected, Serial1/0

P 20.0.0.0/8, 1 successors, FD is 3557888

via Summary (3659520/0), Null0


via 10.0.0.2 (2172416/28160), Serial1/0

P 20.0.0.0/24, 1 successors, FD is 3659520

via Connected, FastEthernet0/0


R1#sh ip rou 2.2.2.2
Routing entry for 2.0.0.0/8

Known via "eigrp 10", distance 90, metric 2297856, type internal


Redistributing via eigrp 10


Last update from 20.0.0.2 on FastEthernet0/0, 00:00:34 ago


Routing Descriptor Blocks:


* 20.0.0.2, from 20.0.0.2, 00:00:34 ago, via FastEthernet0/0


Route metric is 3787520, traffic share count is
73


Total delay is 5100 microseconds, minimum bandwidth is 700 Kbit


Reliability 255/255, minimum MTU 1500 bytes


Loading 1/255, Hops 1


10.0.0.2, from 10.0.0.2, 00:00:34 ago, via Serial1/0


Route metric is 2297856, traffic share count is
120


Total delay is 25000 microseconds, minimum bandwidth is 1544 Kbit


Reliability 255/255, minimum MTU 1500 bytes


Loading 1/255, Hops 1


!!注意:在12.4版本中这个比值不再四舍五入,但是否会无限制的扩大,我们可以设想,如果可以无限制的扩大,达到9991000甚至更大,那么转发的方式是极不合理的,两条链路都会拥塞,我们改动一下Fa0/0口的带宽Bandwidth 720(之前为700)。
R1#sh ip rou 2.2.2.2
Routing entry for 2.0.0.0/8

Known via "eigrp 10", distance 90, metric 2297856, type internal


Redistributing via eigrp 10


Last update from 20.0.0.2 on FastEthernet0/0, 00:00:01 ago


Routing Descriptor Blocks:


* 20.0.0.2, from 20.0.0.2, 00:00:01 ago, via FastEthernet0/0


Route metric is 3685888, traffic share count is
5


Total delay is 5100 microseconds, minimum bandwidth is 720 Kbit


Reliability 255/255, minimum MTU 1500 bytes


Loading 1/255, Hops 1


10.0.0.2, from 10.0.0.2, 00:00:01 ago, via Serial1/0


Route metric is 2297856, traffic share count is
8


Total delay is 25000 microseconds, minimum bandwidth is 1544 Kbit


Reliability 255/255, minimum MTU 1500 bytes


Loading 1/255, Hops 1


可以很明显的看到,路由器对开销的比例做了处理,比12.2的版本更合理,将比值在更合理的范围内变得更加精细,是负载均衡更高效。。


帖子来自汤姆一通,yangrubing-ITAA QQ:383506128

TOP

发现一个错误 默认cisco路由器cef是关闭的, fast switching是开启,要达到实验效果,要关闭fast switching,即在接口下打上no ip route-cache,使路由器基于数据包转发。

R1#sho ip int s1/0
Serial1/0 is up, line protocol is up
Internet address is 12.1.1.1/24
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
IP fast switching on the same interface is enabled
IP Flow switching is disabled
IP CEF switching is disabled
IP Fast switching turbo vector
IP multicast fast switching is enabled
IP multicast distributed fast switching is disabled
IP route-cache flags are Fast
Router Discovery is disabled
IP output packet accounting is disabled
IP access violation accounting is disabled
TCP/IP header compression is disabled
RTP/IP header compression is disabled
Policy routing is disabled
Network address translation is disabled
WCCP Redirect outbound is disabled
WCCP Redirect inbound is disabled
WCCP Redirect exclude is disabled
BGP Policy Mapping is disabled


帖子来自汤姆一通,yangrubing-ITAA QQ:383506128

TOP

总结一下,有2种改进:
1、全部做成 N :1的比率,n做四舍五入(12.2T)
2、做成n:m的比率,n,m超过一定数值,也取四舍五入(12.4)
3、最古老的方式,n:m的比率,n、m为互质,数值几乎可以没有上限

这里面其实是1最合理,因为在12.4也可以作出大数比值:

R2#show ip ro 1.1.1.1
Routing entry for 1.0.0.0/8
Known via "eigrp 100", distance 90, metric 1231872, type internal
Redistributing via eigrp 100
Last update from 10.1.1.1 on Ethernet0/0, 00:00:04 ago
Routing Descriptor Blocks:
* 12.1.1.1, from 12.1.1.1, 00:00:04 ago, via Serial1/0
Route metric is 1231872, traffic share count is 240
Total delay is 10000 microseconds, minimum bandwidth is 2623 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 1
10.1.1.1, from 10.1.1.1, 00:00:04 ago, via Ethernet0/0
Route metric is 1983232, traffic share count is 149
Total delay is 6000 microseconds, minimum bandwidth is 1399 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 1

TOP