A method and system for lacp load balancing

By introducing a load balancing state machine and monitoring unit into LACP, the load balancing mode is dynamically adjusted, solving the problem of traffic imbalance in existing technologies and improving network performance and reliability.

CN116743661BActive Publication Date: 2026-05-12武汉迈威通信股份有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
武汉迈威通信股份有限公司
Filing Date
2023-05-29
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

The existing LACP load balancing method cannot be dynamically adjusted in a timely manner, resulting in uneven distribution of network traffic in the aggregation link, which affects network performance and reliability.

Method used

By using the load balancing state machine to count the number and rate of service packets and load balancing parameters of active ports in the aggregated link, and combining the load balancing monitoring unit to calculate the weight, it is determined whether the conditions for switching the load sharing mode are met, and if necessary, it switches to the optimal load balancing mode, using parameters such as source MAC, destination MAC, source IP, and destination IP to optimize load sharing.

Benefits of technology

It enables timely adjustment of load balancing mode when the network environment changes, ensuring even distribution of service packets, improving the bandwidth utilization of aggregation links and the stability of traffic transmission, reducing the risk of traffic congestion and packet loss, and is suitable for various complex business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116743661B_ABST
    Figure CN116743661B_ABST
Patent Text Reader

Abstract

The application discloses a kind of LACP load balancing method and system, the method includes: in the set time period, the number of selected active port forwarding service message in aggregation link is counted by load balancing state machine, rate and load balancing parameter under message field;After the set time period ends, the weight of the number of port forwarding service message counted by load balancing state machine in the overall aggregation link is calculated by load balancing monitoring unit;Whether the set load sharing mode switching condition is satisfied in current statistical period according to weight and load balancing parameter, if load sharing mode switching condition is satisfied and current LACP load balancing mode is not the best load balancing mode, then announce LACP switches to the best load balancing mode.The application can timely announce to LACP when traffic distribution is uneven to switch appropriate load balancing mode, to respond to the change of network environment, so that traffic can be relatively evenly distributed on each member link.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial Ethernet switches, specifically relating to a method and system for LACP load balancing. Background Technology

[0002] Link aggregation is a method of increasing bandwidth by bundling a group of physical ports together as a single logical interface. By establishing a link aggregation group between two devices, higher communication bandwidth and reliability can be provided without requiring hardware upgrades, and redundancy protection is also offered for communication between the two devices.

[0003] LACP (Link Aggregation Control Protocol), based on the IEEE 802.3ad standard, is a protocol for dynamic link aggregation. It provides a standard negotiation method for devices exchanging data. LACP forms aggregated links and initiates data transmission and reception based on the device port configurations (i.e., speed, duplex, basic configuration, and management key). After the aggregated link is formed, LACP maintains the link state and automatically adjusts or dissolves the aggregation when aggregation conditions change. This allows both ends of the device to agree on whether a port should join or leave a dynamic aggregation group, binding multiple connected ports into a single logical connection. The bandwidth of the bound port is the sum of the bandwidths of the selected active ports. When increased traffic on a port becomes a bottleneck limiting network performance, using a switch that supports this feature can easily increase network bandwidth. Active member ports within the aggregation group distribute traffic according to a specified method.

[0004] With the development of communication technology, link aggregation technology has been widely used in data transmission to distribute the incoming and outgoing load across the member ports of the aggregation group, while also providing higher connection reliability. Although link aggregation can multiply bandwidth, it is difficult to utilize the ideal maximum bandwidth in practical applications. Furthermore, uneven load distribution among member links can lead to traffic congestion, and in extreme cases, packet loss, affecting normal business operations. Current link aggregation technologies configure fixed load balancing modes and cannot flexibly adjust the load balancing mode according to the real-time network environment to ensure that traffic from different business scenarios is evenly distributed across member links. Figure 1 The diagram shows a convergence link. PC-A needs to communicate with other PCs on the other end. If the load balancing algorithm of the convergence link is configured to source MAC or source IP, then the service packets will only pass through one of the convergence links. In fact, load balancing is not achieved, and network traffic is unevenly distributed in the convergence link.

[0005] The invention patent with publication number CN105490958A discloses a method and system for LACP load balancing. It uses a message field to implement the load balancing mechanism, calculates a sub-link and the load balancing parameters under the message field, and selects the load balancing mechanism with the smallest load balancing parameters. However, its entire calculation process is relatively cumbersome and is not conducive to the dynamic adjustment of the load balancing mode.

[0006] Therefore, a more flexible and faster LACP load balancing scheme needs to be designed to quickly achieve a uniform distribution of network traffic on aggregated links and make more efficient use of aggregated link bandwidth. Summary of the Invention

[0007] In view of this, the present invention proposes a method and system for LACP load balancing to solve the problem that existing LACP load balancing methods cannot be dynamically adjusted in a timely manner.

[0008] In a first aspect, the present invention provides a method for LACP load balancing, the method comprising:

[0009] Within a set time period, the load balancing state machine is used to count the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters in the packet fields.

[0010] After the set time period ends, the load balancing monitoring unit calculates the weight of the number of service packets forwarded by the port, which is statistically analyzed by the load balancing state machine, in the overall aggregated link.

[0011] Based on the weights and load balancing parameters, determine whether the set load sharing mode switching conditions are met within the current statistical period, and calculate the optimal load balancing mode within the current statistical period based on the load balancing parameters. If the load sharing mode switching conditions are met and the current LACP load balancing mode is not the optimal load balancing mode, then notify LACP to switch to the optimal load balancing mode, and clear the port statistics in the load balancing state machine, and enter the next time period.

[0012] Based on the above technical solutions, preferably, before the step of using the load balancing state machine to statistically analyze the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters under the packet fields, the following steps are also included:

[0013] When LACP is running, it initializes the packet statistics and load balancing parameter statistics of the LACP port. After the aggregation link election is stable, the load balancing state machine starts working, and the timer starts working at the same time.

[0014] Based on the above technical solutions, preferably, the load balancing parameters include source MAC, destination MAC, source and destination MAC, source IP, destination IP, and source and destination IP.

[0015] Based on the above technical solutions, preferably, before the load balancing monitoring unit calculates the weight of the number of service packets forwarded by the port as counted by the load balancing state machine in the overall aggregated link, the method further includes:

[0016] During the continuous operation of the load balancer state machine within the set time period, when there is uneven and excessively different service traffic, or when the set time period expires, the load balancer monitoring unit is activated to start analyzing the forwarding of service packets in the aggregated link.

[0017] Based on the above technical solutions, preferably, the weight is calculated as follows:

[0018]

[0019] Where R is the weight.

[0020] Based on the above technical solutions, preferably, the step of determining whether the set load sharing mode switching conditions are met within the current statistical period according to the weight and load balancing parameters specifically includes:

[0021] Set the following conditions for switching load sharing modes:

[0022] ① The number of active ports is not less than 1;

[0023] ② The traffic weight R of the active port is not within the reasonable weight range. Within this context, N1 represents the maximum number of active ports, and N1 > 1;

[0024] ③ There are better load-sharing modes;

[0025] When all three load sharing mode switching conditions are met, if the business traffic is uneven within the current statistical period, it is necessary to notify LACP to switch the load sharing mode.

[0026] Based on the above technical solutions, the preferred method for determining whether a better load-sharing mode exists is as follows:

[0027] Calculate the optimal load balancing mode for the current statistical period based on the load balancing parameters, and determine whether the current LACP load balancing mode is consistent with the optimal load balancing mode; if they are inconsistent, there is a better load sharing mode.

[0028] The calculation of the optimal load balancing mode for the current statistical period based on load balancing parameters specifically includes:

[0029] The parameter with the most types among the six load balancing parameters (source MAC, destination MAC, source and destination MAC, source IP, destination IP, and source and destination IP) is selected as the optimal load balancing parameter for this round of calculation.

[0030] In a second aspect, the present invention discloses an LACP load balancing system, the system comprising:

[0031] Data statistics module: Used to count the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters under the packet fields, within a set time period through the load balancing state machine;

[0032] Weight calculation module: Used to calculate the weight of the number of service packets forwarded by the port, as counted by the load balancer state machine, in the overall aggregated link after the set time period ends;

[0033] The mode switching module is used to determine whether the set load sharing mode switching conditions are met in the current statistical period based on the weight and load balancing parameters, and to calculate the optimal load balancing mode in the current statistical period based on the load balancing parameters. If the load sharing mode switching conditions are met and the current LACP load balancing mode is not the optimal load balancing mode, then the LACP is notified to switch to the optimal load balancing mode, and the statistical results of the ports in the load balancing state machine are cleared, and the next time period begins.

[0034] The present invention has the following advantages over the prior art:

[0035] (1) This invention uses a load balancing state machine to count the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters in the packet field. The load balancing monitoring unit calculates the weight of the number of service packets forwarded by the ports counted by the load balancing state machine in the overall aggregated link. When the traffic distribution is uneven, it can promptly notify the LACP to switch to a suitable load balancing mode to cope with changes in the network environment. This ensures that service packets are always relatively evenly distributed on each member link, improves the utilization rate of the aggregation link bandwidth, traffic transmission stability and traffic forwarding efficiency, and reduces the risk of packets being dropped due to traffic congestion.

[0036] (2) The present invention sets the conditions for switching load sharing modes. By monitoring the number of active ports, the traffic weight of active ports, and judging in real time whether there is a better load sharing mode, it determines whether it is necessary to switch the load sharing mode, which improves the response speed of load sharing mode switching and allows for better dynamic adjustment.

[0037] (3) This invention selects the parameter with the most types among the six types of load balancing parameters, namely source MAC, destination MAC, source and destination MAC, source IP, destination IP and source and destination IP, as the optimal load balancing parameter for this round of calculation, thereby reducing the computational complexity of the optimal load balancing parameter. It can quickly and dynamically switch the LACP load balancing mode and is applicable to various complex business scenarios. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a schematic diagram of the aggregation link;

[0040] Figure 2 A flowchart of an LACP load balancing method provided in an embodiment of the present invention;

[0041] Figure 3 A schematic diagram of the LACP polling state machine with added load balancing state machine;

[0042] Figure 4 This is a schematic diagram of the structure of the LACP polling state machine and the load balancing monitoring unit in the LACP process;

[0043] Figure 5 A flowchart of a LACP load balancing method provided in another embodiment of the present invention. Detailed Implementation

[0044] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0045] Please see Figure 2 This invention proposes a method for LACP load balancing, the method comprising:

[0046] S1. Within a set time period, the load balancing state machine is used to count the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters in the packet fields.

[0047] Design a load-balancing machine based on the existing LACP polling state machine, such as... Figure 3 The diagram shows the structure of the LACP polling state machine with added load balancing state machine. This invention only adds a load-balancing machine to the original LACP polling state machine, while keeping everything else unchanged. This state machine is responsible for counting the number of service packets forwarded on the selected active port within a period of time, and collecting the load balancing parameters under the packet fields, including the source MAC address, destination MAC address, source IP, and destination IP of the packet, to provide data support for analyzing whether network traffic is evenly distributed in the aggregated link.

[0048] During LACP runtime, packet statistics and load balancing parameter statistics for the LACP ports are initialized. After the aggregation link election stabilizes, the load balancing state machine starts working, and the timer starts running. Within a set time period, the load balancing state machine is responsible for calculating the number and rate of service packets forwarded by the selected active ports in the aggregation link, as well as collecting load balancing parameters from the packet fields. These load balancing parameters include source MAC, destination MAC, source and destination MAC, source IP, destination IP, and source and destination IP.

[0049] S2. After the set time period ends, the load balancing monitoring unit calculates the weight of the number of service packets forwarded by the port, as counted by the load balancing state machine, in the overall aggregated link.

[0050] Within the set time period, the load balancing state machine continuously collects data. When uneven and excessively different service traffic occurs, or when the set time expires, it proactively notifies the load balancing monitoring unit to start working and simultaneously stops the timer. For example, in scenarios where some active links have a load exceeding 80% or even reaching 100% while other active links have 0%, the load balancing monitoring unit will proactively notify the load balancing monitoring unit to start analyzing the forwarding of service packets in the aggregated links. At the same time, the timer stops, and after the load balancing monitoring unit finishes its analysis, it clears the statistical results in the load balancing state machine and restarts the timer. Otherwise, the load balancing monitoring unit will only start running and analyzing the traffic forwarding of the aggregated links after the set time expires to determine whether each aggregated sub-link can evenly distribute service traffic.

[0051] The weight R is calculated as follows:

[0052]

[0053] S3. Determine whether the set load sharing mode switching conditions are met within the current statistical period based on the weight and load balancing parameters, calculate the optimal load balancing mode within the current statistical period based on the load balancing parameters, and determine whether a load sharing mode switch is required based on the current LACP load balancing mode.

[0054] Set the following conditions for switching load sharing modes:

[0055] ① The number of active ports is not less than 1.

[0056] ② The traffic weight R of the active port is not within the reasonable weight range. Within this, N1 represents the maximum number of active ports and N1>1.

[0057] ③ There are better load-sharing modes.

[0058] The specific steps for determining the load sharing mode switching conditions are as follows:

[0059] 1) If the number of active ports is greater than 1, then condition ① is met and condition ② is verified. Otherwise, the load balancing monitoring unit stops working, clears the port statistics in the load balancing state machine, and the timer restarts.

[0060] 2) If there are one or more active ports and the traffic weight is not within a reasonable weight range If condition ② is met, condition ③ will be verified; otherwise, the monitoring unit will stop working, clear the port statistics in the load balancer state machine, and the timer will restart.

[0061] 3) Condition ③ The way to determine whether there is a better load sharing mode is: calculate the best load balancing mode in the current statistical period based on the load balancing parameters, and determine whether the current LACP load balancing mode is consistent with the best load balancing mode; if they are inconsistent, then there is a better load sharing mode.

[0062] When all three load balancing mode switching conditions are met, and the service traffic is uneven within the current statistical period, it is necessary to notify LACP to switch load balancing modes. By setting load balancing mode switching conditions to determine whether a load balancing mode switch is needed, the response speed of load balancing mode switching can be improved, allowing for better dynamic adjustment of the load balancing mode.

[0063] This invention selects the parameter with the most types among the six types of load balancing parameters—source MAC, destination MAC, source and destination MAC, source IP, destination IP, and source and destination IP—as the optimal load balancing parameter for this round of calculation. If the optimal load balancing parameter selected by the monitoring unit is consistent with the currently running LACP load sharing mode, the port statistics in the load balancing state machine are cleared, and the timer restarts. Otherwise, the optimal load balancing parameter calculated in this round is announced to the LACP module to achieve dynamic switching of the load sharing mode. At the same time, the port statistics in the load balancing state machine are cleared, and the timer restarts to enter the next time cycle.

[0064] Referring to the hash algorithm of load balancing, the chip uses the packet header content as the hash key, such as SPA, SMAC, DMAC, SIP, DIP, SPORT, and DPORT. The hash key can be any combination of the above items, selected through HASH_MASK. For example, 0x7 represents SPA, SMAC, and DMAC as the hash key. This ultimately produces a 4-bit hash result (0-15), which is divided by the number of linkup ports in the aggregation group to obtain the remainder. The (remainder + 1)th linkup port in the aggregation group is the outgoing port. Therefore, the same type of packet (with the same hash key) will inevitably go out from the same port (the load balancing mechanism ensures packet order but not bandwidth utilization). Thus, the more load balancing parameters there are, the more valuable the calculated hash result and the selected outgoing port become, and the more evenly the traffic distribution tends to be distributed. This invention analyzes business traffic, calculates the optimal load balancing algorithm, and then notifies the LACP. The LACP actively adjusts the hash key of the switching chip to achieve uniform traffic distribution, reducing the computational complexity of the optimal load balancing parameters. It can quickly and dynamically switch the LACP load balancing mode and is applicable to various complex business scenarios.

[0065] For example, in the LACP port statistics with 4 aggregated sub-links, there are 10 types of source and destination MAC addresses and 2 types of source and destination IP addresses. If the current LACP load balancing mode is source and destination MAC addresses, then the 10 types of source and destination MAC address data will be relatively evenly distributed to these 4 ports. If the current LACP load balancing mode is source and destination IP addresses, then the 2 types of data need to be distributed to the 4 ports, which can easily lead to uneven traffic. Therefore, this mode is not the optimal load balancing mode, and the service traffic at this time cannot be evenly distributed in the aggregated sub-links.

[0066] like Figure 4The diagram shows the structure of the LACP polling state machine and the load balancing monitoring unit in the LACP process. The load balancing state machine in the LACP polling state machine monitors the traffic forwarding between the packet receiving module and the packet sending module. The load balancing monitoring unit calculates the weight ratio of the forwarded service packets on the selected active ports among all selected active ports, and analyzes whether each aggregation sub-link can evenly distribute the service traffic. If it is normal, no subsequent actions are executed. Otherwise, the load balancing monitoring unit executes the set algorithm according to the collected load balancing parameters, calculates the optimal load sharing mode for the current service, and decides whether to notify LACP to complete the dynamic switching of the load balancing mode based on the actual situation.

[0067] Figure 5 A flowchart of an LACP load balancing method is provided as another embodiment of the present invention, the complete implementation of which is as follows:

[0068] 1. Power on the switch and configure the LACP-related parameters;

[0069] 2. Two switches configured with LACP participate in the negotiation and successfully negotiate to select the active port and determine the aggregated link;

[0070] 3. Initialize the packet statistics and load balancing parameter statistics for the selected active port;

[0071] 4. The selected active ports begin to count the number of service packets forwarded by their respective aggregated links, as well as the load balancing parameter types and quantities;

[0072] 5. Statistics will continue until the statistical period ends;

[0073] 6. Upon completion of the statistical period, a notification will be sent to the load balancing monitoring unit;

[0074] 7. The load balancing monitoring unit calculates the weight of the service packets forwarded by the aggregated link, analyzes whether the service traffic is even within the current statistical period, and selects the parameter with the most types among the six types of load balancing parameters (source MAC, destination MAC, source and destination MAC, source IP, destination IP, and source and destination IP) as the best load balancing mode within the current statistical period.

[0075] 8. If the service traffic is even, clear the statistics of all ports and start a new round of monitoring. If it is uneven and the current LACP load balancing mode is not the optimal load balancing mode, notify LACP to switch the load balancing mode so that the service traffic is always distributed evenly.

[0076] This invention uses a load balancing state machine to statistically analyze the number and rate of service packets forwarded by selected active ports in the aggregated link, as well as the load balancing parameters in the packet fields. The load balancing monitoring unit calculates the weight of the number of service packets forwarded by the ports statistically analyzed by the load balancing state machine in the overall aggregated link. When traffic distribution is uneven, it can promptly notify the LACP to switch to an appropriate load balancing mode to cope with changes in the network environment. This ensures that service packets are always relatively evenly distributed on each member link, improving the utilization rate of the aggregation link bandwidth, traffic transmission stability, and traffic forwarding efficiency, while reducing the risk of packets being dropped due to traffic congestion.

[0077] Corresponding to the above method embodiments, the present invention also proposes an LACP load balancing system, the system comprising:

[0078] Data statistics module: Used to count the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters under the packet fields, within a set time period through the load balancing state machine;

[0079] Weight calculation module: Used to calculate the weight of the number of service packets forwarded by the port, as counted by the load balancer state machine, in the overall aggregated link after the set time period ends;

[0080] Mode switching module: It is used to determine whether the set load sharing mode switching conditions are met in the current statistical period based on the weight and load balancing parameters, and to calculate the best load balancing mode in the current statistical period based on the load balancing parameters. If the current LACP load balancing mode is not the best load balancing mode, it notifies LACP to switch to the best load balancing mode, and clears the port statistics in the load balancing state machine, and enters the next time period.

[0081] The above system embodiments and method embodiments are one-to-one correspondences. For a brief description of the system embodiments, please refer to the method embodiments.

[0082] The present invention also discloses an electronic device, comprising: at least one processor, at least one memory, a communication interface, and a bus; wherein the processor, memory, and communication interface communicate with each other through the bus; the memory stores program instructions executable by the processor, and the processor calls the program instructions to implement the aforementioned method of the present invention.

[0083] The present invention also discloses a computer-readable storage medium that stores computer instructions, which cause the computer to implement all or part of the steps of the method described in the embodiments of the present invention. The storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0084] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, meaning they can be distributed across multiple network units. Those skilled in the art can select some or all of the modules to achieve the purpose of this embodiment without any inventive effort, based on actual needs.

[0085] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for LACP load balancing, characterized in that, The method includes: Within a set time period, the load balancing state machine is used to count the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters in the packet fields. After the set time period ends, the load balancing monitoring unit calculates the weight of the number of service packets forwarded by the port, which is statistically analyzed by the load balancing state machine, in the overall aggregated link. The weights are calculated as follows: ; in, R As weight; Based on the weight and load balancing parameters, determine whether the set load sharing mode switching conditions are met within the current statistical period, and calculate the optimal load balancing mode within the current statistical period based on the load balancing parameters. If the load sharing mode switching conditions are met and the current LACP load balancing mode is not the optimal load balancing mode, then notify LACP to switch to the optimal load balancing mode, and clear the port statistics in the load balancing state machine, and enter the next time period. The specific steps for determining whether the set load sharing mode switching conditions are met within the current statistical period based on weights and load balancing parameters include: Set the following conditions for switching load sharing modes: ① The number of active ports is not less than 1; ②Active Port Traffic Weight R Not within the reasonable weight range , Within the brackets, N1 represents the maximum number of active ports and N1 > 1; ③ There are better load-sharing modes; When all three load sharing mode switching conditions are met, if the business traffic is uneven within the current statistical period, it is necessary to notify LACP to switch the load sharing mode.

2. The LACP load balancing method according to claim 1, characterized in that, Before the step of using the load balancing state machine to statistically analyze the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters under the packet fields, the following steps are also included: When LACP is running, it initializes the packet statistics and load balancing parameter statistics of the LACP port. After the aggregation link election is stable, the load balancing state machine starts working, and the timer starts working at the same time.

3. The LACP load balancing method according to claim 2, characterized in that, The load balancing parameters include source MAC, destination MAC, source and destination MAC, source IP, destination IP, and source and destination IP.

4. The LACP load balancing method according to claim 3, characterized in that, Before calculating the weight of the number of service packets forwarded by the port, as counted by the load balancing state machine, in the overall aggregated link through the load balancing monitoring unit, the following steps are also included: During the continuous operation of the load balancer state machine within the set time period, when there is uneven and excessively different service traffic, or when the set time period expires, the load balancer monitoring unit is activated to start analyzing the forwarding of service packets in the aggregated link.

5. The LACP load balancing method according to claim 1, characterized in that, The method to determine whether a better load-sharing mode exists is as follows: Calculate the optimal load balancing mode for the current statistical period based on the load balancing parameters, and determine whether the current LACP load balancing mode is consistent with the optimal load balancing mode. If they are inconsistent, there is a better load-sharing mode. The calculation of the optimal load balancing mode for the current statistical period based on load balancing parameters specifically includes: The parameter with the most types among the six load balancing parameters (source MAC, destination MAC, source and destination MAC, source IP, destination IP, and source and destination IP) is selected as the optimal load balancing parameter for this round of calculation.

6. A LACP load balancing system for performing a LACP load balancing method as described in any one of claims 1-5, characterized in that, The system includes: Data statistics module: Used to count the number and rate of service packets forwarded by the selected active ports in the aggregated link, as well as the load balancing parameters under the packet fields, within a set time period through the load balancing state machine; Weight calculation module: Used to calculate the weight of the number of service packets forwarded by the port, as counted by the load balancer state machine, in the overall aggregated link after the set time period ends; The mode switching module is used to determine whether the set load sharing mode switching conditions are met in the current statistical period based on the weight and load balancing parameters, and to calculate the optimal load balancing mode in the current statistical period based on the load balancing parameters. If the load sharing mode switching conditions are met and the current LACP load balancing mode is not the optimal load balancing mode, then the LACP is notified to switch to the optimal load balancing mode, and the statistical results of the ports in the load balancing state machine are cleared, and the next time period begins.