虚拟化环境网卡绑定模式

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

虚拟化环境网卡绑定模式

作者:郭国华,新炬网络技术专家

随着云计算的发展,虚拟化技术已普遍应用于各类型企业,同时虚拟化为服务器带来密集的网络吞吐压力已成为影响云计算发展的最大性能瓶颈之一,为了最大化提升主机网络性能,对不同的业务场景主机需配置合理的网卡BOND模式,本项目将在不对交换机做特别设置的KVM虚拟化环境下(交换机采用Trunk模式)对七种双网卡BOND模式进行测试,用数据说话浅析虚拟化环境网卡绑定模式应该如何选择。

一、测试环境方法介绍

(一)网络拓扑图

(二)测试环境及工具:

本项目使用2台服务器(各跑一台虚拟机)、3台交换机KVM虚拟化环境进行测试,测试软硬件环境及工具如下:

1、服务器:2台IBM X3950M2服务器(带2张千兆网卡),2台虚拟机;

2、交换机:1台Cisco Nexus 5548P,2台Cisco Nexus 2248TP,Trunk模式;

3、操作系统:linux redhat6.2,KVM虚拟化、网卡桥接模式(见上图);

4、测试工具:netperf、ping、scp、sar、iostat。

(三)具体测试项

拟定BOND模式的测试项目如下:

1、丢包率测试:通过ping命令测试主机间网络丢包情况;

2、网卡切换效率测试:通过down、up网卡测试切换过程ping与文件传输的中断

情况;

3、网络TCP、UDP吞吐量:通过netperf命令分别测试TCP与UDP的吞吐量;

4、网络速率测试:通过网络传输文件测试网络接收、发送速率。

二、七种网卡绑定模式介绍

网卡绑定7种模式官方说明如下,网上一堆资料在此不再赘述:

mode=0 (balance-rr)

Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

mode=1 (active-backup)

Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's 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.

mode=2 (balance-xor)

XOR policy: Transmit based on [(source MAC address XOR'd 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.

mode=3 (broadcast)

Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.

mode=4 (802.3ad)

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-requisites: 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 link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.

mode=5 (balance-tlb)

Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.

Prerequisite: Ethtool support in the base drivers for retrieving the speed of each slave.

mode=6 (balance-alb)

Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.

三、测试结果

通过测试发现只有3种模式适用于该虚拟化环境的虚拟机通讯需求,详见下表:

四、关键问题分析

也许大家比较疑惑“mod=0,mod=3、mod=4”大多需要交换机支持在该环境不适用还算正常,但“mod=6”是常用的负载均衡模式为什么不适用呢?通过分析情况如下:

相关文档
最新文档