Load balancing method and related device

By performing path allocation and identification information updates based on load information before the forwarding device, the uneven path distribution caused by the ECMP algorithm is resolved, thereby achieving load balancing and improved forwarding performance in the data center network.

CN121967329APending Publication Date: 2026-05-01CHENGDU HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU HUAWEI TECH CO LTD
Filing Date
2024-10-23
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing Equal Cost Multipath (ECMP) algorithms lead to uneven path selection for network flows in data center networks, resulting in bandwidth contention losses and low utilization.

Method used

Before forwarding a network flow, the forwarding device allocates a path to the network flow to be transmitted based on the load information of the forwarding device and updates the identification information of the network flow to achieve load balancing of multiple network flows. The identification information of the network flow is modified by a reverse hashing strategy so that the forwarding device forwards the flow along the allocated path.

Benefits of technology

It improves the forwarding performance of forwarding devices, achieves load balancing across multiple forwarding paths, avoids hash collisions, and improves the forwarding efficiency of network flows.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967329A_ABST
    Figure CN121967329A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a load balancing method and a related device, and the method comprises the steps: carrying out the path distribution of a network flow according to the load information of a forwarding path of the network flow before the to-be-transmitted data flow is transmitted to a forwarding device and is forwarded by the forwarding device; and updating the identification information of the network flow based on the mapping relationship between the allocated path and the forwarding path and the identification information, so that the forwarding device can determine the allocated forwarding path of the network flow based on the Hash algorithm and the updated identification information. The path distribution is determined based on the load information of the forwarding path, the load balance of the forwarding path after the path distribution can be improved, the path distribution is performed before the forwarding equipment forwards the network flow, the forwarding equipment does not need to be modified, and the adaptability is wide.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a load balancing method and related apparatus. Background Technology

[0002] With the development of technologies such as cloud computing, big data, and artificial intelligence, and the rise of related applications, data center networks need to handle more network traffic and meet higher network performance requirements. Data center networks experience a large amount of concurrent traffic, which converges at the input ports of switches or routers. When a switch or router forwards this traffic through the same output port, a collision occurs, leading to a degraded network performance. Currently, the Equal Cost Multi-Path (ECMP) algorithm is commonly used to resolve traffic collisions. ECMP utilizes a hash-based load balancing algorithm to distribute traffic across multiple equal-cost paths.

[0003] However, in real-world large-scale networks, the path selection results of network flows caused by the hash algorithm implemented by ECMP are mostly uneven. On the one hand, multiple network flows choose to share the same transmission path, resulting in bandwidth contention and loss of transmission rate. On the other hand, a small number of network flows share a single transmission path, resulting in low bandwidth utilization. Summary of the Invention

[0004] This application provides a load balancing method and related apparatus. Before a forwarding device forwards network traffic, it allocates paths to the network traffic to be transmitted based on the load of the forwarding device, and updates the identification information of the network traffic based on the allocated paths, so that the forwarding device can forward the network traffic along the allocated paths, thereby achieving load balancing of multiple network traffic and improving the forwarding performance of the forwarding device.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] Firstly, a load balancing method is provided, the method comprising:

[0007] Obtain the identification information of the network flow to be transmitted and the load information of the forwarding path set of the network flow to be transmitted. The forwarding path set includes at least two forwarding paths, and the forwarding path is the path along which the forwarding device forwards the network flow to the destination node of the network flow to be transmitted.

[0008] Based on the load information and the forwarding path set, the network flow to be transmitted is allocated a path to obtain the forwarding path allocated to the network flow to be transmitted.

[0009] The identification information of the network flow to be transmitted is updated according to the forwarding path and mapping relationship assigned to it, so that the updated identification information of the network flow to be transmitted corresponds to the assigned forwarding path. The mapping relationship describes the correspondence between the identification information and the forwarding path. The forwarding device determines the forwarding path of the network flow based on the hash algorithm and the identification information.

[0010] Thus, before the data stream to be transmitted is sent to the forwarding device and forwarded by the forwarding device, the network stream is allocated a path based on the load information of the forwarding path. The identification information of the network stream is then updated based on the mapping relationship between the allocated path, the forwarding path, and the identification information. This allows the forwarding device to determine the allocated forwarding path for the network stream based on the hash algorithm and the updated identification information. Since the forwarding device determines the forwarding path of the network stream based on a hash algorithm, this application uses a dehazing method. First, the forwarding path of the network stream is determined through path allocation. Then, the identification information of the network stream is updated based on the forwarding path. This allows the forwarding device to determine the allocated forwarding path based on the modified identification information and the hash algorithm, and forward the network stream along the allocated forwarding path. Furthermore, since the path allocation is based on the load information of the forwarding path, the load balancing of the forwarding path after path allocation can be improved. And because path allocation is performed before the forwarding device forwards the network stream, no modification to the forwarding device is required, making it widely adaptable.

[0011] In some implementations of the first aspect, if there are multiple network flows to be transmitted, the step of allocating paths to the network flows to be transmitted based on the load information and the forwarding path set to obtain the forwarding path allocated to the network flows to be transmitted includes:

[0012] Based on the load information, the forwarding path set, and the flow size of the multiple network flows to be transmitted, paths are allocated to the multiple network flows to be transmitted, resulting in the forwarding paths assigned to the network flows to be transmitted. Thus, during the path allocation process, in addition to comprehensively considering the flow size and the number of flows, it is also necessary to ensure load balancing across the multiple forwarding paths after path allocation.

[0013] In some implementations of the first aspect, the step of allocating a path to the network flow to be transmitted based on the load information and the forwarding path set to obtain the forwarding path allocated to the network flow to be transmitted includes:

[0014] The load information, the forwarding path set, and the identification information of the network flow to be transmitted are input into the load balancing model to obtain the forwarding paths allocated to the network flow to be transmitted. The objective function of the load balancing model is used to achieve load balancing of at least two forwarding paths corresponding to the network flow to be transmitted. Since the load balancing model is determined by a heuristic algorithm, multiple iterations of path allocation are used to achieve load balancing of at least two forwarding paths corresponding to the network flow to be transmitted after path allocation, thereby improving the forwarding performance of the forwarding devices.

[0015] Optionally, the load balancing model is determined based on a heuristic algorithm. Of course, the load balancing model can also be determined based on other algorithms, such as linear programming algorithms, reinforcement learning algorithms, etc.

[0016] In some implementations of the first aspect, before updating the identification information of the network flow to be transmitted according to the forwarding path and mapping relationship allocated to the network flow to be transmitted, the method further includes:

[0017] Obtain available identification information;

[0018] The identification information is input into the hash algorithm corresponding to the forwarding device to obtain the forwarding path corresponding to the identification information;

[0019] The mapping relationship is established based on the forwarding path corresponding to the identification information. Since the mapping relationship is determined based on the hash algorithm of the forwarding device, it is identical to the forwarding path constructed by the forwarding device based on the identification information. After path allocation for the network flow to be transmitted, the identification information of the network flow to be transmitted is modified based on the allocated forwarding path, and the network flow to be transmitted with the modified identification information is sent to the forwarding device so that the forwarding device forwards the network flow along the allocated forwarding path.

[0020] In some implementations of the first aspect, before updating the identification information of the network flow to be transmitted according to the forwarding path and mapping relationship allocated to the network flow to be transmitted, the method further includes: sending a probe packet to the forwarding device and receiving an acknowledgment character corresponding to the probe packet, wherein the probe packet carries identification information; determining the forwarding path corresponding to the identification information based on the acknowledgment character, and establishing the mapping relationship based on the forwarding path corresponding to the identification information. Thus, the forwarding path corresponding to each identification information is obtained through probe packets in order to establish the corresponding mapping relationship.

[0021] Secondly, a load balancing system is provided, the load balancing system including a management node and at least one sending node;

[0022] The control node is used to obtain the identification information of the network flow to be transmitted by the sending node and the load information of the forwarding path set of the network flow to be transmitted. The forwarding path set includes at least two forwarding paths. The forwarding path is the path along which the forwarding device forwards the network flow from the sending node to the destination node of the network flow to be transmitted.

[0023] The control node is also used to allocate paths to the network flow to be transmitted based on the load information and the forwarding path set, to obtain the forwarding path allocated to the network flow to be transmitted, and to send the forwarding path allocated to the network flow to be transmitted to the sending node.

[0024] The sending node updates the identification information of the network flow to be transmitted according to the forwarding path and mapping relationship allocated to the network flow to be transmitted, so that the updated identification information of the network flow to be transmitted corresponds to the allocated forwarding path. The mapping relationship describes the correspondence between the identification information and the forwarding path. The forwarding device determines the forwarding path of the network flow based on the hash algorithm and the identification information.

[0025] In some implementations of the second aspect, the step of allocating a path to the network flow to be transmitted based on the load information and the forwarding path set to obtain the forwarding path allocated to the network flow to be transmitted includes:

[0026] Based on the load information, the forwarding path set, and the flow size of the multiple network flows to be transmitted, path allocation is performed on the multiple network flows to be transmitted to obtain the forwarding path allocated to the network flows to be transmitted.

[0027] In some implementations of the second aspect, the step of allocating a path to the network flow to be transmitted based on the load information and the forwarding path set to obtain the forwarding path allocated to the network flow to be transmitted includes:

[0028] The load information, the forwarding path set, and the identification information of the network flow to be transmitted are input into the load balancing model to obtain the forwarding path allocated to the network flow to be transmitted. The objective function of the load balancing model is used to achieve load balancing of at least two forwarding paths corresponding to the network flow to be transmitted.

[0029] Optionally, the load balancing model is determined based on a heuristic algorithm.

[0030] In some implementations of the second aspect, the sending node is further configured to obtain available identification information; input the identification information into the hash algorithm corresponding to the forwarding device to obtain the forwarding path corresponding to the identification information; and establish the mapping relationship based on the forwarding path corresponding to the identification information.

[0031] In some implementations of the second aspect, the sending node is further configured to: send a probe packet to the forwarding device and receive an acknowledgment character corresponding to the probe packet, wherein the probe packet carries identification information; determine the forwarding path corresponding to the identification information based on the acknowledgment character, and establish the mapping relationship based on the forwarding path corresponding to the identification information.

[0032] Thirdly, an electronic device is provided, comprising: a memory including computer-readable instructions; and a processor communicating with the memory, the processor being configured to execute the computer-readable instructions, causing the electronic device to perform the load balancing method described in any one of the first aspects.

[0033] Fourthly, a computer-readable storage medium is provided, including a program or instructions that, when executed by a processor, implement the load balancing method as described in any one of the first aspects.

[0034] Fifthly, a chip is provided, including a processor for retrieving and executing instructions stored in a memory, causing an electronic device on which the chip is mounted to perform the load balancing method described in any one of the first aspects.

[0035] In a sixth aspect, a computer program product is provided, the computer program product comprising instructions that, when executed by a computer, implement the method as described in any one of the first aspects.

[0036] The beneficial effects of each possible implementation of the load balancing method provided in the second aspect of this application, the electronic device provided in the third aspect, the computer-readable storage medium provided in the fourth aspect, the chip provided in the fifth aspect, and the computer program product provided in the sixth aspect can be referred to the descriptions of the various possible implementations in the first aspect, and will not be repeated here. Attached Figure Description

[0037] Figure 1 A schematic diagram of a load balancing architecture provided in an embodiment of this application;

[0038] Figure 2 A flowchart illustrating a load balancing method provided in an embodiment of this application;

[0039] Figure 3A This application provides a schematic diagram of a path allocation scenario. Figure 1 ;

[0040] Figure 3B This application provides a schematic diagram of a path allocation scenario. Figure 2 ;

[0041] Figure 3CA schematic diagram of a path allocation scenario provided for an embodiment of this application;

[0042] Figure 3D A schematic diagram of a path allocation scenario provided for an embodiment of this application;

[0043] Figure 4A This application provides a schematic diagram of a path allocation scenario. Figure 5 ;

[0044] Figure 4B A schematic diagram of a path allocation scenario provided for an embodiment of this application is shown in Figure 6.

[0045] Figure 4C A schematic diagram of a path allocation scenario provided for an embodiment of this application;

[0046] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0047] The technical solutions in this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments in this specification, and not all of them.

[0048] 1. Network flow

[0049] A network flow refers to a sequence of data packets transmitted using a network protocol stack (usually the TCP / IP protocol stack). Each flow can be uniquely identified by a certain tuple in the data packet. The most common five-tuple is (source IP, destination IP, source port, destination port).

[0050] 2. Equal-cost Multi-path Routing (ECMP)

[0051] Because data center networks are typically "fat tree" structures, multiple communication links with the same cost but different paths exist between two servers, creating redundancy and backup. Distributing the network flow between these servers relatively evenly across these links—preventing one link from being overloaded while others are idle—achieves load balancing. ECMP uses a hash algorithm for this even distribution. The basic idea of ​​a hash algorithm is to map an input of arbitrary size to a fixed-size output range. If a unique tuple of a network flow is used as the input to the hash algorithm, and the set of all codes of the sending links is used as the output range, a mapping relationship is formed. As long as the chosen hash algorithm is sufficiently robust, it can guarantee that different network flows are evenly distributed across the links. ECMP is an active, stateless method that can run per-hop in routers and switches, making it simple to implement and widely used.

[0052] The ECMP method has two main problems:

[0053] First, if the network flows are of varying sizes, the load balancing effect will be affected. Since the ECMP method performs load balancing for different network flows, if one flow has a large throughput while another has a small throughput, even if they are distributed across different links, the load will obviously be unbalanced.

[0054] Secondly, since the forwarding device determines the forwarding path of the network flow based on the hash strategy, and due to the uncertainty of network traffic, if the forwarding device receives a large number of network flows with the same identification information (such as the five-tuple of the flow) at the same time, the forwarding device will allocate them to a specific forwarding path according to the hash strategy. If a large number of network flows are forwarded at the same time on a specific forwarding path, the load on that forwarding path will be large. When a hash collision occurs on a specific forwarding path and there are idle forwarding paths, the forwarding performance of the forwarding device will be affected.

[0055] To address the aforementioned issues, this application provides a load balancing method. Before sending a network flow to be transmitted to a forwarding device, the method obtains the identification information of the network flow to be transmitted and the load information of the forwarding path of the forwarding device. Based on the load information and the forwarding path of the network flow to be transmitted, a path is allocated to the network flow to be transmitted, resulting in the assigned forwarding path. Then, based on the allocated forwarding path and mapping relationship, the identification information of the network flow is modified, allowing the forwarding device to select the assigned forwarding path for forwarding based on the modified identification information. This enables the forwarding device to forward network flows according to the load of the forwarding path, achieving load balancing across multiple forwarding paths, improving the performance of the forwarding device. Furthermore, this process requires no modification to the forwarding device, making it easy to implement. Specifically, since the forwarding device determines the forwarding path for each network flow based on a hash strategy, before forwarding the network flow, a forwarding path is allocated to the network flow based on the load information of multiple forwarding paths. By modifying the identification information of the network flow, the forwarding device forwards the network flow along the allocated forwarding path according to the modified identification information.

[0056] Please see Figure 1 , Figure 1 The present application provides a schematic diagram of a load balancing architecture, which includes a sending node, a management node, and a forwarding device, and the sending node, management node, and forwarding device are interconnected in pairs.

[0057] The forwarding device determines the forwarding path for the network flow to be forwarded based on hash algorithm information and network flow identification information.

[0058] Optionally, the forwarding device inputs the identification information of the network flow into a hash algorithm to obtain a hash value; the forwarding device pre-stores the correspondence between hash values ​​and forwarding paths, and uses the hash value and the correspondence to determine the forwarding path of the network flow.

[0059] Optionally, the forwarding device includes multiple forwarding nodes, such as Figure 1 The forwarding device includes forwarding nodes 1 to N. Forwarding node 1 is located at the first hop of the forwarding path, and forwarding node N is located at the Nth hop of the forwarding path. After receiving the network flow, each forwarding node inputs the identifier of the network flow into the hash algorithm corresponding to the forwarding node to obtain a hash value. The forwarding path of the network flow is determined based on the hash value, or the forwarding path is directly output by the hash algorithm corresponding to the forwarding node. Figure 1A load balancing system includes a forwarding device. As is easy to understand, the forwarding device may include multiple forwarding nodes, which can be multi-layered. For example, network flow A from the sending node reaches the destination node B through forwarding nodes C and D. Forwarding node C has three output ports, and forwarding node D has five output ports. Then, network flow A has 15 forwarding paths. The network flow A can be allocated according to the load of each forwarding path so that the load of the subsequent forwarding paths is the same or similar. For example, if path M is selected, the network flow can reach the destination node sequentially through the output port E of forwarding node C and the output port F of forwarding node D.

[0060] Optionally, the forwarding device includes multiple forwarding nodes, and each forwarding node has at least two output ports that can reach the destination node of the network stream to be transmitted.

[0061] Optionally, the forwarding device can be an electronic device with forwarding function, such as a router or switch.

[0062] Optionally, each forwarding node determines a forwarding path, that is, determines the outgoing port of the network flow at the corresponding hop forwarding node. For example, if the forwarding node is located at the i-th forwarding path, the forwarding node can determine the outgoing port of the i-th forwarding node based on the identification information of the network flow, that is, the i-th forwarding path forwards the network flow through this outgoing port.

[0063] The identification information can be at least one of the five tuples (source / destination IP, source / destination port, and transport protocol) corresponding to the network flow, or the flow tag corresponding to the network flow, or other information that can identify the network flow.

[0064] Because hash algorithms are deterministic, meaning that the same input data always produces the same hash value, forwarding devices will forward network flows with the same identification information along a specific forwarding path. Of course, the same forwarding path can also be determined based on different identification information. For example, if the identification information is the source port, the network flows from source port 1 to source port 10 correspond to forwarding path 1, and the network flows from source port 11 correspond to forwarding path 2.

[0065] Since forwarding devices allocate paths based solely on the identification information of network flows, in real-world scenarios, network traffic fluctuates significantly. For example, during certain time periods, sending node A may have a large number of network flows corresponding to forwarding path 1, such as all of them having source ports 1 to 10. This results in too many network flows being forwarded on the same forwarding path, leading to a high load on that path. Other forwarding paths may forward fewer network flows, resulting in lower utilization. This imbalance in load across multiple forwarding paths of the forwarding device negatively impacts network forwarding performance.

[0066] This application is based on a reverse hashing strategy: after detecting a network flow to be transmitted from a sending node, the control node allocates paths to the network flow based on the identification information of the network flow to be transmitted, the load information of the forwarding path of the forwarding device, and the forwarding path of the network flow. It then modifies the identification information of the network flow according to the assigned forwarding path and a pre-determined mapping relationship, so that the forwarding device forwards the network flow along its assigned forwarding path. The mapping relationship describes the correspondence between the identification information and the forwarding path. In other words, first, paths are allocated to the network flow to be transmitted based on the load information of the forwarding device; then, the identification information of the network flow is modified based on the allocated path, thereby enabling the forwarding device to forward the network flow with modified identification information along the allocated path. This improves the load balancing of multiple forwarding paths of the forwarding device, thus improving the forwarding performance of the forwarding device.

[0067] Because hash algorithms are irreversible and deterministic, it's impossible to deduce the original input data from the hash value, nor can the identification information be deduced from the forwarding path using a hash algorithm. However, the identification information corresponding to each forwarding path can be determined based on other methods (such as packet probing), thus pre-establishing a mapping relationship between the forwarding paths of the forwarding devices and the identification information. The same input data always produces the same hash value. The forwarding device determines the forwarding path of the network flow based on the hash algorithm and the identification information of the network flow. Then, the control node allocates paths to the network flow to be transmitted based on the load information of the forwarding device. For example, if network flow A has two forwarding paths B and C, and the load of forwarding path B is greater than that of forwarding path C, forwarding path C can be selected to forward network flow A, so that after path allocation, the load of forwarding path B and forwarding path C are the same or similar. Then, based on the allocated forwarding path and the mapping relationship, the identification information of the network flow is modified so that the forwarding device forwards the network flow according to the allocated forwarding path based on the hash algorithm and the modified identification information.

[0068] Figure 1 In this system, the control node and the sending node are independent nodes, such as... Figure 1 If there are two nodes, a control node and a sending node 2, then one control node can simultaneously allocate forwarding paths for multiple sending nodes. It is easy to understand that in other embodiments, the control node and the sending node can be the same node, such as... Figure 1 The middle control node and sending node 1, that is, this node has the functions of a control node and a sending node. In this way, before sending the network flow to the forwarding device, the sending node allocates the forwarding path for the network flow of the sending node.

[0069] Please see Figure 2 , Figure 2 This is a flowchart illustrating a load balancing method provided in an embodiment of this application. The following is a summary of the process. Figure 1The following explanation uses the central control node as the implementing entity.

[0070] Figure 2 The medium-load balancing methods include: S201 to S203.

[0071] S201. Obtain the identification information of the network flow to be transmitted and the load information of the forwarding path set of the network flow to be transmitted. The forwarding path set includes at least two forwarding paths.

[0072] A forwarding path is the path that a forwarding device uses to forward a network flow to its destination node. For example, if a sending node sends a network flow to a destination node through a forwarding device, then the path through which the forwarding device transmits the network flow is the forwarding path of that network flow.

[0073] Optionally, if the forwarding device has multiple output ports, the forwarding path can be determined based on the output ports of the forwarding device, with different output ports corresponding to different forwarding paths.

[0074] Optionally, at least two forwarding paths in the forwarding path set of the network flow to be transmitted are equivalent paths of the network flow to be transmitted, that is, the cost of forwarding the network flow to be transmitted through at least two forwarding paths is the same. Equivalence indicates that the cost of at least two forwarding paths is the same, and this cost can be calculated by a routing protocol (such as OSPF, IS-IS or BGP).

[0075] Optionally, since the network flow from the sending node reaches the destination node through forwarding devices, meaning there is a direct or indirect physical connection between the sending node and the forwarding devices, the number of forwarding paths from the sending node to the destination node is deterministic. For example, if the forwarding devices include two levels of forwarding nodes: forwarding node A and forwarding node B, with forwarding node A having three ports and forwarding node B having four ports, then the number of forwarding paths for the sending node's network flow is 12. Optionally, the forwarding devices for the sending and destination nodes can be single-layer forwarding devices, such as switch 1, in which case the load information of the forwarding path includes the load information of the output ports of switch 1; or they can be multi-layer forwarding devices, such as multiple forwarding nodes, such as switch 1 and switch 2, in which case the load information of the forwarding path includes the load information of the output ports of switch 1 and switch 2. Optionally, the sending node obtains several forwarding paths in advance and sends these forwarding paths to the management node.

[0076] Optionally, when a network flow to be transmitted is detected in the sending node, since the network flow has a specific destination node and source node (or sending node), the forwarding path of the network flow can be determined based on the destination node and source node. Because the load of the forwarding device's ports is dynamically changing, the load information of the forwarding path is determined based on the port load information. When a network flow to be transmitted is detected, the current load information of the forwarding device's ports is also obtained to acquire the current load information of the forwarding path.

[0077] Optionally, the control node obtains the identification information of the network flow to be transmitted from the sending node, and the control node obtains the load information of the forwarding path corresponding to the network flow from the forwarding device. These two steps can occur simultaneously or in a certain order, and this application does not impose any restrictions on this.

[0078] Alternatively, a network flow is a sequence of data packets with the same 5-tuple.

[0079] Optionally, the load information may be the bandwidth utilization of the port corresponding to the forwarding path, such as the ratio of the bandwidth used by the port to the bandwidth available to the port. Optionally, the load information may also include the packet processing rate or network flow rate of the port corresponding to the forwarding path. It may also be the available bandwidth of the port in the forwarding path; for example, the larger the available bandwidth, the smaller the load, and vice versa.

[0080] Optionally, identification information can be used to identify the network flow. The identification information can be the source port corresponding to the network flow, the flow tag of the network flow, or other information that can identify the network flow.

[0081] S202. Based on the load information and the forwarding path set of the network flow to be transmitted, the path of the network flow to be transmitted is allocated to obtain the forwarding path allocated to the network flow to be transmitted.

[0082] Optionally, the purpose of path allocation is to achieve load balancing of multiple forwarding paths of the forwarding device; that is, improving load balancing is the basic principle of path allocation.

[0083] Optionally, the number of forwarding paths for a network flow is at least two. During the path allocation process, the control node selects the forwarding path with the lowest load among the at least two forwarding paths as the forwarding path for the network flow, so as to improve the load balancing of multiple forwarding paths of the forwarding device.

[0084] Optionally, the load information of the forwarding path is determined based on the load of the outgoing port in the forwarding path. During the path allocation process, the control node selects the forwarding path with the lowest load (e.g., the lowest bandwidth utilization) for the network flow based on the load information of the outgoing port in the forwarding path.

[0085] Optionally, if the number of forwarding paths for a network flow is at least two, and the number of forwarding nodes corresponding to each forwarding path is at least two (meaning the network flow takes at least two hops to reach its destination node), then when allocating paths for the network flow, the output port with the lowest load among each forwarding node can be selected. For example, if there are two forwarding paths, and the network flow reaches its destination node via forwarding node A and forwarding node B, with forwarding node A having five output ports (1 to 5) and forwarding node B having five output ports (6 to 10), then when allocating paths for the network flow, the output port 1 with the lowest load among forwarding node A and the output port 6 with the lowest load among forwarding node B are selected, and the forwarding path corresponding to the network flow is determined based on the selected output ports 1 and 6.

[0086] S203. Update the identification information of the network flow to be transmitted according to the forwarding path and mapping relationship assigned to it. The mapping relationship describes the relationship between the identification information and the forwarding path. The forwarding device can determine the forwarding path assigned to the network flow based on the hash algorithm and the updated identification information.

[0087] Optionally, the sending node and the control node may be the same node. For example... Figure 1 In this system, the control node and the sending node 1 are the same node, namely the control node. After allocating paths for the network flow, this control node updates the identification information of the network flow according to the allocated path and sends the network flow with the updated identification information to the forwarding device. The forwarding device receives the network flow with the updated identification information and determines the forwarding path based on the network flow with the updated identification information and a hash algorithm. This forwarding path is the path allocated to the network flow. Of course, the sending node and the control node can also be two independent nodes, such as... Figure 1 In this system, the control node and the sending node 2 are two independent nodes. After the control node allocates a path to the network flow, it sends the allocated path to the sending node. The sending node updates the identification information of the network flow to be transmitted according to the mapping relationship and the forwarding path allocated to the network flow. The sending node updates the identification information of the network flow according to the allocated path and sends the network flow with updated identification information to the forwarding device. The forwarding device receives the network flow with updated identification information and determines the forwarding path according to the network flow with updated identification information and the hash algorithm. This forwarding path is the path allocated to the network flow.

[0088] Optionally, the control node allocates a forwarding path for the network flow to be transmitted. Since the allocated forwarding path is determined based on the load information of the forwarding path, that is, the forwarding device determines the forwarding path of the network flow based on the hash algorithm and the identification information, in order for the forwarding device to forward the network flow according to the allocated forwarding path, the identification information of the network flow is updated so that the updated identification information of the network flow corresponds to the allocated forwarding path. Then, the forwarding path receives the updated network flow, determines the allocated forwarding path according to the updated identification information of the network flow and the hash algorithm, and forwards the network flow along the allocated forwarding path.

[0089] Optionally, the control node pre-stores mapping relationships. The same hash algorithm is used to determine the mapping relationships and the forwarding paths determined by the forwarding devices for network flows. The mapping relationship describes the correspondence between forwarding paths and identification information. The input to the hash algorithm is the identification information, and the output is the forwarding path. Since the mapping relationship is determined based on the hash algorithm, the identification information in the mapping relationship serves as the input to the hash algorithm, and the output is the forwarding path corresponding to the identification information in the mapping relationship.

[0090] Optionally, each forwarding path may correspond to at least one identification information, such as the source port corresponding to the network flow. The number of source ports is 100, and the number of forwarding paths for the network flow between the sending node and the destination node is 10. Each 10 source ports correspond to one forwarding path. If the forwarding paths corresponding to source ports 1 to 10 are all forwarding path 1, then source ports 1 to 10 are respectively input into the hash algorithm, and the output is forwarding path 1.

[0091] Optionally, the forwarding device determines the forwarding path of the network stream to be transmitted based on the identification information of the network stream to be transmitted, a random seed, and a hash algorithm.

[0092] Thus, before the forwarding device forwards the network flow to its corresponding destination node, the control node allocates paths to the network flow based on the load information of the forwarding path. It then updates the network flow's identification information based on the mapping relationship between the allocated path, the forwarding path, and the identification information. This allows the forwarding device to determine the allocated forwarding path for the network flow based on the hash algorithm and the updated identification information. Since the forwarding device determines the forwarding path based on a hash algorithm, this application uses a dehazing method. First, it determines the forwarding path of the network flow through path allocation. Then, it updates the network flow's identification information based on the forwarding path. This allows the forwarding device to determine the allocated forwarding path based on the modified identification information and the hash algorithm, and forward the network flow along the allocated forwarding path. Furthermore, because the path allocation is based on the load information of the forwarding path, it improves the load balancing of the allocated forwarding paths. Since path allocation occurs before the forwarding device forwards the network flow, it requires no modification to the forwarding device, making it highly adaptable.

[0093] Optionally, if the sending node and the control node are two independent nodes, then before S201, the process further includes: the sending node determining the mapping relationship and sending the mapping relationship to the control node. If the sending node and the control node are the same node, then before S201, the control node determines the mapping relationship.

[0094] Optionally, the mapping relationship can be determined as follows: obtain available identification information, determine the forwarding path corresponding to each identification information based on a hash algorithm, and establish a mapping relationship between the forwarding path and the identification information. After obtaining available identification information, input the identification information into the hash algorithm to obtain the forwarding path corresponding to the hash algorithm, thereby establishing a mapping relationship between the identification information and the forwarding path.

[0095] Optionally, the mapping relationship can be established by address traversal (AT). Specifically, after determining the available identification information on the sending node side, each identification information is input into a hash algorithm in turn to obtain the forwarding path corresponding to the identification information, and then a mapping relationship is established based on the obtained multiple identification information and the corresponding forwarding path.

[0096] For example, if the identification information is the source port of the network flow, then the mapping relationship is the RP-SP mapping table T of the forwarding path and the source port:

[0097] T={(RP1,SP1),(RP2,SP2),…)};

[0098] Among them, RP i For the i-th forwarding path, SP i It is the source port of the i-th port.

[0099] If the forwarding device includes multiple switches, then SW = {1,2,3,…,m} represents the set of switches, and PT = {1,2,3,…,n} is the set of output ports of the switches. Therefore:

[0100] That is, the corresponding forwarding path is determined by multiple switch output ports.

[0101] Among them, (s k ,p k The switch s used in the k-th hop of the forwarding path is identified. k and the corresponding output port p of the switch k .

[0102] By iterating through all the source ports in sequence, we can obtain the SP for each source port. i Corresponding forwarding path RP i .

[0103] Then, determine the source port SP for eachi Corresponding forwarding path RP i Check if it exists in path mapping table T; if path mapping table T does not exist, then (RP) i SP i Add to the mapping table; if the path mapping table T exists, discard (RP). i SP i Once the traversal is complete, the mapping table will be obtained, which contains the mapping relationship between forwarding paths and identification information.

[0104] Optionally, a mapping relationship can be established through packet detection (PT). Specifically, the sending node sends a probe packet to the forwarding device and receives the corresponding acknowledgment character (ACK) for the probe packet. Each probe packet carries the source port. Based on the received ACK, the forwarding path corresponding to each source port is determined, and a mapping relationship is established based on the obtained multiple identification information and the corresponding forwarding path.

[0105] Optionally, if the forwarding device supports in-band network telemetry (INT), the forwarding device embeds the forwarding path corresponding to the probe packet in the ACK. After receiving the ACK, the sending node establishes a mapping relationship between the source port and the forwarding path based on the forwarding path information in the ACK and the source port in the corresponding probe packet. Of course, in other embodiments, network traffic monitoring technologies such as sFlow or NetFlow can be used to capture data packets from switch ports for path analysis to obtain the mapping relationship between the source port and the forwarding path.

[0106] It is easy to understand that when allocating forwarding paths to a network, if there are multiple network flows to be transmitted, in addition to considering the number of network flows to be transmitted allocated to each forwarding path, it is also necessary to consider the flow size of each network flow to be transmitted so that after the path allocation is completed, the load of multiple forwarding paths in the forwarding path set is the same or similar. That is, the load balancing of multiple forwarding paths in the forwarding path set is improved through path allocation, thereby improving the forwarding performance of the forwarding device.

[0107] Optionally, if there are multiple network flows, and the destination and source nodes of these multiple network flows are identical, and the identification information of different network flows is different, and the multiple network flows correspond to the same set of forwarding paths, then S202 includes: allocating paths to the multiple network flows to be transmitted based on load information, the set of forwarding paths, and the flow size of the multiple network flows to be transmitted, to obtain the forwarding paths allocated to the network flows to be transmitted. Thus, since the multiple network flows have the same destination and source nodes, the forwarding paths corresponding to the multiple network flows are identical. For example, if there are 6 forwarding paths between the sending node and the destination node, then the network flows with that destination and source node all have 6 forwarding paths. During the path allocation process, the load of each forwarding path and the size of each flow are considered to improve the load balancing of the multiple forwarding paths in the set of forwarding paths after path allocation, thereby improving the forwarding performance of the forwarding device.

[0108] Optionally, multiple network streams with the same destination node and source node can correspond to the same sending node, that is, they are all data streams to be transmitted from the same sending node.

[0109] For example, there are three network flows to be transmitted: A, B, and C. The source and destination addresses of the three flows are the same, and the forwarding paths corresponding to the three flows are identical. The flow sizes of A, B, and C are 10Mbps, 15Mbps, and 20Mbps, respectively. Each flow has three forwarding paths: D, E, and F. The available bandwidth of D, E, and F is 30Mbps, 35Mbps, and 40Mbps, respectively, to identify the load on each forwarding path. Therefore, forwarding path D can be assigned to A, forwarding path E to B, and forwarding path F to C. After path assignment, the available bandwidth of each forwarding path is 20Mbps, thus achieving load balancing across the multiple forwarding paths.

[0110] Optionally, S202 includes: based on a load balancing strategy, performing path allocation on the network flow to be transmitted according to load information and the forwarding path of the network flow to be transmitted, to obtain the forwarding path allocated to the network flow to be transmitted. The load balancing strategy is used to achieve load balancing of multiple forwarding paths in the forwarding path set after path allocation, that is, to make the load of multiple forwarding paths after path allocation the same or similar, so as to improve the load balancing of multiple forwarding paths of the forwarding device and improve the forwarding performance of the forwarding device.

[0111] It's easy to understand that a forwarding device forwards network flows from the sending node to the destination node. If multiple network flows have the same source and destination addresses, then the forwarding path sets for these flows are the same. If multiple network flows have different source and / or destination addresses, then their forwarding path sets may be completely different. For example, if network flow 1 and network flow 2 have different source addresses, network flow 1's forwarding path includes forwarding path A and forwarding path B, while network flow 2's forwarding path includes forwarding path C and forwarding path D. That is, if the forwarding paths for multiple network flows are completely different, paths can be independently allocated to each network flow to improve load balancing of their corresponding forwarding paths. If multiple network flows have different source addresses and / or destination addresses, their forwarding paths may also be different. For example, the source addresses of network flow 1 and network flow 2 are different. The forwarding path of network flow 1 includes forwarding path A and forwarding path B, while the forwarding path of network flow 2 includes forwarding path B and forwarding path C. Since forwarding path B can transmit network flow 1 and network flow 2 to the destination node simultaneously, the path allocation of network flow 2 needs to be considered when allocating paths for network flow 1 to avoid unbalanced load on multiple forwarding paths.

[0112] Optionally, S202 includes:

[0113] Load information, the set of forwarding paths for the network flow to be transmitted, and the identification information of the network flow are input into a load balancing model to obtain the forwarding paths assigned to the network flow to be transmitted. The objective function of the load balancing model is used to achieve load balancing among the multiple forwarding paths in the set of forwarding paths after path allocation. Thus, by allocating paths to multiple network flows through the load balancing model, the load on multiple forwarding paths in the set of forwarding paths after path allocation is made to be the same or similar. The load balancing model is a mathematical model that allocates paths to the network flow to be transmitted based on the input load information, the set of forwarding paths for the network flow to be transmitted, and the identification information of the network flow, and outputs the forwarding paths assigned to the network flow to be transmitted. Path allocation is used to achieve load balancing among the multiple forwarding paths in the set of forwarding paths after path allocation, or to achieve load balancing among the multiple forwarding paths in the set of forwarding paths for data to be transmitted.

[0114] It's easy to understand that since different forwarding paths correspond to different output ports, load balancing across multiple forwarding paths can be achieved by minimizing the load difference at the output ports of the forwarding devices. Therefore, the objective function of the load balancing model can be:

[0115]

[0116] Where N is the number of output ports of the forwarding device, m≤N, n≤N, C m For the load of the m-th output port of the forwarding device, Cn Let represent the load of the nth output port of the forwarding device. Here, the load can be the available bandwidth (or idle bandwidth) of the output port; if multiple output ports have the same forwarding capacity, the load can also be the current bandwidth of the output port. Load balancing across multiple forwarding paths is achieved by minimizing the difference in load between the multiple output ports of the forwarding device.

[0117] It's easy to understand that since different forwarding paths correspond to different output ports, the objective function of the load balancing model can be achieved by minimizing the variance of the load on the output ports of the forwarding device, making the load on multiple output ports of the forwarding device relatively concentrated.

[0118]

[0119] Where N is the number of output ports of the forwarding device, m≤N, C m Let C be the load of the m-th output port of the forwarding device, and C be the average load of the m output ports of the forwarding device. By minimizing the variance of the loads of the multiple output ports of the forwarding device, the loads of the multiple output ports are relatively concentrated, thereby achieving load balancing of the multiple forwarding paths of the forwarding device.

[0120] It's easy to understand that each forwarding device has multiple ports; however, when a forwarding device receives multiple network flows to be transmitted, not all outgoing ports can be used for the transmission of each network flow. For example, network flow 1 can be forwarded through outgoing ports 1 and 2 of the forwarding device, and network flow 2 can be forwarded through outgoing ports 2 and 3 of the forwarding device. Therefore, the constraints of the load balancing model include:

[0121] Each network flow to be transmitted has a corresponding subset of forwarding paths, which includes at least one forwarding path, and each forwarding path has an output port of a corresponding forwarding device. The set of forwarding paths includes at least one subset of forwarding paths. Thus, during path allocation, by defining the subset of forwarding paths corresponding to each network flow, the forwarding device can forward the network flow to be transmitted to the destination node using the set of forwarding paths corresponding to each network flow.

[0122] In some embodiments, the same forwarding path can forward different network flows to be transmitted. The forwarding path set includes a first forwarding path subset and a second forwarding path subset. Each of the first and second forwarding path subsets includes at least one forwarding path, and they share a common forwarding path. Optionally, the load balancing model can be determined based on a heuristic algorithm used to achieve load balancing of multiple forwarding paths in the forwarding path set after path allocation. If the load of a forwarding path is the available bandwidth of that path, for example, the available port of the outgoing port in a forwarding path minimizes the load difference between multiple forwarding paths, then the load difference is the difference in available bandwidth of the forwarding paths. For example, if the forwarding path set includes three forwarding paths: A, B, and C, then by allocating paths to minimize the load difference between A and B, the load difference between C and B, and the load difference between A and C, load balancing of multiple forwarding paths in the forwarding path set of the network flows to be transmitted is achieved. It is easy to understand that the load balancing model can also be based on other algorithms, as long as it can improve the load balancing of multiple forwarding paths of the forwarding device after path allocation. Of course, load balancing models can also be based on linear programming algorithms or reinforcement learning algorithms. If based on reinforcement learning, the objective is to achieve load balancing across multiple forwarding paths of the forwarding device, i.e., load balancing across multiple outgoing ports of the forwarding device. Then, a state space is defined, including the load of each outgoing port of the forwarding device, the number of network flows to be transmitted, the size of each network flow, and the forwarding paths corresponding to the multiple network flows. Next, an action space is defined, whereby multiple network flows to be transmitted are assigned to their corresponding forwarding paths to achieve load balancing across the multiple outgoing ports of the forwarding device. For example, the network flows to be transmitted can be assigned to the forwarding path with the lowest load. Then, a reward function is set. For example, after path allocation, the load of the multiple outgoing ports after path allocation is obtained, and adjustments are made based on the load to determine whether the network flows already allocated to the paths need to be adjusted until load balancing across multiple outgoing ports is achieved, for example, minimizing the difference in load across multiple outgoing ports. The following explanation uses a load balancing model based on a heuristic algorithm as an example. A heuristic algorithm is an algorithm based on intuition or experience that provides a feasible solution to each instance of a combinatorial optimization problem within an acceptable cost (computation time and space). The deviation of this feasible solution from the optimal solution is generally unpredictable. This application allocates paths to the network flow to be transmitted within a set of forwarding paths to achieve load balancing across multiple forwarding paths, or to minimize the load difference between multiple forwarding paths. Heuristic algorithms can include ant colony optimization, simulated annealing, neural networks, etc. The following explanation uses a load balancing model to achieve load balancing across at least two forwarding paths corresponding to the network flow to be transmitted:

[0123] If there are multiple network flows to be transmitted, and at least two of these flows have different source and / or destination addresses, since different source and / or destination addresses may correspond to different forwarding paths, each network flow to be transmitted has a corresponding subset of forwarding paths. This subset may include at least two forwarding path subsets. The control node allocates paths within the corresponding subsets of forwarding paths for each network flow. If different subsets of forwarding paths contain the same forwarding path, because some forwarding paths are used by multiple groups of network flows, multiple iterations may be required to achieve load balancing for the forwarding paths corresponding to each group.

[0124] The control node can divide multiple network flows to be transmitted into multiple groups, each group including at least one network flow to be transmitted. The network flows within each group have the same source and destination addresses, while the source and / or destination addresses of network flows in different groups are different. Then, based on load balancing, the control node performs initial path allocation on the network flows in the multiple groups. After the initial path allocation is completed, it obtains the transitional load information of the forwarding paths after the path allocation and determines whether the termination condition is met based on the transitional load information and the forwarding paths allocated to each network flow. If the termination condition is not met, a secondary path allocation is performed on the forwarding paths after the initial allocation based on the transitional load information of the initially allocated forwarding paths, until the termination condition is met. This yields the forwarding path allocated to each network flow.

[0125] The termination condition can be the load balancing of at least two forwarding paths corresponding to the network flow to be transmitted after path allocation, that is, the load balancing of at least two forwarding paths cannot be changed by adjusting multiple sets of forwarding paths for the network flow to be transmitted.

[0126] It's easy to understand that if multiple network streams to be transmitted originate from the same sending node, then the source addresses of these multiple streams are the same. Alternatively, if multiple network streams to be transmitted are transmitted from multiple sending nodes, then the same control node will uniformly allocate paths for the network streams from different sending nodes. This allows the network streams from multiple sending nodes to be transmitted to be distributed across multiple forwarding paths according to their load, thereby improving the forwarding performance of the forwarding devices.

[0127] For example: see Figure 3A The network flows to be transmitted include three groups: Group 1, Group 2, and Group 3. Each group contains 10 network flows. The flow size of all flows within each group is the same (1). The 10 network flows within each group have the same source and destination addresses. The source and / or destination addresses of network flows within different groups are different. The forwarding device has four forwarding paths: A, B, C, and D. The load on all four forwarding paths is the same (0). Figure 3AThe load of the forwarding path is illustrated using the bandwidth of the port in the forwarding path as an example. The load is 0, which means that the forwarding device does not forward network flows through this forwarding path. The forwarding paths corresponding to the network flows in the first group are A and B; the forwarding paths corresponding to the network flows in the second group are B and C; and the forwarding paths corresponding to the network flows in the third group are C and D.

[0128] Please see Figure 3B First, path allocation is performed on the network flows in the first group to ensure load balancing of the allocated forwarding paths. Then, 5 network flows in the first group correspond to forwarding path A, and the other 5 network flows correspond to forwarding path B. After path allocation, the load of both forwarding path A and forwarding path B is 5.

[0129] Please see Figure 3C At this point, the load of forwarding path B is 5, and the load of forwarding path C is 0. Path allocation is performed on the network flows within the second group to balance the load of the allocated forwarding paths. Then, 3 network flows in the second group correspond to forwarding path B, and the other 7 network flows correspond to forwarding path C. After path allocation, the load of forwarding path B is 8 for all flows, and the load of forwarding path C is 7 for all flows.

[0130] Please see Figure 3D At this point, the load of forwarding path C is 7, and the load of forwarding path D is 0. Path allocation is performed on the network flows within the third group to balance the load of the allocated forwarding paths. Then, two network flows in the third group correspond to forwarding path C, and the other eight network flows correspond to forwarding path D. Therefore, after path allocation, the load of forwarding path C is 9 for all forwarding paths, and the load of forwarding path D is 8 for all forwarding paths.

[0131] After three path allocations, the loads of the four forwarding paths are 5, 8, 9, and 8 respectively. The load differences among the four forwarding paths are significant. To improve load balancing across the forwarding paths, based on… Figure 3D Based on the path allocation results, the three groups of network flows are re-allocated.

[0132] Please see Figure 4A At this point, the load of forwarding path A is 5, and the load of forwarding path B is 8. First, a secondary path allocation is performed on the network flows in the first group to make the load of the forwarding paths balanced. Then, one network flow corresponding to forwarding path B is allocated to forwarding path A. After the path allocation, the load of both forwarding path A and forwarding path B is 7.

[0133] Please see Figure 4BAt this point, the load on forwarding path B is 7, and the load on forwarding path C is 9. Further path allocation is performed on the network flows within the second group to balance the load on the allocated forwarding paths. Alternatively, one network flow corresponding to forwarding path C can be allocated to forwarding path B. After this allocation, the load on forwarding path B will be 8, and the load on forwarding path C will also be 8. At this point, the load on forwarding path C is 8, and the load on forwarding path D is 8. Therefore, further path allocation is not required for the network flows within the third group.

[0134] Please see Figure 4C At this point, the load of forwarding path A is 6, and the load of forwarding path B is 8. First, a secondary path allocation is performed on the network flows in the first group to make the load of the forwarding paths balanced. Then, one network flow corresponding to forwarding path B is allocated to forwarding path A. After the path allocation, the load of both forwarding path A and forwarding path B is 7.

[0135] At this point, the load on forwarding path B is 7, and the load on forwarding path C is 8. Performing three path allocations on the network flows within the second group does not change the load balancing of the forwarding paths; therefore, there is no need to perform three path allocations on the network flows within the second group. Similarly, there is no need to perform another path allocation on the network flows within the third group. Path allocation is complete. Figure 4C This is the final path allocation result.

[0136] It is easy to understand that the above Figures 3A to 4C In this embodiment, multiple network flows have the same flow size. In other embodiments, the flow sizes of multiple network flows may be different, and the flow sizes of network flows within each group may also be different. Figure 3A Before path allocation, the loads of multiple forwarding paths are the same and are all 0. Here, 0 means that no data is being transmitted. In other embodiments, the loads of multiple forwarding paths may be different and not necessarily 0.

[0137] Optionally, the constraints of the load balancing model include:

[0138] The forwarding path set includes a first forwarding path subset and a second forwarding path subset. The first forwarding path subset includes at least one forwarding path, and the second forwarding path subset includes at least two forwarding paths. Multiple network flows to be transmitted include a first group and a second group. The first group includes at least one first network flow, and the second group includes at least one second network flow. The forwarding device can forward the first network flow to the destination node along the forwarding path corresponding to the first forwarding path subset, and the forwarding device can forward the second network flow to the destination node along the forwarding path corresponding to the second forwarding path subset. Since multiple network flows to be transmitted correspond to different forwarding path subsets, the forwarding path corresponding to each type of network flow needs to be considered during path allocation.

[0139] Optionally, the first and second forwarding path subsets share a common forwarding path, and the forwarding device can forward the network flows to be transmitted within the first and second sets to the destination node along this common forwarding path. Since different network flows to be transmitted share a common forwarding path, path allocation can be performed through a load balancing model, and load balancing of multiple forwarding paths can be achieved through multiple iterations after path allocation.

[0140] It should be understood that the above description is merely to help those skilled in the art better understand the embodiments of this application, and is not intended to limit the scope of the embodiments of this application. Based on the examples given above, those skilled in the art can obviously make various equivalent modifications or changes. For example, some steps in the various methods described above may be unnecessary, or new steps may be added. Alternatively, any combination of two or more of the above embodiments may be used. Such modifications, changes, or combinations also fall within the scope of the embodiments of this application.

[0141] It should also be understood that the methods, situations, categories, and classifications of embodiments in this application are for the convenience of description only and should not constitute a special limitation. Various methods, categories, situations, and features in embodiments can be combined without contradiction.

[0142] It should also be understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application. The order of the process numbers described above does not imply the order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0143] It should also be understood that the above description of the embodiments of this application focuses on highlighting the differences between the various embodiments. Any similarities or differences not mentioned can be referred to each other. For the sake of brevity, they will not be repeated here.

[0144] The above combination Figures 1-4C The embodiments of the methods and systems provided in this application have been described. The electronic devices provided in the embodiments of this application are described below.

[0145] This embodiment can divide the electronic device into functional modules according to the above method. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0146] It should be noted that the relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0147] The electronic device provided in this application embodiment is used to execute the load balancing method provided in the above method embodiment, and thus can achieve the same effect as the above implementation method.

[0148] In other embodiments, when using integrated units, the electronic device may include a processing module, a storage module, and a communication module. The processing module can be used to control and manage the actions of the electronic device. For example, it can be used to support the electronic device in executing the steps performed by the processing unit. The storage module can be used to store program code and data, etc. The communication module can be used to support communication between the electronic device and other electronic devices.

[0149] The processing module can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, or a device that interacts with other electronic devices or electronic devices.

[0150] Based on the same concept, this application also provides an electronic device, see [link to relevant documentation]. Figure 5 , Figure 5 A schematic diagram of the structure of an exemplary electronic device according to this application is shown. Figure 5 The electronic device shown can execute the steps of any of the load balancing methods performed by the control node or the sending node provided in the embodiments of this application.

[0151] The electronic device 500 includes at least one processor 501, a memory 503, and at least one network interface 504.

[0152] Processor 501 may be, for example, a general-purpose CPU, a digital signal processor (DSP), a network processor (NP), a GPU, a neural network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits or application-specific integrated circuits (ASICs) used to implement the solutions of this application, a programmable logic device (PLD), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A PLD may be, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0153] Optionally, the electronic device 500 also includes a bus 502. The bus 502 is used to transmit information between the various components of the electronic device 500. The bus 502 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 502 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0154] Memory 503 may be, for example, read-only memory (ROM) or other types of storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.); magnetic disk storage media or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 503 may exist independently and be connected to processor 501 via bus 502. Memory 503 may also be integrated with processor 501.

[0155] Network interface 504 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), or wireless local area network (WLAN). Network interface 504 can include wired network interfaces and wireless network interfaces. Specifically, network interface 504 can be an Ethernet interface, such as Fast Ethernet (FE), Gigabit Ethernet (GE), Asynchronous Transfer Mode (ATM), WLAN, cellular network, or combinations thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In some embodiments of this application, network interface 504 can be used by electronic device 500 to communicate with other devices.

[0156] In specific implementations, as some embodiments, processor 501 may include one or more CPUs. Each of these processors may be a single-core processor or a multi-core processor. Here, "processor" may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0157] In specific implementations, as some embodiments, electronic device 500 may include multiple processors. Each of these processors may be a single-core processor or a multi-core processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0158] In some embodiments, memory 503 is used to store program instructions for executing the present application's solution, and processor 501 can execute the program instructions stored in memory 503. That is, electronic device 500 can implement the method provided in the above-described embodiments through processor 501 and the program instructions in memory 503. The program instructions may include one or more software modules. Optionally, processor 501 itself may also store program instructions for executing the present application's solution.

[0159] In specific implementation, the processor 501 in the electronic device 500 of this application reads instructions from the memory 503, causing... Figure 5 The electronic device 500 shown is capable of performing all or part of the steps in the load balancing method performed by the electronic device in the above embodiments.

[0160] In the above embodiments, each step of the method is implemented through integrated logic circuits in the hardware of the processor of the electronic device 500 or through software instructions. The steps of the method embodiments disclosed in this application can be directly implemented by the hardware processor, or implemented by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. Since the storage medium is located in memory, the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method embodiments; to avoid repetition, these will not be described in detail here.

[0161] It should be understood that the aforementioned processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting the Advanced Reduced Instruction Set Computing (RISC) machine (ARM) architecture.

[0162] Furthermore, in an alternative embodiment, the memory described above may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store device type information.

[0163] The memory can be volatile or non-volatile, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0164] The electronic device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so they will not be described again here.

[0165] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the methods described in the above-described method embodiments.

[0166] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to implement the method described in the above-described method embodiments.

[0167] This application provides a chip, including a processor, for calling and executing instructions stored in a memory, causing a communication device with the chip installed to execute the method described in the above-described method embodiments of any electronic device provided in this application.

[0168] This application also provides a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the method described in the above-described method embodiments. The chip system may be a single chip or a chip module composed of multiple chips.

[0169] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, or magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0170] Those skilled in the art will understand that implementing all or part of the processes in the above embodiments can be accomplished by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium can include various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0171] The naming or numbering of steps in this application does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effect can be achieved.

[0172] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0173] In the embodiments provided in this application, it should be understood that the disclosed apparatus / devices and methods can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0174] It should be understood that in the description of this application and the appended claims, the terms "comprising," "including," "having," and any variations thereof are intended to cover a non-exclusive inclusion and mean "including but not limited to," unless otherwise specifically emphasized. For example, a process, method, system, product, or apparatus that includes a series of steps or modules is not necessarily limited to those steps or modules that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0175] In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can mean A or B. "And / or" in this application is used to describe the mapping relationship of the related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural.

[0176] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0177] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0178] Furthermore, in the description of this application and the appended claims, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein; features defined as "first" or "second" may explicitly or implicitly include at least one of those features.

[0179] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0180] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A load balancing method, characterized in that, The method includes: Obtain the identification information of the network flow to be transmitted and the load information of the forwarding path set of the network flow to be transmitted. The forwarding path set includes at least two forwarding paths, and the forwarding path is the path along which the forwarding device forwards the network flow to the destination node of the network flow to be transmitted. Based on the load information and the forwarding path set, the network flow to be transmitted is allocated a path to obtain the forwarding path allocated to the network flow to be transmitted. The identification information of the network flow to be transmitted is updated according to the forwarding path and mapping relationship assigned to it, so that the updated identification information of the network flow to be transmitted corresponds to the assigned forwarding path. The mapping relationship describes the correspondence between the identification information and the forwarding path. The forwarding device determines the forwarding path of the network flow based on the hash algorithm and the identification information.

2. The method according to claim 1, characterized in that, If there are multiple network flows to be transmitted, the step of allocating paths to the network flows to be transmitted based on the load information and the forwarding path set to obtain the forwarding paths allocated to the network flows to be transmitted includes: Based on the load information, the forwarding path set, and the flow size of the multiple network flows to be transmitted, path allocation is performed on the multiple network flows to be transmitted to obtain the forwarding path allocated to the network flows to be transmitted.

3. The method according to claim 1 or 2, characterized in that, The step of allocating paths to the network flow to be transmitted based on the load information and the forwarding path set to obtain the forwarding path allocated to the network flow to be transmitted includes: The load information, the forwarding path set, and the identification information of the network flow to be transmitted are input into the load balancing model to obtain the forwarding path allocated to the network flow to be transmitted. The objective function of the load balancing model is used to achieve load balancing of at least two forwarding paths corresponding to the network flow to be transmitted.

4. The method according to any one of claims 1 to 3, characterized in that, Before updating the identification information of the network flow to be transmitted according to the forwarding path and mapping relationship allocated to the network flow to be transmitted, the method further includes: Obtain available identification information; The identification information is input into the hash algorithm corresponding to the forwarding device to obtain the forwarding path corresponding to the identification information; The mapping relationship is established based on the forwarding path corresponding to the identification information.

5. The method according to any one of claims 1 to 3, characterized in that, Before updating the identification information of the network flow to be transmitted according to the forwarding path and mapping relationship allocated to the network flow to be transmitted, the method further includes: Send a probe packet to the forwarding device and receive an acknowledgment character corresponding to the probe packet, wherein the probe packet carries identification information; The forwarding path corresponding to the identification information is determined based on the confirmation character, and the mapping relationship is established based on the forwarding path corresponding to the identification information.

6. A load balancing system, characterized in that, The load balancing system includes a management node and at least one sending node; The control node is used to obtain the identification information of the network flow to be transmitted by the sending node and the load information of the forwarding path set of the network flow to be transmitted. The forwarding path set includes at least two forwarding paths. The forwarding path is the path along which the forwarding device forwards the network flow from the sending node to the destination node of the network flow to be transmitted. The control node is also used to allocate paths to the network flow to be transmitted based on the load information and the forwarding path set, to obtain the forwarding path allocated to the network flow to be transmitted, and to send the forwarding path allocated to the network flow to be transmitted to the sending node. The sending node updates the identification information of the network flow to be transmitted according to the forwarding path and mapping relationship allocated to the network flow to be transmitted, so that the updated identification information of the network flow to be transmitted corresponds to the allocated forwarding path. The mapping relationship describes the correspondence between the identification information and the forwarding path. The forwarding device determines the forwarding path of the network flow based on the hash algorithm and the identification information.

7. The system according to claim 6, characterized in that, If there are multiple network flows to be transmitted, the step of allocating paths to the network flows to be transmitted based on the load information and the forwarding path set to obtain the forwarding paths allocated to the network flows to be transmitted includes: Based on the load information, the forwarding path set, and the flow size of the multiple network flows to be transmitted, path allocation is performed on the multiple network flows to be transmitted to obtain the forwarding path allocated to the network flows to be transmitted.

8. The system according to claim 6 or 7, characterized in that, The step of allocating paths to the network flow to be transmitted based on the load information and the forwarding path set to obtain the forwarding path allocated to the network flow to be transmitted includes: The load information, the forwarding path set, and the identification information of the network flow to be transmitted are input into the load balancing model to obtain the forwarding path allocated to the network flow to be transmitted. The objective function of the load balancing model is used to achieve load balancing of at least two forwarding paths corresponding to the network flow to be transmitted. The load balancing model is determined based on a heuristic algorithm.

9. The system according to any one of claims 6 to 8, characterized in that, The sending node is also used to obtain available identification information; input the identification information into the hash algorithm corresponding to the forwarding device to obtain the forwarding path corresponding to the identification information; and establish the mapping relationship based on the forwarding path corresponding to the identification information.

10. The system according to any one of claims 6 to 8, characterized in that, The sending node is further configured to: send a probe packet to the forwarding device and receive an acknowledgment character corresponding to the probe packet, wherein the probe packet carries identification information; determine the forwarding path corresponding to the identification information based on the acknowledgment character, and establish the mapping relationship based on the forwarding path corresponding to the identification information.

11. An electronic device, characterized in that, include: The memory includes computer-readable instructions; A processor communicating with the memory, the processor being configured to execute the computer-readable instructions, causing the electronic device to perform the load balancing method of any one of claims 1-5.

12. A computer program product, characterized in that, The computer program product includes instructions that, when executed by a computer, implement the load balancing method as described in any one of claims 1-5.