A method and apparatus for load sharing

By configuring egress and ingress port groups and setting a load balancing (LBN) value for each egress port, the problems of load imbalance and network congestion in multi-ingress and multi-egress network environments are solved, enabling packets to be forwarded along their original paths and improving network throughput.

CN118631734BActive Publication Date: 2026-06-12NEW H3C TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NEW H3C TECH CO LTD
Filing Date
2024-06-28
Publication Date
2026-06-12

Smart Images

  • Figure CN118631734B_ABST
    Figure CN118631734B_ABST
Patent Text Reader

Abstract

The application provides a load sharing method and device. The method comprises the following steps: configuring an out port group; configuring an in port group; wherein the number of in ports of the in port group is an integer multiple of the number of out ports of the out port group; configuring each out port of the out port group to map the integer multiple of in ports respectively; configuring a load sharing value LBN value for each out port of the out port group; and setting the LBN value of each out port as the LBN value of the mapped in port.
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 load sharing. Background Technology

[0002] In AI (Artificial Intelligence) intelligent computing networks, complex scenarios with multiple ingress and egress ports are frequently encountered. In such scenarios, the goal is to distribute traffic from multiple ingress ports to multiple egress ports evenly while maintaining packet order (flow-by-flow forwarding). However, in real-world environments, traffic from multiple ingress ports often converges on a single egress port, while other egress ports experience no traffic, leading to unbalanced load balancing and network congestion.

[0003] LBN (Load Balance Number) is a network-level load balancing technology that maps network devices to equal-cost routing groups and one or more inbound port groups. Traffic from multiple inbound ports of each port group is precisely distributed to different outbound ports of that port group to improve network throughput.

[0004] However, the order of the outgoing ports for the next hop in an equal-cost routing group is not fixed and can change due to network conditions. Network devices calculate a hash value based on the LBN value of the packet's ingress port and then send the packet through the downgraded outgoing port corresponding to the calculated hash value. After the outgoing port order of the next hop in an equal-cost routing group changes, assuming no routing failure occurs in the group, packets from the same service flow arriving at the same ingress port in the ingress port group may be unable to be forwarded along the original path. Summary of the Invention

[0005] The purpose of this application is to provide a method and device for load balancing, ensuring that packets are forwarded along the original path when no routing failure occurs in the equal-cost routing group.

[0006] To achieve the above objectives, this application provides a method for implementing load balancing. The method includes: configuring an output port group; configuring an input port group; wherein the number of input ports in the input port group is an integer multiple of the number of output ports in the output port group; configuring each output port of the output port group to map an integer multiple of the input ports; configuring a load balancing value (LBN) for each output port of the output port group; and setting the LBN value of each output port to the LBN value mapped to the input port.

[0007] To achieve the above objectives, this application also provides a device for implementing load balancing, which includes at least a processor, a memory, and a switching chip connected via a bus; the processor executes processor-executable instructions in the memory to perform the following operations: configuring an output port group; configuring an input port group; wherein the number of input ports in the input port group is an integer multiple of the number of output ports in the output port group; configuring each output port of the output port group to map an integer multiple of the input ports; configuring a load balancing value (LBN) for each output port of the output port group; and setting the LBN value of each output port to the LBN value mapped to the input port.

[0008] The beneficial effect of this application is that, according to the LBN value of each outgoing port in the outgoing port group, the outgoing ports of each next hop in the equal-cost routing group are sorted, ensuring that the order of the outgoing ports of the next hop in the equal-cost routing group will not change, and ensuring that when no routing failure occurs in the equal-cost routing group, the packets are forwarded according to the original path. Attached Figure Description

[0009] Figure 1 A flowchart illustrating an embodiment of the load balancing method provided in this application;

[0010] Figure 2 This is a schematic diagram of the leaf node load sharing link in the intelligent computing network provided in the embodiments of this application;

[0011] Figure 3 for Figure 2 A schematic diagram of the output port group and input port group for configuring load sharing values ​​in the leaf nodes;

[0012] Figure 4 A schematic diagram illustrating load balancing for output port groups and input port groups;

[0013] Figure 5 A diagram illustrating load sharing between the outgoing and incoming port groups after a member route of an equal-cost routing group fails.

[0014] Figure 6 This application provides a schematic diagram of another embodiment of the leaf node load-sharing link.

[0015] Figure 7 for Figure 6 A schematic diagram illustrating load sharing between the output port group and the input port group;

[0016] Figure 8 for Figure 6 A diagram illustrating load sharing between the outgoing and incoming port groups after a member route in a medium-cost routing group fails.

[0017] Figure 9 This is a schematic diagram of an embodiment of the device for implementing load sharing provided in this application. Detailed Implementation

[0018] 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.

[0019] 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.

[0020] Figure 1 The diagram shown is a flowchart of an embodiment of the load balancing method provided in this application; the method includes,

[0021] Step 101, Configure the output port group;

[0022] Step 102, configure the ingress port group; wherein the number of ingress ports in the ingress port group is an integer multiple of the number of egress ports in the egress port group;

[0023] Step 103: Configure each output port of the output port group to map an integer multiple of the input ports;

[0024] Step 104: Configure the load sharing value (LBN) for each output port of the output port group;

[0025] Step 105: Set the LBN value of each output port to the LBN value mapped to the input port.

[0026] Figure 1 The beneficial effect of this embodiment is that, according to the LBN value of each outgoing port in the outgoing port group, the outgoing ports of each next hop in the equal-cost routing group are sorted, ensuring that the order of the outgoing ports of the next hop in the equal-cost routing group will not change, and ensuring that when no routing failure occurs in the equal-cost routing group, the packets are forwarded according to the original path.

[0027] Figure 2 This is a schematic diagram of the load sharing link in the leaf node of the intelligent computing network provided in the embodiments of this application. Figure 2 In this system, the backbone nodes Spine 11-14 and the leaf nodes Leaf 1 and Leaf 12 are all Layer 3 switching devices; Leaf 1 is connected to servers s1-s4 through ports a, b, c, and d respectively; Leaf 1 is connected to Spine 11-14 through ports w, x, y, and z respectively.

[0028] Leaf 2 connects to servers s9-s12 via the downlink in the same way as leaf 1, and connects to spine11-14 via the uplink in the same way as leaf 11. The following will take leaf 1 as an example to explain the setting of outgoing port groups, incoming port groups, identification of outgoing port groups associated with equal-cost routing groups, sorting of next-hop ports of equal-cost routing groups, and load balancing forwarding of leaf nodes in this application.

[0029] First, an output port group is configured on Leaf1; then, an input port group 22 containing integer multiples of input ports is configured, and each output port of the output port group is configured to map an integer multiple of the input port.

[0030] Figure 2 In the middle, Leaf1 is first configured with an output port group 21 containing output ports port w, port x, port y, and port z; then an input port group 22 containing input ports port a, port b, port c, and port d is configured, and each output port is configured to map to the input ports port a, port b, port c, and port d respectively.

[0031] Figure 3 for Figure 2 A schematic diagram of the outgoing and incoming port groups for configuring load balancing values ​​in the leaf nodes.

[0032] Leaf1 sets the LBN values ​​of each output port (port w, port x, port y, port z) of output port group 21 to LBN0, LBN1, LBN2, and LBN3, respectively; and sets the LBN values ​​of the mapped input ports (port a, port b, port c, port d) to LBN0, LBN1, LBN2, and LBN3 based on the LBN values ​​of each output port (port w, port x, port y, port z).

[0033] exist Figure 2 In the process, leaf1 received routes from server s9 from spine11-14 respectively, and generated the routing table entries shown in Table 1.

[0034] Prefix / mask Next jump Output port 11.1.1.11 / 32 7.1.1.1 portz 11.1.1.11 / 32 8.1.1.1 port y 11.1.1.11 / 32 9.1.1.1 port x 11.1.1.11 / 32 10.1.1.1 port w

[0035] Table 1

[0036] Based on the routing table entries shown in Table 1, Leaf1 generates four different next-hop routes to the IP address 11.1.1.11 of server s9, generates an equal-cost route group ECMP 33, and finds the outgoing port group 21 containing the four next-hop outgoing ports port z, port y, port x, and port w of the equal-cost route group ECMP 33.

[0037] leaf1 sorts the four next-hop outgoing ports of the equal-cost routing group ECMP33 into port w, port x, port y, and port z according to the LBN values ​​of each outgoing port in the outgoing port group 21: LBN0, LBN1, LBN2, and LBN3. This way, the order of the next-hop outgoing ports of the equal-cost routing group will not change.

[0038] Leaf1 records a Layer 3 forwarding table entry for IP address 11.1.1.11 / 32; the next hop for this Layer 3 forwarding table entry is ECMP33.

[0039] Figure 4 A schematic diagram illustrating load sharing for output port groups and input port groups.

[0040] Leaf1 receives packet 41 through ingress port a of ingress port group 22. Based on the destination IP address 11.1.1.11, it finds the next hop to be ECMP33. Based on the LBN value LBN0 of ingress port a and the number of members 4 of egress port group 21 associated with ECMP33, it calculates the hash value to hash 0. Using the MAC address of the egress port port w of LBN0 in egress port group 21 associated with ECMP33 as the source MAC address, and the MAC address of the next hop 10.1.1.1 of egress port w as the destination MAC address, it re-encapsulates the Ethernet header of packet 41 and sends the encapsulated packet 41 through egress port w.

[0041] Leaf1 receives packet 42 through ingress port c of ingress port group 22. Based on the destination IP address 11.1.1.11, it finds the next hop to be ECMP33. Based on the LBN value LBN2 of ingress port c and the number of members 4 of egress port group 21 associated with ECMP33, it calculates the hash value hash2. Using the MAC address of the egress port y of LBN2 in egress port group 21 associated with ECMP33 as the source MAC address, and the MAC address of the next hop 8.1.1.1 of egress port y as the destination MAC address, it re-encapsulates the Ethernet header of packet 42 and sends the encapsulated packet 42 through egress port y.

[0042] In this way, leaf1 distributes the uplink packets sent to server s9 received by each ingress port of ingress port group 22 to the corresponding egress ports of egress port group 21 associated with equal-cost routing group 33.

[0043] Leaf1 monitors the traffic statistics of each output port in port group 21.

[0044] when Figure 2In the middle, the path between leaf1 and spine13 failed. After the route from leaf1 to server s9 was updated, it is shown in Table 2.

[0045] Prefix / mask Next jump Output port 11.1.1.11 / 32 7.1.1.1 portz 11.1.1.11 / 32 9.1.1.1 port x 11.1.1.11 / 32 10.1.1.1 port w

[0046] Table 2

[0047] Based on the routing table entries shown in Table 2, Leaf1 refreshes the equal-cost routing group ECMP 33 to three next hops: 7.1.1.1, 9.1.1.1, and 11.1.1.1. Leaf11 finds that the outgoing ports (port w, port x, and port z) of these three next hops in ECMP 33 belong to outgoing port group 21. Comparing the outgoing ports of the three next hops in equal-cost routing group ECMP 33 with the outgoing ports of outgoing port group 21, the outgoing port of the faulty next hop is identified as port y.

[0048] Based on the traffic of the normal outgoing ports of outgoing port group 21, Leaf1 identifies the lightly loaded outgoing port port w among the normal outgoing ports port w, port x, and port z of outgoing port group 21 with the current minimum forwarding traffic.

[0049] Figure 5 A diagram illustrating load sharing between the outgoing and incoming port groups after a member route of an equal-cost routing group fails. Figure 5 In the middle, Leaf1 sets the LBN value of the input port port c mapped to the faulty output port port y to the LBN value LBN0 of the lightly loaded output port port w.

[0050] Leaf1 maintains the number of output ports in output port group 21 unchanged, and maintains the LBN value of the faulty output port y unchanged.

[0051] Leaf1 receives packet 51 through ingress port a of ingress port group 22. Based on the destination IP address 11.1.1.11, it finds the next hop to be ECMP33. Based on the LBN value LBN0 of ingress port a and the number of members in egress port group 21 associated with ECMP33 (4), it calculates the hash value to hash 0. Using the MAC address of the egress port port w of LBN0 in egress port group 21 associated with ECMP33 as the source MAC address, and the MAC address of the next hop 10.1.1.1 of egress port w as the destination MAC address, it re-encapsulates the Ethernet header of packet 51 and sends the encapsulated packet 51 through egress port w.

[0052] Leaf1 receives packet 52 through ingress port c of ingress port group 22. Based on the destination IP address 11.1.1.11, it finds the next hop to be ECMP33. Based on the LBN value LBN0 of ingress port c and the number of members in egress port group 21 associated with ECMP33 (4), it calculates the hash value to hash 0. Using the MAC address of the egress port port w of LBN0 in egress port group 21 associated with ECMP33 as the source MAC address, and the MAC address of the next hop 10.1.1.1 of egress port w as the destination MAC address, it re-encapsulates the Ethernet header of packet 52 and sends the encapsulated packet 52 through egress port w.

[0053] Figure 5 In the process, leaf1 quickly identifies the faulty outgoing port of the outgoing port group associated with the equal-cost routing group based on the refresh of the next-hop outgoing port of the member routes of the equal-cost routing group; it sets the LBN value of the outgoing port of the next hop of the other member routes that replace the faulty outgoing port, sets the LBN value of the ingoing port that maps the faulty outgoing port, and quickly switches the traffic forwarded by port y of the faulty outgoing port of the outgoing port group to the next-hop outgoing port of the replacement member route.

[0054] Furthermore, leaf1 maintains the same number of output ports in output port group 21. When leaf1 receives a message through input ports a, b, and d of input port group 22, the output port LBN value calculated based on the input port LBN value remains unchanged. Messages received by input ports a, b, and d of input port group 22 are still sent through the normal output ports w, x, and z of output port group 21.

[0055] when Figure 5 The path between leaf1 and spine13 is restored, and the routing table 2 for leaf1 to reach server s9 is updated to the route shown in Table 1.

[0056] Based on the next hop of the restored route in Table 1, Leaf1 refreshes the equal-cost route group ECMP 33 to four next hops: 7.1.1.1, 9.1.1.1, 8.1.1.11, and 10.1.1.1. Leaf11 finds that the outgoing ports of these four next hops of ECMP 33, port w, port x, port y, and port z, belong to outgoing port group 21.

[0057] Based on the LBN value of 2 for the outgoing port y of the recovered next-hop 8.1.1.11, Leaf1 sets the LBN value of the ingoing port c mapped to port y. Thus, when leaf1's ingoing port c subsequently receives an Ethernet packet destined for IP address 11.1.1.11, it will... Figure 4 Forward in the manner shown.

[0058] Figure 6 This is a schematic diagram of another embodiment of the leaf node load-sharing link provided in this application. Figure 6 In the diagram, ports w, x, y, and z of Leaf 1 are connected to... Figure 2 Spine 11-14;

[0059] The backbone nodes Spine 11-14 and leaf nodes Leaf 1 and Leaf 12 of Leaf1 are all Layer 3 switches; Leaf1 connects to eight servers via port ah. (Not shown in the diagram)

[0060] First, port group 61 is configured with output ports port w, port x, port y, and port z. Then, port group 62, which contains twice the number of input ports (port a-port h), is configured. Each output port in port group 62 is mapped to two input ports: port w is mapped to port a and port e; port x is mapped to port b and port f; port y is mapped to port c and port g; and port z is mapped to port d and port h.

[0061] Leaf1 sets the LBN values ​​of each output port (port w, port x, port y, port z) of port group 61 to LBN0, LBN1, LBN2, and LBN3, respectively.

[0062] Leaf1 sets the LBN values ​​of ingress ports a and e to LBN0 based on the LBN0 of outgress port w; sets the LBN values ​​of ingress ports b and f to LBN1 based on the LBN1 of outgress port x; sets the LBN values ​​of ingress ports c and g to LBN2 based on the LBN2 of outgress port y; and sets the LBN values ​​of ingress ports d and h to LBN3 based on the LBN3 of outgress port z.

[0063] exist Figure 7 In the process, leaf1 received routes from server s9 from spine11-14 respectively, and generated the routing table entries shown in Table 1.

[0064] Based on the routing table entries shown in Table 1, Leaf1 generates four different next-hop routes to the IP address 11.1.1.11 of server s9, generates an equal-cost route group ECMP 33, and finds the outgoing port group 61 containing the four next-hop outgoing ports port z, port y, port x, and port w of the equal-cost route group ECMP 33.

[0065] leaf1 sorts the four next-hop outgoing ports of the equal-cost routing group ECMP33 into port w, port x, port y, and port z according to the LBN values ​​of each outgoing port in the outgoing port group 61: LBN0, LBN1, LBN2, and LBN3. This way, the order of the next-hop outgoing ports of the equal-cost routing group 33 will not change.

[0066] Figure 7 for Figure 6 The diagram in the middle illustrates load sharing between the output port group and the input port group.

[0067] Figure 7 In the process, leaf1 receives packet 71 through ingress port a of ingress port group 62. Based on the destination IP address 11.1.1.11, it finds the next hop to be ECMP33. Based on the LBN value LBN0 of ingress port a and the number of members of the outgress port group 61 associated with ECMP33 (4), it calculates the hash value to hash 0. Using the MAC address of the outgress port w of LBN0 in the outgress port group 61 associated with ECMP33 as the source MAC address, and the MAC address of the next hop 10.1.1.1 of outgress port w as the destination MAC address, leaf1 re-encapsulates the Ethernet header of packet 61 and sends the encapsulated packet 61 through outgress port w.

[0068] Leaf1 receives packet 72 through ingress port e of ingress port group 62. Based on the destination IP address 11.1.1.11, it finds the next hop to be ECMP33. Based on the LBN value LBN0 of ingress port e and the number of members in egress port group 61 associated with ECMP33 (4), it calculates the hash value to hash 0. Using the MAC address of egress port w of LBN0 in egress port group 61 associated with ECMP33 as the source MAC address, and the MAC address of the next hop 10.1.1.1 of egress port w as the destination MAC address, it re-encapsulates the Ethernet header of packet 62 and sends the encapsulated packet 62 through egress port w.

[0069] Figure 8 for Figure 6 A diagram illustrating load sharing between the outgoing and incoming port groups after a member route in a medium-cost routing group fails.

[0070] if Figure 6 The path failure between leaf1 and spine13 is shown above. After the route update, the route from leaf1 to server s9 is as shown in Table 2 above.

[0071] Based on the routing table entries shown in Table 2, Leaf1 refreshes the equal-cost routing group ECMP 33 to three next hops: 7.1.1.1, 9.1.1.1, and 11.1.1.1. Leaf11 finds that the outgoing ports (port w, port x, and port z) of these three next hops in ECMP 33 belong to outgoing port group 61. Comparing the outgoing ports of the three next hops in equal-cost routing group ECMP 33 with the outgoing ports of outgoing port group 61, the outgoing port of the faulty next hop is identified as port y.

[0072] Based on the traffic of the normal outgoing ports of port group 61, Leaf1 identifies the lightly loaded outgoing port port w among the normal outgoing ports port w, port x, and port z of port group 61 with the current minimum forwarding traffic.

[0073] Leaf1 sets the LBN values ​​of the input ports c and g mapped to the faulty output port y to the LBN value LBN0 of the lightly loaded output port w.

[0074] Leaf1 maintains the number of output ports in output port group 61 unchanged, and maintains the LBN value of the faulty output port y unchanged.

[0075] Leaf1 receives packet 81 through ingress port a of ingress port group 62. Based on the destination IP address 11.1.1.11, it finds the next hop to be ECMP33. Based on the LBN value LBN0 of ingress port a and the number of members in egress port group 61 associated with ECMP33 (4), it calculates the hash value to hash 0. Using the MAC address of the egress port port w of LBN0 in egress port group 61 associated with ECMP33 as the source MAC address, and the MAC address of the next hop 10.1.1.1 of egress port w as the destination MAC address, it re-encapsulates the Ethernet header of packet 81 and sends the encapsulated packet 81 through egress port w.

[0076] Leaf1 receives packet 82 through ingress port g of ingress port group 62. Based on the destination IP address 11.1.1.11, it finds the next hop to be ECMP33. Based on the LBN value LBN0 of ingress port g and the number of members in egress port group 61 associated with ECMP33 (4), it calculates the hash value to hash 0. Using the MAC address of the egress port port w of LBN0 in egress port group 61 associated with ECMP33 as the source MAC address, and the MAC address of the next hop 10.1.1.1 of egress port w as the destination MAC address, it re-encapsulates the Ethernet header of packet 82 and sends the encapsulated packet 82 through egress port w.

[0077] Figure 9 The diagram shown is a schematic representation of an embodiment of a device method for implementing load balancing provided in this application. The device 90 includes at least a processor, a memory, and a switching chip connected via a bus. The processor executes processor-executable instructions in the memory to perform the following operations: configuring an output port group; configuring an input port group; wherein the number of input ports in the input port group is an integer multiple of the number of output ports in the output port group; configuring each output port of the output port group to map an integer multiple of the input ports; configuring a load balancing value (LBN) for each output port of the output port group; and setting the LBN value of each output port to the LBN value mapped to the input port.

[0078] The processor, by executing processor-executable instructions in memory, also performs the following operations: generates an equivalent route group to the target IP address; finds each next-hop outgoing port of the equivalent route group that is contained in the outgoing port group; and sorts each next-hop outgoing port of the equivalent route group based on the LBN value of each outgoing port of the outgoing port group.

[0079] The processor, by executing processor-executable instructions in memory, also performs the following operations: receiving a packet through one of the ingress ports of the ingress port group; finding the equivalent route group based on the destination IP address of the packet; calculating a hash value based on the LBN value of the ingress port where the packet arrived and the number of members in the egress port group; identifying the egress port in the egress port group whose LBN value is equal to the calculated hash value; re-encapsulating the Ethernet header of the packet based on the MAC address of the identified egress port; and sending the re-encapsulated packet through the identified egress port.

[0080] The processor, by executing processor-executable instructions in memory, also performs the following operations: refreshes the equivalent-cost route group based on the next hop of the faulty route to the destination IP address; finds each next-hop outgoing port in the outgoing port group that contains the refreshed equivalent-cost route group; identifies the outgoing port of the faulty next hop in the outgoing port group based on each next-hop outgoing port in the refreshed equivalent-cost route group; identifies the normal outgoing port of the current minimum forwarding traffic in the outgoing port group; sets the LBN value of the normal outgoing port of the current minimum forwarding traffic to the LBN value of the ingoing port mapped by the outgoing port of the faulty next hop; and maintains the number of outgoing ports in the outgoing port group.

[0081] The processor, by executing processor-executable instructions in memory, also performs the following operations: refreshes the equivalent route group based on the next hop of the recovery route to the destination IP address; finds each next-hop outgoing port of the equivalent route group after the recovery route is included in the outgoing port group; and sets the LBN value of the mapped incoming port of the next-hop outgoing port of the recovery route according to the LBN value of the outgoing port of the next-hop outgoing port of the recovery route.

[0082] 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, characterized in that, The method includes, Configure the outgoing port group; Configure an ingress port group; wherein the number of ingress ports in the ingress port group is an integer multiple of the number of egress ports in the egress port group; Configure each output port of the output port group to map an integer multiple of the input ports; Configure a load balancing value (LBN) for each output port of the output port group; Set the LBN value of each output port to the LBN value mapped to the input port; Generate an equal-cost route group to the target IP address; The outgoing port group was found to contain each next-hop outgoing port of the equal-cost route group; Based on the LBN value of each outgoing port in the outgoing port group, sort each next-hop outgoing port of the equal-cost routing group.

2. The method according to claim 1, characterized in that, The method also includes, The message was received through one of the ingress ports of the ingress port group; The equivalent routing group is located based on the destination IP address of the message; The hash value is calculated based on the LBN value of the ingress port where the message arrives and the number of members in the egress port group; Identify the output ports in the output port group whose LBN value is equal to the calculated hash value; Based on the identified MAC address of the outgoing port, the Ethernet header is re-encapsulated for the packet; The re-encapsulated message is sent through the identified output port.

3. The method according to claim 1, characterized in that, The method includes, The next hop of the faulty route based on the target IP address refreshes the equal-cost route group; The outgoing port group was found to contain each next-hop outgoing port of the refreshed equivalent route group; Based on each next-hop outgoing port of the refreshed equivalent routing group, identify the outgoing port of the faulty next hop in the outgoing port group; Identify the normal outgoing port with the current minimum forwarding traffic in the outgoing port group; Set the LBN value of the normal outgoing port with the current minimum forwarding traffic to the LBN value of the ingoing port mapped to the outgoing port of the next hop after a failure. Maintain the number of output ports in the output port group.

4. The method according to claim 1, characterized in that, The method includes, The next hop of the recovery route based on the target IP address refreshes the equivalent route group; The outgoing port group was found to contain each next-hop outgoing port of the equivalent route group after route recovery; Based on the LBN value of the outgoing port of the next hop of the recovery route, set the LBN value of the mapped incoming port of the outgoing port of the recovery route.

5. A device for load sharing, characterized in that, The device includes at least a processor, a memory, and a switching chip connected via a bus; the processor performs the following operations by executing processor-executable instructions in the memory. Configure the outgoing port group; Configure an ingress port group; wherein the number of ingress ports in the ingress port group is an integer multiple of the number of egress ports in the egress port group; Configure each output port of the output port group to map an integer multiple of the input ports; Configure a load balancing value (LBN) for each output port of the output port group; Set the LBN value of each output port to the LBN value mapped to the input port; Generate an equal-cost route group to the target IP address; The outgoing port group was found to contain each next-hop outgoing port of the equal-cost route group; Based on the LBN value of each outgoing port in the outgoing port group, sort each next-hop outgoing port of the equal-cost routing group.

6. The device according to claim 5, characterized in that, The processor also performs the following operations by executing processor-executable instructions in the memory; The message was received through one of the ingress ports of the ingress port group; The equivalent routing group is located based on the destination IP address of the message; The hash value is calculated based on the LBN value of the ingress port where the message arrives and the number of members in the egress port group; Identify the output ports in the output port group whose LBN value is equal to the calculated hash value; Based on the identified MAC address of the outgoing port, the Ethernet header is re-encapsulated for the packet; The re-encapsulated message is sent through the identified output port.

7. The device according to claim 5, characterized in that, The processor also performs the following operations by executing processor-executable instructions in the memory; The equal-cost route group is refreshed based on the next hop of the faulty route to the target IP address; The outgoing port group was found to contain each next-hop outgoing port of the refreshed equivalent route group; Based on each next-hop outgoing port of the refreshed equivalent routing group, identify the outgoing port of the faulty next hop in the outgoing port group; Identify the normal outgoing port with the current minimum forwarding traffic in the outgoing port group; Set the LBN value of the normal outgoing port with the current minimum forwarding traffic to the LBN value of the ingoing port mapped to the outgoing port of the next hop after a failure. Maintain the number of output ports in the output port group.

8. The device according to claim 5, characterized in that, The processor also performs the following operations by executing processor-executable instructions in the memory; The equal-cost route group is refreshed based on the next hop of the recovery route to the target IP address; The outgoing port group was found to contain each next-hop outgoing port of the equivalent route group after route recovery; Based on the LBN value of the outgoing port of the next hop of the recovery route, set the LBN value of the mapped incoming port of the outgoing port of the recovery route.