linux 中 bonding 的模式

bonding 有7种调度策略:

(1)轮询策略(Round-robin policy),模式代号是0。该策略是按照设备顺序依次传输数据包,直到最后一个设备。这种模式提供负载均衡和容错能力。

(2)活动备份策略(Active-backup policy),模式代号是1。该策略只有一个设备处理数据,当它宕机的时候就会由备份代替,仅提供容错能力。

(3)异或策略(XOR policy),模式代号是2。该策略是根据MAC地址异或运算的结果来选择传输设备,提供负载均衡和容错能力。

(4)广播策略(Broadcast policy),模式代号是3。该策略通过全部设备来传输所有数据,提供容错能力。

(5)IEEE 802.3ad 动态链接聚合(IEEE 802.3ad Dynamic link aggregation),模式代号是4。该策略通过创建聚合组来共享相同的传输速度,需要交换机也支持 802.3ad 模式,提供容错能力。

(6)适配器传输负载均衡(Adaptive transmit load balancing),模式代号是5。该策略是根据当前的负载把发出的数据分给每一个设备,由当前使用的设备处理收到的数据。本策略的通道联合不需要专用的交换机支持,提供负载均衡和容错能力。

(7)适配器负载均衡(Adaptive load balancing),模式代号是6。该策略在IPV4情况下包含适配器传输负载均衡策略,由ARP协商完成接收的负载,通道联合驱动程序截获ARP在本地系统发送出的请求,用其中一个设备的硬件地址覆盖从属设备的原地址。

 

附英文,来自:https://help.ubuntu.com/community/LinkAggregation

 

Bonding Modes

 

You can bond your interfaces in a variety of modes, depending on your hardware capabilities, as follows:

 

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:

Ethtool support in the base drivers for retrieving the speed and duplex of each slave.

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.

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据