Traffic migration method and device, computer device and computer readable storage medium

By dynamically adjusting the traffic migration threshold and optimizing traffic distribution in OVS, the problem of unnecessary migration in the OVS traffic migration mechanism is solved, improving network stability and performance, and adapting to different network environments and network card speed limiting requirements.

CN119520439BActive Publication Date: 2026-02-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411722320.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2026-02-27
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

The existing OVS traffic migration mechanism does not fully consider changes in actual network conditions when setting migration conditions, which may lead to unnecessary traffic migration under normal network traffic fluctuations, affecting network stability and performance.

Method used

By dynamically determining the traffic migration threshold based on the bandwidth rate limit of the aggregated member ports, and considering the total traffic volume of each aggregated member port when selecting the traffic to be migrated and the destination member port, the traffic distribution is optimized to avoid some member ports being overloaded while others are idle.

Benefits of technology

It reduces unnecessary traffic migrations, improves network resource utilization and overall performance, enhances system scalability and flexibility, and adapts to different network environments and network card speed limits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520439B_ABST
    Figure CN119520439B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of communication, in particular to a traffic migration method and device, computer equipment and a computer readable storage medium. The method comprises the following steps: acquiring a traffic migration threshold value corresponding to each aggregation member port, to-be-transmitted traffic and a total amount of the to-be-transmitted traffic; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to a broadband limiting value of the aggregation member port; if the total amount of traffic corresponding to any aggregation member port exceeds the traffic migration threshold value corresponding to the aggregation member port, the aggregation member port is used as a source member port; according to the total amount of traffic corresponding to each other aggregation member port except the source member port, to-be-migrated traffic is selected from the to-be-transmitted traffic of the source member port, and a destination member port corresponding to the to-be-migrated traffic is selected from each other aggregation member port; and the to-be-migrated traffic is migrated from the source member port to the destination member port.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, and in particular to a traffic migration method and device, computer equipment and a computer readable storage medium. BACKGROUND

[0002] Open Virtual Switch (OVS) is an open source virtual switch, which is widely used in cloud computing scenarios. At the same time, in order to improve its forwarding performance, a Data Plane Development Kit (DPDK) acceleration scheme is introduced, so that data can be directly forwarded in user mode, greatly improving the forwarding performance of OVS.

[0003] When introducing the DPDK (Data Plane Development Kit) acceleration scheme in OVS (Open vSwitch), the data packet is directly forwarded in user mode and will not pass through the kernel mode processing, so it cannot use the aggregation port provided by the kernel module. In order to solve this problem, the OVS user mode process provides its own aggregation port implementation, which allows the physical network card bound with the user mode driver to join the OVS user mode bridge. The aggregation port implemented in the user mode of OVS contains a dynamic aggregation mode, which has the function of traffic migration, aiming to balance the traffic between the aggregation member ports and avoid the overload of a single aggregation member port.

[0004] However, the current traffic migration mechanism may not fully consider the changes of actual network conditions when setting the migration conditions. In complex network environments such as cloud computing, network traffic has high dynamicity and uncertainty. If the migration conditions are set too sensitively, unnecessary traffic migration may occur under normal network traffic fluctuations. SUMMARY

[0005] Therefore, it is necessary to provide a traffic migration method, device, computer equipment and computer readable storage medium capable of optimizing the traffic migration process in view of the above technical problems.

[0006] In a first aspect, the present application provides a traffic migration method applied to a host computer, wherein a virtual switch OVS bridge is configured on the host computer, and the OVS bridge is connected with at least one aggregation member port; the method comprises:

[0007] obtaining a traffic migration threshold value corresponding to each aggregation member port, to-be-forwarded traffic and a total number of to-be-forwarded traffic; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to a bandwidth limiting value of the aggregation member port;

[0008] If the total quantity of the traffic corresponding to any of the aggregated member ports exceeds the traffic migration threshold value corresponding to the aggregated member port, the aggregated member port is taken as a source member port;

[0009] According to the total quantity of the traffic corresponding to each of the other aggregated member ports except the source member port, the traffic to be migrated is selected from the traffic to be forwarded of the source member port, and the destination member port corresponding to the traffic to be migrated is selected from each of the other aggregated member ports;

[0010] The traffic to be migrated is migrated from the source member port to the destination member port.

[0011] In an exemplary embodiment, the traffic migration threshold value corresponding to each of the aggregated member ports is acquired, comprising:

[0012] For each of the aggregated member ports, an initial migration threshold value of the aggregated member port is acquired;

[0013] It is verified whether the initial migration threshold value is greater than a set empirical total quantity of traffic and less than a dynamic upper limit value corresponding to the aggregated member port; wherein the dynamic upper limit value corresponding to the aggregated member port is determined according to a bandwidth limit value of the aggregated member port;

[0014] If yes, the initial migration threshold value is taken as the traffic migration threshold value corresponding to the aggregated member port.

[0015] In an exemplary embodiment, the dynamic upper limit value corresponding to the aggregated member port is one fourth of the bandwidth limit value of the aggregated member port.

[0016] In an exemplary embodiment, according to the total quantity of the traffic corresponding to each of the other aggregated member ports except the source member port, the traffic to be migrated is selected from the traffic to be forwarded of the source member port, and the destination member port corresponding to the traffic to be migrated is selected from each of the other aggregated member ports, comprising:

[0017] A traffic difference value between the total quantity of the traffic corresponding to the source member port and the total quantity of the traffic corresponding to each of the other aggregated member ports except the source member port is determined;

[0018] From each of the traffic difference values, a maximum traffic difference value is selected;

[0019] From the traffic to be forwarded of the source member port, a quantity of traffic corresponding to the maximum traffic difference value is selected as the traffic to be migrated;

[0020] From each of the other aggregated member ports, the aggregated member port corresponding to the maximum traffic difference value is taken as the destination member port corresponding to the traffic to be migrated.

[0021] In an exemplary embodiment, the traffic to be forwarded and the total quantity of the traffic to be forwarded corresponding to each of the aggregated member ports are acquired, comprising:

[0022] obtaining a flow array structure stored in the OVS bridge, wherein the flow array structure is used to store flow description information of each to-be-forwarded flow and an aggregation member port allocated for each to-be-forwarded flow, and the flow description information of each to-be-forwarded flow is generated according to five-tuple information of the to-be-forwarded flow;

[0023] According to the flow array structure, the to-be-forwarded flow corresponding to each aggregation member port and the total flow of the to-be-forwarded flow are determined.

[0024] In an exemplary embodiment, the flow description information of each to-be-forwarded flow is obtained by performing a hash operation on the five-tuple information of the to-be-forwarded flow.

[0025] In a second aspect, the present application further provides a flow migration device, comprising:

[0026] The obtaining module is configured to obtain the flow migration threshold value corresponding to each aggregation member port, the to-be-forwarded flow, and the total flow of the to-be-forwarded flow, wherein the flow migration threshold value corresponding to each aggregation member port is determined according to the bandwidth limit value of the aggregation member port.

[0027] The threshold verification module is configured to, if the total flow of any aggregation member port exceeds the flow migration threshold value corresponding to the aggregation member port, take the aggregation member port as a source member port.

[0028] The migration flow selection module is configured to select to-be-migrated flow from the to-be-forwarded flow of the source member port according to the total flow of each other aggregation member port other than the source member port, and select a destination member port corresponding to the to-be-migrated flow from each other aggregation member port.

[0029] The flow migration module is configured to migrate the to-be-migrated flow from the source member port to the destination member port.

[0030] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0031] The obtaining module is configured to obtain the flow migration threshold value corresponding to each aggregation member port, the to-be-forwarded flow, and the total flow of the to-be-forwarded flow, wherein the flow migration threshold value corresponding to each aggregation member port is determined according to the bandwidth limit value of the aggregation member port.

[0032] The threshold verification module is configured to, if the total flow of any aggregation member port exceeds the flow migration threshold value corresponding to the aggregation member port, take the aggregation member port as a source member port.

[0033] The migration flow selection module is configured to select to-be-migrated flow from the to-be-forwarded flow of the source member port according to the total flow of each other aggregation member port other than the source member port, and select a destination member port corresponding to the to-be-migrated flow from each other aggregation member port.

[0034] migrating the to-be-migrated traffic from the source member port to the destination member port.

[0035] In a fourth aspect, the present application provides a computer readable storage medium, having stored thereon a computer program, which when executed by a processor, implements the following steps:

[0036] obtaining a traffic migration threshold value corresponding to each aggregated member port, to-be-forwarded traffic, and a total amount of traffic of the to-be-forwarded traffic; wherein the traffic migration threshold value corresponding to each aggregated member port is determined according to a bandwidth limiting value of the aggregated member port;

[0037] if the total amount of traffic corresponding to any aggregated member port exceeds the traffic migration threshold value corresponding to the aggregated member port, taking the aggregated member port as the source member port;

[0038] selecting to-be-migrated traffic from the to-be-forwarded traffic of the source member port according to the total amount of traffic corresponding to each other aggregated member port other than the source member port, and selecting a destination member port corresponding to the to-be-migrated traffic from each other aggregated member port;

[0039] migrating the to-be-migrated traffic from the source member port to the destination member port.

[0040] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which when executed by a processor, implements the following steps:

[0041] obtaining a traffic migration threshold value corresponding to each aggregated member port, to-be-forwarded traffic, and a total amount of traffic of the to-be-forwarded traffic; wherein the traffic migration threshold value corresponding to each aggregated member port is determined according to a bandwidth limiting value of the aggregated member port;

[0042] if the total amount of traffic corresponding to any aggregated member port exceeds the traffic migration threshold value corresponding to the aggregated member port, taking the aggregated member port as the source member port;

[0043] selecting to-be-migrated traffic from the to-be-forwarded traffic of the source member port according to the total amount of traffic corresponding to each other aggregated member port other than the source member port, and selecting a destination member port corresponding to the to-be-migrated traffic from each other aggregated member port;

[0044] migrating the to-be-migrated traffic from the source member port to the destination member port.

[0045] The traffic migration method, device, computer device and computer readable storage medium ensure that the threshold value matches the actual processing capability of the network card, thereby greatly reducing the number of unnecessary traffic migrations. In addition, the technical solution of the present application considers the total amount of traffic of each aggregation member port when selecting the to-be-migrated traffic and the destination member port, thereby more reasonably allocating traffic and avoiding the situation that some member ports are overloaded while other member ports are idle. This way of optimizing traffic distribution helps to improve the utilization rate of network resources and overall performance. The technical solution of the present application does not rely on a fixed migration trigger threshold value, but dynamically determines the threshold value according to the bandwidth limit value of the aggregation member port. This makes the solution adaptable to the needs of different network environments and different network card speed limits, enhancing the scalability and flexibility of the system. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without creative labor.

[0047] Figure 1 Flowchart of a traffic migration method in an embodiment;

[0048] Figure 2 Flowchart of a step of obtaining the traffic migration threshold value corresponding to each aggregation member port in an embodiment;

[0049] Figure 3 Flowchart of a step of selecting the destination member port corresponding to the to-be-migrated traffic from each other aggregation member port in an embodiment;

[0050] Figure 4 Flowchart of a step of obtaining the to-be-forwarded traffic corresponding to each aggregation member port and the total amount of to-be-forwarded traffic in an embodiment;

[0051] Figure 5 Block diagram of a traffic migration device in an embodiment;

[0052] Figure 6 Internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.

[0054] OVS (Open vSwitch) is a software virtual switch deployed on servers for packet forwarding in virtual networks. The OVS-DPDK-based aggregated member port traffic load migration involves using DPDK (Data Plane Development Kit) technology to accelerate and optimize the performance of OVS, especially in handling large-scale network traffic and virtual machines. Accordingly, the OVS-DPDK-based aggregated member port traffic load migration refers to dynamically adjusting the load of aggregated member ports (i.e., virtual ports participating in traffic aggregation) during the process of virtual network packet forwarding using OVS-DPDK, to achieve balanced distribution of traffic and optimized utilization of resources.

[0055] In the current OVS traffic migration mechanism, the migration decision is based on the comparison of the traffic difference between two member ports. Specifically, when the difference exceeds 100000 bytes, and the difference is also greater than 3% of the traffic at the migration destination, traffic migration is triggered. However, this setting faces challenges in high-speed network environments.

[0056] Considering that the physical network cards equipped in current mainstream servers generally have a limit speed of 25Gbps or even higher, which is a very large number when converted to bytes. In contrast, the 100000-byte migration trigger threshold is relatively small. This means that in the case of low overall network traffic, far from reaching the limit speed of the network card, traffic migration may be frequently triggered due to the small traffic difference between member ports. Traffic migration itself is not a cost-free operation. It requires the OVS revalidator process to intervene and refresh the flow table. Frequent flow table refresh not only increases overhead, but also may cause a series of problems. The most notable of which is that it may cause probabilistic packet loss, thereby affecting the stability of the network and the integrity of data transmission.

[0057] Therefore, this setting in the current OVS traffic migration mechanism may lead to unnecessary traffic migration and frequent flow table refresh in high-speed, low-traffic network environments. This not only wastes resources, but also may negatively impact the stability and performance of the network.

[0058] To improve this situation, the traffic migration trigger conditions of OVS can be adjusted. By setting a more reasonable threshold that matches the limit speed of the network card and the network environment, unnecessary traffic migration and flow table refresh can be effectively reduced, thereby improving the stability and performance of the network. At the same time, this will also help OVS better adapt to future high-speed, high-density network environments.

[0059] In an exemplary embodiment, the present embodiment provides a traffic migration method, which is applied to a host computer as an example. The host computer is configured with a virtual switch OVS bridge, and the OVS bridge is connected with at least one aggregation member port.

[0060] It can be understood that in the OVS (Open vSwitch) and traffic migration scenarios, the host computer refers to a physical server that deploys an OVS virtual switch and runs virtual machines or containers thereon. These virtual machines or containers communicate through the OVS, and the OVS is responsible for forwarding network traffic within the host computer and between host computers. The suggestion of adding a traffic migration threshold configuration on the OVS aggregation port is to better control the frequency of traffic migration and avoid unnecessary migration when the traffic is low or the network condition is stable. This threshold value can be dynamically adjusted according to the bandwidth limit of the aggregation port member port network card on the host computer and the actual network traffic on the host computer. By setting a reasonable threshold value, unnecessary flow table refreshing and traffic migration can be reduced while ensuring network performance, thereby reducing the risk of network packet loss.

[0061] In an exemplary embodiment, as shown in Figure 1 the above traffic migration method comprises:

[0062] S101, obtaining the traffic migration threshold value corresponding to each aggregation member port, the to-be-forwarded traffic, and the total number of the to-be-forwarded traffic.

[0063] The to-be-forwarded traffic refers to the network traffic that is currently transmitted through the aggregation member port but has not been forwarded. Specifically, it refers to the amount of data that has reached the aggregation member port and is waiting to be sent to the next network node (such as another server, network device, or end user).

[0064] In the present embodiment, the traffic migration threshold value corresponding to each aggregation member port is determined according to the bandwidth limit value of the aggregation member port. During the deployment or configuration phase, the administrator can pre-set a traffic migration threshold value for each aggregation member port according to the network policy, the bandwidth limit of the aggregation member port, and the actual demand. These threshold values are stored in a configuration file or provided and managed through a network management interface (such as an API, a command line interface, etc.). When obtaining the traffic migration threshold value of a certain aggregation member port, the value will be first read from the configuration file. If the configuration file does not directly provide the threshold value or is designed to dynamically calculate the threshold value according to the bandwidth limit, the bandwidth limit value of the aggregation member port will be obtained. According to a pre-set algorithm or rule (for example, threshold value = bandwidth limit value × a certain proportion coefficient), the traffic migration threshold value of the aggregation member port is calculated.

[0065] S102, if the total traffic of any of the aggregated member ports exceeds the traffic migration threshold of the corresponding aggregated member port, the aggregated member port is marked as a source member port.

[0066] When the monitoring period starts, the traffic migration thresholds of all aggregated member ports are obtained (these values can be pre-configured or dynamically calculated according to bandwidth throttling). At the same time, the network traffic on each aggregated member port is monitored in real time, and the total traffic of each member port is calculated. For each aggregated member port, the current total traffic is compared with the corresponding traffic migration threshold. If the total traffic of a member port is greater than or equal to the threshold, the next step is entered; otherwise, the traffic of the member port is continuously monitored.

[0067] It can be understood that when the total traffic of an aggregated member port is found to exceed the threshold, the member port is marked as a source member port. This usually means that the current traffic carried by the member port is large, and it may be considered to migrate part of the traffic to other member ports to balance the load or avoid congestion. After being marked as a source member port, the subsequent traffic migration decision process can be triggered. This may include determining the target member port for migration, calculating the amount of traffic to be migrated, updating the flow table, and other operations.

[0068] S103, according to the total traffic of each of the aggregated member ports other than the source member port, selecting the traffic to be migrated from the traffic to be forwarded of the source member port, and selecting the destination member port corresponding to the traffic to be migrated from each of the aggregated member ports other than the source member port.

[0069] It can be understood that the current total traffic of all aggregated member ports other than the source member port is obtained. These data can be used to evaluate the load of each member port and determine which member ports have the ability to receive additional traffic.

[0070] Further, the traffic to be forwarded of the source member port is analyzed in detail, which may include the type, size, priority and other attributes of the traffic. According to these attributes, it can be determined which traffic can be migrated and the priority of migration. Based on the results of traffic analysis, a part of the traffic to be forwarded of the source member port is selected as the traffic to be migrated. The selection criteria may include the priority, size, sensitivity to delay of the traffic, and the load of the source member port and other member ports.

[0071] Then, the load capacity and current traffic situation of all other member ports are evaluated to determine which member ports are suitable as destination member ports to receive the migrated traffic. The evaluation can consider factors such as the bandwidth, latency, packet loss rate, and other performance indicators of the member ports, as well as whether the current traffic load is close to its capacity limit. Based on the evaluation results, one or more suitable destination member ports are selected for the traffic to be migrated. The selection can be based on various strategies, such as selecting the member port with the lowest load, selecting the member port with the highest available bandwidth, or distributing according to some load balancing algorithm. Once the traffic to be migrated and the destination member ports are determined, the migration operation can be performed. This can involve updating flow tables, modifying routing rules, or redirecting traffic from the source member port to the destination member port through other mechanisms.

[0072] S104, migrating the traffic to be migrated from the source member port to the destination member port.

[0073] Specifically, before migration, a clear migration strategy is first formulated based on factors such as network conditions, traffic characteristics, migration targets, etc. The migration strategy can include the timing of migration, the size of traffic to be migrated, the priority of migration, the path of migration, etc. Ensure that the destination member port has the ability to receive the migrated traffic, including sufficient bandwidth, processing capacity and storage resources. Perform necessary configuration on the source member port and the destination member port, such as updating routing tables, flow tables, etc., to ensure that the traffic can be correctly migrated.

[0074] One or more migration channels are established between the source member port and the destination member port for transmitting the traffic to be migrated. The migration channel can be a direct physical link, or a logical link established through virtual network, tunneling technology, etc. Deploy a traffic identification mechanism on the source member port to accurately identify the traffic to be migrated. Use traffic interception techniques such as flow table rules, filters, etc. to separate the traffic to be migrated from the normal traffic of the source member port. Modify the traffic forwarding rules of the source member port to redirect the traffic to be migrated to the migration channel, so that it can be transmitted along the preset path to the destination member port. The traffic to be migrated is transmitted to the destination member port through the migration channel.

[0075] The above flow migration method, in the traditional technology, since the migration trigger threshold (such as 100000 bytes) is very small relative to the speed limit (such as 25Gbps) of the high-speed network card, it is easy to cause the flow migration to be frequently triggered when the overall network flow is low. The present application dynamically determines the flow migration threshold value according to the bandwidth limit value of the aggregation member port, ensures that the threshold value matches the actual processing capacity of the network card, thereby greatly reducing the number of unnecessary flow migrations. In addition, the technical scheme of the present application considers the total flow of each aggregation member port when selecting the flow to be migrated and the destination member port, so that the flow can be more reasonably distributed, avoiding the situation that some member ports are overloaded while other member ports are idle. This way of optimizing the flow distribution helps to improve the utilization rate of network resources and the overall performance. The technical scheme of the present application does not rely on a fixed migration trigger threshold, but dynamically determines the threshold value according to the bandwidth limit value of the aggregation member port. This makes the scheme adaptable to different network environments and different network card speed limits, enhancing the scalability and flexibility.

[0076] In an exemplary embodiment, as shown in Figure 2 The method comprises:

[0077] S201, for each aggregation member port, obtaining an initial migration threshold value of the aggregation member port.

[0078] Optionally, after obtaining the migration threshold value, verification is performed to ensure that the values are reasonable and effective. The verification can include checking whether the threshold value is within the expected range, and whether it is consistent with the actual bandwidth limit of the aggregation member port and the network policy.

[0079] S202, verifying whether the initial migration threshold value is greater than a set empirical total flow and less than a dynamic upper limit value corresponding to the aggregation member port.

[0080] The dynamic upper limit value corresponding to the aggregation member port is determined according to the bandwidth limit value of the aggregation member port; specifically, the dynamic upper limit value corresponding to the aggregation member port is one fourth of the bandwidth limit value of the aggregation member port.

[0081] The specific verification process is as follows:

[0082] The OVS master process listens for configuration change events. When it receives a message about a change in the aggregate port traffic migration threshold configuration, it triggers the subsequent processing flow. The OVS master process reads the currently set aggregate port traffic migration threshold from the database. It checks whether the threshold is too small: if the read threshold is less than 100,000 bytes (i.e., the default minimum value), it considers the value unreasonable and sets the threshold to the default 100,000 bytes. It obtains the bandwidth limit value of the aggregate member port and converts it to bytes (if it was not originally in bytes). If the threshold exceeds 1 / 4 of the member port bandwidth limit, it considers the value too large and adjusts the threshold to 1 / 4 of the member port bandwidth limit in bytes.

[0083] If the threshold value is not explicitly specified in the command line, the OVS master process performs the following steps: it obtains the bandwidth limit value of the aggregate member port. It converts the bandwidth limit value to bytes. It calculates 1 / 4 of the value and uses it as the traffic migration threshold. It applies the verified and adjusted threshold value to the OVS configuration, ensuring that traffic migration decisions are based on a reasonable threshold value.

[0084] Then, the OVS master process should continuously monitor configuration changes to ensure that it can obtain and apply new values in a timely manner when the threshold value changes. If network policies or member port bandwidth limits change, the threshold value should be automatically updated to maintain consistency.

[0085] S203, if yes, the initial migration threshold value is set as the traffic migration threshold value corresponding to the aggregate member port.

[0086] Optionally, if the initial migration threshold value passes all the verifications, it can now be officially set as the traffic migration threshold value corresponding to the aggregate member port. This usually involves writing the threshold value to the network traffic management configuration file or applying the threshold value to the corresponding aggregate member port through the network management interface. Even if the threshold value has been set, it should continue to monitor its reasonableness and effectiveness. Periodically or according to changes in network conditions, re-verify the threshold value to ensure that it is still between the total experienced traffic and the dynamic upper limit value, and adjust it accordingly.

[0087] In an exemplary embodiment, as shown in FIG. 1, the method for selecting the to-be-migrated traffic from the to-be-forwarded traffic of the source member port according to the total traffic of each other aggregate member port other than the source member port, and selecting the destination member port corresponding to the to-be-migrated traffic from each other aggregate member port, comprises: Figure 3

[0088] S301, determining the traffic difference between the total traffic of the source member port and the total traffic of each other aggregate member port other than the source member port.

[0089] ​Optionally, for the source member port, obtain its current total traffic (denoted as SourceTotal) from the traffic monitoring or statistics module. For each other aggregation member port besides the source member port, similarly obtain its current total traffic (denoted as OtherTotal_i, where i represents the i-th other aggregation member port). For each other aggregation member port, calculate the difference between its total traffic and that of the source member port, i.e., Difference_i = OtherTotal_i - SourceTotal.

[0090] S302, Select the largest flow difference from the various flow differences.

[0091] Set an initial maximum traffic difference (MaxDifference) as a very small number (e.g., negative infinity), and its corresponding index (MaxIndex) as -1. Iterate through all calculated traffic differences (Difference_i). For each Difference_i, if it is greater than the current MaxDifference, update MaxDifference to Difference_i and update MaxIndex to i. After the iteration is complete, MaxDifference is the maximum traffic difference, and MaxIndex corresponds to the index of other aggregate member ports with this maximum difference.

[0092] S303 selects the traffic with the largest traffic difference from the traffic to be forwarded from the source member port as the migration traffic.

[0093] Specifically, the size of traffic migrated from the source member port is determined based on MaxDifference. Here, the maximum traffic difference is directly used as the size of the migrated traffic. Traffic of the MaxDifference value is selected from the source member port's queue or list of traffic to be forwarded as the migrated traffic. This can be achieved through various strategies, such as selecting the earliest arriving traffic, the lowest priority traffic, or traffic selected according to a certain algorithm.

[0094] S304, take the aggregation member port corresponding to the largest traffic difference among the other aggregation member ports as the destination member port corresponding to the traffic to be migrated.

[0095] Use MaxIndex to find the corresponding destination member port from other aggregate member port lists. Record the found destination member port for subsequent traffic migration operations.

[0096] In one exemplary embodiment, such as Figure 4 As shown, the method retrieves the traffic to be forwarded and the total amount of traffic to be forwarded for each aggregation member port, including:

[0097] S401, acquire the flow array structure stored in the OVS bridge.

[0098] The flow array structure is used to store the flow description information of each to-be-forwarded flow and the aggregation member port allocated for each to-be-forwarded flow.

[0099] It can be understood that in the OVS, the bridge is a virtual switch connecting different interfaces (including aggregation ports). Each OVS bridge has its corresponding data structure, which contains all the interfaces, flow tables, flow statistics, and other information related to the bridge. Access this data structure to obtain the flow array structure. In the data structure of the bridge, the flow array structure storing the to-be-forwarded flow is found. This array structure usually contains the description information of the flow (such as five-tuple, priority, VLAN tag, etc.) and the aggregation member port information allocated for each flow.

[0100] Further, the flow description information of each to-be-forwarded flow is generated according to the five-tuple information of the to-be-forwarded flow. The flow description information of each to-be-forwarded flow is obtained by hashing the five-tuple information of the to-be-forwarded flow.

[0101] It can be understood that for each flow sent, its five-tuple information is extracted: source IP address, destination IP address, four-layer protocol type (such as TCP, UDP), source port number, and destination port number. Using the extracted five-tuple information as input, a Hash value is calculated through a certain Hash algorithm (such as MD5, SHA-1, etc., depending on the implementation of OVS).

[0102] The calculated Hash value is bitwise ANDed with 0xFF (i.e., the hexadecimal representation of 255) to obtain an integer between 0 and 255, which is an array index of the bond_entry pointer array. The calculated array index is used to access the bond_entry pointer array to obtain the bond_entry structure at the corresponding index. This structure contains the member port flow information and flow statistics information related to a specific flow.

[0103] When sending to-be-sent flow, a suitable member port can be selected to send the flow according to the information in the bond_entry structure. The strategy for selecting the member port can be based on multiple factors, such as the current load of the member port, link state, priority, etc. After selecting the member port and sending the flow, the flow statistics information in the bond_entry structure is updated for subsequent flow analysis and load balancing decisions.

[0104] S402, according to the flow array structure, determine the to-be-forwarded flow corresponding to each aggregation member port and the total number of to-be-forwarded flows.

[0105] The flow description information, especially the assigned aggregated member port identifier, is extracted. According to the aggregated member port identifier, the corresponding record in the temporary data structure is looked up. If the record does not exist, a new record is created. The current flow is added to the list of pending forwarding flows of the aggregated member port. The total flow size of the aggregated member port is updated, usually by adding the size of the current flow (in bytes). For each aggregated member port, the size of all flows in its list of pending forwarding flows is accumulated to get the total flow size of the member port. This total flow size can be used for subsequent flow management decisions, such as load balancing, flow migration, etc. The information in the temporary data structure is organized into the required format and returned to the caller. This usually includes the identifier of each aggregated member port, the list of pending forwarding flows (possibly encapsulated in some form), and the total flow size.

[0106] In an exemplary embodiment, in the above flow migration method, two OVS bridges are created on the host, one of which (as the first OVS bridge) is used to forward the traffic sent by the virtual machine or send the traffic to the designated virtual machine. The other bridge is bound to two physical network cards and is configured in dynamic aggregation mode. This OVS bridge (as the second OVS bridge) is responsible for tunneling the packets sent by the virtual machine and sending the packets to the underlying network or receiving the tunnel packets from the underlying network and forwarding the inner packets after decapsulation to the virtual network.

[0107] The above-mentioned second OVS bridge triggers the flow migration process periodically. First, check whether the flow difference between the two member ports is greater than or equal to the configured threshold value, and the difference exceeds 3% of the total flow size of the existing pending forwarding flows of the destination member port. When the above conditions are met, select part of the flow from the member port with larger current flow according to the five-tuple information of the inner packet and migrate it to the destination member port. When the flow sizes of the member ports are close, the migration process ends. Wait for the next round of flow migration processing. By combining the two ways of increasing the flow migration threshold configuration item and the OVS automatically calculating the flow migration threshold value according to the aggregated member port bandwidth value, the frequency of flow switching is reduced, and the stability of OVS forwarding is improved.

[0108] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps.

[0109] Based on the same inventive concept, the embodiments of the present application also provide a flow migration device for implementing the flow migration method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more flow migration device embodiments provided below can refer to the limitations of the flow migration method in the above text, which will not be repeated here.

[0110] In one exemplary embodiment, as shown in Figure 5 A flow migration device is provided, comprising: an acquisition module 11, a threshold verification module 12, a migrated flow selection module 13, and a flow migration module 14; wherein,

[0111] The acquisition module 11 is configured to acquire a flow migration threshold value corresponding to each aggregation member port, to-be-forwarded traffic, and a total amount of traffic of the to-be-forwarded traffic; wherein the flow migration threshold value corresponding to each aggregation member port is determined according to a bandwidth limiting value of the aggregation member port;

[0112] The threshold verification module 12 is configured to, if the total amount of traffic corresponding to any aggregation member port exceeds the flow migration threshold value corresponding to the aggregation member port, take the aggregation member port as a source member port;

[0113] The migrated flow selection module 13 is configured to select to-be-migrated traffic from the to-be-forwarded traffic of the source member port according to the total amount of traffic corresponding to each other aggregation member port other than the source member port, and select a destination member port corresponding to the to-be-migrated traffic from each other aggregation member port;

[0114] The flow migration module 14 is configured to migrate the to-be-migrated traffic from the source member port to the destination member port.

[0115] In one embodiment, the acquisition module 11 is further configured to: for each aggregation member port, acquire an initial migration threshold value of the aggregation member port;

[0116] verify whether the initial migration threshold is greater than the set empirical total traffic volume and less than a dynamic upper limit value corresponding to the aggregated member port; wherein the dynamic upper limit value corresponding to the aggregated member port is determined according to a broadband limit value of the aggregated member port;

[0117] If yes, the initial migration threshold is taken as a traffic migration threshold corresponding to the aggregated member port.

[0118] In one embodiment, the dynamic upper limit value corresponding to the aggregated member port is one fourth of the broadband limit value of the aggregated member port.

[0119] In one embodiment, the traffic migration module 14 is further configured to determine a traffic difference value between the total traffic volume corresponding to the source member port and the total traffic volume corresponding to each of the other aggregated member ports except the source member port.

[0120] Select a maximum traffic difference value from the traffic difference values.

[0121] From the to-be-forwarded traffic of the source member port, select traffic of the maximum traffic difference value as the migration traffic.

[0122] From the aggregated member ports corresponding to the maximum traffic difference values among the other aggregated member ports, select an aggregated member port corresponding to a maximum traffic difference value as a destination member port corresponding to the to-be-migrated traffic.

[0123] In one embodiment, the obtaining module 11 is further configured to obtain a traffic array structure stored in the OVS bridge; wherein the traffic array structure is configured to store traffic description information of each to-be-forwarded traffic and an aggregated member port allocated for each to-be-forwarded traffic; and the traffic description information of each to-be-forwarded traffic is generated according to five-tuple information of the to-be-forwarded traffic.

[0124] According to the traffic array structure, determine the to-be-forwarded traffic corresponding to each aggregated member port and the total traffic volume of the to-be-forwarded traffic.

[0125] In one embodiment, the traffic description information of each to-be-forwarded traffic is obtained by performing a hash operation on the five-tuple information of the to-be-forwarded traffic.

[0126] Each module in the above traffic migration device can be realized by software, hardware and a combination thereof in whole or in part. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so as to be called and executed by a processor to perform operations corresponding to each module.

[0127] In one exemplary embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in Figure 6The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected through a system bus. The communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be implemented through WIFI, mobile cellular network, Near Field Communication (NFC), or other technologies. The computer program is executed by the processor to implement a traffic migration method. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or can be a key, a trackball, or a touchpad arranged on the shell of the computer device. The input device can also be an external keyboard, a touchpad, or a mouse, etc.

[0128] Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0129] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps:

[0130] obtaining a traffic migration threshold value corresponding to each aggregation member port, to-be-forwarded traffic, and a total amount of to-be-forwarded traffic; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to a bandwidth limiting value of the aggregation member port;

[0131] If the total amount of traffic corresponding to any aggregation member port exceeds the traffic migration threshold value corresponding to the aggregation member port, the aggregation member port is taken as a source member port;

[0132] selecting, from the to-be-forwarded traffic of the source member port, to-be-migrated traffic according to the total amount of traffic corresponding to each of the other aggregated member ports except the source member port, and selecting, from each of the other aggregated member ports, a destination member port corresponding to the to-be-migrated traffic;

[0133] migrating the to-be-migrated traffic from the source member port to the destination member port.

[0134] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program, which, when executed by a processor, implements the following steps:

[0135] obtaining a traffic migration threshold value corresponding to each aggregated member port, to-be-forwarded traffic, and a total amount of traffic of the to-be-forwarded traffic; wherein the traffic migration threshold value corresponding to each aggregated member port is determined according to a bandwidth limit value of the aggregated member port;

[0136] if the total amount of traffic corresponding to any aggregated member port exceeds the traffic migration threshold value corresponding to the aggregated member port, taking the aggregated member port as a source member port;

[0137] selecting, from the to-be-forwarded traffic of the source member port, to-be-migrated traffic according to the total amount of traffic corresponding to each of the other aggregated member ports except the source member port, and selecting, from each of the other aggregated member ports, a destination member port corresponding to the to-be-migrated traffic;

[0138] migrating the to-be-migrated traffic from the source member port to the destination member port.

[0139] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0140] obtaining a traffic migration threshold value corresponding to each aggregated member port, to-be-forwarded traffic, and a total amount of traffic of the to-be-forwarded traffic; wherein the traffic migration threshold value corresponding to each aggregated member port is determined according to a bandwidth limit value of the aggregated member port;

[0141] if the total amount of traffic corresponding to any aggregated member port exceeds the traffic migration threshold value corresponding to the aggregated member port, taking the aggregated member port as a source member port;

[0142] selecting, from the to-be-forwarded traffic of the source member port, to-be-migrated traffic according to the total amount of traffic corresponding to each of the other aggregated member ports except the source member port, and selecting, from each of the other aggregated member ports, a destination member port corresponding to the to-be-migrated traffic;

[0143] migrating the to-be-migrated traffic from the source member port to the destination member port.

[0144] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0145] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.

[0146] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A traffic migration method, characterized by, The application is applied to a host computer, wherein two virtual switch (OVS) bridges are configured on the host computer, and at least one aggregation member port is connected to the OVS bridge; the method comprises the following steps: Obtaining a traffic migration threshold value corresponding to each aggregation member port, a to-be-forwarded traffic and a total amount of the to-be-forwarded traffic; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to a bandwidth limit value of the aggregation member port; If the total amount of any aggregation member port exceeds the traffic migration threshold value corresponding to the aggregation member port, the aggregation member port is used as a source member port; Determining a traffic difference value between the total amount of the source member port and the total amount of each other aggregation member port except the source member port; Selecting a maximum traffic difference value from each traffic difference value; Selecting a traffic of the maximum traffic difference value from the to-be-forwarded traffic of the source member port as a migration traffic; Selecting an aggregation member port corresponding to the maximum traffic difference value from each other aggregation member port as a destination member port corresponding to a to-be-migrated traffic; Migrating the to-be-migrated traffic from the source member port to the destination member port. Two OVS bridges are created on the host computer, a first OVS bridge is used for forwarding traffic sent by a virtual machine or sending traffic to a specified virtual machine, a second OVS bridge is bound to two physical network cards and is configured in a dynamic aggregation mode, and the second OVS bridge is responsible for tunnel encapsulation of a packet sent by a virtual machine and sending the packet to a basic network or receiving a tunnel packet from the basic network, and is responsible for decapsulation of the tunnel packet and forwarding an inner packet after the decapsulation to a virtual network.

2. The method of claim 1, wherein, Obtaining a traffic migration threshold value corresponding to each aggregation member port comprises the following steps: For each aggregation member port, obtaining an initial migration threshold value of the aggregation member port; Verifying whether the initial migration threshold value is greater than a set empirical total amount and less than a dynamic upper limit value corresponding to the aggregation member port; wherein the dynamic upper limit value corresponding to the aggregation member port is determined according to a bandwidth limit value of the aggregation member port; If yes, the initial migration threshold value is used as the traffic migration threshold value corresponding to the aggregation member port.

3. The method of claim 2, wherein, The dynamic upper limit value corresponding to the aggregation member port is one fourth of the bandwidth limit value of the aggregation member port.

4. The method of claim 1, wherein, Obtaining a to-be-forwarded traffic corresponding to each aggregation member port and a total amount of the to-be-forwarded traffic comprises the following steps: Obtaining a traffic array structure stored in the OVS bridge; wherein the traffic array structure is used for storing traffic description information of each to-be-forwarded traffic and an aggregation member port allocated for each to-be-forwarded traffic; the traffic description information of each to-be-forwarded traffic is generated according to five-tuple information of the to-be-forwarded traffic; According to the traffic array structure, determining the to-be-forwarded traffic corresponding to each aggregation member port and the total amount of the to-be-forwarded traffic.

5. The method of claim 4, wherein, The traffic description information of each to-be-forwarded traffic is obtained by performing a hash operation on the five-tuple information of the to-be-forwarded traffic.

6. A traffic migration apparatus, characterized by, The application is applied to a host computer, wherein two virtual switch (OVS) bridges are configured on the host computer, and at least one aggregation member port is connected to the OVS bridge; the method comprises the following steps: The acquisition module is configured to acquire a traffic migration threshold corresponding to each of the aggregated member ports, to-be-forwarded traffic, and a total amount of traffic of the to-be-forwarded traffic; wherein the traffic migration threshold corresponding to each of the aggregated member ports is determined according to a bandwidth limiting value of the aggregated member port; The threshold verification module is configured to, if the total amount of traffic corresponding to any of the aggregated member ports exceeds the traffic migration threshold corresponding to the aggregated member port, take the aggregated member port as a source member port; The migrated traffic selection module is configured to determine a traffic difference value between the total amount of traffic corresponding to the source member port and the total amount of traffic corresponding to each of other aggregated member ports except the source member port, select a maximum traffic difference value from the traffic difference values, select traffic in an amount of the maximum traffic difference value from the to-be-forwarded traffic of the source member port as migrated traffic, and take an aggregated member port corresponding to the maximum traffic difference value from each of the other aggregated member ports as a destination member port corresponding to to-be-migrated traffic. The traffic migration module is configured to migrate the to-be-migrated traffic from the source member port to the destination member port. Two OVS bridges are created on the host computer, a first OVS bridge is used to forward traffic sent by a virtual machine or send traffic to a specified virtual machine, and a second OVS bridge is bound to two physical network cards and is configured in a dynamic aggregation mode, the second OVS bridge is responsible for tunnel encapsulation of a packet sent by a virtual machine and sending the packet to a basic network or receiving a tunnel packet from the basic network, and then decapsulating and forwarding the inner packet to a virtual network. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.

9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Flow sharing method and equipment

    CN104821922A

  • Data stream segmentation method, device and equipment and computer readable storage medium

    CN117579543A