结论:

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交换机是逐包。的更多相关文章

  1. 交换机上的trunk,hybrid,access配置和应用(转)

    交换机上的trunk,hybrid,access配置和应用 以太网端口的链路类型: Access类型:端口只能属于一个vlan,一般用于连接计算机. Trunk类型:端口可以属于端个vlan,可以接收 ...

  2. 关于ECMP 等价路由

    1.ECMP简介 Equal-CostMultipathRouting,等价多路径.即存在多条到达同一个目的地址的相同开销的路径.当设备支持等价路由时,发往该目的 IP 或者目的网段的三层转发流量就可 ...

  3. 浅析ECMP等价路由

    1.ECMP简介 Equal-CostMultipathRouting,等价多路径.即存在多条到达同一个目的地址的相同开销的路径.当设备支持等价路由时,发往该目的 IP 或者目的网段的三层转发流量就可 ...

  4. 在H3C交换机上开通一个VLAN并且开通一个端口ping通它

    <H3C>system-view System View: return to User View with Ctrl+Z. [H3C]interface vlan-interface 2 ...

  5. 交换机上的MAC地址表

    拓扑图: 1.首先在R1上的配置: R1(config)#int R1(config)#interface g R1(config)#interface gigabitEthernet 0/0 R1( ...

  6. 交换机上禁止某个MAC地址通信

    当分析出网络中某台机器中毒时而有不知道它的具体位置,我们可以通过获取其MAC地址然后在交换机上禁止其MAC来达到隔离它的效果.通过ARP表查询IP地址对应的MAC地址,再将该MAC地址加入黑名单过滤. ...

  7. linux 接口地址全部清除才清理从此接口发出的下一跳路由

    接口地址全部清除才清理从此接口发出的下一跳路由 如: eth7配置两个地址 eth7: 192.168.1.1 10.1.1.1 添加一条路由: route add -net 2.2.2.0/24 g ...

  8. bootstrap导航条在手机上默认展开二级目录,必须用setTimeout才能实现

    bootstrap导航条在手机上默认展开二级目录,必须用setTimeout才能实现 $(document).ready(function() { $('.dropdown').hover(funct ...

  9. Linux3.5内核以后的路由下一跳缓存

    在Linux3.5版本号(包括)之前.存在一个路由cache.这个路由cache的初衷是美好的,可是现实往往是令人遗憾的.下面是陈列得出的两个问题:1.面临针对hash算法的ddos问题(描写叙述该问 ...

随机推荐

  1. [Swift]LeetCode354. 俄罗斯套娃信封问题 | Russian Doll Envelopes

    You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envel ...

  2. [Swift]LeetCode377. 组合总和 Ⅳ | Combination Sum IV

    Given an integer array with all positive numbers and no duplicates, find the number of possible comb ...

  3. FastDFS 学习笔记

      一.理论基础 FastDFS比较适合以中小文件为载体的在线服务,比如跟NGINX(APACHE)配合搭建图片服务器. 分布式文件系统FastDFS FastDFS是纯C语言实现,只支持Linux. ...

  4. Build Assimp library for Android

    Build Assimp library for Android 首先各路教程中有推荐使用 NDK 或者 STANDALONE TOOLCHAIN 编译的,根据我的理解,这两种方式都是可以的,如果能直 ...

  5. java初见

    public class Diyi{ public static void main(String[] args){ System.out.println("Hello,world" ...

  6. 面试前必知Redis面试题—缓存雪崩+穿透+缓存与数据库双写一致问题

    今天来分享一下Redis几道常见的面试题: 如何解决缓存雪崩? 如何解决缓存穿透? 如何保证缓存与数据库双写时一致的问题? 一.缓存雪崩 1.1什么是缓存雪崩? 回顾一下我们为什么要用缓存(Redis ...

  7. 火狐l浏览器所有版本

    最近在群里看到好多人需要火狐浏览器的低版本,而且都是跪求,更有甚者是高额悬赏,因此给大家一个链接,免费的,免费的,免费的!!!重要的事说三遍,拿走不谢~~ 火狐所有版本,了解一下,有需要的自行下载. ...

  8. 版本管理工具Git(一)简要介绍

    版本管理工具不但可以备份而且还能记录版本,也就是同一个东西不同时期的状态同时可以跟踪追溯.版本管理工具由CVS.SVN.Git.GitHub. 最早的版本管理工具CVS,因为多人开发项目导致工作很难协 ...

  9. Spring boot 之自动生成API文档swagger2

    目前解决API的方案一般有两种 1.编写文档接口.2.利用一些现成的api系统.3.如我一般想搞点特色的就自己写个api系统:http://api.zhaobaolin.vip/ ,这个还支持多用户. ...

  10. 【java多线程】多线程的创建三种方式--笔记

    申明:线程的概念以及进程的相关概念,可以参考网络上其他资料,这里只讨论多线程是怎么实现. 一.多线程的简单理解 明白什么是多线程,小生通俗一点的理解为:在一个程序里,我想同时让这个程序完成多个任务. ...