S310 V600R022C10 Configuration Guide - Ethernet Switching

Eth-Trunk in LACP Mode

Eth-Trunk in LACP Mode

In Link Aggregation Control Protocol (LACP) mode, similar to in manual mode, you also need to manually create Eth-Trunks and add member interfaces to Eth-Trunks, which, unlikely manual mode, requires the participation of LACP.

While manual mode can increase the bandwidth using an Eth-Trunk, only member link disconnections in the Eth-Trunk can be detected in this mode. Other faults, such as link layer faults and incorrect link connections, cannot be detected. This is another difference of LACP, which can be used to detect more fault types, improving fault tolerance of Eth-Trunks, providing backup, and ensuring high reliability of member links.

LACP, as specified in IEEE 802.3ad, implements dynamic link aggregation and de-aggregation, allowing LACP-enabled devices at both ends to create an Eth-Trunk based on their configurations and exchange Link Aggregation Control Protocol Data Units (LACPDUs). After an Eth-Trunk is created, LACP is responsible for maintaining the Eth-Trunk, and adjusting its member links if a link aggregation condition changes.

For example, in Figure 3-4, four interfaces on DeviceA are supposed to be bundled into an Eth-Trunk 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. In manual mode, this fault would go undetected.

In this case, if LACP is enabled on DeviceA and DeviceB, the Eth-Trunk only selects active links (links connected to DeviceB) to forward data after negotiation. Data sent by DeviceA destined for DeviceB only reaches DeviceB.

Figure 3-4 Incorrect Eth-Trunk connection

Eth-Trunk Configuration in LACP Mode

LACP implements dynamic link aggregation and de-aggregation, allowing devices at both ends of the link to exchange LACPDUs. After member interfaces are added to an Eth-Trunk in LACP mode, each device sends LACPDUs to inform the other device of its system priority, MAC address, member interface priorities, interface numbers, and keys. Of these, keys are used to determine whether the member interfaces on the local and peer end are in the same LAG and whether bandwidth of each interface in the LAG is the same. The peer end 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.

Two important parameters in LACP mode are the LACP system priority and LACP interface priority, which directly affect the selection of the Actor and active interfaces of an Eth-Trunk.

  • LACP system priority

    System LACP priorities are set to prioritize the devices at both ends of an Eth-Trunk link. In LACP mode, active interfaces selected by devices at both ends must be consistent; otherwise, the LAG cannot be set up. To ensure consistency between active interfaces at both ends, set a higher priority for one device. The other device then selects active interfaces based on this device. A smaller LACP system priority value indicates a higher LACP system priority.

  • LACP interface priority

    Interfaces of an Eth-Trunk are assigned different LACP interface priorities. The interfaces with the highest LACP interface priority become active interfaces. A smaller numerical value represents a higher priority.

To learn more information about the format of the LACPDU, use Packet Format Query Tool.

An Eth-Trunk in LACP mode is set up as follows:

  1. After member interfaces are added to an Eth-Trunk in LACP mode, both ends of the Eth-Trunk send LACPDUs.

    In Figure 3-5, 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.

    Figure 3-5 Exchange of LACPDUs
  2. Devices at both ends determine the Actor and active links.

    In Figure 3-6, 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.

    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. An Eth-Trunk is established when both devices select the same interfaces as active interfaces. Traffic is then load balanced among active links.

    Figure 3-6 Selecting the Actor and active links in LACP mode

LACP Preemption

In Figure 3-7, Port 1, Port 2, and Port 3 are member interfaces of an Eth-Trunk. DeviceA acts as the Actor; the upper threshold for the number of active interfaces is 2; and LACP interface priorities of Port 1, Port 2, and Port 3 are 10, 20, and 30 respectively. When LACP negotiation is complete, Port 1 and Port 2 are selected as active interfaces because their LACP interface priorities are higher, and Port 3 is used as the backup interface.

Figure 3-7 LACP preemption

When LACP preemption is enabled, interfaces with higher priorities in an Eth-Trunk always function as active interfaces. The following describes two typical application scenarios of LACP preemption:

  • Port 1 fails and then recovers. Port 1 becomes faulty and is replaced by Port 3 to transmit traffic. When Port 1 recovers, if LACP preemption is not enabled on the Eth-Trunk, Port 1 remains in backup state, despite having a higher priority than Port 3. If LACP preemption is enabled on the Eth-Trunk, the recovered Port 1 becomes active again because of its higher priority than Port 3. Port 3 then becomes a backup interface again.
  • With LACP preemption enabled, setting a higher LACP priority for Port 3 will allow it to replace Port 1 or Port 2 as an active interface without either of them first becoming faulty. If LACP preemption is not enabled, the system does not re-select active interfaces even if the priority of a backup interface is set higher than that of an active interface.

LACP Preemption Delay

The LACP preemption delay is the time a backup interface waits before becoming an active interface after an active interface becomes faulty. Such a delay is used to prevent unstable data transmission over an Eth-Trunk caused by flapping of member link statuses.

In Figure 3-7, Port1 becomes a backup interface due to a faulty link, which then recovers. If LACP preemption is enabled and the LACP preemption delay is set, Port 1 becomes active again only after the LACP preemption delay.

Switchover Between Active and Inactive Links

In LACP mode, a link switchover in a LAG is triggered if a device at one end detects one of the following events:

  • An active link goes down.

  • LACP detects a link fault.

  • An active interface becomes 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 a fault occurs, LACP takes effect with the following sequence of events:

  1. Shut down the faulty link.

  2. The backup link with the highest priority is selected to replace the faulty active link.

  3. The new active link begins forwarding data.

LACP Implementation Modes

LACP can work in static or dynamic LACP mode. The characteristics are as follows:

Static LACP mode

On the network shown in Figure 3-8, DeviceA and DeviceB are directly connected and both support LACP. To implement load balancing and link backup, configure an Eth-Trunk in static LACP mode on each device. The static LACP mode is widely used as it provides both backup links and protection against faults. If an active link fails, the system selects the backup link with the highest priority as a new active link.

Figure 3-8 Eth-Trunk in static LACP mode

Dynamic LACP mode

In dynamic LACP mode, LACPDUs are exchanged in the same way as in static LACP mode. Where they differ is how they respond to an LACP negotiation failure:
  • In static LACP mode, an Eth-Trunk goes down and cannot forward data after an LACP negotiation failure.
  • In dynamic LACP mode, an Eth-Trunk goes down after an LACP negotiation failure, but its member interfaces inherit VLAN attributes of the Eth-Trunk and enter the Indep state. In this state, they can still forward data at Layer 2.

After a device configured with an Eth-Trunk in dynamic LACP mode receives LACPDUs from a peer device, the two devices will use LACPDUs to negotiate link aggregation parameters. After the negotiation, the Eth-Trunk provides the same function as the Eth-Trunk working in static LACP mode.

The dynamic LACP mode is often used for Eth-Trunks that directly connect devices to servers. For example, in Figure 3-9, ServerA needs to obtain the configuration file from the file server ServerB through DeviceA.
  • When ServerA restarts and restores the default configuration, LACP negotiation fails. The dynamic LACP mode ensures that ServerA obtains the configuration file from ServerB through an Eth-Trunk member interface.
  • After DeviceA receives LACPDUs from ServerA, DeviceA uses LACPDUs to negotiate link aggregation parameters with ServerA.
Figure 3-9 Eth-Trunk in dynamic LACP mode

Eth-Trunks in dynamic LACP mode are used only when Huawei devices connect to servers. For other scenarios, configuring Eth-Trunks in static LACP mode is recommended because Eth-Trunks in dynamic LACP mode may incur a risk of loops.