A method and apparatus for implementing equal-cost multi-path group load sharing

By calculating the bandwidth weights and link quality changes of ECMP group member paths and combining them with a stability convergence mechanism, the problem of traffic imbalance caused by the ECMP group hash algorithm is solved, achieving more efficient traffic load balancing and link utilization.

CN123055650APending Publication Date: 2026-11-06NEW H3C TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611071097.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In the Spine-Leaf network architecture, the existing ECMP group's hash algorithm cannot effectively combine the actual available bandwidth of the link, resulting in uneven traffic distribution. This can easily cause link congestion, especially in scenarios with complex topologies and large differences in link bandwidth.

Method used

By calculating the bandwidth weights of ECMP group member paths and monitoring differences in link quality, a stability convergence mechanism is introduced. The ECMP entries are written sequentially in turn to ensure that traffic load balancing is combined with link quality fluctuations, thereby reducing real-time modifications to the hash table.

Benefits of technology

This enables traffic load balancing based on actual bandwidth while maintaining stable link quality, reducing the processing overhead of communication equipment and improving link utilization and the balance of traffic distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123055650A_ABST
    Figure CN123055650A_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for implementing load balancing in an equal-cost multipath group (ECMP). The method includes: calculating the bandwidth weight of each member path in the ECMP group; monitoring the link quality variation differences within a detection period of each member path; monitoring the link quality variation differences between detection periods of each member path; determining that the link quality variation within a detection period of each member path is stable and that the link quality variation between detection periods of each member path is stable; calculating the number of ECMP entries allocated to each member path based on the bandwidth weights of all member paths; and sequentially writing the equivalent next hop of each member path into the ECMP table of the ECMP group until the allocated ECMP entries for each member path are reached.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to communication technology, specifically a method and device for implementing load sharing of equal-cost multipath groups. Background Technology

[0002] ECMP (Equal-Cost Multi-Path) is a routing strategy that load-balances traffic forwarding across multiple paths with equal costs to a destination IP address, thereby improving link utilization, increasing bandwidth, and enhancing network redundancy and reliability.

[0003] When a communication device encounters a failure of an equivalent next hop in the ECMP group leading to a destination IP address, it modifies its hash algorithm based on the number of working equivalent next hops in the ECMP group. This reloads traffic destined for the destination IP address onto different ECMP members, resulting in different equivalent paths. However, this can cause traffic load-sharing on the equivalent path containing the unaffected equivalent next hop to be switched to other equivalent paths. To address this, the communication device determines the equivalent next hops for each equivalent multipath and sequentially fills them into the ECMP table of the ECMP group until it is full. For example, if the communication device's routing learning indicates that the ECMP group leading to the destination IP address contains 6 equivalent next hops, these 6 equivalent next hops are sequentially filled into the 32 entries of the ECMP table until it is full. When one of these equivalent next hops fails, the other normal equivalent next hops sequentially replace the failed next hop's ECMP entry, preventing traffic from normal ECMP members from being switched to other ECMP members.

[0004] In existing Spine-Leaf network architectures, the hash value calculated based on packet characteristic parameters of service flows for Leaf nodes is used to select the next hop in the ECMP group. However, there is a lack of a dynamic allocation mechanism that considers the actual available bandwidth of the links. This approach can easily lead to uneven traffic distribution in scenarios with complex topologies and significant differences in link bandwidth. For example, when multiple Leaf nodes communicate with the same destination Leaf node simultaneously, the hash algorithm may concentrate most of the traffic on the same Spine node and link, causing congestion on that link while other link bandwidth resources are not fully utilized. Summary of the Invention

[0005] The purpose of this application is to provide a method and device for implementing load balancing in an equal-cost multipath group. After the link quality of each member path in the equal-cost multipath group reaches a stable level, the traffic forwarded through the equal-cost next hop of the ECMP group is load balanced based on bandwidth weight.

[0006] To achieve the above objectives, this application provides a method for implementing load balancing in an equal-cost multipath group. The method includes: calculating the bandwidth weight of each member path in the ECMP group; monitoring the link quality variation differences within the detection period of each member path; monitoring the link quality variation differences between detection periods of each member path; determining that the link quality variation within the detection period of each member path is stable and that the link quality variation between detection periods of each member path is stable; calculating the number of ECMP entries allocated to each member path based on the bandwidth weights of all member paths; and sequentially writing the equivalent next hop of each member path into the ECMP table of the ECMP group until the allocated number of ECMP entries for each member path is reached.

[0007] To achieve the above objectives, this application provides an apparatus for implementing load balancing in an equal-cost multipath group. The apparatus includes a processor, a machine-readable storage medium, a switching chip, and a network interface. In this apparatus, the processor executes machine-executable instructions recorded on the machine-readable storage medium to perform the following operations: calculate the bandwidth weight of each member path in the ECMP group; monitor the link quality variation differences within the detection period of each member path; monitor the link quality variation differences between the detection periods of each member path; determine that the link quality variation within the detection period of each member path is stable and that the link quality variation between the detection periods of each member path is stable; calculate the number of ECMP entries allocated to each member path based on the bandwidth weights of all member paths; and sequentially write the equivalent next hop of each member path into the ECMP table of the ECMP group until the allocated number of ECMP entries for each member path is reached.

[0008] The beneficial effects of this application are that it combines the quality fluctuations of ECMP member links with traffic load balancing, does not modify the hash table in real time with real-time quality changes, reduces the additional processing overhead that communication equipment may introduce due to frequent changes in ECMP load balancing, and improves link utilization by distributing traffic load based on the actual available bandwidth of member links. Attached Figure Description

[0009] Figure 1 A flowchart illustrating an embodiment of a method for implementing load balancing across an equivalent multipath group provided in this application; Figure 2 A schematic diagram of the network architecture for calculating the bandwidth weight of each member path of an ECMP group, provided for this application; Figure 3 A schematic diagram of an embodiment of the allocation of ECMP entries provided for this application; Figure 4 A schematic diagram of Embodiment 2 for allocating ECMP entries provided in this application; Figure 5A schematic diagram of Embodiment 3 for allocating ECMP entries provided in this application; Figure 6 This is a schematic diagram of an embodiment of a device for implementing load sharing of equivalent multipath groups provided in this application. Detailed Implementation

[0010] The following detailed description will be provided with reference to several examples illustrated in the accompanying figures. In this detailed description, numerous specific details are used to provide a comprehensive understanding of the present application. Known methods, steps, components, and circuits are not described in detail in the examples to avoid obscuring their meaning.

[0011] In the terminology used, the term "including" means including but not limited to; the term "containing" means including but not limited to; the terms "above," "within," and "below" include the number itself; the terms "greater than" and "less than" mean not including the number itself. The term "based on" means based on at least a portion of them.

[0012] Figure 1 The diagram shown is a flowchart of an embodiment of a method for implementing load balancing in an equal-cost multipath group, provided by this application; the embodiment includes the following steps: Step 101: Calculate the bandwidth weight of each member path in the ECMP group; Step 102: Monitor the differences in link quality changes within the detection period of each member path; Step 103: Monitor the differences in link quality changes between detection cycles for each member path; Step 104: Determine that the link quality changes within the detection period of each member path are stable and that the link quality changes between detection periods of each member path are stable. Step 105: Based on the bandwidth weights of all member paths, calculate the number of ECMP entries allocated to each member path; write the equivalent next hop of each member path into the ECMP table of the ECMP group in turn until the number of allocated ECMP entries for each member path is reached.

[0013] Figure 1 The beneficial effect of this embodiment is that it combines the quality fluctuations of ECMP member links with traffic load balancing, does not modify the hash table in real time with real-time quality changes, reduces the additional processing overhead that communication devices may introduce due to frequent changes in ECMP load balancing, and improves link utilization by distributing traffic load based on the actual available bandwidth of member links.

[0014] Figure 2 A schematic diagram of the network architecture for calculating the bandwidth weight of each member path of an ECMP group, provided for this application; Figure 2In the Spine-Leaf architecture of the data center, Spine nodes 21-24 and Leaf nodes 11-14 are both Layer 3 switching devices. Through routing protocols such as OSPF or EBGP, equal-cost multipath load balancing and link backup are achieved between Spine devices and Leaf devices.

[0015] Leaf nodes 11-14 and Spine nodes 21-24 can measure link quality within the Spine-Leaf architecture using in-band telemetry or the Two-Way Active Measurement Protocol (TWAMP) according to the detection cycle. Taking the measurement of ECMP link quality from Leaf node 11 to Leaf node 14 as an example...

[0016] The next hops of the four ECMP member paths from Leaf node 11 to Leaf node 14 are Spine nodes 21-24. Leaf node 11 measures the link quality of the direct links L1.1, L1.2, L1.3, and L1.4 of the four ECMP member paths, and measures the link quality of the direct links LS1.4, LS2.4, LS3.4, and LS4.4 of the equivalent next hop Spine nodes 21, 22, 23, and 24 on the four ECMP member paths.

[0017] In this application, Leaf node 11 can choose the measured link quality of direct links L1.1, L1.2, L1.3, and L1.4 as the bandwidth weights QA, QB, QC, and QD of the four member paths, respectively; or, it can choose the link quality of the direct links LS1.4, LS2.4, LS3.4, and LS4.4 of the four equivalent next-hop Spine nodes 21, 22, 23, and 24 as the bandwidth weights QA, QB, QC, and QD of the four member paths, respectively; or Leaf node 11 compares the link quality of link L1.1 and link LS1.4, and selects the highest link quality among the two links as the bandwidth weight QA of the first member path based on the link quality priority principle; Leaf node 11 selects the bandwidth weights QB, QC, and QD of the other three member paths in the same way based on the link quality priority principle.

[0018] Other Leaf nodes calculate the bandwidth weights of each member path in the ECMP group from this device to other Leaf nodes in the same way. In this embodiment, QA, QB, QC, and QD represent the calculated bandwidth weight values. The specific bandwidth weight values ​​will be calculated based on the service network, and this application does not provide specific examples.

[0019] exist Figure 2In the architecture shown, relying solely on the bandwidth weight values ​​calculated using QA, QB, QC, and QD to dynamically allocate ECMP group weights has the beneficial effect of enabling a more balanced distribution of traffic based on link quality, avoiding hash polarization. However, due to the instantaneous fluctuations in network conditions, immediate adjustments based on bandwidth weight values ​​may cause a rapid improvement in the link quality of a certain member path, leading to an increase in its bandwidth weight value, thus necessitating a new round of adjustments.

[0020] Therefore, this application introduces a stability convergence mechanism, which redistributes the weights after the bandwidth weights of each member path in the ECMP group have stabilized, and adjusts the traffic carried by the member paths.

[0021] Taking Leaf node 11 as an example, Leaf node 11 monitors the differences in link quality changes within the detection period of each member path; and monitors the differences in link quality changes between detection periods of each member path.

[0022] Leaf node 11 monitors the differences in link quality changes within the detection period of each member path by calculating the link quality variance within the detection period of each member path.

[0023] Leaf node 11 calculates the link quality variance within the detection period of each member path using the following formula 1.

[0024] Formula 1: .

[0025] in, The variance is calculated; This represents the number of member paths in an ECMP group. This represents the average path weight of the ECMP group members; This represents the bandwidth weight of each member path within a period.

[0026] Leaf node 11 calculation refers to the variance of link quality samples between detection cycles of each member path, in order to monitor the differences in link quality changes between detection cycles of each member path.

[0027] Leaf node 11 calculates the sample variance of link quality between detection cycles for each member path using the following formula 2.

[0028] Formula (2) in, To calculate the sample variance, Indicates the number of cycles involved in the calculation. Indicates the first The average weight of the member links in each cycle, Indicates all Average of each period The overall average.

[0029] After Leaf node 11 completes the calculation based on Formula 1 and Formula 2, it compares the link quality variance of each member path in the current detection period with the link quality variance in the previous detection period, and compares the link quality sample variance between the current detection periods of each member path with the link quality sample variance between the previously calculated detection periods.

[0030] In one example, Leaf node 11 determines that the link quality variance within the current detection period of each member path in the ECMP group is the same as the link quality variance within the previous detection period, and the link quality sample variance between the current detection periods of each member path is the same as the link quality sample variance calculated between the previous detection periods. Therefore, Leaf node 1 determines that the link quality change within the detection period of each member path is stable, and the link quality change between the detection periods of each member path is stable. Alternatively, In another example, Leaf node 1 determines that the difference between the link quality variance in the current detection period and the link quality variance in the previous detection period for each member path is less than a defined first threshold, and the difference between the link quality sample variance between the current detection periods and the link quality sample variance between the previously calculated detection periods for each member path is less than a defined second threshold. Leaf node 1 determines that the link quality changes within the detection periods of each member path are stable, and the link quality changes between the detection periods of each member path are stable.

[0031] In this way, Leaf node 11 combines the quality fluctuations of the ECMP group's member links with traffic load balancing, without modifying the hash table in real time as the real-time quality changes, thus reducing the additional processing overhead that communication devices may introduce due to frequent changes in ECMP load balancing.

[0032] Meanwhile, Leaf node 11 improves link utilization by distributing traffic load based on the actual available bandwidth of member links. Leaf node 11 calculates the number of ECMP entries allocated to each member path based on the bandwidth weight of all member paths; it then writes the equivalent next hop of each member path into the ECMP table of the ECMP group in turn until the number of allocated ECMP entries for each member path is reached.

[0033] Figure 3 A schematic diagram of an embodiment of the allocation of ECMP entries provided in this application.

[0034] Leaf node 11 calculates the bandwidth weight ratio among all member paths of the ECMP group reaching Leaf node 14 as QA:QB:QC:QD, and allocates a corresponding number of ECMP entries according to the ratio of the bandwidth weight of each member path in the ratio.

[0035] In one example, Leaf node 11 calculates the ratio QA:QB:QC:QD=2:4:5:7, then the number of ECMP entries allocated to each member path is 2, 4, 5, and 7.

[0036] Leaf node 11 writes the equivalent next hops S1, S2, S3, and S4 of each member path in turn in sequence. Figure 3 The ECMP table 30 for this ECMP group is shown.

[0037] When the number of ECMP entries for the first member path written to ECMP table 30 reaches 2, the equivalent next hop S1 of that member path will no longer be written. Instead, the equivalent next hops S2, S3, and S4 of the other member paths will be written to ECMP table 30 in turn.

[0038] If Leaf node 11 determines that the number of ECMP entries for the second member path written to ECMP table 30 has reached 4, then it will no longer write the equivalent next hop S2 for that member path, and will write the equivalent next hops S3 and S4 for other member paths to ECMP table 30 in turn.

[0039] Leaf node 11 determines that the number of ECMP entries for the third member path written to ECMP table 30 has reached 5. If so, it stops writing the equivalent next hop S3 for that member path and continues writing the equivalent next hop S4 for the fourth member path to ECMP table 30 until the number of equivalent next hop S4 entries written to ECMP table 30 reaches 7.

[0040] Figure 4 A schematic diagram of Embodiment 2 for assigning ECMP entries to this application.

[0041] Figure 4 In the ECMP Table 40, the total number of entries is 32.

[0042] In one example, Leaf node 11 calculates the bandwidth weights of each member path of the ECMP group leading to Leaf node 14 as 2, 4, 4, and 6, respectively.

[0043] Leaf node 11 calculates the total bandwidth weight of all member paths: QA+QB+QC+QD=2+4+4+6=16.

[0044] Leaf node 11 distributes the total number of entries 32 in ECMP table 40 equally according to the total bandwidth weight of the member paths, and calculates the number of entries allocated to each weight unit: .

[0045] Leaf node 11 modulo the total number of entries 32 in ECMP table 40 according to the total bandwidth weight 32 of all member paths: .

[0046] Leaf node 11 calculates that the number of unsplitting entries in ECMP table 40 is zero. Based on the bandwidth weight of each member path and the number of entries allocated to each weight unit, the number of ECMP entries for each member path is calculated.

[0047] Leaf node 11 calculates the number of ECMP entries for the first member path to be 4 based on the bandwidth weight 2 of the first member path and the number of entries allocated to each weight unit 2.

[0048] Leaf node 11 calculates the number of ECMP entries for the second member path to be 8 based on the bandwidth weight 2 of the second member path and the number of entries assigned to each weight unit 4.

[0049] Leaf node 11 calculates the number of ECMP entries for the third member path to be 8 based on the bandwidth weight 2 of the third member path and the number of entries allocated to each weight unit 4.

[0050] Leaf node 11 calculates the number of ECMP entries for the fourth member path to be 12 based on the bandwidth weight 2 of the fourth member path and the number of entries allocated to each weight unit 6.

[0051] Leaf node 11 writes the equivalent next hops S1, S2, S3, and S4 of each member path in turn in sequence. Figure 4 The ECMP table 40 for this ECMP group is shown.

[0052] When Leaf node 11 determines that the number of ECMP entries for the first member path written to ECMP table 40 reaches 4, it will no longer write the equivalent next hop S1 of that member path, and will write the equivalent next hops S2, S3, and S4 of other member paths to ECMP table 40 in turn.

[0053] Leaf node 11 determines that the number of ECMP entries for the second and third member paths written to ECMP table 30 has reached 8, then it will no longer write the equivalent next hops S2 and S3 for these two member paths, and will write the equivalent next hop S4 for the remaining fourth member path to ECMP table 40.

[0054] Figure 5A schematic diagram of Embodiment 3 for assigning ECMP entries to this application.

[0055] Figure 5 In this context, ECMP Table 50 contains a total of 32 entries.

[0056] In one example, Leaf node 11 calculates the bandwidth weights of each member path of the ECMP group leading to Leaf node 14 as 2, 2, 3, and 3, respectively.

[0057] Leaf node 11 calculates the total bandwidth weight of all member paths: QA+QB+QC+QD=2+2+3+3=10.

[0058] Leaf node 11 distributes the total number of entries 32 in ECMP table 50 equally according to the total bandwidth weight of the member paths, and calculates the number of entries allocated to each weight unit: .

[0059] Leaf node 11 modulo the total number of entries 32 in ECMP table 50 according to the total bandwidth weight 32 of all member paths: .

[0060] Leaf node 11 calculates that the number of unsplitting entries in ECMP table 50 is 3. Based on the bandwidth weight of each member path and the number of entries allocated to each weight unit, the number of ECMP entries for each member path is calculated.

[0061] Leaf node 11 calculates the number of ECMP entries for the first member path to be 6 based on the bandwidth weight 2 of the first member path and the number of entries assigned to each weight unit 3.

[0062] Leaf node 11 calculates the number of ECMP entries for the second member path to be 6 based on the bandwidth weight 2 of the second member path and the number of entries allocated to each weight unit 3.

[0063] Leaf node 11 calculates the number of ECMP entries for the third member path to be 9 based on the bandwidth weight of 3 for the third member path and the number of entries allocated to each weight unit of 3.

[0064] Leaf node 11 calculates the number of ECMP entries for the fourth member path to be 9 based on the bandwidth weight of the fourth member path (9) and the number of entries allocated to each weight unit (3).

[0065] Leaf node 11, following the link quality priority principle, allocates the two ECMP entries that cannot be evenly distributed to the fourth member path, which has the highest link quality. That is, the fourth member path has 11 ECMP entries.

[0066] Leaf node 11 writes the equivalent next hops S1, S2, S3, and S4 of each member path in turn in sequence. Figure 4 The ECMP table 50 for this ECMP group is shown.

[0067] When Leaf node 11 determines that the number of ECMP entries for the first and second member paths written to ECMP table 50 reaches 6, it will stop writing the equivalent next hop S1 of that member path and write the equivalent next hops S3 and S4 of other member paths to ECMP table 50 in turn.

[0068] Leaf node 11 determines that if the number of ECMP entries written to the third member path in ECMP table 30 reaches 9, then it will no longer write the equivalent next hop S3 of the third member path; then Leaf node 11 determines to write the remaining 2 ECMP entries to the equivalent next hop S4 of the fourth member path.

[0069] Figure 6 This is a schematic diagram of an embodiment of a device for implementing equivalent multipath group load balancing provided in this application. Device 60 includes a processor 61, a machine-readable storage medium 62, a switching chip 63, and a network interface 64.

[0070] The processor 61 performs the following operations by executing machine-executable instructions recorded in the machine-readable storage medium 62: calculating the bandwidth weight of each member path in the ECMP group; monitoring the link quality variation differences within the detection period of each member path; monitoring the link quality variation differences between the detection periods of each member path; determining that the link quality variation within the detection period of each member path is stable and that the link quality variation between the detection periods of each member path is stable; calculating the number of ECMP entries allocated to each member path based on the bandwidth weights of all member paths; and writing the equivalent next hop of each member path into the ECMP table of the ECMP group in turn until the number of allocated ECMP entries for each member path is reached.

[0071] The processor 61 executes machine-executable instructions recorded in the machine-readable storage medium 62 to monitor the link quality variation difference within the detection period of each member path, which refers to the link quality variance within the detection period of each member path that is monitored and calculated. in, This represents the number of member paths in an ECMP group. This represents the average path weight of the ECMP group members; This represents the bandwidth weight of each member path within a period.

[0072] The processor 61 performs the following operations by executing machine-executable instructions recorded in the machine-readable storage medium 62: monitoring the link quality variation differences between detection cycles of each member path refers to monitoring and calculating the sample variance of link quality between detection cycles of each member path. in, Indicates the number of cycles involved in the calculation. Indicates the first The average weight of the member links in each cycle, Indicates all Average of each period The overall average.

[0073] In one example, the processor 61 executes machine-executable instructions recorded in the machine-readable storage medium 62 to determine that the link quality changes within the detection period of each member path are stable and that the link quality changes between detection periods of each member path are stable. This includes determining that the link quality variance within the current detection period of each member path is the same as the link quality variance within the previous detection period and that the link quality sample variance between the current detection periods of each member path is the same as the link quality sample variance calculated between the previous detection periods.

[0074] In one example, the processor 61 executes machine-executable instructions recorded on the machine-readable storage medium 62 to determine that the link quality changes within the detection period of each member path are stable and that the link quality changes between detection periods of each member path are stable. This includes determining that the difference between the link quality variance within the current detection period of each member path and the link quality variance within the previous detection period is less than a set first threshold and that the difference between the link quality sample variance between the current detection periods of each member path and the link quality sample variance between the previously calculated detection periods is less than a set second threshold.

[0075] In one example, processor 61 performs the calculation of bandwidth weights for each member path of the ECMP group by running machine-executable instructions recorded in machine-readable storage medium 62, including the following processes: calculating the link quality of the directly connected links of each member path as the bandwidth weight for each member path.

[0076] In one example, processor 61 performs the calculation of bandwidth weights for each member path of the ECMP group by running machine-executable instructions recorded in machine-readable storage medium 62, including the following processing: calculating the link quality of the direct link of the equivalent next hop for each member path as the bandwidth weight for each member path. In one example, processor 61 performs the calculation of bandwidth weights for each member path of the ECMP group by running machine-executable instructions recorded in machine-readable storage medium 62, including the following processes: calculating the link quality of the direct links of each member path and the link quality of the direct links of the equivalent next hop of each member path, and selecting the highest link quality as the bandwidth weight for each member path based on the link quality priority principle.

[0077] In one example, processor 61 performs the following processes by executing machine-executable instructions recorded in machine-readable storage medium 62 to calculate the bandwidth weight of each member path in the ECMP group: calculating the proportional relationship of bandwidth weights among all member paths; and allocating a corresponding number of ECMP entries according to the ratio of the bandwidth weight of each member path in the proportional relationship.

[0078] In one example, processor 61 performs the following processes by executing machine-executable instructions recorded in machine-readable storage medium 62 to calculate the bandwidth weight of each member path in the ECMP group: dividing the total number of entries in the ECMP table equally according to the total bandwidth weight of all member paths, and calculating the number of entries allocated to each weight unit; taking the remainder of the total number of entries in the ECMP table according to the total bandwidth weight of all member paths, and calculating the number of entries that cannot be evenly divided to be zero; and calculating the number of ECMP entries for each member path according to the bandwidth weight of each member path and the number of entries allocated to each weight unit.

[0079] In one example, processor 61 performs the following processing by executing machine-executable instructions recorded in machine-readable storage medium 62 to calculate the bandwidth weight of each member path in the ECMP group: dividing the total number of entries in the ECMP table equally according to the total bandwidth weight of all member paths, and calculating the number of entries allocated to each weight unit; taking the remainder of the total number of entries in the ECMP table according to the total bandwidth weight of all member paths, and calculating the number of entries that cannot be evenly distributed; calculating the number of ECMP entries that are evenly distributed to each member path according to the bandwidth weight of each member path and the number of entries allocated to each weight unit; and allocating the number of entries that cannot be evenly distributed to the member path with the highest link quality according to the link quality priority principle.

[0080] In this application, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device used to store or contain information (such as executable instructions, data, etc.). For example, any machine-readable storage medium herein can be any type of random access memory (RAM), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid-state drive, any type of optical disc (such as an optical disc, DVD, etc.), and similar devices, or combinations thereof. Furthermore, any machine-readable storage medium herein can be a non-transitory machine-readable storage medium.

[0081] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for implementing load sharing in an equivalent multipath group, characterized in that, The method includes, Calculate the bandwidth weight for each member path in the ECMP group; Monitor the differences in link quality changes within the detection period for each member path; Monitor the differences in link quality changes between detection cycles for each member path; It is determined that the link quality changes within the detection period of each member path are stable and the link quality changes between the detection periods of each member path are stable; Based on the bandwidth weights of all the member paths, calculate the number of ECMP entries allocated to each member path. The equivalent next hop for each member path is written sequentially and in turn into the ECMP table of the ECMP group until the number of assigned ECMP entries for each member path is reached.

2. The method according to claim 1, characterized in that, Monitoring the differences in link quality changes within the detection period of each member path refers to calculating the link quality variance within the detection period of each member path. in, This represents the number of member paths of the ECMP group. This represents the average path weight of the members of the ECMP group; This represents the bandwidth weight of each member path within the period; The difference in link quality between detection periods for each member path refers to the sample variance of link quality between detection periods for each member path. in, Indicates the number of cycles involved in the calculation. Indicates the first The average weight of the member links in each cycle, Indicates all Average of each period The overall average.

3. The method according to claim 2, characterized in that, Determining that the link quality changes are stable within the detection period of each member path and that the link quality changes are stable between the detection periods of each member path means that... The link quality variance in the current detection period of each member path is the same as the link quality variance in the previous detection period, and the link quality sample variance between the current detection periods of each member path is the same as the link quality sample variance calculated between the previous detection periods; or, The difference between the link quality variance in the current detection period and the link quality variance in the previous detection period for each member path is less than a first threshold, and the difference between the link quality sample variance between the current detection periods and the link quality sample variance between the previously calculated detection periods for each member path is less than a second threshold.

4. The method according to claim 1, characterized in that, The bandwidth weight for each member path in the ECMP group is calculated as follows: Calculate the link quality of the directly connected links for each member path as the bandwidth weight for each member path; or, Calculate the link quality of the directly connected link with the equivalent next hop for each member path as the bandwidth weight for each member path; or, Calculate the link quality of the direct link of each member path and the link quality of the direct link of the equivalent next hop of each member path. Based on the link quality priority principle, select the highest link quality as the bandwidth weight of each member path.

5. The method according to claim 1, characterized in that, The number of ECMP entries allocated to each member path is calculated based on the bandwidth weights of all member paths, including: Calculate the proportional relationship of bandwidth weights among all the member paths; allocate a corresponding number of ECMP entries according to the ratio of the bandwidth weight of each member path in the proportional relationship; or, Divide the total number of entries in the ECMP table evenly according to the total bandwidth weight of all member paths, and calculate the number of entries allocated to each weight unit; take the remainder of the total number of entries in the ECMP table according to the total bandwidth weight of all member paths, and calculate the number of entries that cannot be evenly divided, which is zero; calculate the number of ECMP entries for each member path according to the bandwidth weight of each member path and the number of entries allocated to each weight unit; or, The total number of entries in the ECMP table is divided equally according to the total bandwidth weight of all member paths, and the number of entries allocated to each weight unit is calculated. The total number of entries in the ECMP table is then modulo the total bandwidth weight of all member paths, and the number of entries that cannot be evenly distributed is calculated. The number of ECMP entries that are evenly distributed to each member path is calculated according to the bandwidth weight of each member path and the number of entries allocated to each weight unit. The number of entries that cannot be evenly distributed is then allocated to the member path with the highest link quality according to the link quality priority principle.

6. A device for implementing load balancing across equal-cost multipath groups, the device comprising a processor, a machine-readable storage medium, a switching chip, and a network interface; characterized in that, The processor performs the following operations by executing machine-executable instructions recorded on the machine-readable storage medium. Calculate the bandwidth weight for each member path in the ECMP group; Monitor the differences in link quality changes within the detection period for each member path; Monitor the differences in link quality changes between detection cycles for each member path; It is determined that the link quality changes within the detection period of each member path are stable and the link quality changes between the detection periods of each member path are stable; Based on the bandwidth weights of all the member paths, calculate the number of ECMP entries allocated to each member path. The equivalent next hop for each member path is written sequentially and in turn into the ECMP table of the ECMP group until the number of assigned ECMP entries for each member path is reached.

7. The device according to claim 6, characterized in that, The processor executes machine-executable instructions recorded on the machine-readable storage medium to monitor the link quality variation differences within the detection period of each member path, which means calculating the link quality variance within the detection period of each member path. in, This represents the number of member paths of the ECMP group. This represents the average path weight of the members of the ECMP group; This represents the bandwidth weight of each member path within the period; The difference in link quality between detection periods for each member path refers to the sample variance of link quality between detection periods for each member path. in, Indicates the number of cycles involved in the calculation. Indicates the first The average weight of the member links in each cycle, Indicates all Average of each period The overall average.

8. The device according to claim 7, characterized in that, The processor, by executing machine-executable instructions recorded on the machine-readable storage medium, performs the operation of determining that the link quality changes are stable within the detection period of each member path and that the link quality changes are stable between the detection periods of each member path. The link quality variance in the current detection period of each member path is the same as the link quality variance in the previous detection period, and the link quality sample variance between the current detection periods of each member path is the same as the link quality sample variance between the previously calculated detection periods. or, The difference between the link quality variance in the current detection period and the link quality variance in the previous detection period for each member path is less than a first threshold, and the difference between the link quality sample variance between the current detection periods and the link quality sample variance between the previously calculated detection periods for each member path is less than a second threshold.

9. The device according to claim 6, characterized in that, The processor performs the following processing to calculate the bandwidth weight of each member path of the ECMP group by executing machine-executable instructions recorded on the machine-readable storage medium: Calculate the link quality of the directly connected links of each member path as the bandwidth weight of each member path; or, Calculate the link quality of the direct link with the equivalent next hop for each member path as the bandwidth weight for each member path; or, Calculate the link quality of the direct link of each member path and the link quality of the direct link of the equivalent next hop of each member path. Based on the link quality priority principle, select the highest link quality as the bandwidth weight of each member path.

10. The device according to claim 6, characterized in that, The processor performs the following processes by executing machine-executable instructions recorded on the machine-readable storage medium to calculate the number of ECMP entries allocated to each of the member paths based on the bandwidth weights of all the member paths: Calculate the proportional relationship of bandwidth weights among all the member paths; allocate a corresponding number of ECMP entries according to the ratio of the bandwidth weight of each member path in the proportional relationship; or, Divide the total number of entries in the ECMP table equally according to the total bandwidth weight of all the member paths, and calculate the number of entries allocated to each weight unit; take the remainder of the total number of entries in the ECMP table according to the total bandwidth weight of all the member paths, and calculate that the number of entries that cannot be evenly divided is zero; calculate the number of ECMP entries for each member path according to the bandwidth weight of each member path and the number of entries allocated to each weight unit. or, The total number of entries in the ECMP table is divided equally according to the total bandwidth weight of all member paths, and the number of entries allocated to each weight unit is calculated. The total number of entries in the ECMP table is then modulo the total bandwidth weight of all member paths, and the number of entries that cannot be evenly distributed is calculated. The number of ECMP entries that are evenly distributed to each member path is calculated according to the bandwidth weight of each member path and the number of entries allocated to each weight unit. The number of entries that cannot be evenly distributed is then allocated to the member path with the highest link quality according to the link quality priority principle.