LAG
A Link Aggregation Group (LAG), based on the IEEE 802.1ax standard (formerly 802.3ad), increases the bandwidth available between two network devices, depending on the number of links installed. A LAG also provides redundancy if one or more links participating in the LAG fail. All physical links in a LAG combine to form one logical interface.
Packet sequencing is maintained for individual sessions. The hashing algorithm deployed by SR Linux is based on the type of traffic transported to ensure that all traffic in a flow remains in sequence, while providing effective load sharing across the links in the LAG.
LAGs can be either statically configured, or formed dynamically with Link Aggregation Control Protocol (LACP). Load sharing is executed in hardware, which provides line rate forwarding for all port types. A LAG can consist of ports of the same speed, as well as ports of mixed speed; however, the active links would be only those whose port speed matches the configured member-speed parameter for the LAG instance.
Min-link threshold
SR Linux supports configuring a min-link threshold for a LAG, which sets the minimum number of member links that must be active in order for the LAG to be operationally up. If the number of active links falls below this threshold, the entire LAG is brought operationally down.
If the min-link threshold is crossed, the active member links are maintained, including continuing to run LACP on links where it is configured, but the LAG is held out of forwarding state. When the number of active links reaches or exceeds the min-link threshold, the LAG is brought back up operationally.
LACP
LACP, defined by the IEEE 802.3ad standard, specifies a method for two devices to establish and maintain LAGs. When LACP is enabled, SR Linux can automatically associate LACP-compatible ports into a LAG. All non-failing links in a LAG are active, and traffic is load-balanced across the active links.
When LACP is enabled, LACP changes are visible through traps and log messages logged against the LAG.
LACP fallback
LACP fallback allows one or more designated links of an LACP controlled LAG to go into forwarding mode if LACP is not yet operational after a configured timeout period.
SR Linux supports LACP fallback in static mode. In static mode, a single designated LAG member goes into forwarding mode if LACP is not operational after the timeout period.
LACP fallback is configured by selecting the mode and fallback timeout (seconds). If the LAG receives no PDUs and the timeout period expires, the configured fallback mode is enabled. If any member link in the LAG receives a PDU, the fallback mode is immediately disabled.
LAG configuration
To configure a LAG, you specify LAG parameters within the context of a LAG interface, then associate Ethernet interfaces with the LAG interface.
The MAC address of the LAG should be a unique value taken from the chassis MAC address pool.
Member links in the LAG can be associated statically or dynamically.
Static links are explicitly associated with the LAG within the configuration of the LAG instance.
Dynamic links are associated with the LAG using LACP.
A LAG instance can consist of static links only or dynamic links only.
If an Ethernet interface is associated with a LAG interface, the following parameters must be the same for all associated Ethernet ports:
flow-control
port-speed
aggregate-id
The following example shows the configuration for a LAG consisting of three member links.
--{ * candidate shared default }--[ ]--
# info interface *
interface ethernet-1/1 {
admin-state enable
ethernet {
aggregate-id lag1
}
}
interface ethernet-1/2 {
admin-state enable
ethernet {
aggregate-id lag1
}
}
interface ethernet-1/3 {
admin-state enable
ethernet {
aggregate-id lag1
}
}
interface lag1 {
subinterface 1 {
admin-state enable
}
lag {
lag-type static
min-links 2
}
}
Configuring the min-link threshold
You can configure the min-link threshold for a LAG, which specifies the minimum number of member links that must be active in order for the LAG to be operationally up. If the number of active links falls below this threshold, the entire LAG is brought operationally down.
The following example configures the min-link threshold for a LAG to be 4. If the number of active links in the LAG drops below 4, the LAG is taken operationally down.
--{ * candidate shared default }--[ ]--
# info interface lag1
interface lag1 {
lag {
min-links 4
}
}
After the LAG has been taken operationally down because of crossing the min-link threshold, if the number active links in the LAG subsequently reaches 4 or higher, the LAG is brought operationally up. The default for the min-link threshold is 0 (disabled).
Configuring LACP and LACP fallback
When you enable LACP, SR Linux can automatically associate LACP-compatible ports into a LAG. LACP
should be configured in ACTIVE
mode only if LACP Fallback is also
configured.
Configure LACP to run on an interface
The following example configures LACP to run on an interface, which can dynamically become a member of a LAG:
--{ * candidate shared default }--[ ]--
# info interface ethernet-1/1 lag
interface ethernet-1/1 {
lag {
lag-type lacp
min-links 1
member-speed 100G
lacp-fallback-mode static
lacp-fallback-timeout 4
lacp {
interval FAST
lacp-mode ACTIVE
}
}
}
In this example, the LACP interval is set to FAST, which causes LACP messages to be sent every second. The SLOW option for LACP interval causes LACP messages to be sent every 30 seconds.
Enable LACP fallback mode for a LAG
The following example enables LACP fallback mode for a LAG, which allows a single designated LAG member to go into forwarding mode if LACP is not operational after the timeout period.
--{ * candidate shared default }--[ ]--
# info interface ethernet-1/1 lag
interface ethernet-1/1 {
lag {
lacp-fallback-mode static
lacp-fallback-timeout 60
}
}
The LACP fallback timeout range is 4 to 3600 seconds when the LACP interval is FAST, and 90 to 3600 seconds when LACP interval is SLOW.
Enable LACP port priority
The following example enables LACP port priority. When LACP fallback is triggered in static mode, one of the member-links goes into a forwarding state that can be influenced using LACP port priority.
--{ * candidate shared default }--[ ]--
# info interface ethernet-1/1 ethernet
interface ethernet-1/1 {
ethernet {
aggregate-id lag1
lacp-port-priority 1
port-speed 25G
hw-mac-address 00:01:02:FF:00:01
}
}
Configuring forwarding viability for LAG member links
By default, all interfaces configured in a LAG are capable of forwarding traffic to the other end of the LAG, assuming all other LAG and port attributes allow it (port and LACP state). You can optionally configure individual LAG members to be non-viable for forwarding traffic to the other end of the LAG link.
When a LAG member is configured as non-viable for forwarding traffic, the interface is not used for the transmission of traffic over the LAG, but is still able to process traffic it receives on the associated member link. In addition, Layer 2 protocols such as LLDP, LACP, and micro-BFD continue to be sent and processed over the non-forwarding-viable LAG member.
The following example configures a LAG member to be non-viable for forwarding traffic across a LAG link. The interface can still receive traffic on the LAG link and participate in Layer 2 functions, but does not transmit packets to the other end of the LAG.
--{ candidate shared default }--[ ]--
# info interface ethernet-1/1 ethernet
interface ethernet-1/1 {
ethernet {
aggregate-id lag1
forwarding-viable false
}
}
Displaying LAG interface statistics
To display statistics for a LAG interface, use the info from state command in candidate or running mode, or the info command in state mode.
--{ candidate shared default }--[ ]--
# info from state interface lag1 statistics
interface lag1 {
statistics {
in-octets 0
in-unicast-packets 0
in-broadcast-packets 0
in-multicast-packets 0
in-error-packets 0
in-fcs-error-packets 0
out-octets 7168
out-unicast-packets 0
out-broadcast-packets 0
out-multicast-packets 56
out-error-packets 0
last-clear 2020-06-09T21:58:40.919Z
}
}
Clearing LAG interface statistics
You can clear the statistics counters for a specified LAG interface.
Clear statistics counters for a LAG interface
--{ candidate shared default }--[ ]--
# tools interface lag1 statistics clear
/interface[name=lag1]:
interface lag1 statistics cleared
Clear statistics for a LAG interface and all member links
--{ candidate shared default }--[ ]--
# tools interface lag1 statistics clear include-members
/interface[name=lag1]:
interface lag1 and all member interfaces statistics cleared