深度分析linux网卡绑定的七种模式

上传人:第*** 文档编号:31499917 上传时间:2018-02-08 格式:DOC 页数:9 大小:116KB
返回 下载 相关 举报
深度分析linux网卡绑定的七种模式_第1页
第1页 / 共9页
深度分析linux网卡绑定的七种模式_第2页
第2页 / 共9页
深度分析linux网卡绑定的七种模式_第3页
第3页 / 共9页
深度分析linux网卡绑定的七种模式_第4页
第4页 / 共9页
深度分析linux网卡绑定的七种模式_第5页
第5页 / 共9页
点击查看更多>>
资源描述

《深度分析linux网卡绑定的七种模式》由会员分享,可在线阅读,更多相关《深度分析linux网卡绑定的七种模式(9页珍藏版)》请在金锄头文库上搜索。

1、深度分析Linux下双网卡绑定七种模式现在一般的企业都会使用双网卡接入,这样既能添加网络带宽,同时又能做相应的冗余,可以说是好处多多。而一般企业都会使用linux操作系统下自带的网卡绑定模式,当然现在网卡产商也会出一些针对windows操作系统网卡管理软件来做网卡绑定(windows操作系统没有网卡绑定功能 需要第三方支持)。进入正题,linux有七种网卡绑定模式:Mode=0:round robinMode=1:active-backupMode=2:load balancing (xor)Mode=3:fault-tolerance (broadcast)Mode=4:lacpMode=5

2、:transmit load balancingMode=6:adaptive load balancing第一种:bond0:round robin标准:round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.特点:(1)所有链路处于负载均衡状态,轮询方式往每条链路发送报文,基于per packet方式发送。服务上ping 一个相同

3、地址: 1.1.1.1 双网卡的两个网卡都有流量发出。负载到两条链路上,说明是基于per packet方式 ,进行轮询发送。(2)这模式的特点增加了带宽,同时支持容错能力,当有链路出问题,会把流量切换到正常的链路上。实际绑定结果:cat /proc/net/bonding/bond0Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)Bonding Mode: load balancing (round-robin)的模式MII Status: upMII Polling Interval (ms): 100Up Delay

4、(ms): 0Down Delay (ms): 0Slave Interface: eth0MII Status: upLink Failure Count: 0Permanent HW addr: 74:ea:3a:6a:54:e3Slave Interface: eth1MII Status: upLink Failure Count: 0应用拓扑:交换机端需要配置聚合口,cisco叫port channel。拓扑图如下:第二种:bond1:active-backup标准文档定义:Active-backup policy: Only one slave in the bond is act

5、ive. A different slave becomes active if, and only if, the active slave fails. The bonds MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.模式的特点:一个端口处于主状态 ,一个处于从

6、状态,所有流量都在主链路上处理,从不会有任何流量。当主端口down掉时,从端口接手主状态。实际绑定结果:root1:# cat /proc/net/bonding/bond0Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)Bonding Mode: fault-tolerance (active-backup) backup模式Primary Slave: NoneCurrently Active Slave: eth0MII Status: upMII Polling Interval (ms): 100Up Delay

7、 (ms): 0Down Delay (ms): 0Slave Interface: eth0MII Status: upLink Failure Count: 0Permanent HW addr: 74:ea:3a:6a:54:e3Slave Interface: eth1MII Status: upLink Failure Count: 0Permanent HW addr: d8:5d:4c:71:f9:94应用拓扑:这种模式接入不需要交换机端支持,随便怎么接入都行。第三种:bond2:load balancing (xor)标准文档描述:XOR policy: Transmit ba

8、sed on (source MAC address XORd with destination MAC address) modulo slave count. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.特点:该模式将限定流量,以保证到达特定对端的流量总是从同一个接口上发出。既然目的地是通过MAC地址来决定的,因此该模式在“本地 ”网络配置下可以工作得很好。如果所有流量是通过单个路由器(比如 “网关”型网

9、络配置,只有一个网关时,源和目标mac都固定了,那么这个算法算出的线路就一直是同一条,那么这种模式就没有多少意义了。),那该模式就不是最好的选择。和balance-rr一样,交换机端口需要能配置为“port channel”。这模式是通过源和目标mac做hash因子来做xor算法来选路的。实际绑定结果:rootlocalhost # cat /proc/net/bonding/bond0Ethernet Channel Bonding Driver: v3.0.3 (March 23, 2006)Bonding Mode: load balancing (xor) 配置为xor模式Transm

10、it Hash Policy: layer2 (0)MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Slave Interface: eth1MII Status: upLink Failure Count: 0Permanent HW addr: 00:d0:f8:40:f1:a0Slave Interface: eth2MII Status: upLink Failure Count: 0Permanent HW addr: 00:d0:f8:00:0c:0c应用拓扑:同bond0一

11、样的应用模型。这个模式也需要交换机配置聚合口。第四种:bond3:fault-tolerance (broadcast)标准文档定义:Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.特点:这种模式的特点是一个报文会复制两份往bond下的两个接口分别发送出去,当有对端交换机失效,我们感觉不到任何downtime,但此法过于浪费资源;不过这种模式有很好的容错机制。此模式适用于金融行业,因为他们需要高可靠性的网络,不允许出现任何问题。实际绑定结果:ro

12、otubuntu12:/ram# cat /proc/net/bonding/bond0Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)Bonding Mode: fault-tolerance (broadcast) - fault-tolerance 模式MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Slave Interface: eth0MII Status: upLink Failure Count: 0

13、Permanent HW addr: 74:ea:3a:6a:54:e3Slave Interface: eth1MII Status: upLink Failure Count: 0Permanent HW addr: d8:5d:4c:71:f9:94应用拓扑:如下:这种模式适用于如下拓扑,两个接口分别接入两台交换机,并且属于不同的vlan,当一边的网络出现故障不会影响服务器另一边接入的网络正常工作。而且故障过程是0丢包。下面展示了这种模式下ping信息:64 bytes from 1.1.1.1: icmp_seq=901 ttl=64 time=0.205 ms64 bytes fro

14、m 1.1.1.1: icmp_seq=901 ttl=64 time=0.213 ms (DUP!) dup为重复报文64 bytes from 1.1.1.1: icmp_seq=902 ttl=64 time=0.245 ms64 bytes from 1.1.1.1: icmp_seq=902 ttl=64 time=0.254 ms (DUP!)64 bytes from 1.1.1.1: icmp_seq=903 ttl=64 time=0.216 ms64 bytes from 1.1.1.1: icmp_seq=903 ttl=64 time=0.226 ms (DUP!)从这

15、个ping信息可以看到,这种模式的特点是,同一个报文服务器会复制两份分别往两条线路发送,导致回复两份重复报文,这种模式有浪费资源的嫌疑。第五种:bond4:lacp标准文档定义:IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification. Pre-requisite

16、s: 1. Ethtool support in the base drivers for retrieving.the speed and duplex of each slave. 2. A switch that supports IEEE 802.3ad Dynamic linkaggregation. Most switches will require some type of configuration to enable 802.3ad mode.特点:802.3ad模式是 IEEE标准,因此所有实现了 802.3ad的对端都可以很好的互操作。802.3ad 协议包括聚合的自动配置,因此只需要很少的对交换机的手动配置(要指出的是,只有某些设备才能使用802.3ad)。802.3ad标准也要求帧按顺序(一定程度上)传递,因此通常单个连接不会看到包的乱序。802.3ad也有些缺点:标准要求所有设备在聚合操作时,要在同样的速率和双工模式,而且,和除了balance-rr模式外的

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号