Flow load sharing method and device and related equipment
By monitoring and analyzing the load status of ECMP members and dynamically adjusting the hash algorithm parameters, the problem of unbalanced traffic load in ECMP network is solved, and the balanced allocation of traffic on multiple paths is achieved.
Patent Information
- Application Number
- CN202510797910.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-09-02
AI Technical Summary
In ECMP networking, the problem of traffic load imbalance is particularly significant in multi-level networking. The fixed parameters of the existing HASH algorithm lead to load imbalance and polarization, making it difficult to adapt to changes in traffic characteristics.
By monitoring the load status of ECMP members, sampling and analyzing the traffic packet characteristics, using the load sharing algorithm of the analysis center and forwarding chip, dynamically adjusting the hash algorithm parameters to achieve load balancing.
It realizes dynamic adjustment of load sharing according to traffic characteristics, avoids load imbalance and polarization, and ensures balanced distribution of traffic on multiple paths.
Smart Images

Figure CN120583033A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a traffic load sharing method, apparatus, and related equipment. Background Art
[0002] In internet technology, ECMP (Equal-cost multi-path routing) is a routing technology used to improve network bandwidth utilization and load balancing. When multiple equal-cost paths exist in a network, ECMP uses a hash algorithm to distribute data flows across different paths, achieving balanced traffic distribution. However, if the hash algorithm is not appropriately chosen, traffic distribution will be uneven across the paths, resulting in traffic polarization.
[0003] Traffic load balancing is a challenge in ECMP networks. A hash algorithm may work well for a specific traffic load, but its effectiveness may deteriorate if traffic characteristics change. Therefore, devices using fixed hash algorithm parameters will often experience load imbalance in real-world applications. Furthermore, hash polarization is also a common problem in multi-level ECMP networks. Summary of the Invention
[0004] The present application provides a traffic load sharing method, apparatus and related equipment.
[0005] In a first aspect, the present application provides a traffic load sharing method, which is applied to a forwarding chip of a network device; the method comprises:
[0006] Monitor the load of each ECMP member in the Equal Cost Multipath Routing (ECMP) group;
[0007] When it is determined that the load of any ECMP member does not meet the preset requirements, sampling and processing are performed on each flow carried by the ECMP group based on preset rules, and each sampled flow message is sent to the analysis center, so that the analysis center analyzes the message characteristics of each flow carried by the ECMP group, and determines a target load sharing algorithm for load sharing of each flow carried by the ECMP group based on the analysis results and the load sharing algorithm supported by the forwarding chip, and notifies the forwarding chip of the target load sharing algorithm;
[0008] Based on the target load sharing algorithm, load sharing is performed on each flow carried by the ECMP group.
[0009] Optionally, a counter is provided for each ECMP member included in the ECMP group; and the step of monitoring the load of each ECMP member included in the ECMP group includes:
[0010] The number of packets and bytes processed by each ECMP member within a preset time period are counted using the counter of each ECMP member.
[0011] Calculate the packet rate of each ECMP member based on the number of packets processed by each ECMP member within the preset time period.
[0012] The packet bandwidth rate of each ECMP member is calculated based on the number of packet bytes processed by each ECMP member within the preset time.
[0013] Optionally, the target load sharing algorithm notified by the analysis center includes a target hash algorithm and hash algorithm parameters; and the step of load sharing each flow carried by the ECMP group based on the target load sharing algorithm includes:
[0014] The hash algorithm and hash algorithm parameters are used to perform hash processing on each flow message carried by the ECMP group, and the ECMP member carrying each flow is determined according to the hash result.
[0015] In a second aspect, the present application provides a traffic load sharing method, which is applied to an analysis center; the method comprises:
[0016] Receive traffic messages reported by network devices, wherein, when the network device determines that the load of any ECMP member included in the ECMP group does not meet preset requirements, the network device samples each flow carried by the ECMP group based on preset rules and sends the sampled traffic messages to an analysis center;
[0017] Analyzing the packet characteristics of each flow carried by the ECMP group;
[0018] Determining a target load balancing algorithm for load balancing each flow carried by the ECMP group based on the analysis result and the load balancing algorithm supported by the forwarding chip of the network device;
[0019] The target load sharing algorithm is notified to the forwarding chip, so that the forwarding chip performs load sharing on each flow carried by the ECMP group based on the target load sharing algorithm.
[0020] Optionally, the step of analyzing the message characteristics of each flow carried by the ECMP group includes:
[0021] Analyze the five-tuple information of each flow and analyze the flow size information of each flow.
[0022] Optionally, the step of determining a target load balancing algorithm for load balancing each flow carried by the ECMP group according to the analysis result and the load balancing algorithm supported by the forwarding chip of the network device includes:
[0023] Obtain the load balancing algorithms supported by the forwarding chip and the algorithm parameters supported by each load balancing algorithm, wherein the algorithm parameters include but are not limited to the number of bits supported by the algorithm offset and the number of bits supported by the seed setting;
[0024] Obtain the number of ECMP members included in the ECMP group;
[0025] Using a preset simulation program, simulating the results of the ECMP group forwarding each traffic message under different load sharing algorithms and / or different algorithm parameters;
[0026] When it is determined that a load sharing algorithm and a set of algorithm parameters are used in the simulation, when the ECMP group forwards each flow message, the load situation of each ECMP group meets the preset requirements, then the load sharing algorithm and the algorithm parameters are determined as the target load sharing algorithm for load sharing of each flow carried by the ECMP group.
[0027] In a third aspect, the present application provides a traffic load sharing device, which is applied to a forwarding chip of a network device; the device includes:
[0028] A monitoring unit, configured to monitor the load of each ECMP member included in the equal-cost multi-path routing ECMP group;
[0029] a sampling unit configured to, when it is determined that the load of any ECMP member does not meet preset requirements, sample each flow carried by the ECMP group based on preset rules, and send each sampled flow message to an analysis center so that the analysis center analyzes the message characteristics of each flow carried by the ECMP group, and determines a target load sharing algorithm for load sharing each flow carried by the ECMP group based on the analysis results and the load sharing algorithms supported by the forwarding chip, and notifies the forwarding chip of the target load sharing algorithm;
[0030] A processing unit is configured to perform load balancing on each flow carried by the ECMP group based on the target load balancing algorithm.
[0031] Optionally, a counter is provided for each ECMP member included in the ECMP group; when monitoring the load of each ECMP member included in the ECMP group, the monitoring unit is specifically configured to:
[0032] The number of packets and bytes processed by each ECMP member within a preset time period are counted using the counter of each ECMP member.
[0033] Calculate the packet rate of each ECMP member based on the number of packets processed by each ECMP member within the preset time period.
[0034] The packet bandwidth rate of each ECMP member is calculated based on the number of packet bytes processed by each ECMP member within the preset time.
[0035] Optionally, the target load sharing algorithm notified by the analysis center includes a target hash algorithm and hash algorithm parameters; when load sharing is performed on each flow carried by the ECMP group based on the target load sharing algorithm, the processing unit is specifically configured to:
[0036] The hash algorithm and hash algorithm parameters are used to perform hash processing on each flow message carried by the ECMP group, and the ECMP member carrying each flow is determined according to the hash result.
[0037] In a fourth aspect, the present application provides a traffic load sharing device, which is applied to an analysis center; the device includes:
[0038] a receiving unit, configured to receive traffic messages reported by a network device, wherein when the network device determines that the load of any ECMP member included in the ECMP group does not meet a preset requirement, the network device samples each flow carried by the ECMP group based on a preset rule and sends each sampled traffic message to an analysis center;
[0039] An analysis unit, configured to analyze packet characteristics of each flow carried by the ECMP group;
[0040] a determining unit, configured to determine a target load balancing algorithm for load balancing each flow carried by the ECMP group based on an analysis result and a load balancing algorithm supported by a forwarding chip of the network device;
[0041] A notification unit is configured to notify the forwarding chip of the target load sharing algorithm, so that the forwarding chip performs load sharing on each flow carried by the ECMP group based on the target load sharing algorithm.
[0042] Optionally, when analyzing the message characteristics of each flow carried by the ECMP group, the analyzing unit is specifically configured to:
[0043] Analyze the five-tuple information of each flow and analyze the flow size information of each flow.
[0044] Optionally, when determining a target load sharing algorithm for load sharing of each flow carried by the ECMP group based on the analysis result and the load sharing algorithm supported by the forwarding chip of the network device, the determining unit is specifically configured to:
[0045] Obtain the load balancing algorithms supported by the forwarding chip and the algorithm parameters supported by each load balancing algorithm, wherein the algorithm parameters include but are not limited to the number of bits supported by the algorithm offset and the number of bits supported by the seed setting;
[0046] Obtain the number of ECMP members included in the ECMP group;
[0047] Using a preset simulation program, simulating the results of the ECMP group forwarding each traffic message under different load sharing algorithms and / or different algorithm parameters;
[0048] When it is determined that a load sharing algorithm and a set of algorithm parameters are used in the simulation, when the ECMP group forwards each flow message, the load situation of each ECMP group meets the preset requirements, then the load sharing algorithm and the algorithm parameters are determined as the target load sharing algorithm for load sharing of each flow carried by the ECMP group.
[0049] In a fifth aspect, an embodiment of the present application provides a traffic load sharing device, the traffic load sharing device comprising:
[0050] a memory for storing program instructions;
[0051] The processor is configured to call the program instructions stored in the memory and execute the steps of the method as described in any one of the first aspects above according to the obtained program instructions.
[0052] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method described in any one of the above-mentioned first aspects.
[0053] In a seventh aspect, an embodiment of the present application provides a traffic load sharing device, the traffic load sharing device comprising:
[0054] a memory for storing program instructions;
[0055] The processor is used to call the program instructions stored in the memory and execute the steps of the method as described in any one of the second aspects according to the obtained program instructions.
[0056] In an eighth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method described in any one of the above-mentioned second aspects.
[0057] In summary, the traffic load sharing method provided in the embodiment of the present application is applied to the forwarding chip of the network device; the method includes: monitoring the load status of each ECMP member included in the equal-cost multi-path routing ECMP group; when it is determined that the load status of any ECMP member does not meet the preset requirements, sampling and processing the various flows carried by the ECMP group based on preset rules, and sending the sampled traffic messages to the analysis center, so that the analysis center analyzes the message characteristics of each flow carried by the ECMP group, and determines the target load sharing algorithm for load sharing of each flow carried by the ECMP group based on the analysis results and the load sharing algorithm supported by the forwarding chip, and notifies the forwarding chip of the target load sharing algorithm; based on the target load sharing algorithm, load sharing is performed on each flow carried by the ECMP group.
[0058] The traffic load balancing method provided in the embodiments of this application evaluates the load status of each ECMP member based on its Nexthop, monitors ECMP traffic hash characteristics through sampling, and evaluates traffic distribution based on the sampling frequency. Ultimately, this method selects a load balancing algorithm and parameters that optimize load balancing. Load balancing is still based on fixed traffic characteristics, ensuring predictable routing and preventing packet out-of-order situations. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments of the present application or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present application.
[0060] Figure 1 A detailed flow chart of a traffic load sharing method provided in an embodiment of the present application;
[0061] Figure 2 A schematic diagram of a unicast message forwarding process provided in an embodiment of the present application;
[0062] Figure 3 A detailed flow chart of another traffic load sharing method provided in an embodiment of the present application;
[0063] Figure 4 A schematic diagram of the structure of a traffic load sharing device provided in an embodiment of the present application;
[0064] Figure 5 A schematic structural diagram of another load sharing device provided in an embodiment of the present application;
[0065] Figure 6A schematic diagram of the hardware architecture of a traffic load sharing device provided in an embodiment of the present application;
[0066] Figure 7 A schematic diagram of the hardware architecture of another load sharing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] The terms used in the embodiments of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms "a," "the," and "the" used in this application and claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.
[0068] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" used may also be interpreted as "at the time of" or "when" or "in response to determining".
[0069] For example, see Figure 1 , which is a detailed flow chart of a traffic load sharing method provided in an embodiment of the present application, and which is applied to a forwarding chip of a network device; the method includes the following steps:
[0070] Step 100: Monitor the load of each ECMP member included in the Equal Cost Multi-Path Routing (ECMP) group.
[0071] In the embodiment of the present application, in ECMP networking, unicast routing forwarding generally adopts the following architecture:
[0072] For example, see Figure 2 As shown in the figure, first, IP traffic will pass through the Longest Prefix Match (LPM) table to find the corresponding ECMP group (ECMP GROUP). This ECMP group contains multiple ECMP members (ECMPMEMBER), which further point to the next hop (NEXTHOP) table to determine the final packet forwarding path.
[0073] In the embodiment of the present application, ECMP GROUP is used as the granularity to monitor whether the traffic is load-balanced.
[0074] Specifically, a counter is set for each ECMP member included in the ECMP group. Then, when monitoring the load of each ECMP member included in the ECMP group, a better implementation method is:
[0075] The number of packets and the number of packet bytes processed by each ECMP member within the preset time are counted using the counter of each ECMP member. The packet rate of each ECMP member is calculated based on the counted number of packets processed by each ECMP member within the preset time. The packet bandwidth rate of each ECMP member is calculated based on the counted number of packet bytes processed by each ECMP member within the preset time.
[0076] That is, the packet number rate and packet bandwidth rate of an ECMP member represent the load of the ECMP member.
[0077] In practical applications, network equipment includes a load monitoring module. This module can monitor the load on each ECMP path by attaching a counter to each ECMP member in the ECMP group. The counter supports both packet count and byte count statistics. By periodically reading the packet count and byte count, two monitoring items can be calculated: the packet rate (pps) and the packet bandwidth rate (bps). Based on the packet rate, traffic load balancing is determined. If there are large and small packets, the packet bandwidth rate is added to calculate the load.
[0078] The link difference percentage threshold and link bandwidth alarm threshold are user-configurable and support customization. When any threshold of any ECMP member is reached, it indicates that the load of the ECMP member does not meet the preset requirements, and an alarm is issued for the ECMP member.
[0079] For example, the link difference percentage threshold = |(actual link packet rate – theoretical rate of full load sharing)| / theoretical rate of full load sharing;
[0080] Link bandwidth alarm threshold = link bandwidth rate / link bandwidth;
[0081] In actual applications, the link difference percentage threshold can be set to 5%, and the link bandwidth alarm threshold can be set to 90%. An alarm will only be issued when the link is about to be congested.
[0082] Step 110: When it is determined that the load of any ECMP member does not meet the preset requirements, each flow carried by the ECMP group is sampled based on the preset rules, and each sampled flow message is sent to the analysis center.
[0083] In an embodiment of the present application, the analysis center analyzes the message characteristics of each flow carried by the ECMP group, and determines the target load sharing algorithm for load sharing of each flow carried by the ECMP group based on the analysis results and the load sharing algorithm supported by the forwarding chip, and notifies the forwarding chip of the target load sharing algorithm.
[0084] Specifically, when an alarm occurs in the load monitoring module, the chip triggers the traffic sampling function to collect traffic from the ECMP group that generated the alarm. For example, at a certain sampling frequency, such as 10,000:1, the traffic of each ECMP group is collected from the forwarding chip to the analysis center. Optionally, the analysis center can be the CPU of the network device or an independent third-party server, which is not specifically limited in the embodiments of this application.
[0085] Collecting traffic characteristics is the basis for in-depth analysis and optimization of load balancing. This process involves analyzing the five-tuple information of the data packet, including the source IP (SIP), destination IP (DIP), protocol type, source port (L4SPORT), and destination port (L4DPORT). If it is a tunnel message, the five-tuple information of the message payload also needs to be parsed. In other words, the message characteristics of each flow carried by the ECMP group are analyzed, and further, the bandwidth size of each flow needs to be counted. Based on the analyzed message characteristics of each flow, the bandwidth size of each flow, and the number of ECMP members included in the ECMP group, a target load balancing algorithm (including algorithm parameters) that can enable ECMP members to load share each flow is selected from the multiple load balancing algorithms supported by the forwarding chip.
[0086] For example, the analysis center can obtain the load balancing algorithm parameter capabilities supported by the current forwarding chip, including the number of hash algorithms supported (such as XOR and CRC), the number of bits supported for the algorithm offset, and the number of bits supported for the seed setting. It must also obtain the hash parameters configured by the user (hash algorithm, algorithm offset, seed value) and the fields selected for hash calculation. It must also determine to which ECMP group the sampled traffic belongs. It must also obtain ECMP group-related information, primarily the number of ECMP MEBRERS.
[0087] The built-in simulation program of the analysis center can calculate a set of reasonable algorithm parameters (algorithm ID value, algorithm offset value, seed value) to keep the load sharing difference of the sampled messages within the allowable range and achieve load balancing.
[0088] The simulation program simulates the hash load balancing process within the chip. Packet hash routing generally involves three steps: 1) hash field selection; 2) hash calculation; and 3) hash bit selection. Finally, the selected hash value is modulo the number of ECMP next hops, and one of these next hops is selected for forwarding.
[0089] Hash field selection refers to which fields in the message quintuple can participate in the hash calculation. For example, you can configure only the SIP (source IP) to participate in the hash calculation.
[0090] Hash calculation groups the hashing fields into 16-bit chunks (the hash length of current mainstream chips). For example, if SIP is selected for hashing, the 32-bit IP address is divided into two segments, the front and back. Based on the configured hash algorithm (XOR or CRC) and hashseed, a 16-bit value is calculated. To ensure more random packet hashing, chips typically have at least four hash engines, calculating a 4*16-bit hash value.
[0091] Hash bit selection does not necessarily require 16 bits to be taken from bit 0 as the hash value. You can set it to take 16 consecutive bits from any position of the 64 bits (4*16bit) as the hash value.
[0092] As can be seen, the amount of calculation is still relatively large. If you want to select the appropriate combination by using the variable hash algorithm parameters, there will be certain requirements for the computing power of the analysis center. Based on the existing algorithm parameters of the chip, you can make fine adjustments on this basis to select the appropriate values. In the embodiment of the present application, the algorithm selection strategy is set as follows: if the algorithm ID remains unchanged, adjust the algorithm offset (hash bit selection); if the offset remains unchanged, adjust the algorithm ID. This strategy has a good effect based on actual application experience.
[0093] Finally, the key to algorithm adjustment is to set the algorithm parameters calculated by the analysis center to a specific ECMP group for them to take effect. This setting method is closely related to the chip's capabilities. If the chip supports setting these parameters directly within the ECMP group, then do so directly. Typical chips do not have this capability. Alternatively, consider issuing an ACL match and setting these hash parameters through ACL actions. This approach is supported by mainstream chips. If the ACL match item is the ECMP group, the hash parameters are only effective for the ECMP group. This solution does not limit the implementation method, but it does require this key setting.
[0094] Step 120: Based on the target load sharing algorithm, load share the flows carried by the ECMP group.
[0095] Specifically, the forwarding chip performs hash calculations on the traffic carried by the ECMP group based on the target load sharing algorithm and algorithm parameters, and distributes the traffic to each ECMP member for forwarding according to the hash results.
[0096] For example, see Figure 3 FIG. 1 is a detailed flow chart of a traffic load sharing method provided in an embodiment of the present application, which is applied to an analysis center; the method includes the following steps:
[0097] Step 300: Receive traffic packets reported by network devices.
[0098] In an embodiment of the present application, when the network device determines that the load condition of any ECMP member included in the ECMP group does not meet the preset requirements, it samples and processes the various flows carried by the ECMP group based on preset rules, and sends the sampled flow packets to the analysis center.
[0099] Step 310: Analyze the message characteristics of each flow carried by the ECMP group.
[0100] In the embodiment of the present application, when analyzing the message characteristics of each flow carried by the ECMP group, a preferred implementation method is:
[0101] Analyze the five-tuple information of each flow and analyze the flow size information of each flow.
[0102] Step 320: Determine a target load balancing algorithm for load balancing each flow carried by the ECMP group based on the analysis result and the load balancing algorithm supported by the forwarding chip of the network device.
[0103] In an embodiment of the present application, when determining a target load sharing algorithm for load sharing each flow carried by the ECMP group based on the analysis results and the load sharing algorithm supported by the forwarding chip of the network device, a preferred implementation method is:
[0104] Obtain the load balancing algorithms supported by the forwarding chip and the algorithm parameters supported by each load balancing algorithm, wherein the algorithm parameters include but are not limited to the number of bits supported by the algorithm offset and the number of bits supported by the seed setting;
[0105] Obtain the number of ECMP members included in the ECMP group;
[0106] Using a preset simulation program, simulating the results of the ECMP group forwarding each traffic message under different load sharing algorithms and / or different algorithm parameters;
[0107] When it is determined that a load sharing algorithm and a set of algorithm parameters are used in the simulation, when the ECMP group forwards each flow message, the load situation of each ECMP group meets the preset requirements, then the load sharing algorithm and the algorithm parameters are determined as the target load sharing algorithm for load sharing of each flow carried by the ECMP group.
[0108] Step 330: Notify the forwarding chip of the target load sharing algorithm, so that the forwarding chip performs load sharing on each flow carried by the ECMP group based on the target load sharing algorithm.
[0109] Based on the same inventive concept as the above-mentioned embodiment of the invention of the forwarding chip applied to the network device, for example, refer to Figure 4 FIG. 1 is a schematic diagram of the structure of a traffic load sharing device provided in an embodiment of the present application, which is applied to a forwarding chip of a network device; the device includes:
[0110] A monitoring unit 40 is configured to monitor the load of each ECMP member included in the equal-cost multi-path routing ECMP group;
[0111] The sampling unit 41 is configured to, when it is determined that the load of any ECMP member does not meet preset requirements, sample each flow carried by the ECMP group based on preset rules, and send each sampled flow message to an analysis center so that the analysis center analyzes the message characteristics of each flow carried by the ECMP group, and determines a target load sharing algorithm for load sharing each flow carried by the ECMP group based on the analysis results and the load sharing algorithms supported by the forwarding chip, and notifies the forwarding chip of the target load sharing algorithm;
[0112] The processing unit 42 is configured to perform load balancing on each flow carried by the ECMP group based on the target load balancing algorithm.
[0113] Optionally, a counter is provided for each ECMP member included in the ECMP group; when monitoring the load of each ECMP member included in the ECMP group, the monitoring unit 40 is specifically configured to:
[0114] The number of packets and bytes processed by each ECMP member within a preset time period are counted using the counter of each ECMP member.
[0115] Calculate the packet rate of each ECMP member based on the number of packets processed by each ECMP member within the preset time period.
[0116] The packet bandwidth rate of each ECMP member is calculated based on the number of packet bytes processed by each ECMP member within the preset time.
[0117] Optionally, the target load sharing algorithm notified by the analysis center includes a target hash algorithm and hash algorithm parameters; when load sharing is performed on each flow carried by the ECMP group based on the target load sharing algorithm, the processing unit 42 is specifically configured to:
[0118] The hash algorithm and hash algorithm parameters are used to perform hash processing on each flow message carried by the ECMP group, and the ECMP member carrying each flow is determined according to the hash result.
[0119] Based on the same inventive concept as the above-mentioned embodiment of the invention applied to the analysis center, for example, refer to Figure 5 FIG. 1 is a schematic diagram of a traffic load sharing device provided in an embodiment of the present application, which is applied to an analysis center; the device includes:
[0120] The receiving unit 50 is configured to receive traffic packets reported by a network device. When the network device determines that the load of any ECMP member included in the ECMP group does not meet a preset requirement, the network device samples each traffic carried by the ECMP group based on a preset rule and sends the sampled traffic packets to an analysis center.
[0121] An analysis unit 51 is configured to analyze packet characteristics of each flow carried by the ECMP group;
[0122] a determining unit 52 configured to determine a target load balancing algorithm for load balancing each flow carried by the ECMP group based on the analysis result and the load balancing algorithm supported by the forwarding chip of the network device;
[0123] The notification unit 53 is configured to notify the forwarding chip of the target load sharing algorithm, so that the forwarding chip performs load sharing on each flow carried by the ECMP group based on the target load sharing algorithm.
[0124] Optionally, when analyzing the message characteristics of each flow carried by the ECMP group, the analyzing unit 51 is specifically configured to:
[0125] Analyze the five-tuple information of each flow and analyze the flow size information of each flow.
[0126] Optionally, when determining a target load sharing algorithm for load sharing each flow carried by the ECMP group based on the analysis result and the load sharing algorithm supported by the forwarding chip of the network device, the determining unit 52 is specifically configured to:
[0127] Obtain the load balancing algorithms supported by the forwarding chip and the algorithm parameters supported by each load balancing algorithm, wherein the algorithm parameters include but are not limited to the number of bits supported by the algorithm offset and the number of bits supported by the seed setting;
[0128] Obtain the number of ECMP members included in the ECMP group;
[0129] Using a preset simulation program, simulating the results of the ECMP group forwarding each traffic message under different load sharing algorithms and / or different algorithm parameters;
[0130] When it is determined that a load sharing algorithm and a set of algorithm parameters are used in the simulation, when the ECMP group forwards each flow message, the load situation of each ECMP group meets the preset requirements, then the load sharing algorithm and the algorithm parameters are determined as the target load sharing algorithm for load sharing of each flow carried by the ECMP group.
[0131] The above units may be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a unit is implemented by scheduling program code through a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0132] Furthermore, the traffic load sharing device provided in the embodiment of the present application, from the hardware level, the hardware architecture diagram of the traffic load sharing device can be found in Figure 6 As shown, the traffic load sharing device may include: a memory 60 and a processor 61,
[0133] The memory 60 is used to store program instructions. The processor 61 calls the program instructions stored in the memory 60 and executes the above method embodiment applied to the forwarding chip of the network device according to the obtained program instructions. The specific implementation method and technical effect are similar and will not be repeated here.
[0134] Optionally, the present application also provides a load sharing device, comprising at least one processing element (or chip) for executing the above-mentioned method embodiment applied to a forwarding chip of a network device.
[0135] Optionally, the present application also provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the above-mentioned method embodiment applied to the forwarding chip of the network device.
[0136] Furthermore, the traffic load sharing device provided in the embodiment of the present application, from the hardware level, the hardware architecture diagram of the traffic load sharing device can be found in Figure 7 As shown, the traffic load sharing device may include: a memory 70 and a processor 71,
[0137] The memory 7 is used to store program instructions. The processor 71 calls the program instructions stored in the memory 70 and executes the above method embodiment applied to the analysis center according to the obtained program instructions. The specific implementation method and technical effect are similar and will not be repeated here.
[0138] Optionally, the present application also provides a load sharing device, comprising at least one processing element (or chip) for executing the above-mentioned method embodiment applied to the analysis center.
[0139] Optionally, the present application also provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the above-mentioned method embodiment applied to the analysis center.
[0140] Here, the machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage media, or a combination thereof.
[0141] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.
[0142] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0143] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0144] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] Furthermore, these computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0147] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A traffic load sharing method, characterized in that: A forwarding chip applied to a network device; the method comprising: Monitor the load of each ECMP member in the Equal Cost Multipath Routing (ECMP) group; When it is determined that the load of any ECMP member does not meet the preset requirements, sampling and processing are performed on each flow carried by the ECMP group based on preset rules, and each sampled flow message is sent to the analysis center, so that the analysis center analyzes the message characteristics of each flow carried by the ECMP group, and determines a target load sharing algorithm for load sharing of each flow carried by the ECMP group based on the analysis results and the load sharing algorithm supported by the forwarding chip, and notifies the forwarding chip of the target load sharing algorithm; Based on the target load sharing algorithm, load sharing is performed on each flow carried by the ECMP group.
2. The method according to claim 1, wherein A counter is provided for each ECMP member included in the ECMP group; and the step of monitoring the load of each ECMP member included in the ECMP group includes: The number of packets and bytes processed by each ECMP member within a preset time period are counted using the counter of each ECMP member. Calculate the packet rate of each ECMP member based on the number of packets processed by each ECMP member within the preset time period. The packet bandwidth rate of each ECMP member is calculated based on the number of packet bytes processed by each ECMP member within the preset time.
3. The method according to claim 1 or 2, wherein: The target load balancing algorithm notified by the analysis center includes a target hash algorithm and hash algorithm parameters; and the step of load balancing each flow carried by the ECMP group based on the target load balancing algorithm includes: The hash algorithm and hash algorithm parameters are used to perform hash processing on each flow message carried by the ECMP group, and the ECMP member carrying each flow is determined according to the hash result.
4. A traffic load sharing method, characterized in that: Applied to an analysis center; the method comprises: Receive traffic messages reported by network devices, wherein, when the network device determines that the load of any ECMP member included in the ECMP group does not meet preset requirements, the network device samples each flow carried by the ECMP group based on preset rules and sends the sampled traffic messages to an analysis center; Analyzing the packet characteristics of each flow carried by the ECMP group; Determining a target load balancing algorithm for load balancing each flow carried by the ECMP group based on the analysis result and the load balancing algorithm supported by the forwarding chip of the network device; The target load sharing algorithm is notified to the forwarding chip, so that the forwarding chip performs load sharing on each flow carried by the ECMP group based on the target load sharing algorithm.
5. The method according to claim 4, wherein The step of analyzing the message characteristics of each flow carried by the ECMP group includes: Analyze the five-tuple information of each flow and analyze the flow size information of each flow.
6. The method according to claim 5, wherein The step of determining a target load balancing algorithm for load balancing each flow carried by the ECMP group according to the analysis result and the load balancing algorithm supported by the forwarding chip of the network device includes: Obtain the load balancing algorithms supported by the forwarding chip and the algorithm parameters supported by each load balancing algorithm, wherein the algorithm parameters include but are not limited to the number of bits supported by the algorithm offset and the number of bits supported by the seed setting; Obtain the number of ECMP members included in the ECMP group; Using a preset simulation program, simulating the results of the ECMP group forwarding each traffic message under different load sharing algorithms and / or different algorithm parameters; When it is determined that a load sharing algorithm and a set of algorithm parameters are used in the simulation, when the ECMP group forwards each flow message, the load situation of each ECMP group meets the preset requirements, then the load sharing algorithm and the algorithm parameters are determined as the target load sharing algorithm for load sharing of each flow carried by the ECMP group.
7. A traffic load sharing device, characterized in that: A forwarding chip applied to a network device; the device comprises: A monitoring unit, configured to monitor the load of each ECMP member included in the equal-cost multi-path routing ECMP group; a sampling unit configured to, when it is determined that the load of any ECMP member does not meet preset requirements, sample each flow carried by the ECMP group based on preset rules, and send each sampled flow message to an analysis center so that the analysis center analyzes the message characteristics of each flow carried by the ECMP group, and determines a target load sharing algorithm for load sharing each flow carried by the ECMP group based on the analysis results and the load sharing algorithms supported by the forwarding chip, and notifies the forwarding chip of the target load sharing algorithm; A processing unit is configured to perform load balancing on each flow carried by the ECMP group based on the target load balancing algorithm.
8. A traffic load sharing device, characterized in that: Applicable to an analysis center; the device comprises: a receiving unit, configured to receive traffic messages reported by a network device, wherein when the network device determines that the load of any ECMP member included in the ECMP group does not meet a preset requirement, the network device samples each flow carried by the ECMP group based on a preset rule and sends each sampled traffic message to an analysis center; An analysis unit, configured to analyze packet characteristics of each flow carried by the ECMP group; a determining unit, configured to determine a target load balancing algorithm for load balancing each flow carried by the ECMP group based on an analysis result and a load balancing algorithm supported by a forwarding chip of the network device; A notification unit is configured to notify the forwarding chip of the target load sharing algorithm, so that the forwarding chip performs load sharing on each flow carried by the ECMP group based on the target load sharing algorithm.
9. A traffic load sharing device, characterized in that: The traffic load sharing device includes: a memory for storing program instructions; A processor is configured to call the program instructions stored in the memory, and execute the steps of the method according to any one of claims 1 to 3 or any one of claims 4 to 6 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method according to any one of claims 1 to 3 or any one of claims 4 to 6.