Bonding

Interface Bonding is a network technique that combines multiples physical network interfaces into a single logical interface, often to increase bandwidth, improve fault tolerance, or optimize network performance. It operates at the data link layer of the OSI model, securing interface aggregation whilst keeping communication protocols consistent. In OSDx, bonding configuration is preformed via bonding interfaces.

Operational command interfaces bonding <value> show ports can be used to display miscellaneous information about Bonding interfaces, including bonding mode, hash policy, bonded ports, etc.

Example:

admin@osdx# run interfaces bonding bond0 show ports
Ethernet Channel Bonding Driver: v6.1.55

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:a0:26:e2:3c:49
Slave queue ID: 0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:a0:26:e2:3c:48
Slave queue ID: 0

Port Status monitorization

In an interface bonding configuration, a port refers to a physical network interface that becomes part of a bonded group. This section explains the different monitorization modes for bonded ports available in OSDx.

ARP Monitor

In ARP monitor mode, each bonded interface sends periodic ARP requests to a specified IP addres to verify link availability. Responses indicate that the path is operational. This mechanism requires defining both the target IP address and the interval in milliseconds between ARP checks. This can be configured as shown below.

set interfaces bonding bond0 arp-monitor target 192.168.100.1
set interfaces bonding bond0 arp-monitor interval 100

Note

Specifying multiple IP addresses increases the reliability of ARP monitoring. This can be achived by adding more than one interfaces bonding <txt> arp-monitor target <ipv4> configuration command.

MII monitoring

This mode only monitors the state of the local interface, with the device driver determining whether the link is up or down. The main disadvantage is that MII monitoring cannot determine network connectivity, even if the link appears to be up. This mechanism requires setting an interval (in milliseconds) to read the port status. This can be configured as shown below.

set interfaces bonding bond0 miimon 100

Bonding modes

Interface bonding offers a strategic approach to network optimization by allowing multiple physical interfaces to function as a single logical link. However, its effectiveness depends on the bonding mode selected, since each has different operational logic, performance characteristics, and fault tolerance capabilities. Bonded interfaces do not work independently. Instead, they operate according to the bonding mode and rules defined by the bond interface. In the section below, we explain the different types of bonding modes available in OSDx, analyzing their roles and configuration. To add an interface to a bond in OSDx, the following configuration command is used interfaces ethernet <txt> bond-group <txt>

Round-Robin

This mode transmits packets in sequential order, from the first port available to the last. This mode provides load balancing and fault tolerance. This configuration mode requires that the bond-connected switch has its ports grouped into a single logical interface. This mode can be configured as shown below.

set interfaces bonding bond0 mode round-robin
set interfaces ethernet eth0 bond-group bond0
set interfaces ethernet eth1 bond-group bond0

Active-backup

In this mode, only one bond port is active at a time. A different port becomes active when the current port fails. The bond’s MAC address is visible only on one port, to prevent the switch from becoming confused. This mode provides fault tolerance and can be configured as shown below.

set interfaces bonding bond0 mode active-backup
set interfaces ethernet eth0 bond-group bond0
set interfaces ethernet eth1 bond-group bond0

Xor-Hash

This mode selects the output port based on an XOR hash function, providing load balancing. The parameters used in the XOR hash function can be modified by changing the hash-policy. Different hash-policies are explained in the hash-policy section. This configuration mode requires that the switch connected to the bond has its ports grouped into a single logical interface. This mode can be configured as shown below.

set interfaces bonding bond0 mode xor-hash
set interfaces ethernet eth0 bond-group bond0
set interfaces ethernet eth1 bond-group bond0

Broadcast

This mode transmits everything on all bonded interfaces available, providing fault tolerance. This mode can be configured as shown below.

set interfaces bonding bond0 mode broadcast
set interfaces ethernet eth0 bond-group bond0
set interfaces ethernet eth1 bond-group bond0

Transmit load balance

This mode supports two ways to transmit load balancing: dynamic and static. In dynamic mode, outgoing traffic is distributed across bonded interfaces based on their current workload and individual link speed, allowing for real-time optimization. In static mode, traffic distribution remains fixed once assigned (based on an XOR hash function). Different hash-policies are explained in the hash-policy section. Incoming traffic is not balanced and will use the link configured as primary. Each link can have different speed and duplex settings. This mode can be dynamically configured, as shown below, and does not require any special switch support. It is important to note that only MII monitor is supported in this mode.

set interfaces bonding bond0 mode transmit-load-balance
set interfaces ethernet eth0 bond-group bond0
set interfaces ethernet eth1 bond-group bond0

This mode can also be statically configured, as shown below, and does not require any special switch support.

set interfaces bonding bond0 mode transmit-load-balance
set interfaces bonding bond0 disable-dynamic-lb
set interfaces ethernet eth0 bond-group bond0
set interfaces ethernet eth1 bond-group bond0

Adaptive load balance

This mode operates like transmit load balance, but incoming IPv4 traffic is also balanced. This mode can be dynamically configured, as shown below. It is important to note that only MII monitor is supported in this mode.

set interfaces bonding bond0 mode adaptive-load-balance
set interfaces ethernet eth0 bond-group bond0
set interfaces ethernet eth1 bond-group bond0

This mode can also be statically configured, as shown below, and does not require any special switch support.

set interfaces bonding bond0 mode adaptive-load-balance
set interfaces bonding bond0 disable-dynamic-lb
set interfaces ethernet eth0 bond-group bond0
set interfaces ethernet eth1 bond-group bond0

Hash-policies

Hash policies define how traffic is distributed across bonded interfaces in bonding modes that use hashing, such as xor-hash, 802.3ad or transmit-load-balance and adaptive-load-balance in static mode. These policies determine which parameters need to be taken into account for hash calculation. Simply adjust the hash-policy parameter.

Layer 2

Uses source and destination MAC addresses, as well as the packet type ID field, to generate the hash. This algorithm will send all traffic to a particular network peer on the same bonded interface.

Layer 2+3

Uses source and destination MAC and IP addresses, as well as the packet type ID field, to generate the hash. This algorithm will send all traffic to a particular network peer on the same bonded interface.

Layer 3+4

This policy uses upper layer protocol information when available. It uses source and destination ports, as well as source and destination IP addresses.

Warning

This algorithm is not fully 802.3ad compliant. In rare cases, mixed fragmented and normal packets from the same connection might get split between network interfaces, causing out-of-order delivery. However, this does not usually have an impact on typical network traffic.

To configure the desired hash policy in OSDx, you can use the interfaces bonding <txt> hash-policy <txt> configuration command as shown below. By default, the value is set to layer2.

set interfaces bonding bond0 hash-policy layer2+3

The following table sumarizes the different hash policies.

Hash policies:

Destination MAC addr

Source MAC addr

Destination IP addr

Source IP addr

Destination Port

Source Port

Packet type ID

Layer 2

Yes

Yes

No

No

No

No

Yes

Layer 2+3

Yes

Yes

Yes

Yes

No

No

Yes

Layer 3+4

No

No

Yes

Yes

Yes

Yes

No

Bonding and VLANs

OSDx also allows VLANs to be used together with bonding. Enter the following configuration command. interfaces bonding <txt> vif <u32> address <ipv4cidr|ipv6cidr|id>. It is important to note that, when using VLANs, you only need to specify the VIF ID in the address configuration command.

Here, you can find an example on how to configure VLANs with bonding interfaces.

Bonding Interoperability

In OSDx, bonding interfaces are compatible with both Ethernet and WLAN interfaces. However, it is important to note that WLAN interfaces are only supported in station mode. A configuration is shown below by way of example.

set controllers wlan radios wifi0 band 5GHz
set controllers wlan radios wifi0 bandwidth 80MHz
set controllers wlan radios wifi0 channel 36
set controllers wlan radios wifi0 mode 802.11a
set controllers wlan radios wifi0 mode 802.11ac
set controllers wlan radios wifi0 mode 802.11ax
set interfaces wlan wlan0 phy wifi0
set interfaces wlan wlan0 type station network 1 security akm psk
set interfaces wlan wlan0 type station network 1 security encrypted-passphrase U2FsdGVkX19XLkE83M+8+fXp0fmeVC61212xISymnJI=
set interfaces wlan wlan0 type station network 1 security framework rsn
set interfaces wlan wlan0 type station network 1 security pairwise-ciphers aes-ccmp
set interfaces wlan wlan0 type station network 1 ssid testbond
set interfaces wlan wlan0 bond-group bond0
set interfaces bonding bond0 address 192.168.101.1/24
set interfaces bonding bond0 mode active-backup

This example shows how to configure wlan0 and add it to a bond interface. It is also posible to include additional WLAN interfaces, such as wlan3, in station mode. Finally, it is important to note that WLAN and ethernet interfaces can be bonded together.

Examples

Here, you can find different examples of these options.

Command Summary

Configuration commands

Operational commands