A method, apparatus, electronic device, and storage medium for implementing dynamic ECMP load rebalancing
By judging ECMP heavy load events and updating the flow table, the load imbalance problem when members within the ECMP group change is solved, load rebalancing is achieved, and link utilization efficiency is improved.
Patent Information
- Application Number
- CN202310112323.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-14
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-02-14
AI Technical Summary
The prior art cannot achieve load rebalancing when members within the ECMP group change, resulting in the inability to share existing traffic to new members and the bandwidth cannot be released after the flow table is aging.
By judging the ECMP heavy load event, query the ECMP load status table, obtain the heavy load status value, and reselect the lightest link to update the flow table when it is greater than the preset value, and control the number of heavy loads to achieve load balancing.
Load rebalancing is realized when the load of members in the ECMP group changes, maintain load balancing of members in the ECMP group, and improve link utilization efficiency.
Smart Images

Figure CN116055405B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of load balancing, and particularly to a method for realizing dynamic ECMP load rebalancing, a device, an electronic device and a storage medium for realizing the method. Background Art
[0002] ECMP (Equal-Cost Multipath Routing) is a load sharing technology widely used in networks. ECMP is applied to a network environment where multiple different links reach the same destination address. If traditional routing technology is used, the data packets sent to this destination address can only utilize one of the links, and the other links are in a backup state or an invalid state, and there is a certain time required for switching between them in a dynamic routing environment. While ECMP can use multiple links simultaneously in this network environment, which not only increases the transmission bandwidth but also can back up the data transmission of the failed link without delay and packet loss. When there are multiple routes discovered by the same routing protocol to the same destination, and the cost values of these routes are also the same, then the conditions for load sharing are met.
[0003] Dynamic ECMP can dynamically select the link with the lightest load based on the flow slicing technology for subsequent packet forwarding, and its working principle can be referred to as Figure 1 shown. Among them, the lightest load selection module selects forwarding members through the flow chart as Figure 2 shown. The flow table structure involved therein is as Figure 3 shown. However, when a member is added to the ECMP members (such as adding ECMP member N + 1, and this ECMP member can only be used by new flows), although the traffic load of the new member is 0, the existing traffic cannot be shared to the new member. At the same time, after the flow table ages, the existing flows cannot use the released bandwidth, that is to say, the currently active flows cannot re-optimize and allocate the released bandwidth. As can be seen from the above, the prior art cannot achieve load rebalancing when the members within the ECMP group change.
[0004] The information disclosed in this background art section is only intended to increase the understanding of the overall background of the present invention, and should not be regarded as an admission or any form of suggestion that this information constitutes the prior art already known to those of ordinary skill in the art. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for realizing dynamic ECMP load rebalancing, which can achieve load rebalancing when the load of the members within the ECMP group changes, thereby keeping the load of the members within the ECMP group balanced. At the same time, a device, an electronic device and a storage medium for realizing the above method are also provided.
[0006] To achieve the above object, an embodiment of the present invention provides a method for implementing dynamic ECMP load rebalancing, the method comprising:
[0007] Determine whether an ECMP heavy load event occurs;
[0008] In response to the occurrence of an ECMP heavy load event, query the ECMP load status table to obtain the heavy load status value corresponding to the ECMP group, wherein the heavy load status table is configured with the ECMP group and its corresponding heavy load status value for indicating the number of heavy load occurrences;
[0009] Determine whether the heavy load status value is greater than a preset value;
[0010] In response to being greater than the preset value, reselect the link with the lightest load for the current flow and update the flow table, and store the heavy load status value after subtracting one into the ECMP heavy load status table.
[0011] In one or more embodiments of the present invention, the ECMP heavy load event is generated based on the flow status or based on software configuration.
[0012] In one or more embodiments of the present invention, the flow status is selected from one of a flow fixed time interval, a flow fixed number interval, and a flow switching gap.
[0013] In one or more embodiments of the present invention, the heavy load status value can be determined according to the number of active flow entries corresponding to the ECMP group. Determining the heavy load status value according to the number of active flow entries corresponding to the ECMP group includes:
[0014] Obtain the link load, query the load difference interval table through the difference between the maximum value and the minimum value of the load to obtain the allowed number of heavy load occurrences, and the load difference interval table is configured with the mapping relationship between the load difference interval and its corresponding allowed number of heavy load occurrences;
[0015] Judge whether heavy load processing is required according to the number of active flow entries corresponding to the ECMP group;
[0016] In response to the need for heavy load processing, store the allowed number of heavy load occurrences into the ECMP heavy load status table.
[0017] In one or more embodiments of the present invention, judging whether heavy load processing is required according to the number of active flow entries corresponding to the ECMP group includes:
[0018] Judge whether the number of active flow entries corresponding to the ECMP group is greater than the heavy load threshold;
[0019] In response to the number of active flow entries being greater than the heavy load threshold, determine that heavy load processing is required.
[0020] In one or more embodiments of the present invention, determining the heavy load status value according to the number of active flow entries corresponding to the ECMP group further includes:
[0021] In response to being less than the heavy load threshold, store the preset allowed heavy load times in the ECMP heavy load status table.
[0022] In one or more embodiments of the present invention, the link load is obtained periodically by a timer.
[0023] An embodiment of the present invention provides a device for implementing dynamic ECMP load rebalancing, characterized in that the device includes:
[0024] A first judgment module, configured to judge whether an ECMP heavy load event occurs;
[0025] An obtaining module, configured to, in response to the occurrence of an ECMP heavy load event, query the ECMP load status table to obtain the heavy load status value corresponding to the ECMP group, wherein the heavy load status table is configured with the ECMP group and its corresponding heavy load status value for indicating the number of heavy load times;
[0026] A second judgment module, configured to judge whether the heavy load status value is greater than a preset value;
[0027] A heavy load module, configured to, in response to being greater than the preset value, reselect the link with the lightest load for the current flow and update the flow table, and store the heavy load status value after subtracting one in the ECMP heavy load status table.
[0028] An embodiment of the present invention provides an electronic device, the electronic device includes:
[0029] At least one processor; and
[0030] At least one memory, the at least one memory is coupled to the at least one processor and stores a computer program for execution by the at least one processor, and when the computer program is executed by the at least one processor, the electronic device executes the method described above.
[0031] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a machine, the method described in any one of the above is implemented.
[0032] Compared with the prior art, the present invention can achieve load rebalancing when the load of the members within the ECMP group changes, and further keep the load of the members within the ECMP group balanced. Description of the Drawings
[0033] Figure 1It is a flowchart of the implementation of dynamic ECMP in the prior art;
[0034] Figure 2 is Figure 1 the processing flowchart of the lightest load member selection module in
[0035] Figure 3 a schematic diagram of the flow table structure;
[0036] Figure 4 It is a flowchart of the method for implementing dynamic ECMP load rebalancing according to an embodiment of the present invention;
[0037] Figure 5 It is a flowchart of the implementation of dynamic ECMP load rebalancing according to an embodiment of the present invention;
[0038] Figure 6 It is a block diagram of the device for implementing dynamic ECMP load rebalancing according to an embodiment of the present invention. Detailed implementation manners
[0039] The following will describe in detail the specific implementation manners of the present invention in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation manners.
[0040] Unless otherwise clearly stated, in the whole specification and claims, the term "comprising" or its variations such as "including" or "having" etc. will be understood to include the stated elements or components, without excluding other elements or other components.
[0041] As Figures 4 to 5 shown, a method for implementing dynamic ECMP load rebalancing according to a preferred embodiment of the present invention can achieve load rebalancing when the load of the members within the ECMP group changes, and further keep the load of the members within the ECMP group balanced.
[0042] Specifically, a method for implementing dynamic ECMP load rebalancing includes the following steps:
[0043] S100, determine whether an ECMP heavy load event occurs;
[0044] S200, in response to the occurrence of an ECMP heavy load event, query the ECMP load status table to obtain the heavy load status value corresponding to the ECMP group;
[0045] Specifically, to balance the loads of ECMP members within an ECMP group, first, it is necessary to determine whether an ECMP heavy-load event has occurred, that is, whether an event that can trigger ECMP heavy load has occurred. Among them, ECMP heavy load refers to reallocating the loads of ECMP members within an ECMP group to balance the loads of ECMP members within the ECMP group. The ECMP heavy-load event here can be generated based on the flow state or can be generated based on CPU software configuration. In specific implementation, the flow state is selected from one of the flow fixed event interval, flow fixed number interval, and flow switching gap, and can be selected according to actual requirements.
[0046] When an ECMP heavy-load event occurs in an ECMP group, that is, the loads of ECMP members within the ECMP group need to be reallocated to achieve load rebalancing. At this time, query the ECMP heavy-load status table using the ECMP group ID corresponding to the ECMP group to obtain the heavy-load status value corresponding to the ECMP group, so as to use the heavy-load status value to determine whether to perform heavy-load processing subsequently, and select the path with the lightest load for the flow (that is, select the ECMP member with the lightest load).
[0047] The ECMP load status table here is configured with ECMP groups and their corresponding heavy-load status values. The heavy-load status value here is used to mark the number of heavy loads, and the heavy-load status value can be determined according to the number of active flow entries corresponding to the ECMP group, or can be determined by subtracting one from the original heavy-load status value after heavy load. In specific implementation, determining the heavy-load status value according to the number of active flow entries corresponding to the ECMP group includes the following steps:
[0048] First, obtain the link load (that is, the load corresponding to the ECMP member), query the load difference interval table through the difference between the maximum value and the minimum value of the load to obtain the allowed number of heavy loads. At the same time, the load balance of ECMP members within the ECMP group can also be judged by the maximum value and the minimum value of the load. The load difference interval table here is configured with the mapping relationship between the load difference interval and its corresponding allowed number of heavy loads. For example, the allowed number of heavy loads corresponding to the load difference interval [0, V1) is A, and the allowed number of heavy loads corresponding to the load difference interval [V1, V2) is B, etc. After determining the difference between the maximum value and the minimum value of the load, determine the interval where the difference is located, and then the allowed number of heavy loads can be further determined. For example, if the interval where the difference between the maximum value and the minimum value of the load is located is [V1, V2), the allowed number of heavy loads can be determined to be B.
[0049] Secondly, judge whether heavy-load processing is required according to the number of active flow entries corresponding to the ECMP group;
[0050] Specifically, after obtaining the allowed overload times, it is further determined whether overload is required according to the number of active flow entries corresponding to the ECMP group. During implementation, it is determined whether the number of active flow entries corresponding to the ECMP group is greater than the overload threshold. When the number of active flow entries is greater than the overload threshold, it indicates that the load needs to be redistributed for the flows so as to achieve load rebalancing when the load of the members within the ECMP group changes. When the number of active flow entries is less than or equal to the overload threshold, it indicates that there is no need to redistribute the load for the flows. The number of active flow entries here is determined based on the addition or aging of the flows. During specific implementation, when a new flow is added, the number of active flow entries is incremented by one, and when a flow ages, the number of active flow entries is decremented by one. The change in the number of active flow entries corresponds to the change in the ECMP members, so overload processing is required to achieve load rebalancing.
[0051] Finally, in response to the need for overload processing, the allowed overload times are stored in the ECMP overload status table.
[0052] Specifically, when it is determined that the number of active flow entries corresponding to the ECMP group is greater than the overload threshold, it indicates that overload processing is required. At this time, the obtained allowed overload times are stored in the ECMP overload status table. For example, when it is determined that the number of active flow entries corresponding to the ECMP group (the ECMP group number is 1) is greater than the overload threshold, the obtained allowed overload times (such as n) are stored in the corresponding position of the ECMP group with ID 1 in the ECMP overload status table.
[0053] In this embodiment, the link load is obtained at regular intervals, so that the allowed overload times are also stored in the ECMP overload status table at regular intervals.
[0054] S300, determine whether the overload status value is greater than a preset value;
[0055] S400, in response to being greater than the preset value, subtract one from the overload status value and then store it in the ECMP overload status table, and reselect the link with the lightest load for the current flow and update the flow table.
[0056] Specifically, after obtaining the heavy load status value corresponding to the ECMP group from the ECMP heavy load status table, it is further determined whether the heavy load status value is greater than a preset threshold, and the preset threshold is preferably zero. When the heavy load status value is greater than the preset threshold, the current flow is reselected to the link with the lightest load and the flow table is updated, so that the flow is forwarded through the selected link with the lightest load (i.e., the ECMP member). At the same time, the heavy load status value is decremented by one, and the decremented value is stored in the corresponding position in the ECMP table. As shown in the figure, the heavy load status value corresponding to the ECMP group numbered 2 is n, which is greater than the preset threshold. Therefore, after selecting the path with the lightest load (i.e., the ECMP member) in the ECMP group for the flow, the heavy load status value n - 1 is stored in the EMCP heavy load status table.
[0057] The present invention can control the number of heavy loads according to the load conditions of the ECMP members within the ECMP group when the load of the members within the ECMP group changes, and achieve rebalancing of the load within the ECMP group through orderly heavy loads.
[0058] As Figure 6 shown, a device for implementing dynamic ECMP load rebalancing in a preferred embodiment of the present invention can implement the above-mentioned method, can achieve load rebalancing when the load of the members within the ECMP group changes, and further keep the load of the members within the ECMP group balanced.
[0059] Specifically, the device includes a first judgment module, an acquisition module, a second judgment module, and a heavy load module. Among them, the first judgment module is used to judge whether an ECMP heavy load event occurs; the acquisition module is used to query the ECMP load status table in response to the occurrence of an ECMP heavy load event and obtain the heavy load status value corresponding to the ECMP group; the second judgment module is used to judge whether the heavy load status value is greater than a preset value; the heavy load module is used to, in response to being greater than the preset value, store the heavy load status value after decrementing by one in the ECMP heavy load status table, and reselect the link with the lightest load for the current flow and update the flow table. The above modules correspond one by one to the above method steps. For how each module implements the corresponding functions, please refer to the above details and will not be elaborated here one by one.
[0060] An electronic device according to a preferred embodiment of the present invention may include, but is not limited to: a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile electronic device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable electronic device, a consumer electronic device, and the like. The electronic device can implement the method for realizing dynamic ECMP load rebalancing described above, and can achieve load rebalancing when the load of the members in the ECMP group changes, thereby keeping the load of the members in the ECMP group balanced. Specifically, the electronic device includes at least one memory, at least one processor, and a computer program. The at least one memory is coupled to the at least one processor. Among them, the computer program is stored in the memory and can run in the processor, such as the computer program for realizing the dynamic ECMP load rebalancing program. When implemented, when the processor executes the computer program, each step in the above method can be realized, such as the step of determining whether an ECMP heavy load event occurs, and the like.
[0061] The computer program here can be divided into one or more units. The one or more units are stored in the memory and executed by the memory to complete the present invention. Among them, the one or more units can be a series of computer program instruction segments capable of completing specific functions, and the computer program instruction segments are used to describe the execution process of the computer program in the electronic device.
[0062] It should be noted that the electronic device here includes, but is not limited to, the memory, the processor, and the computer program described above, and may also include others, such as an input device for inputting instructions (such as a keyboard), a display screen for displaying negotiation results, a communication interface, and the like. These components communicate with each other through a bus.
[0063] A computer-readable storage medium according to a preferred embodiment of the present invention stores a computer program. When the computer program is executed by a processor, the method for realizing dynamic ECMP load rebalancing can be realized, and load rebalancing can be achieved when the load of the members in the ECMP group changes, thereby keeping the load of the members in the ECMP group balanced. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, an executable file, or some intermediate form, etc. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), and the like.
[0064] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0065] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0066] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that realizes the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0067] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0068] The foregoing description of specific exemplary embodiments of the invention has been presented for purposes of illustration and example. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many modifications and variations are possible in light of the above teaching. The purpose of selecting and describing the exemplary embodiments was to explain the specific principles of the invention and its practical application so that others skilled in the art may realize and utilize the various different exemplary embodiments of the invention, as well as various different selections and modifications. The scope of the invention is intended to be defined by the claims and their equivalents.
Claims
1. A method for implementing dynamic ECMP load rebalancing, characterized in that, The method includes: Determine whether an ECMP heavy load event occurs; In response to the occurrence of an ECMP heavy load event, query the ECMP load status table to obtain the heavy load status value corresponding to the ECMP group, where the ECMP load status table is configured with the ECMP group and its corresponding heavy load status value for indicating the number of heavy load occurrences; Determine whether the heavy load status value is greater than a preset value; In response to being greater than the preset value, re-select the link with the lightest load for the current flow and update the flow table, and subtract one from the heavy load status value and store it in the ECMP load status table, where The heavy load status value can be determined according to the number of active flow entries corresponding to the ECMP group. Determining the heavy load status value according to the number of active flow entries corresponding to the ECMP group includes: Obtain the link load, query the load difference interval table through the difference between the maximum value and the minimum value of the load to obtain the allowed number of heavy load occurrences, and the load difference interval table is configured with the mapping relationship between the load difference interval and its corresponding allowed number of heavy load occurrences; Judge whether heavy load processing is required according to the number of active flow entries corresponding to the ECMP group; In response to the need for heavy load processing, store the allowed number of heavy load occurrences in the ECMP load status table.
2. The method according to claim 1, wherein The ECMP heavy load event is generated based on the flow state or based on software configuration.
3. The method according to claim 2, wherein The flow state is selected from one of a fixed flow time interval, a fixed number of flow intervals, and a flow switching gap.
4. The method according to claim 1, characterized in that, Judging whether heavy load processing is required according to the number of active flow entries corresponding to the ECMP group includes: Judge whether the number of active flow entries corresponding to the ECMP group is greater than the heavy load threshold; In response to the number of active flow entries being greater than the heavy load threshold, determine that heavy load processing is required.
5. The method according to claim 1, wherein Determining the heavy load status value according to the number of active flow entries corresponding to the ECMP group further includes: In response to being less than the heavy load threshold, store the preset allowed number of heavy load occurrences in the ECMP load status table.
6. The method according to claim 1, characterized in that Obtain the link load regularly through a timer.
7. A device for implementing dynamic ECMP load rebalancing, characterized in that, The device includes: A first judgment module for judging whether an ECMP heavy load event occurs; An acquisition module for, in response to the occurrence of an ECMP heavy load event, querying the ECMP load status table to obtain the heavy load status value corresponding to the ECMP group, where the ECMP load status table is configured with the ECMP group and its corresponding heavy load status value for indicating the number of heavy load occurrences, the heavy load status value can be determined according to the number of active flow entries corresponding to the ECMP group, and determining the heavy load status value according to the number of active flow entries corresponding to the ECMP group includes: obtaining the link load, querying the load difference interval table through the difference between the maximum value and the minimum value of the load to obtain the allowed number of heavy load occurrences, further judging whether heavy load processing is required according to the number of active flow entries corresponding to the ECMP group and storing the allowed number of heavy load occurrences in the ECMP load status table when heavy load processing is required, and the load difference interval table is configured with the mapping relationship between the load difference interval and its corresponding allowed number of heavy load occurrences; A second judgment module for judging whether the heavy load status value is greater than a preset value; A heavy-load module, which is configured to, in response to a value greater than a preset value, reselect the link with the lightest load for the current flow, update the flow table, and store the reduced heavy-load status value into the ECMP load status table.
8. An electronic device, characterized in that, The electronic device includes: at least one processor; and at least one memory, the at least one memory being coupled to the at least one processor and storing a computer program for execution by the at least one processor, and when the computer program is executed by the at least one processor, the electronic device is caused to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and when the computer program is executed by a machine, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Dynamic ECMP (Equal-Cost Multi-Path) chip implementation method based on elephant flow
CN106487676A
Data center network multi-path dynamic load balancing method based on SDN
CN113098789A