Generating, configuring, and monitoring Ethernet traffic over bond – Eliminating All the SPOFs! An Exercise in Redundancy

Share this post on:

Generating, configuring, and monitoring Ethernet traffic over bond

When using bare-metal servers as dedicated hosts or Linux systems that host virtual machines using the KVM hypervisor, the network can be a weak point. Fortunately, this issue can be resolved by implementing Ethernet bonding, also known as network bonding, or Network Interface Card (NIC) bonding. It is a technology in Linux that allows you to combine multiple NICs into a single logical interface. This logical interface, known as a bond or bonded interface, provides increased network bandwidth, fault tolerance, and load balancing. These are summarized as follows:

  • Load balancing: Bonding distributes network traffic across multiple NICs, increasing bandwidth. Various algorithms, such as round-robin, active-backup, and XOR, can be used depending on specific requirements.
  • Fault tolerance: In the event of an NIC or network link failure, Ethernet bonding can automatically switch traffic to another active NIC. This provides redundancy and fault tolerance, ensuring network connectivity remains available even if one NIC becomes unavailable.
  • Link aggregation: Bonding can be used to create link aggregation groups (LAGs) or NIC teams, which enhance bandwidth and redundancy in HA setups.

In this recipe, we will configure bonding, and then show some common tools that will allow you to both monitor and generate Ethernet traffic over the bond.

Additionally, there are a few technologies you need to be familiar with.

MAC

A Media Access Control (MAC) address is a hardware identifier assigned to network interfaces such as Ethernet cards and Wi-Fi adapters for communication on a local network. It is hardcoded into the network hardware during manufacturing and is used at the data link layer (Layer 2) of the OSI model. One of the most important features of MAC addresses is that they must be unique. Each MAC address is meant to be globally unique, and manufacturers bear the responsibility of ensuring that no two network interfaces have the same MAC address, though this can be a challenging task to accomplish in practice, especially in virtualized environments. This can be an issue with networking, as duplicate MAC addresses on any network will cause issues. Additionally, many of the bonding modes rely on MAC addresses to load balance traffic.

Bonding modes

Bonding modes refer to the various strategies or algorithms used to determine how network traffic is distributed across the physical network interfaces that have been aggregated into a bonded interface using the Linux bonding driver. These modes control the load-balancing and failover behavior of the bonded interface. The choice of bonding mode depends on your specific network requirements and goals. Here are some common Linux bonding modes:

  • balance-rr: In this mode, outgoing network traffic is distributed evenly across the available network interfaces in a round-robin fashion. It’s a simple load-balancing mode that provides improved outbound traffic performance but does not consider the state of the interfaces, which can lead to uneven inbound traffic distribution. Occasionally, this mode does not work well with some switching systems.
  • active-backup: A commonly used mode, which is often referred to as failover mode, this mode has a primary interface, while the others remain on standby. If the primary interface fails, the next available interface is automatically activated to ensure continuity. This mode provides redundancy and is one of the easiest modes to get working in any environment.
  • balance-xor: This mode utilizes a straightforward XOR operation to maintain a balance between the transmission and reception of data. The process involves distributing traffic based on the MAC addresses of the source and destination. This guarantees that packets between the same endpoints will always take the same path. The primary purpose of this mode is to ensure fault tolerance. Occasionally, this mode does not work well with some switching systems.
  • balance-tlb: When operating in this mode, the outgoing traffic is distributed among all available interfaces based on their current load. However, incoming traffic is not actively balanced, and it is only received by the active interface. This mode is particularly useful when the switch does not support Link Aggregation Control Protocol (LACP). Occasionally, this mode does not work well with some switching systems.
  • balance-alb: This mode actively balances both incoming and outgoing traffic by considering the availability and load of each interface. Occasionally, this mode does not work well with some switching systems.
Share this post on:

Author: Stacy Atkins Prince

View all posts by Stacy Atkins Prince >

Leave a Reply

Your email address will not be published. Required fields are marked *