等价路由在路由器和CE交换机上默认的行为是不同的,路由器总是走第一个下一跳,CE交换机是逐包。

2023-07-29,,

结论:

1、在eNSP中实验,路由器和CE交换机对于等价路由的默认转发行为是不同的,

路由器:默认是基于流的转发形态,更准确的来讲,ping两个不同的下一跳,都是走等价路由的第一个路由,不走第二条路由。

CE交换机:默认就是逐包转发,即使ping同一个目的ip, 流量也会在不同的下一跳上进行负载分担。

2、实验图如下:

3. 配置说明

R1 上配置默认路由,下一跳是两个,形成等价路由。

<Huawei>dis curr | inc ip route
ip route-static 0.0.0.0 0.0.0.0 20.0.0.2
ip route-static 0.0.0.0 0.0.0.0 10.0.0.2
<Huawei>

CE交换机上也是相同配置,下一跳是两个,形成等价路由。

<HUAWEI>dis curr | inc ip route
ip route-static 0.0.0.0 0.0.0.0 10.0.0.1
ip route-static 0.0.0.0 0.0.0.0 20.0.0.1
<HUAWEI>

4. 实验内容

(1)实验路由器默认情况下的等价路由。

步骤一、从PC1 ping PC3

步骤二、查看路由器的GE0/0/1, GE0/0/2的端口统计信息,如下,

可以看出,流量只会从GE 0/0/1发送,GE0/0/2没有发送流量。

<Huawei>dis interface GigabitEthernet 0/0/1
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:37 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5754
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:29:04-08:00
Hardware address is 5489-9806-5754
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 296 bytes, 4 packets
Output: 740 bytes, 10 packets
Input:
Unicast: 4 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 10 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>
<Huawei>dis interface GigabitEthernet 0/0/2
GigabitEthernet0/0/2 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:49 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 20.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5755
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:29:07-08:00
Hardware address is 5489-9806-5755
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 370 bytes, 5 packets
Output: 0 bytes, 0 packets
Input:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 0 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>

步骤三、从PC1 ping PC4, 目的是测试不同的流(PC4的ip和PC3的ip不同),会不会进行负载分担。

清楚R上的统计信息后,再ping.

步骤四、查看路由器的GE0/0/1, GE0/0/2的端口统计信息,如下,

可以看出,流量只会从GE 0/0/1发送,GE0/0/2没有发送流量。也就是说,即使是不同的流,也不会进行负载分担。

<Huawei>dis interface GigabitEthernet 0/0/1
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:37 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5754
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:33:39-08:00
Hardware address is 5489-9806-5754
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 370 bytes, 5 packets
Output: 740 bytes, 10 packets
Input:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 10 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>
<Huawei>dis interface GigabitEthernet 0/0/2
GigabitEthernet0/0/2 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:49 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 20.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5755
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:33:42-08:00
Hardware address is 5489-9806-5755
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 370 bytes, 5 packets
Output: 0 bytes, 0 packets
Input:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 0 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>

(2)实验路由器的逐包转发功能。

路由器的逐包转发功能,需要配置命令行:

步骤一、从PC1 ping PC3

步骤二、查看路由器的GE0/0/1, GE0/0/2的端口统计信息,如下,

可以看出是每个下一跳端口上都有转发流量,实现的是负载分担模式。

<Huawei>dis interface GigabitEthernet 0/0/1
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:37 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5754
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:20:52-08:00
Hardware address is 5489-9806-5754
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 370 bytes, 5 packets
Output: 370 bytes, 5 packets
Input:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>
<Huawei>dis interface GigabitEthernet 0/0/2
GigabitEthernet0/0/2 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:49 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 20.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5755
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:20:55-08:00
Hardware address is 5489-9806-5755
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 296 bytes, 4 packets
Output: 370 bytes, 5 packets
Input:
Unicast: 4 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>

其实,从上面的GE0/0/2能够接收到报文的结果看,已经证明CE交换机总是在逐包进行负载分担。下面再从实验上验证。

(3)验证交换机的默认转发

步骤一、从PC3 ping PC1.  ping 10个包

步骤二、查看CE交换机上的GE 1/0/1, GE1/0/2的统计信息,如下,

可以看出,即使目的ip相同,交换机也会进行逐包的转发行为。

<HUAWEI>dis interface GE 1/0/1
GE1/0/1 current state : UP (ifindex: 3)
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:50:25
Description:
Route Port,The Maximum Transmit Unit is 1500,The Maximum Frame Length is 9216
Internet Address is 10.0.0.2/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 0400-0611-0101
Last physical up time : 2018-01-14 18:50:25
Last physical down time : 2018-01-14 18:46:59
Current system time: 2018-01-14 19:39:46
Statistics last cleared:2018-01-14 19:38:38
Last 300 seconds input rate: 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bits/sec, 0 packets/sec
Input peak rate 0 bits/sec, Record time: -
Output peak rate 0 bits/sec, Record time: -
Input: 0 bytes, 9 packets
Output: 0 bytes, 5 packets
Input:
Unicast: 9 packets, Multicast: 0 packets
Broadcast: 0 packets, JumboOctets: 0 packets
CRC: 0 packets, Symbol: 0 packets
Overrun: 0 packets, InRangeLength: 0 packets
LongPacket: 0 packets, Jabber: 0 packets, Alignment: 0 packets
Fragment: 0 packets, Undersized Frame: 0 packets
RxPause: 0 packets
Output:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets, JumboOctets: 0 packets
Lost: 0 packets, Overflow: 0 packets, Underrun: 0 packets
System: 0 packets, Overruns: 0 packets
TxPause: 0 packets
Last 300 seconds input utility rate: 0.00%
Last 300 seconds output utility rate: 0.00%

<HUAWEI>
<HUAWEI>dis interface GE 1/0/2
GE1/0/2 current state : UP (ifindex: 4)
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:50:25
Description:
Route Port,The Maximum Transmit Unit is 1500,The Maximum Frame Length is 9216
Internet Address is 20.0.0.2/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 0400-0611-0102
Last physical up time : 2018-01-14 18:50:25
Last physical down time : 2018-01-14 18:46:59
Current system time: 2018-01-14 19:39:53
Statistics last cleared:2018-01-14 19:38:38
Last 300 seconds input rate: 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bits/sec, 0 packets/sec
Input peak rate 0 bits/sec, Record time: -
Output peak rate 0 bits/sec, Record time: -
Input: 0 bytes, 0 packets
Output: 0 bytes, 5 packets
Input:
Unicast: 0 packets, Multicast: 0 packets
Broadcast: 0 packets, JumboOctets: 0 packets
CRC: 0 packets, Symbol: 0 packets
Overrun: 0 packets, InRangeLength: 0 packets
LongPacket: 0 packets, Jabber: 0 packets, Alignment: 0 packets
Fragment: 0 packets, Undersized Frame: 0 packets
RxPause: 0 packets
Output:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets, JumboOctets: 0 packets
Lost: 0 packets, Overflow: 0 packets, Underrun: 0 packets
System: 0 packets, Overruns: 0 packets
TxPause: 0 packets
Last 300 seconds input utility rate: 0.00%
Last 300 seconds output utility rate: 0.00%

<HUAWEI>

等价路由在路由器和CE交换机上默认的行为是不同的,路由器总是走第一个下一跳,CE交换机是逐包。的相关教程结束。

《等价路由在路由器和CE交换机上默认的行为是不同的,路由器总是走第一个下一跳,CE交换机是逐包。.doc》

下载本文的Word格式文档,以方便收藏与打印。