Bonding-Teaming

Bonding:

Network interface bonding combines multiple network connections into a single logical interface. A bonded network interface can increase data throughput by load balancing or can provide redundancy by allowing failover from one NIC to another.

There are following bonding types:

(balance-rr)
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

(active-backup)
Active-backup policy: Only one slave in the bond is active. A different slave becomes active if  the active slave fails.

 (balance-xor)
XOR policy: Transmit based on the selected transmit hash policy.

 (broadcast)
Broadcast policy: transmits everything on all slave interfaces.

 (802.3ad)
Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.

Interface teaming:

Interface teaming is introduced in RHEL 7/CENTOS 7 it performs same function as NIC Bonding.
Teaming is a new feature; it handles the flows of packets more efficient than bonding does

Network teaming is implemented with a kernel driver and a user space daemon named teamd.

Software, called runners, enables load balancing

The following runners can be used:

broadcast    : transmits each packet from all ports.
roundrobin : transmits each packets in a round-robin way from each of its ports.
activebackup: failover runner which watches for link changes and select an active port for data transfer.
loadbalance: monitor traffic and uses a hash function to try to reach a perfect balance when selecting ports for packet transmission.
lacp  : Implement the 802.3ad Link Aggregation Control Protocol. It can use the same transmit port selection possibilities as the loadbalance runner.

 

Table of Comparison of Features in Bonding and Team

Feature Bonding Team
broadcast Tx policy Yes Yes
round-robin Tx policy Yes Yes
active-backup Tx policy Yes Yes
LACP (802.3ad) support Yes (passive only) Yes
Hash-based Tx policy Yes Yes
User can set hash function No Yes
Tx load-balancing support (TLB) Yes Yes
LACP hash port select Yes Yes
load-balancing for LACP support No Yes
Ethtool link monitoring Yes Yes
ARP link monitoring Yes Yes
NS/NA (IPv6) link monitoring No Yes
ports up/down delays Yes Yes
port priorities and stickiness (“primary” option enhancement) No Yes
separate per-port link monitoring setup No Yes
multiple link monitoring setup Limited Yes
lockless Tx/Rx path No (rwlock) Yes (RCU)
VLAN support Yes Yes
user-space runtime control Limited Full
Logic in user-space No Yes
Extensibility Hard Easy
Modular design No Yes
Performance overhead Low Very Low
D-Bus interface No Yes
multiple device stacking Yes Yes
zero config using LLDP No (in planning)
NetworkManager support Yes Yes

We need install teamd package and to load team driver:

#yum –y install teamd , #modprobe team

 

In /etc/sysconfig/nework-scripts folder create file named team0

BOOTPROTO=static
TEAM_CONFIG='{"runner":{"name":"activebackup"},"link_watch":{"name":"ethtool"}}'
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NAME=team0
DEVICE=team0
ONBOOT=yes
DEVICETYPE=Team
PREFIX=24

Balance type is set to activebackup, link_watch specifies how to monitor the link status. (Libteam lib uses ethtool to watch for link state changes). This is the default if no other link-watcher is specified.

Create files for ens224 and ens256 respectively:

TEAM_MASTER=team0
TEAM_PORT_CONFIG='{"prio":99}'
DEVICETYPE=TeamPort
NAME=ens224
DEVICE=ens224
ONBOOT=yes 
TEAM_MASTER=team0
TEAM_PORT_CONFIG='{"prio":100}'
DEVICETYPE=TeamPort
NAME=ens256
DEVICE=ens256
ONBOOT=yes

 

You can set priority numbers to your own. Interfaces are part of team0 (interface_master)

If port priority is not specified by prio it defaults to 0; it accepts negative and positive values in the range -32,767 to +32,767.

Get team details and status:

#teamnl team0 ports , # teamdctl team0 state view -v

 

Script to configure teaming:

teaming