在从服务器接收结果时发生传输级错误_服务器网卡的7种Bond模式详解及服务器接入交换机必要的相关配置...

​本次进行bond讲解,也是源于之前有个朋友在项目中遇到的真实场景,出于应用可靠考虑,应用服务器的网卡进行了物理上的冗余配置,也就是需要针对网卡上一同的网口进行bonding,那么问题就来了,服务器上的Bond有7种之多,应用服务器上需要配置什么样的Bond配置呢,配置Bond以后,服务器接入交换机如何进行配置呢。

b59051300ccd1baa7d7df057ae1510e2.png

下面就结合国外的一篇为《Linux Network bonding – setup guide》的文章(原文章标题截图如上),仅对服务器网卡Bond的7种模式进行介绍,我对其进行了有限的翻译,能力比较有限,但大概意思差不多翻译出来了。我再结合之前的网络经验,在每种模式下,交换机需要如何的配置或哪种技术的应用,也进行了简单的介绍,主要还是便于大家对Bond的理解。其中均为个人的理解,可能会有些错误,也欢迎大家指正。

正文开始

Modes of bonding :

RHEL bonding supports 7 possible “modes” for bonded interfaces. These modes determine the way in which traffic sent out of the bonded interface is actually dispersed over the real interfaces. Modes 0, 1, and 2 are by far the most commonly used among them.

RHEL绑定支持7种合理的“模式”,来用于绑定接口。这些模式决定了从绑定接口发出的流量并实际分散在真实接口上的方式。模式0,1和2是迄今为止最常用的模式。(从项目经验上来看,模式0、1、4、6使用的较多)

Mode 0 (balance-rr)

This mode transmits packets in a sequential order from the first available slave through the last. If two real interfaces are slaves in the bond and two packets arrive destined out of the bonded interface the first will be transmitted on the first slave and the second frame will be transmitted on the second slave. The third packet will be sent on the first and so on. This provides load balancing and fault tolerance.

模式0是按顺序从第一个可用链路到最后一个可用链路发送数据包。如果两个真实接口是绑定中的slaves,并且两个数据包到达绑定接口之后,则第一个数据包将在第一个slave上传输,第二个数据包将在第二个slave上传输。第三个数据包将在第一个数据包发送以后并在第一个slave上传输,依此类推。这提供了负载平衡和容错。

交换机配合

服务器的接入交换机需要配置静态链路聚合

Mode 1 (active-backup)

Mode 1 places one of the interfaces into a backup state and will only make it active if the link is lost by the active interface. Only one slave in the bond is active at an instance of time. A different slave becomes active only when the active slave fails. This mode provides fault tolerance.

模式1则是将其中一个接口置于备份状态,并且只有在活动接口丢失链接时才会使备份状态的接口处于活动状态。在一个实例中,绑定中只有一个slave是活动的,只有当活动slave发生故障时,其他slave才会变为活动状态,此模式可提供容错功能。

交换机配合

交换机无需进行捆绑模式的配置,如果交换机配的是捆绑,将不能正常工作,因为交换机往两块网卡发包,有一半包是丢弃的。该模式下交换机上还会有MAC地址的漂移记录

Mode 2 (balance-xor)

Transmits based on XOR formula. (Source MAC address is XOR’d with destination MAC address) modula slave count. This selects the same slave for each destination MAC address and provides load balancing and fault tolerance.

模式2是基于XOR(异或运算)来传输数据包的。(源MAC地址与目标MAC地址进行异或)% slave计数。这为每个目标MAC地址选择相同的slave,并提供负载平衡和容错能力。

交换机配合

服务器的接入交换机无需配置任何链路模式。

Mode 3 (broadcast)

The broadcast mode transmits everything on all slave interfaces. This mode is least used (only for a specific purpose) and provides only fault tolerance.

模式3为广播模式,广播模式在所有从接口上传输所有内容。此模式使用最少(仅用于特定目的),仅提供容错能力。

交换机配合

服务器的接入交换机无需配置任何链路模式

Mode 4 (802.3ad)

The 802.3ad mode is known as Dynamic Link Aggregation mode. It creates aggregation groups that share the same speed and duplex settings. This mode requires a switch that supports IEEE 802.3ad Dynamic link. Slave selection for outgoing traffic is done according to the transmit hash policy, which may be changed from the default simple XOR policy via the xmit_hash_policy option. Note that not all transmit policies may be 802.3ad compliant, particularly in regards to the packet mis-ordering requirements of section 43.2.4 of the 802.3ad standard. Differing peer implementations will have varying tolerances for noncompliance.

模式4为802.3ad模式,统称为动态链路聚合模式。它创建共享速率和双工模式的聚合组。此模式下的交换机需要支持IEEE 802.3ad动态链路聚合协议。根据传输哈希策略完成传出流量的Slave选择,该策略可以通过xmit_hash_policy option 使默认简单的XOR策略更改。请注意,并非所有传输策略都可以符合802.3ad,特别是在802.3ad标准的第43部分2.4节中的数据包错误排序要求部分。不同的对等体实现将对不合规的将具备不同的容错性。

交换机配合

服务器的接入交换机需要动态链路聚合配置对接,需要交换机支持802.3ad模式(LACP)

Mode 5 (balance-tlb)

This is called as Adaptive transmit load balancing. The outgoing traffic is distributed according to the current load and queue on each slave interface. Incoming traffic is received by the current slave.

模式5被称为自适应传输负载平衡。根据每个从接口上的当前负载和队列分配传出流量。当前Slave接收并传入流量。

交换机配合

服务器的接入交换机无需配置任何链路模式

Mode 6 (balance-alb)

This is Adaptive load balancing mode. This includes balance-tlb + receive load balancing (rlb) for IPV4 traffic. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the server on their way out and overwrites the src hw address with the unique hw address of one of the slaves in the bond such that different clients use different hw addresses for the server.

模式6被称为自适应负载平衡模式。这包括针对IPv4流量的 balance-tlb + receive load balancing (rlb) 。接收负载均衡是通过ARP协商实现的。绑定驱动程序拦截服务器在传输时发送的ARP回复,并使用绑定中某个slave hardware 地址覆盖src hardware 地址,以便不同的客户端为服务器使用不同的hardware 地址。

交换机配合

服务器的接入交换机无需配置任何链路模,由于做bonding的这两块网卡是使用不同的MAC地址,且负载平衡由服务器端实现,所以交换机无需进行配置即可实现链路及传输负载。

结束,收工

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值