What Is Link Aggregation Control Protocol (LACP)?
Link Aggregation Control Protocol (LACP), as specified in IEEE 802.3ad, implements dynamic link aggregation and de-aggregation. LACP-enabled member interfaces in a link aggregation group (LAG) exchange Link Aggregation Control Protocol Data Units (LACPDUs) to reach an agreement on the interfaces that can transmit and receive packets and determine the links that carry service traffic. If a link aggregation condition of a LAG changes, for example, a member link fails, LACP is responsible for selecting another available member link to replace the faulty link to maintain load balancing. With no need for hardware upgrades, LACP provides higher link bandwidth and network reliability.
LACP vs. LAG
A Link Aggregation Group (LAG) is a logical link bundled by multiple Ethernet links, and is also called an Eth-Trunk. Each LAG has one logical interface, known as a LAG interface or Eth-Trunk interface. The interfaces that constitute an Eth-Trunk interface are known as member interfaces, and the link corresponding to a member interface is known as a member link. A LAG interface can be treated as a physical Ethernet interface. The only difference between a LAG interface and a physical Ethernet interface is that the LAG interface needs to select one or more member interfaces to forward traffic.
Relationship between the LAG, LAG interface, member interface, and member link
LAG provides a link aggregation method to bundle several physical ports together to form a single LAG interface. LACP allows network devices to negotiate an automatic bundling of links and set up a LAG. Thanks to LACP, network devices can switch traffic to other member links in the LAG once detecting a member link failure.
A LAG can work in manual or LACP mode.
- In manual mode, an Eth-Trunk interface must be manually created and member interfaces need to be manually added to the Eth-Trunk interface.
- In LACP mode, an Eth-Trunk interface and its member interfaces are configured based on LACP negotiation.
Some device models support only the manual mode. A device can set up a LAG with a remote device only when LACP is enabled on both devices and the same interfaces are selected as active interfaces on both devices. If LACP is not enabled on the remote device, the local device might attempt to transmit packets to a single remote interface, which may cause the communication to fail.
Comparison between the manual mode and LACP mode
Why Do We Need LACP?
LACP Makes Data Transmission More Stable and Reliable
In manual mode, all links are active links and forward data in load balancing mode. If one active link fails, traffic is load balanced among the remaining active links.
In LACP mode, active and backup links are selected. This mode is also called M:N mode, where M refers to the number of active links and N refers to the number of backup links. This mode guarantees high link reliability and allows traffic to be load balanced among active links.
As shown in the following figure, M+N links are connected between two devices and set up an Eth-Trunk. When data is transmitted over the Eth-Trunk, traffic is load balanced among M active links, with no data transmitted over N backup links. In this case, the actual bandwidth of the Eth-Trunk is the sum of the M links' bandwidth, and the maximum bandwidth of the Eth-Trunk is the sum of the (M+N) links' bandwidth. If one of the M links fails, LACP selects one of the N backup links with the highest priority to replace the faulty link. In this case, the actual bandwidth remains the same, but the maximum bandwidth of the Eth-Trunk is the sum of the (M+N-1) links' bandwidth.
Networking of M:N backup
LACP Provides More Accurate and Effective Fault Detection for Eth-Trunks
In manual mode, only member link disconnections in an Eth-Trunk can be detected. In LACP mode, besides member link disconnections, other faults, such as link failures and incorrect link connections, can also be detected.
For example, in the following figure, four interfaces on DeviceA are supposed to be bundled into an Eth-Trunk interface and connected to the corresponding interfaces on DeviceB. However, one interface on DeviceA is connected to an interface on DeviceC, which means that DeviceA may send data destined for DeviceB to DeviceC.
Eth-Trunk in manual mode cannot detect this fault. If LACP is enabled on DeviceA and DeviceB, the Eth-Trunk selects only active links (links connected to DeviceB) to forward data after LACP negotiation. Data sent by DeviceA destined for DeviceB only reaches DeviceB.
Incorrect Eth-Trunk connection
How Does LACP Work?
LACP provides a standard mechanism for devices to negotiate an automatic bundling of links based on their configurations and send and receive data over the aggregated link. Devices on both ends exchange Link Aggregation Control Protocol Data Units (LACPDUs) to set up an Eth-Trunk. A local device sends LACPDUs to inform the peer device of its LACP system priority, MAC address, LACP interface priorities, interface numbers, and keys. The peer device then compares this information with its own information, and selects interfaces to join the Eth-Trunk. Both devices perform LACP negotiation to select active interfaces and links.
An Eth-Trunk in LACP mode is set up as follows:
An Eth-Trunk is created in LACP mode on DeviceA and DeviceB. After member interfaces are added to the Eth-Trunk, LACP is automatically enabled on them. Both devices can then exchange LACPDUs to inform each other of its own LACP system priority, MAC address, LACP interface priorities, interface numbers, and keys.
Exchange of LACPDUs
Select the Actor.
Both DeviceA and DeviceB receive LACPDUs from each other. Take DeviceB as an example. After receiving LACPDUs from DeviceA, DeviceB checks and records information about DeviceA and compares their LACP system priorities. DeviceA becomes the Actor if its LACP system priority is higher than that of DeviceB. If they have the same LACP system priority, the device with a smaller MAC address becomes the Actor.
Selecting the Actor
Select active links.
After the Actor is selected, both devices select active interfaces based on the LACP interface priorities of the Actor. If priorities of interfaces on the Actor are the same, interfaces with smaller interface numbers are selected as active interfaces. In LACP mode, setting the upper threshold for the number of active interfaces can improve network reliability while assuring bandwidth. When the number of active interfaces reaches this threshold, you can keep adding new member interfaces to the Eth-Trunk interface, but the number of active interfaces remains unchanged. In such cases, some links function as backup links until active interfaces go down. After both devices select the same interfaces as active interfaces, an Eth-Trunk is established between them and traffic is then load balanced among active links.
In the following figure, the upper threshold for the number of active interfaces is 2. After LACP negotiation, links 1 and 2 are selected as active links because their priorities are higher, and link 3 is used as the backup link. Since only active links in an Eth-Trunk participate in data forwarding, the total bandwidth of the Eth-Trunk is the sum of the bandwidths of the active links.
Selecting active links
Trigger a link switchover upon an active link failure.
In LACP mode, if an active link in an Eth-Trunk fails, the Eth-Trunk automatically selects the backup link with the highest priority to replace the faulty active link. In LACP mode, a link switchover in an Eth-Trunk is triggered if a device at one end detects one of the following events:
- An active link goes down.
- Ethernet OAM detects a link fault.
- LACP detects a link fault.
- The interface is unavailable.
- When LACP preemption is enabled, a backup interface's priority is changed so that an active interface no longer has the highest priority.
When any of the preceding events occurs, LACP triggers a link switchover as follows:
- Shut down the faulty link.
- Select the backup link with the highest priority to replace the faulty active link.
- The new active link begins forwarding data.
LACP vs. PAgP
LACP and Port Aggregation Protocol (PAgP) are the most widely used negotiation protocols for link aggregation. Both technologies bundle links and balance traffic across the member links to enhance network availability and stability. Both LACPDUs and PAgP packets are exchanged between switches over Ethernet ports.
The most significant difference is the vendors supported for them. LACP is an open standard and supported by most of switches, such as Huawei (S5700 series switches, etc.), while PAgP is a Cisco-proprietary protocol that can run only on Cisco switches or on PAgP-capable third-party switches.
LACP vs. PAgP
- Author： Sun Hongye
- Updated on： 2021-09-02
- Views： 125
- Average rating：