Load control method, apparatus, network device, and storage medium
Patent Information
- Application Number
- CN202211436841.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2042-11-16
AI Technical Summary
[0003]目前,针对二层网络中到同一目的地有多条路径的场景,单播可以通过负载均衡技术提高路径的利用率,但是,为了防止出现多包,组播、广播等泛洪逻辑通常不支持负载,系统中的每个泛洪组都会选择多条路径中最先建立的路径发送报文,导致路径利用率低
[0036]相对现有技术,本申请实施例请提供的一种负载控制方法、装置、网络设备及存储介质,针对与网络设备之间具有多条路径的目的主机,先从目的主机对应的多条路径中确定出需要进行负载分担的每条候选路径形成一个负载对象,再将包含目的主机的每个泛洪组均与该负载对象绑定,最后,基于负载对象为每个泛洪组分配候选路径,使得一个泛洪组关联一条候选路径;从而把负载对象中的候选路径相对均匀地分配给不同的泛洪组,实现了网络设备上所有泛洪组的负载分担,提高了路径利用率。
Smart Images

Figure CN118055069B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data communication, and more specifically, to a load control method, apparatus, network device, and storage medium. Background Technology
[0002] With the development of computer networks, the data traffic in data center networks is increasing, and the requirements for data reliability are also becoming more stringent. Path redundancy load balancing is a very important and commonly used technique to improve data reliability, and unicast load balancing technology is already very mature.
[0003] Currently, for scenarios with multiple paths to the same destination in Layer 2 networks, unicast can improve path utilization through load balancing technology. However, to prevent multiple packets, flooding logic such as multicast and broadcast usually does not support load balancing. Each flooding group in the system will select the first established path among multiple paths to send packets, resulting in low path utilization. Summary of the Invention
[0004] The purpose of this application is to provide a load control method, apparatus, network device, and storage medium to achieve load sharing among all flooding groups on a network device in a Layer 2 network.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0006] In a first aspect, embodiments of this application provide a load control method applied to a network device, the network device being communicatively connected to multiple hosts, the method comprising:
[0007] From the plurality of hosts, obtain the destination host that has multiple paths to the network device;
[0008] From the multiple paths corresponding to the destination host, each candidate path that needs to be load-sharing is determined, and all candidate paths are combined into a load object;
[0009] Obtain each flood group containing the destination host, and bind each flood group to the load object; wherein, the flood group is used to flood packets of the same service to each host it contains;
[0010] Based on the load object, the candidate path is assigned to each flooding group, such that one flooding group is associated with one candidate path.
[0011] Optionally, the load object and each of the candidate paths are pre-configured with weight values, and the initial weight values are the same;
[0012] The step of allocating the candidate path to each flooding group based on the load object includes:
[0013] For each of the flooding groups, obtain the current weight value of the load object and the current weight value of each of the candidate paths;
[0014] The current weight value of each candidate path is compared with the current weight value of the load object.
[0015] If the current weight value of the current candidate path is less than the current weight value of the load object, then the current candidate path is assigned to the flooding group, and the current weight value of the current candidate path is increased by a set value.
[0016] If the current weight values of all candidate paths are equal to the current weight value of the load object, then the last candidate path is assigned to the flooding group, and the current weight value of the last candidate path is added to the set value, and the current weight value of the load object is added to the set value.
[0017] Optionally, the method further includes:
[0018] When any candidate path fails, the failed candidate path is removed from the load object;
[0019] Based on removing the load objects of the failed candidate paths, the candidate paths are reassigned to each flooding group associated with the failed candidate paths.
[0020] Optionally, the method further includes:
[0021] When a new candidate path is added to the load object, the flooding groups and candidate paths that have already been associated remain unchanged.
[0022] Based on the load objects of the newly added candidate paths, the candidate paths are assigned to the newly created flooding groups.
[0023] Optionally, when the service is idle, the candidate path is reassigned to each of the flooding groups based on the load object.
[0024] Optionally, the method further includes:
[0025] Obtain business messages;
[0026] If the service message is a flooding message, then a specific flooding group for flooding the service message is determined;
[0027] The service packets are flooded to each host included in the specific flooding group; wherein the specific flooding group sends the service packets to the destination host with multiple paths between it and the network device through the candidate paths associated with it.
[0028] Optionally, it can be one of multicast traffic, broadcast traffic, or unknown unicast traffic.
[0029] Secondly, embodiments of this application also provide a load control device applied to a network device, the network device being communicatively connected to multiple hosts, the device comprising:
[0030] The selection module is used to obtain, from the plurality of hosts, a destination host that has multiple paths to the network device;
[0031] The load management module is used to determine each candidate path that needs to be load-sharing from the multiple paths corresponding to the destination host, and to form a load object from all candidate paths;
[0032] The load management module is further configured to obtain each flooding group containing the destination host and bind each flooding group to the load object; wherein, the flooding group is configured to flood packets of the same service to each host it contains;
[0033] The path allocation module is used to allocate the candidate path to each flooding group based on the load object, such that one flooding group is associated with one candidate path.
[0034] Thirdly, embodiments of this application also provide a network device, including a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement the load control method in the first aspect above when executing the program.
[0035] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the load control method described in the first aspect above.
[0036] Compared to existing technologies, the load control method, apparatus, network device, and storage medium provided in this application, for a destination host with multiple paths to the network device, firstly determines each candidate path that needs load balancing from the multiple paths corresponding to the destination host to form a load object, then binds each flooding group containing the destination host to the load object, and finally assigns candidate paths to each flooding group based on the load object, so that one flooding group is associated with one candidate path; thereby, the candidate paths in the load object are relatively evenly distributed to different flooding groups, realizing load balancing of all flooding groups on the network device and improving path utilization. Attached Figure Description
[0037] Figure 1 This application illustrates an example of a Layer 2 multicast scenario provided by an embodiment of the present application. Figure 1 .
[0038] Figure 2 This application illustrates an example of a Layer 2 multicast scenario provided by an embodiment of the present application. Figure 2 .
[0039] Figure 3 A schematic diagram of an application scenario provided by an embodiment of this application is shown.
[0040] Figure 4 This application provides a schematic flowchart of a load control method according to an embodiment. Figure 1 .
[0041] Figure 5 This application illustrates an example of a Layer 2 multicast scenario provided by an embodiment of the present application. Figure 3 .
[0042] Figure 6 This application provides a schematic flowchart of a load control method according to an embodiment. Figure 2 .
[0043] Figure 7 This application illustrates an example of a Layer 2 multicast scenario provided by an embodiment of the present application. Figure 4 .
[0044] Figure 8 This application provides a schematic flowchart of a load control method according to an embodiment. Figure 3 .
[0045] Figure 9 This application provides a schematic flowchart of a load control method according to an embodiment. Figure 4 .
[0046] Figure 10 A block diagram of a load control device provided in an embodiment of this application is shown.
[0047] Figure 11 A block diagram of a network device provided in an embodiment of this application is shown.
[0048] Icons: 100-Load control device; 101-Selection module; 102-Load management module; 103-Path allocation module; 104-Message sending module; 10-Network device; 11-Processor; 12-Memory; 13-Bus. Detailed Implementation
[0049] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0050] Currently, for scenarios in Layer 2 networks where there are multiple paths to the same destination, unicast can improve path utilization through load balancing techniques. However, flooding logic such as multicast and broadcast typically does not support load balancing because flooding is a one-to-many communication method. Therefore, to prevent multiple packets from being generated, there can only be one path to the same destination. The following explanation uses Layer 2 multicast as an example.
[0051] The mechanism of Layer 2 multicast is described as follows: A Layer 2 multicast can support the addition of multiple members. A message is flooded to all members in the multicast group through a specified multicast group, thereby realizing the multicast transmission of the message.
[0052] For example, please refer to Figure 1 ,exist Figure 1 In the Layer 2 multicast scenario shown, there are three devices. There are three paths between device 1 and device 2, and one path between device 1 and device 3. Device 1 needs to send Layer 2 multicast messages to devices 2 and 3. If paths 1 through 4 are all added to the multicast group, device 2 will receive three duplicate messages. Therefore, although there are three paths from device 1 to device 2, only one can actually be used; otherwise, multiple packets will occur.
[0053] However, in real-world applications, there are often scenarios where there are multiple paths between two devices. In such scenarios, existing technologies can improve the utilization of these paths through load balancing techniques for unicast, but there are no corresponding load balancing methods for flooding logics such as multicast and broadcast.
[0054] The following is based on Figure 1 Using devices 1 and 2 as examples, please refer to the following explanation. Figure 2 Assume that there are six multicast groups on device 1, each multicast group undertakes a service, each multicast group needs to send messages to device 2, and the three paths from device 1 to device 2 are all loadable paths.
[0055] Because existing technologies lack a unified method for managing loadable paths and multiple multicast groups within a system, each multicast group and each path is independent, and multicast groups have no information to rely on when selecting paths. Therefore, existing technologies, specifically... Figure 2 In the scenario shown, each multicast group selects the first established path (e.g., path 1) from the three paths as the unique path, resulting in low path utilization.
[0056] Furthermore, since each multicast group selects path 1 as the only path, the bandwidth of path 1 is the maximum supported traffic for multicast data. Since the bandwidth of path 1 is limited, when there are many flooded multicast packets in the scenario, there will be significant resource waste and data traffic forwarding bottlenecks. At the same time, if path 1 fails, it will cause traffic interruption, affecting the reliability of multicast data.
[0057] In other words, existing technologies cannot achieve collaboration between different multicast groups or collaborative utilization of different paths, resulting in low network path utilization.
[0058] Therefore, with path redundancy being very common in data center networks and flooding traffic in Layer 2 networks increasing, how to achieve load sharing among all flooding groups in scenarios where there are multiple flooding groups and multiple paths between two devices is an urgent technical problem to be solved.
[0059] To address the aforementioned technical issues, this application embodiment targets a destination host with multiple paths to a network device. First, it identifies each candidate path from these paths that requires load balancing, forming a load object. Then, it binds each flooding group containing the destination host to this load object. Finally, it distributes the candidate paths within the load object relatively evenly to different flooding groups, thereby achieving load balancing across all flooding groups on the network device and improving the utilization rate of network paths.
[0060] The Layer 2 network in this embodiment can be either a VLAN (Virtual Local Access Network) or a VXLAN (Virtual eXtensible Local Access Network). The following description will use a VXLAN network as an example.
[0061] The flooding group in this embodiment can be a multicast group, a broadcast domain, or flooding logic for unknown unicast traffic, etc. The following description uses a multicast group as an example. That is, the following description uses a Layer 2 multicast scenario as an example to illustrate the specific implementation of the embodiments of this application.
[0062] Before introducing the specific implementation of the embodiments of this application, let's first introduce a possible application scenario. Please refer to... Figure 3 , Figure 3 The diagram illustrates an application scenario, which includes a network device and n hosts. The network device communicates with the n hosts, and there is at least one path from the network device to each host.
[0063] It should be pointed out that, Figure 3The number of paths from network devices to various hosts shown is merely an example. Those skilled in the art should understand that in actual applications, the actual number of paths from network devices to different hosts should prevail. This application does not impose any restrictions on this.
[0064] In this embodiment, the network device may be, but is not limited to, a switch, a router, a data center, etc.
[0065] Since each multicast group can only add one path to the same destination, otherwise multiple packets will be added, in order to improve the utilization of multiple paths of Layer 2 multicast and improve the forwarding efficiency of Layer 2 multicast, in a VXLAN network, the network device to each host is a VXLAN tunnel, which can be associated with different VXLAN instances. Each VXLAN instance can have one or more Layer 2 multicast groups.
[0066] That is, combined with Figure 3 , Figure 3 In this system, each network device has a tunnel to each host, and the path from the network device to each host is within its own VXLAN tunnel. For example, the three paths from the network device to host 1 are all within the VXLAN tunnel from the network device to host 1.
[0067] The load control method provided in the embodiments of this application will be described in detail below.
[0068] Please refer to Figure 4 , Figure 4 A schematic flowchart of a load control method provided in an embodiment of this application is shown. This load control method is applied to… Figure 3 The network device in the middle may include the following steps:
[0069] S101 obtains the destination host with multiple paths to the network device from multiple hosts.
[0070] Because network devices communicate with multiple hosts, and there is at least one path from the network device to each host, load control is not needed if there is only one path from the network device to a host. Load control is only needed for hosts with multiple paths to the network device. For example, combined with... Figure 3 If there are three paths from the network device to host 1, then host 1 is the destination host.
[0071] S102, determine each candidate path that needs to be load-sharing from the multiple paths corresponding to the destination host, and form a load object from all candidate paths.
[0072] In real-world applications, although there are multiple paths from a network device to the destination host, not all paths are used to send flooded packets; that is, not all paths require load balancing. In other words, some paths are used to send flooded packets, and these paths require load balancing. However, some paths are used to send other packets, such as unicast packets, and these paths do not require load balancing. Therefore, it is necessary to determine each candidate path that needs load balancing from the multiple paths corresponding to the destination host—that is, the path used to send flooded packets—and to form a load balancer object from all candidate paths.
[0073] Taking VXLAN networks as an example, when a user configures VXLAN, the device calculates and establishes VXLAN tunnels according to the EVPN (Ethernet Virtual Private Network) protocol. Each VXLAN tunnel is a load balancer. For example, using... Figure 3 Taking network device and host 1 as an example, the network device and host 1 run the EVPN protocol. The network device calculates three equivalent paths from the network device to host 1 according to the routing protocol and treats these three equivalent paths as a load object.
[0074] Meanwhile, network devices manage load objects on a per-load basis. Each load object corresponds to a destination, and a load object can include multiple members, each of which represents a candidate path. Network devices maintain the addition and deletion of load objects, as well as the addition and deletion of members within those load objects.
[0075] S103, obtain each flood group containing the destination host, and bind each flood group to the load object; wherein, the flood group is used to flood the packets of the same service to each host contained therein.
[0076] In this embodiment, taking Layer 2 multicast as an example, in real-world applications, network devices typically have multiple multicast groups. Each multicast group usually handles one service, and each group needs to send multicast packets to every host it contains. Since each multicast group on a network device can only add one path to the same destination, otherwise multiple packets will be added, a single multicast group cannot improve the utilization rate of multiple paths in Layer 2 multicast.
[0077] Therefore, in order to improve the utilization of multiple candidate paths corresponding to the destination host, we can first obtain each multicast group containing the destination host and bind each multicast group to the load object. Then, we can distribute the candidate paths in the load object relatively evenly to different multicast groups, so that each multicast group has a candidate path to send multicast messages to the destination host.
[0078] Meanwhile, when creating a multicast group, the receiving logical port of the multicast message in the multicast group can be determined according to the receiving logical port. Then, the load object can be determined according to the sending logical port. Finally, according to the current load status of the load object, a relatively idle candidate path can be found from the load object as the forwarding path of the multicast group.
[0079] S104, based on the load object, assigns a candidate path to each flooding group, so that a flooding group is associated with a candidate path.
[0080] In this embodiment, taking Layer 2 multicast as an example, after binding each multicast group containing the destination host to the load object in step S102, the candidate paths in the load object are relatively evenly distributed to different multicast groups, thereby realizing load sharing of all multicast groups on the network device and improving the utilization of network paths.
[0081] In one possible implementation, weight values can be pre-configured for both the load object and each candidate path, with the initial weight values being the same, for example, all being 0. Subsequently, based on the weight values of the load object and each candidate path, the candidate paths in the load object are relatively evenly distributed to different flooding groups.
[0082] The following section uses a flooding group as an example to introduce the process of allocating candidate paths to the flooding group based on the load object in step S104.
[0083] Optionally, the process of allocating candidate paths to the flooding group based on the load object in step S104 may include:
[0084] S1041, obtain the current weight value of the load object and the current weight value of each candidate path.
[0085] S1042, compare the current weight value of each candidate path with the current weight value of the load object.
[0086] S1043, if the current weight value of the current candidate path is less than the current weight value of the load object, then assign the current candidate path to the flooding group and add the set value to the current weight value of the current candidate path.
[0087] S1044, if the current weight values of all candidate paths are equal to the current weight value of the load object, then the last candidate path is assigned to the flooding group, and the current weight value of the last candidate path is increased by a set value, and the current weight value of the load object is increased by a set value.
[0088] and Figure 3 For example, regarding network device and host 1, please refer to... Figure 5Assume there are 6 multicast groups on the network device, and a VXLAN tunnel connects the network device to host 1. This VXLAN tunnel is a load balancer containing 3 paths: paths 1, 2, and 3. Assign a weight value X to the load balancer, and assign a weight value Y to each path within the load balancer. Initially, all weight values are 0.
[0089] Starting with multicast group 1, candidate paths are assigned to each multicast group sequentially. Taking multicast group 1 as an example, the current weight value of each path in the load object is compared with the current weight value of the load object. That is, the current weight value Y1 of path 1 is compared with the current weight value X of the load object. If Y1 < X, path 1 is assigned to multicast group 1, and the current weight value Y1 of path 1 is increased by a set value, for example, by 1. If Y1 = X, the current weight value Y2 of path 2 is compared with the current weight value X of the load object. If Y2 = X, the current weight value Y3 of path 2 is compared with the current weight value X of the load object, and so on, until the last path in the load object is reached. If the current weight value Yn of the last path is still equal to X, the last path is assigned to multicast group 1, and the current weight value X of the load object and the current weight value Y1 of path 1 are increased by a set value, for example, by 1. This process is repeated until the path assignment for each multicast group is completed.
[0090] like Figure 5 As shown, after path allocation according to the above process, multicast groups 1 and 4 are assigned to path 3, multicast groups 2 and 5 are assigned to path 1, and multicast groups 3 and 6 are assigned to path 2. This evenly distributes candidate paths within the load object to different multicast groups, ensuring that different multicast groups have different paths. This solves the problem in existing technologies where each multicast group selects the first established path 1 as the only path, while paths 2 and 3 remain idle, thus improving network path utilization.
[0091] It should be noted that, for ease of understanding, the above explanation uses a flooding group as an example. However, those skilled in the art should understand that for each multicast group containing the destination host, candidate paths need to be allocated in accordance with the method of S1041 to S1044, so as to evenly distribute the candidate paths in the load object to different multicast groups.
[0092] In one possible scenario, in real-world applications, candidate paths in a load object may fail for various reasons. To avoid traffic interruption caused by changes in path status, the failed candidate path can be removed from the load object first, and then a path can be reassigned to each multicast group associated with the failed candidate path.
[0093] Therefore, in Figure 4 Based on this, please refer to Figure 6After step S104, the load control method provided in this application embodiment further includes S105 to S106.
[0094] S105: When any candidate path fails, the failed candidate path is removed from the load object.
[0095] S106, based on removing the load objects of the failed candidate paths, reassign candidate paths to each flooding group associated with the failed candidate paths.
[0096] For example, in Figure 5 Based on this, please refer to Figure 7 Assuming path 1 fails, to avoid traffic interruption due to path status changes, path 1 is first removed from the load object. At this time, the load object includes paths 2 and 3, which are in normal status. Then, the multicast groups that have established associations with paths 2 and 3 (i.e., multicast groups 1, 3, 4, and 6) remain unchanged. Paths are reassigned to multicast groups 2 and 5 that are associated with path 1. Multicast group 2 is assigned to path 3, and multicast group 5 is assigned to path 2.
[0097] It should be noted that the process of reassigning candidate paths to each multicast group associated with the failed candidate path is similar to the process in S1041 to S1044 described above, and will not be repeated in this embodiment.
[0098] In another possible scenario, in practical applications, new candidate paths may be added to the load balancer, or a new multicast group containing the destination host may be created. To avoid traffic interruption caused by changes in path status, when a new candidate path is added to the load balancer, the multicast groups and candidate paths with normal path status and established relationships can remain unchanged. Only the newly created multicast group can be assigned to the new candidate path with the current lower load.
[0099] Therefore, in Figure 4 Based on this, please refer to Figure 8 After step S104, the load control method provided in this application embodiment further includes S107 to S108.
[0100] S107, When a new candidate path is added to the load object, the flooding group and candidate path with established association remain unchanged.
[0101] S108: Based on the load object of the newly added candidate path, assign candidate paths to the newly created flooding group.
[0102] For example, combined with Figure 5When a new path 4 is added to the load balancer, to avoid traffic interruption due to path status changes, if the existing paths 1, 2, and 3 in the load balancer are all normal, the multicast groups 1, 2, 3, 4, 5, and 6 of the assigned paths will remain unchanged. Subsequently, when multicast groups 7 and 8 are created, the newly created multicast groups will be assigned to the currently less loaded path 4.
[0103] Alternatively, in one possible implementation, to improve the stability and flexibility of the service, candidate paths can be reallocated for each multicast group when the service is idle, thereby improving the stability and flexibility of the service.
[0104] Therefore, after step S104, the load control method provided in this application embodiment further includes S109.
[0105] S109, When the service is idle, the candidate path is reassigned to each flooding group based on the load object.
[0106] For example, based on the above example, suppose there are multicast groups 1, 2, 3, 4, 5, 6, 7, and 8, and the load objects include paths 1, 2, 3, and 4. Then, when the service is idle, four paths from the load objects of the eight multicast groups can be reallocated. This forces a redistribution of the load when the service is idle, thereby achieving traffic reload and improving the stability and flexibility of the service.
[0107] It should be noted that the process of creating candidate paths for new multicast groups and the process of reallocating candidate paths for each multicast group when the service is idle are similar to the processes in S1041 to S1044 above, and will not be described again in this embodiment.
[0108] Based on the load control process described above, the process of sending multicast messages on network devices will be introduced below.
[0109] exist Figure 4 Based on this, please refer to Figure 9 After step S104, the load control method provided in this application embodiment further includes S110 to S112.
[0110] S110, obtain the service message.
[0111] S111, if the service message is a flooding message, then determine the specific flooding group used to flood the service message.
[0112] S112, through a specific flooding group, flood the service message to each host contained in the specific flooding group; wherein, the specific flooding group sends the service message to the destination host with multiple paths between it and the network device through the candidate path associated with itself.
[0113] In this embodiment, the flooding message includes one of the following: multicast traffic, broadcast traffic, unknown unicast traffic, etc. The flooding message may be sent to the network device by other devices communicating with the network device, requiring the network device to flood it to the relevant host, or it may be generated by the network device itself and flooded to the relevant host. This embodiment of the application does not impose any restrictions on this.
[0114] That is, the load control method provided in this application embodiment is applied to the Layer 2 domain load and may include forwarding logic for flooded traffic such as broadcast traffic, multicast traffic, and unknown unicast traffic, and may also include CPU sending logic for flooded traffic such as broadcast traffic, multicast traffic, and unknown unicast traffic.
[0115] Compared with the prior art, the embodiments of this application have the following beneficial effects:
[0116] First, multiple flooding groups containing hosts with the same destination are managed in a unified manner, and multiple candidate paths to the same destination are managed in a unified load object. The candidate paths in the load object are then distributed relatively evenly to different flooding groups. This improves the utilization of network paths while ensuring that each flooding group has only one candidate path to the same destination.
[0117] Secondly, by distributing candidate paths in the load object relatively evenly to different flooding groups, it can support a higher flooding flow limit compared to the existing technology where each multicast group selects the first established path as the only path.
[0118] Third, when a candidate path in a load object fails, the multicast groups already assigned to candidate paths in normal status remain unchanged. Paths are only reassigned to each flood group associated with the failed candidate path, thereby avoiding traffic interruption caused by changes in path status.
[0119] Fourth, when a new candidate path is added to the load object, the existing flooding groups and candidate paths with established relationships remain unchanged. The newly created multicast group is only assigned to the new candidate path with a lower current load, thereby avoiding traffic interruption caused by changes in path status.
[0120] Fifth, when the business is idle, the load is forcibly redistributed to achieve traffic reload, which improves the stability and flexibility of the business.
[0121] In order to perform the corresponding steps in the above method embodiments and various possible implementations, an implementation of a load control device is given below.
[0122] Please refer to Figure 10 , Figure 10 A block diagram of a load control device 100 provided in an embodiment of this application is shown. The load control device 100 is applied to... Figure 3The network device in the load control device 100 includes: a selection module 101, a load management module 102, and a path allocation module 103.
[0123] Selection module 101 is used to obtain the destination host with multiple paths to the network device from multiple hosts.
[0124] The load management module 102 is used to determine each candidate path that needs to be load-sharing from multiple paths corresponding to the destination host, and to form a load object from all candidate paths.
[0125] The load management module 102 is also used to obtain each flooding group containing the destination host and bind each flooding group to the load object; wherein, the flooding group is used to flood the packets of the same service to each host contained therein.
[0126] The path allocation module 103 is used to allocate candidate paths to each flooding group based on the load object, so that a flooding group is associated with a candidate path.
[0127] Optionally, the load object and each candidate path are pre-configured with weight values, and the initial weight values are the same; the path allocation module 103 is specifically used for:
[0128] For each flooding group, obtain the current weight value of the load object and the current weight value of each candidate path;
[0129] The current weight value of each candidate path is compared with the current weight value of the load object.
[0130] If the current weight value of the current candidate path is less than the current weight value of the load object, then the current candidate path is assigned to the flooding group, and the current weight value of the current candidate path is increased by the set value.
[0131] If the current weight values of all candidate paths are equal to the current weight value of the load object, then the last candidate path is assigned to the flooding group, and the current weight value of the last candidate path is increased by a set value, and the current weight value of the load object is increased by a set value.
[0132] Optionally, the load management module 102 is also used to remove the failed candidate path from the load object when any candidate path fails.
[0133] The path assignment module 103 is also used to reassign candidate paths to each flooding group associated with a failed candidate path based on the load object of the candidate path that was removed.
[0134] Optionally, the load management module 102 is also used to maintain the existing flooding groups and candidate paths unchanged when a new candidate path is added to the load object.
[0135] The path allocation module 103 is also used for:
[0136] Based on the load objects of the newly added candidate paths, candidate paths are assigned to the newly created flooding groups.
[0137] Optionally, the path allocation module 103 is also used to reallocate candidate paths for each flooding group based on the load object when the service is idle.
[0138] Optionally, the load control device 100 may further include a message sending module 104, which is used for:
[0139] Obtain business messages;
[0140] If the service message is a flooding message, then determine the specific flooding group used to flood the service message;
[0141] Service packets are flooded to each host contained in a specific flooding group; wherein, a specific flooding group sends service packets to a destination host with multiple paths between itself and the network device through candidate paths associated with itself.
[0142] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the load control device 100 described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0143] Please refer to Figure 11 , Figure 11 A block diagram of a network device 10 provided in an embodiment of this application is shown. The network device 10 may be a router, switch, etc., and includes a processor 11, a memory 12, and a bus 13. The processor 11 is connected to the memory 12 through the bus 13.
[0144] The memory 12 is used to store programs. After receiving an execution instruction, the processor 11 executes the programs to implement the load control method disclosed in the above embodiments.
[0145] The memory 12 may include high-speed random access memory (RAM) or non-volatile memory (NVM).
[0146] Processor 11 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed through integrated logic circuits in the hardware of processor 11 or through software instructions. Processor 11 can be a general-purpose processor, including a Central Processing Unit (CPU), a Microcontroller Unit (MCU), a Complex Programmable Logic Device (CPLD), a Field Programmable Gate Array (FPGA), embedded ARM chips, etc.
[0147] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by the processor 11, implements the load control method disclosed in the above embodiments.
[0148] In summary, the load control method, apparatus, network device, and storage medium provided in this application, for a destination host with multiple paths to the network device, firstly determines each candidate path that needs load balancing from the multiple paths corresponding to the destination host to form a load object, then binds each flooding group containing the destination host to the load object, and finally assigns candidate paths to each flooding group based on the load object, so that one flooding group is associated with one candidate path; thereby, the candidate paths in the load object are relatively evenly distributed to different flooding groups, realizing load balancing of all flooding groups on the network device and improving path utilization.
[0149] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A load control method, characterized in that, Applied to a network device that communicates with multiple hosts, the method includes: From the plurality of hosts, obtain the destination host that has multiple paths to the network device; From the multiple paths corresponding to the destination host, each candidate path that needs to be load-sharing is determined, and all candidate paths are combined into a load object; Obtain each flood group containing the destination host, and bind each flood group to the load object; wherein, the flood group is used to flood packets of the same service to each host it contains; Based on the load object, the candidate path is assigned to each flooding group, such that one flooding group is associated with one candidate path; The load object and each candidate path are pre-configured with weight values, and the initial weight values are the same. The step of allocating the candidate path to each flooding group based on the load object includes: For each of the flooding groups, obtain the current weight value of the load object and the current weight value of each of the candidate paths; The current weight value of each candidate path is compared with the current weight value of the load object. If the current weight value of the current candidate path is less than the current weight value of the load object, then the current candidate path is assigned to the flooding group, and the current weight value of the current candidate path is increased by a set value. If the current weight values of all candidate paths are equal to the current weight value of the load object, then the last candidate path is assigned to the flooding group, and the current weight value of the last candidate path is added to the set value, and the current weight value of the load object is added to the set value.
2. The method as described in claim 1, characterized in that, The method further includes: When any candidate path fails, the failed candidate path is removed from the load object; Based on removing the load objects of the failed candidate paths, the candidate paths are reassigned to each flooding group associated with the failed candidate paths.
3. The method as described in claim 1, characterized in that, The method further includes: When a new candidate path is added to the load object, the flooding groups and candidate paths that have already been associated remain unchanged. Based on the load objects of the newly added candidate paths, the candidate paths are assigned to the newly created flooding groups.
4. The method as described in claim 1, characterized in that, The method further includes: When the service is idle, the candidate path is reallocated to each of the flooding groups based on the load object.
5. The method as described in claim 1, characterized in that, The method further includes: Obtain business messages; If the service message is a flooding message, then a specific flooding group for flooding the service message is determined; The service packets are flooded to each host included in the specific flooding group; wherein the specific flooding group sends the service packets to the destination host with multiple paths between it and the network device through the candidate paths associated with it.
6. The method as described in claim 5, characterized in that, The flooding message includes one of the following: multicast traffic, broadcast traffic, and unknown unicast traffic.
7. A load control device, characterized in that, Applied to a network device that communicates with multiple hosts, the device includes: The selection module is used to obtain, from the plurality of hosts, a destination host that has multiple paths to the network device; The load management module is used to determine each candidate path that needs to be load-sharing from the multiple paths corresponding to the destination host, and to form a load object from all candidate paths; The load management module is further configured to obtain each flooding group containing the destination host and bind each flooding group to the load object; wherein, the flooding group is configured to flood packets of the same service to each host it contains; The path allocation module is used to allocate the candidate path to each flooding group based on the load object, so that one flooding group is associated with one candidate path, wherein the load object and each candidate path are pre-configured with weight values, and the initial weight values are the same; The path allocation module is specifically used to obtain the current weight value of the load object and the current weight value of each candidate path for each flooding group; compare the current weight value of each candidate path with the current weight value of the load object one by one; if the current weight value of the current candidate path is less than the current weight value of the load object, then the current candidate path is allocated to the flooding group, and the current weight value of the current candidate path is added to a preset value; if the current weight values of all candidate paths are equal to the current weight value of the load object, then the last candidate path is allocated to the flooding group, and the current weight value of the last candidate path is added to the preset value, and the current weight value of the load object is added to the preset value.
8. A network device, characterized in that, It includes a processor and a memory, the memory being used to store a program, and the processor being used to implement the load control method according to any one of claims 1-6 when executing the program.
9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the load control method as described in any one of claims 1-6.
Citation Information
Patent Citations
Fast reroute for BUM traffic in ethernet virtual private networks
EP4047883A1
Fast control path and data path convergence in layer 2 overlay networks
WO2018020290A1