LACP Study Notes
1. LACP Introduction
1. LACP Protocol Introduction
LACP (Link Aggregation Control Protocol) based on the IEEE 802.3ad Standard
Protocol) is a protocol for Dynamic Link convergence and decoding. LACP protocol through LACPDU (Link
Aggregation Control Protocol Data Unit, which is a Data Unit of the link Aggregation Control Protocol.
After the LACP protocol of a port is enabled, the port will notify the peer of its system optimization by sending the LACPDU
Level 1, system MAC, port priority, port number, and Operation Key. After receiving the information, the peer end compares the information with the information saved by other ports to select the ports that can be aggregated, so that both sides can
Join or exit a dynamic aggregation group to reach an agreement.
2. LACP packets
Main fields:
Actor_Port/Partner_Port: Local/peer interface information.
Actor_State/Partner_State: Local/peer state.
Actor_System_Priority/Partner_System_Priority: Local/peer system priority.
Actor_System/Partner_System: Local/Peer System ID.
Actor_Key/Partner_Key: Local/peer operation Key. Only the same value of each interface can be aggregated.
Actor_Port_Priority/Partner_Port_Priority: Local/peer interface priority.
Ii. Classification of link Aggregation
1. Link aggregation in manual Load Balancing Mode
1) Overview of manual Aggregation
The manual Load Balancing mode is the most basic link aggregation mode. In this mode, the Eth-Trunk interface is created
Member interfaces are manually configured without the involvement of the link aggregation control protocol. In this mode, all member interfaces (selected) are involved in data forwarding and share the load traffic. This is called the manual Load Balancing mode. The LACP protocol of the manually aggregated port is disabled.
2) port status in the manual aggregation Group
In a manual aggregation group, the port may be in two states: Selected or Standby. In Selected state
And the smallest port number is the master port of the aggregation group.
.
The maximum number of ports in the aggregation group supported by the device is limited. If the port is in the Selected status
The number of ports exceeds the maximum number of ports in the aggregation group supported by the device.
Select the Selected port and Standby port.
3) manual aggregation of Port Configuration Requirements
Generally, manual aggregation does not limit the port rate and duplex mode before aggregation. However, in the following cases,
The system will handle this specially:
For ports in the DOWN state at the beginning, there is no limit on the port speed and duplex mode during aggregation;
For a port that was once in the UP state and negotiated or forced to specify the port rate and duplex mode, but is currently in the DOWN state, the aggregation requires the same speed and duplex mode;
For an aggregation group, when the speed and duplex mode of a port in the aggregation group change, the system does not perform unaggregation, and the ports in the aggregation group are also working normally. However, if the rate of the master port decreases and the duplex mode changes, packet loss may occur during the port forwarding.
2. LACP protocol link Aggregation
LACP (Link Aggregation Control Protocol) Link Aggregation includes two types:
1) Static LACP Mode Link Aggregation
A) Introduction to static LACP Mode Link Aggregation
In static LACP mode, the creation of the Eth-Trunk interface and addition of the member interface are all completed by manual configuration. However, unlike link aggregation in the manual Load Balancing mode, LACP protocol packets are selected as active interfaces in this mode. That is to say, after a group of interfaces are added to the Eth-Trunk interface, the interfaces in these member interfaces must be determined through the negotiation of LACP protocol packets.
The LACP protocol of the static aggregation port is enabled. When a static aggregation group is deleted, its member ports
One or more dynamic LACP aggregates and maintains LACP enabling. Disable the LACP protocol of the static aggregation port.
B) port status in the static aggregation Group
In a static aggregation group, the port may be in two states: Selected or Standby. Selected port and
The Standby port can send and receive LACP, but the Standby port cannot forward user packets.
Note:
In a aggregation group, the primary port with the smallest port number and the other
The port in the Selected status is the member port of the aggregation group.
In a static aggregation group, the system sets the port to be in the Selected or Standby state according to the following principles:
The system selects the port with the highest priority in the Selected state based on the priority of full/High Speed, full/low speed, half/high speed, and half/low speed, other ports are in the Standby status.
Different from the peer device connected to the smallest port in the Selected state, or connected to the same peer device but the port in different aggregation groups will be in the Standby state.
Because of hardware restrictions (for example, cross-board aggregation is not allowed), ports that cannot be aggregated with the smallest port in the Selected status are in the Standby status.
Different from the basic configuration of the smallest port in the Selected state, the port is in the Standby state. Because the number of Selected ports in the aggregation group supported by the device is limited, if the number of member ports exceeds the maximum number of Selected ports supported by the device, the system selects some ports from small to large as the Selected port, and others as the Standby port.
2) Dynamic LACP Mode Link Aggregation
A) Introduction to dynamic LACP Mode Link Aggregation
In dynamic LACP mode, the Eth-Trunk interface is established, the member interface is added, and the active interface is selected
It is all done by LACP protocol through negotiation. This means that the Eth-Trunk interface does not need to be created on the two directly connected devices that have enabled the dynamic LACP protocol, or the interfaces that need to be specified as the group member interface, the two devices automatically perform link aggregation through LACP negotiation. Dynamic LACP aggregation is an aggregation that is automatically created or deleted by the system. You are not allowed to add or delete member ports in the dynamic LACP aggregation. Only ports with the same speed and duplex property, connected to the same device, and with the same basic configuration can be dynamically merged. A dynamic aggregation can be created even if there is only one port, which is a single port aggregation. In dynamic aggregation, The LACP protocol of the port is in the enabling State.
B) port status in the dynamic aggregation Group
In a dynamic aggregation group, the port may be in two states: Selected or Standby. Selected port and
The Standby port can send and receive LACP, but the Standby port cannot forward user packets. The maximum number of ports in the aggregation group supported by the device is limited. If the current number of member ports exceeds the maximum number of ports, the local system and the peer system negotiate, the
The port ID to determine the port status. The negotiation procedure is as follows:
Compare the device ID (system priority + system MAC address ). First compare the system priority, if the same, then compare the system MAC address. One end with a small device ID is considered to be excellent.
Compare the port ID (Port priority + port number ). For each port at the end of the device ID, first compare the port priority. If the priority is the same, then compare the port number. The port with a small port ID is
Selected port. The remaining port is the Standby port. In a aggregation group, the primary port with the smallest port number in the Selected state is the aggregation group's main port, and the other ports in the Selected State are the member ports of the aggregation group.
Note:
Unlike a manual aggregation group, in a static or dynamic aggregation group, the DOWN port is
Standby status.
Iii. LACP implementation principle
1. Principle of manual Aggregation
Manual Load Balancing Mode Link aggregation is a type of link aggregation that is widely used. Most operating-level network devices
This feature is supported. When a large link bandwidth needs to be provided between two directly connected devices, the peer device does not support this feature.
When using LACP, you can use the manual Load Balancing mode.
Note:
The Eth-Trunk interface in manual Load Balancing mode can aggregate member interfaces in different board and duplex modes.
2. Principle of static convergence
A) Basic Concepts
Static LACP Mode Link aggregation is an aggregation mode that uses LACP protocol for parameter negotiation and selection of active links.
. In this mode, the LACP protocol determines the active and inactive links in the aggregation group, also known as the M: N mode, that is
The mode of M active links and N backup links. This mode provides higher link reliability and can
Load Balancing is implemented in different ways in M links.
M: The values of M and N in the Eth-Trunk interface in N mode can be determined by configuring the maximum threshold value of the number of active interfaces.
B) System LACP priority
In static LACP mode, the active interfaces selected by both devices must be consistent; otherwise, the link aggregation group cannot be established. To make the active interfaces at both ends consistent, one end has a higher priority, and the other end selects the active interface based on the high priority. The system LACP priority is a parameter configured to distinguish the priority of both ends.
The smaller the system LACP priority value, the higher the priority value. The default system LACP priority value is 32768.
C) interface LACP priority
The LACP priority of an interface is used to determine the priority of an active interface selected for different interfaces. The smaller the LACP priority value, the higher the priority. By default, the LACP priority of the interface is 32768.
D) creation of the Eth-Trunk interface in static mode
The creation process of the static mode Eth-Trunk interface is as follows:
① The two ends send LACPDU packets to each other.
② The active devices at both ends are determined based on the system LACP priority.
③ The active interfaces of the two devices are determined based on the LACP priority, and the active interfaces of the active devices are determined.
E) Exchange LACPDU packets
Create the Eth-Trunk interface on both the device CX-A and CX-B and configure it to static LACP mode, then manually add a member interface to the Eth-Trunk interface. In this case, the LACP protocol is enabled on the member interface, and the two ends send LACPDU packets to each other, as shown in.
F) Determine the active end
The devices at both ends of Eth-Trunk will receive LACP packets sent from the peer end. Based on the priority field in the packets, confirm
Activity interface. The smaller the value of the priority field, the higher the priority.
As shown in, when the CX-B receives a LACP message from the CX-A, The CX-B views and records peer information and compares system priority fields. The system priority of the CX-A is 10, higher than the system priority of the CX-B, so select the CX-A as the active end. At this point, the CX-B selects the active interface according to the interface priority of the CX-A. If the system priorities of devices at both ends of the Eth-Trunk link are the same, the system selects a device with a smaller System ID field as the active end. The System ID is generated by the MAC address of the device.
G) Select the activity Interface
After the active end is selected, the active interfaces are selected based on the active interface priority. As shown in, the CX-A is the active end, the CX-A interface GE1/0/1, GE1/0/2 priority is higher than the interface GE2/0/1, at this time interface GE1/0/1, GE1/0/2 is selected as the active interface, form an LACP aggregation group to forward data by load balancing.
2. Principle of static convergence
The principle of dynamic aggregation is similar to that of static aggregation, but all ports in the dynamic aggregation are determined through the Protocol, rather than determining the aggregation port in the specified port through the protocol like static aggregation.
IV. Implementation Details
1. parameters related to link aggregation Control
A) How does the LACP protocol uniquely identify an aggregation group:
System ID (System ID) is composed of "System priority + System MAC address". The reason for System priority is that in LACP, the devices at both ends of the link aggregation assume different roles. With the system priority, the administrator can intervene in role election through configuration.
B) Port ID (Port ID ):
Each port involved in link aggregation also needs to be uniquely identified within the device. The port ID consists of "port priority + Port Number". The reason for this is that "port priority" is required ", this is also because different role elections involving ports
C) Aggregator ID:
Multiple Aggregator groups can be aggregated on a device. to distinguish these Aggregator groups, each Aggregator is assigned an Aggregator ID, which is a 16-bit integer.
2. Port key
There are two types of keys in the aggregation port: one is the operation key and the other is the management key.
The operation key is used to aggregate the keys currently used, and the management key is the key that allows the Administrator to operate on the key value.
3. Operation key
In dynamic LACP aggregation, only ports with the same operation KEY can belong to the same aggregation group. You can think that ports with the same operation KEY have the same attributes.
In manual aggregation and static LACP aggregation, although the port operation keys in the same aggregation group are not necessarily the same (because the port is manually added by the Administrator), the Operation Keys on the Selected port must be the same.
During port aggregation, the Operation Key is configured based on the port (namely speed, duplex, basic configuration, and management ).
Key.
(1) For manual and static aggregation groups, the Selected port has the same operation Key.
(2) After LACP is enabled on the static aggregation port, the management Key of the port is the same as that of the aggregation group.
(3) After LACP is enabled, the management Key of the dynamic aggregation port is 0 by default.
(4) For a dynamic aggregation group, members of the same group must have the same operation Key.
4. Six Elements
A) four elements:
For an aggregation group, if a unique identifier is required, it must contain four elements: Local System ID, local operation KEY, Peer System ID, and peer operation KEY.
B) two elements:
Not all aggregation groups in the system contain multiple links. to distinguish an aggregation group that only contains a single link, two additional elements are required: the ID of the local and peer ports.
C) Conclusion:
These six elements uniquely identify an Aggregation Group called the Link Aggregation Group ID (lag id ). If an aggregation group contains multiple links, in the lag id, the local end port ID and the peer end port ID are 0, it is equivalent to describing an aggregation group containing multiple links with only four tuples.
5. Port type:
A) Selectet and Unselected:
The port used for traffic Forwarding is called the Selected port. Otherwise, it is called the Unselected port.
B) master port (master port)
In the Selected status and the smallest Port number is called the Master Port. It can be seen that all ports in the aggregation group are aggregated to the Master Port, the master port logically represents the entire aggregation group. For L2 protocols such as GVRP, GMRP, STP, RSTP, and MSTP, they are only sent from the master port, other datagram files are shared among the Selected ports.
C) supplement:
Because the selection of Selected and Unselected ports in the actual status is affected by hardware, the specific manifestations of products of different manufacturers may be different.
5. LACP binding port
The key basis for binding a port to Aggregator is the lag id. The judgment method is as follows:
(1) The operation KEY of Aggregator is the same as that of port.
(2) The other ports bound to the Aggregator have the same link lag id as the port. That is, the lag id associated with the Aggregator must be the same as the lag id of the port.
(3) "lag id" indicates the Link Aggregation Group ID, and "Aggregation ID" indicates the Aggregator ID. (lag id refers to all ports in the same aggregation, including selected and Standby. It is easy to understand both manual and static. It refers to all ports specified by the user. For dynamic aggregation, all ports)
6. Port exit Aggregator
(1) If the Actor port fails to receive the LACP packet sent by the Partner port within a certain period of time (when long timeout is used for 90 s, the short timeout is used for 3 s, if you do not receive the Partner message within the next short timeout time (3 seconds), the Aggregator will be left.
(2) If the LACP packet received from the Partner port is found to have changed the lag id (the System ID or operation KEY has changed, the System ID change indicates that the connected peer device has changed, and the operation KEY may be changed due to the attribute of the Peer Port). In this case, the port also leaves the Aggregator.
(3) There is also a situation where the port leaves Aggregator: the attribute of the Actor port has changed, and the operation KEY assigned to the Actor port has changed through the dynamic operation KEY function, as a result, it does not match the lag id of Aggregator and thus leaves the aggregation group.
7. Active and Passive Modes
(1) In Active mode, LACP packets are sent periodically on the port;
(2) in Passive mode, LACP packets are not sent on the port. However, once the peer LACP packets are received, the LACP packets are sent normally.