Linux Foundation Certified System Administrator (LFCS)
Networking
Configure Bridge and Bonding Devices Theory
In this lesson, we explore two essential networking techniques: bridging and bonding. Both approaches allow multiple network devices to be combined into a single virtual device managed by the operating system, yet they serve distinct purposes for network connectivity and performance.
Bridging connects two or more separate networks, enabling devices on different segments to communicate as though they were on the same network. In contrast, bonding aggregates multiple network connections into a single logical interface to enhance throughput, resiliency, or both.
Below, we provide a detailed explanation of bridging and bonding, supported by diagrams that clarify these fundamental concepts.
Bridging Network Devices
When you bridge two or more network devices, a virtual bridge is created that interconnects them. This virtual bridge allows computers on different physical networks to communicate seamlessly, just as if they were on the same network.
Consider a server with two network interfaces (or network cards) connected via cables to different networks. By adding these interfaces to a bridge, devices on either network can interact without additional routing. In Linux, this virtual device is simply called a bridge, and each network interface attached to the bridge is known as a port.
Bonding Network Devices
Bonding combines multiple physical network devices into one logical interface. This configuration provides several benefits:
- Resilience: Maintains connectivity even if one network interface fails.
- Increased Throughput: Aggregates multiple network cards to achieve higher data transfer speeds.
- Enhanced Reliability: Offloads traffic to available interfaces if one experiences a slowdown.
Imagine a server with two network interfaces connected to the same network. Without bonding, Linux treats these interfaces as separate connections, and an application must select one. If that interface fails, connectivity is lost. With bonding, however, the system presents the two interfaces as a single virtual interface (or bond). Should one connection fail, Linux automatically switches to the other to ensure continuous connectivity.
From an application's perspective, bonding simplifies configuration by representing multiple physical connections as a single network interface.
Bonding Modes in Linux
Linux supports several bonding modes (Mode 0 through Mode 6). Choosing the correct mode allows you to tailor your bond configuration for optimal performance, load balancing, and redundancy.
Mode 0 (Round Robin):
Data packets are transmitted sequentially across the interfaces.Mode 1 (Active Backup):
Only one interface is active while the others act as backups that take over if the active connection fails.Mode 2 (XOR):
Selects the interface based on the source and destination of the data packet, ensuring that identical connections use the same interface.Mode 3 (Broadcast):
Transmits data packets through all interfaces simultaneously.Mode 4 (IEEE 802.3ad):
Uses dynamic link aggregation to combine interfaces, improving throughput.Mode 5 (Adaptive Transmit Load Balancing):
Distributes outgoing traffic by selecting the least busy interface.Mode 6 (Adaptive Load Balancing):
Balances both incoming and outgoing traffic across the bonded interfaces.
Selecting the appropriate bonding mode depends on your network's needs, as each mode balances the tradeoffs between performance, redundancy, and load balancing.
Key Insight
For network deployments, understanding your objectives—whether maximizing throughput or ensuring constant connectivity—will guide your choice between bridging and bonding as well as the specific bonding mode to implement.
Bridging versus Bonding
In summary, bridging and bonding offer different network solutions:
- Bridging: Connects two or more separate networks to enable seamless communication among devices as if they were on the same network.
- Bonding: Aggregates multiple network connections into a single logical interface to improve overall performance and reliability.
These strategies are fundamental tools for network administrators. By implementing bridging and bonding appropriately, you can design networks that are robust, efficient, and adaptable to various operational requirements.
Talented network administrators continually explore these techniques to build resilient and high-performance network infrastructures.
Additional Resources
Watch Video
Watch video content