Linux Network Bonding and Link Aggregation

Network bonding in the Linux operating system is a kernel-level mechanism that aggregates multiple physical network interfaces into a single logical interface. This process, often referred to as link aggregation or NIC teaming, provides network redundancy to prevent single points of failure and increases total network throughput by balancing traffic across multiple connections.

The Architecture of the Bonding Driver

The Linux kernel implements link aggregation through the bonding kernel module. When loaded, this driver creates a virtual network interface (commonly named bond0, bond1, etc.) that acts as a master device. Physical network interface controllers (NICs) are then bound to this master device as slaves.

To the user space and higher-level networking protocols (such as TCP/IP), the bonded interface appears as a standard network adapter with its own IP address and MAC address. When an application transmits data:

  1. The network stack sends the packet to the virtual bonding interface.
  2. The bonding driver intercepts the packet and selects a slave interface based on the configured bonding mode and hash policy.
  3. The selected slave's driver transmits the raw frame onto the physical wire.

For incoming traffic, slave interfaces receive packets and pass them to the bonding driver, which decapsulates and presents them uniformly to the operating system's network stack.

Bonding Modes

The bonding driver's behavior is dictated by its operational mode. Linux supports seven primary modes:

The bonding driver continuously checks the integrity of its slave interfaces to manage failovers effectively. It does this via two mechanisms:

Through this modular combination of operational policies and health monitoring mechanisms, the Linux bonding driver delivers resilient, high-bandwidth networking suited for enterprise servers, hypervisors, and storage systems.