Ethernet Bonding on Ubuntu Server
If you work with critical Server and create fault tolerant systems to increase the availability, I think after having redundant Power Supplies and a Raid 5 at least, Ethernet bonding is the next most important option to implement. The Linux Kernel uses a module called ifenslave and it provides you with 7 modes to configure the bond.
balance-rr or 0
Round-robin policy transmits packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.
active-backup or 1
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 to avoid confusing the switch.
balance-xor or 2
XOR policy transmit based on the selected transmit hash policy. The default policy is a simple [source MAC address XOR’d with destination MAC address] modulo slave count This mode provides load balancing and fault tolerance.
broadcast or 3
Broadcast policy transmits everything on all slave interfaces. This mode provides fault tolerance.
802.3ad or 4
IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilises all slaves in the active aggregator according to the 802.3ad specification. Additional Switch configuration and support required.
balance-tlb or 5
Adaptive transmit load balancing channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load on each slave. Incoming traffic is received by current slave. If the receiving slave fails another slave takes over the MAC address of the failed receiving slave.
balance-alb or 6
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 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.
Enjoy the demonstration in the Video Clip: