Traffic migration method and device, computer equipment and computer readable storage medium
By dynamically determining the traffic migration threshold value of the OVS aggregation member port, the problem of unnecessary traffic migration in the existing technology is solved, and more reasonable traffic allocation and network performance improvement is achieved.
Patent Information
- Application Number
- CN202411722320.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-28
AI Technical Summary
When setting migration conditions, the existing OVS traffic migration mechanism fails to fully consider changes in the actual network conditions, resulting in unnecessary traffic migration under normal network traffic fluctuations.
By dynamically determining the traffic migration threshold of the aggregation member port, the broadband speed limit value of the aggregation member port ensures that the threshold value matches the actual processing capacity of the network card, thereby reducing unnecessary traffic migration.
It effectively reduces unnecessary traffic migration times, allocates traffic reasonably, and avoids some member ports being overloaded while other member ports are idle, thereby improving the utilization rate and overall performance of network resources.
Smart Images

Figure CN119520439A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a traffic migration method, apparatus, computer equipment, and computer-readable storage medium. Background Art
[0002] Open vSwitch (OVS) is an open source virtual switch that is widely used in cloud computing scenarios. At the same time, in order to improve its forwarding performance, the Data Plane Development Kit (DPDK) acceleration solution was introduced, which enables data to be forwarded directly in user mode, greatly improving the forwarding performance of OVS.
[0003] When the DPDK (Data Plane Development Kit) acceleration solution is introduced in OVS (Open vSwitch), data packets are directly forwarded in user mode and will not be processed in kernel mode, so the aggregation port provided by the kernel module cannot be used. To solve this problem, the OVS user-mode process provides its own aggregation port implementation method, allowing physical network cards bound to user-mode drivers to be added to the OVS user-mode bridge. The aggregation port implemented in user mode by OVS includes a dynamic aggregation mode, which has the function of traffic migration, aiming to balance the traffic between aggregation member ports and avoid overloading a single aggregation member port.
[0004] However, the current traffic migration mechanism may not fully consider the changes in actual network conditions when setting migration conditions. In complex network environments such as cloud computing, network traffic is highly dynamic and uncertain. If the migration conditions are set too sensitively, unnecessary traffic migration may occur even under normal network traffic fluctuations. Summary of the invention
[0005] Based on this, it is necessary to provide a traffic migration method, device, computer equipment and computer-readable storage medium that can optimize the traffic migration process in response to the above-mentioned technical problems.
[0006] In a first aspect, the present application provides a traffic migration method, which is applied to a host machine, wherein a virtual switch OVS bridge is configured on the host machine, and the OVS bridge is connected to at least one aggregation member port; the method comprises:
[0007] Obtaining the traffic migration threshold value, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded corresponding to each aggregation member port; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0008] If the total traffic volume of any aggregation member port exceeds the traffic migration threshold of the aggregation member port, the aggregation member port is used as the source member port.
[0009] According to the total number of flows corresponding to the other aggregation member ports other than the source member port, the flow to be migrated is selected from the flow to be forwarded of the source member ports, and the destination member port corresponding to the flow to be migrated is selected from the other aggregation member ports;
[0010] Migrate the traffic to be migrated from the source member port to the destination member port.
[0011] In an exemplary embodiment, obtaining a traffic migration threshold corresponding to each aggregation member port includes:
[0012] For each aggregation member port, obtain the initial migration threshold value of the aggregation member port;
[0013] Verify whether the initial migration threshold is greater than the set total amount of experience traffic and less than the dynamic upper limit corresponding to the aggregation member port; wherein the dynamic upper limit corresponding to the aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0014] If so, the initial migration threshold is used as the traffic migration threshold corresponding to the aggregation member port.
[0015] In an exemplary embodiment, the dynamic upper limit value corresponding to the aggregation member port is one quarter of the bandwidth rate limit value of the aggregation member port.
[0016] In an exemplary embodiment, according to the total amount of traffic corresponding to each other aggregation member port 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 other aggregation member port, includes:
[0017] Determine the traffic difference between the total traffic amount corresponding to the source member port and the total traffic amount corresponding to each other aggregation member port other than the source member port;
[0018] Select the maximum flow difference from each flow difference;
[0019] Select the traffic with the largest traffic difference from the traffic to be forwarded on the source member port as the migration traffic.
[0020] The aggregation member interface corresponding to the maximum traffic difference among the other aggregation member interfaces is used as the destination member interface corresponding to the traffic to be migrated.
[0021] In an exemplary embodiment, obtaining the to-be-forwarded traffic and the total traffic volume of the to-be-forwarded traffic corresponding to each aggregation member port includes:
[0022] Obtain the traffic array structure stored in the OVS bridge; wherein the traffic array structure is used to store the traffic description information of each traffic to be forwarded and the aggregation member port allocated to each traffic to be forwarded; the traffic description information of each traffic to be forwarded is generated according to the five-tuple information of the traffic to be forwarded;
[0023] According to the traffic array structure, the to-be-forwarded traffic corresponding to each aggregation member port and the total traffic volume of the to-be-forwarded traffic are determined.
[0024] In an exemplary 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.
[0025] In a second aspect, the present application also provides a flow migration device, including:
[0026] An acquisition module is used to obtain the traffic migration threshold value corresponding to each aggregation member port, the traffic to be forwarded and the total traffic volume of the traffic to be forwarded; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0027] A threshold verification module is used to use the aggregation member port as a source 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;
[0028] A migration traffic selection module is used to select the traffic to be migrated from the traffic to be forwarded of the source member port according to the total number of traffic corresponding to each other aggregation member port other than the source member port, and select the destination member port corresponding to the traffic to be migrated from each other aggregation member port;
[0029] The traffic migration module is used to migrate the traffic to be migrated from the source member port to the destination member port.
[0030] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0031] Obtaining the traffic migration threshold value, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded corresponding to each aggregation member port; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0032] If the total traffic volume of any aggregation member port exceeds the traffic migration threshold of the aggregation member port, the aggregation member port is used as the source member port.
[0033] According to the total number of flows corresponding to the other aggregation member ports other than the source member port, the flow to be migrated is selected from the flow to be forwarded of the source member ports, and the destination member port corresponding to the flow to be migrated is selected from the other aggregation member ports;
[0034] Migrate the traffic to be migrated from the source member port to the destination member port.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0036] Obtaining the traffic migration threshold value, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded corresponding to each aggregation member port; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0037] If the total traffic volume of any aggregation member port exceeds the traffic migration threshold of the aggregation member port, the aggregation member port is used as the source member port.
[0038] According to the total number of flows corresponding to the other aggregation member ports other than the source member port, the flow to be migrated is selected from the flow to be forwarded of the source member ports, and the destination member port corresponding to the flow to be migrated is selected from the other aggregation member ports;
[0039] Migrate the traffic to be migrated from the source member port to the destination member port.
[0040] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0041] Obtaining the traffic migration threshold value, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded corresponding to each aggregation member port; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0042] If the total traffic volume of any aggregation member port exceeds the traffic migration threshold of the aggregation member port, the aggregation member port is used as the source member port.
[0043] According to the total number of flows corresponding to the other aggregation member ports other than the source member port, the flow to be migrated is selected from the flow to be forwarded of the source member ports, and the destination member port corresponding to the flow to be migrated is selected from the other aggregation member ports;
[0044] Migrate the traffic to be migrated from the source member port to the destination member port.
[0045] The above-mentioned traffic migration method, device, computer equipment and computer-readable storage medium, the present application ensures that the threshold value matches the actual processing capacity of the network card by dynamically determining the traffic migration threshold value according to the broadband speed limit value of the aggregated member port, thereby greatly reducing the number of unnecessary traffic migrations. In addition, when selecting the traffic to be migrated and the destination member port, the technical solution of the present application takes into account the total traffic of each aggregated member port, so that the traffic can be allocated more reasonably, avoiding the situation where some member ports are overloaded while other member ports are idle. This way of optimizing traffic distribution helps to improve the utilization rate and overall performance of network resources. The technical solution of the present application does not rely on a fixed migration trigger threshold, but dynamically determines the threshold value according to the broadband speed limit value of the aggregated member port. This enables the solution to adapt to different network environments and the requirements of different network card speed limits, and enhances the scalability and flexibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings used in the embodiments of the present application or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] FIG1 is a schematic diagram of a flow chart of a traffic migration method in an embodiment;
[0048] FIG2 is a flow chart of a step of obtaining a flow migration threshold corresponding to each aggregation member port in an embodiment;
[0049] 3 is a flow chart of the step of selecting a destination member port corresponding to traffic to be migrated from other aggregation member ports in one embodiment;
[0050] 4 is a flow chart of the steps of obtaining the amount of traffic to be forwarded and the total amount of traffic to be forwarded corresponding to each aggregation member port in one embodiment;
[0051] FIG5 is a structural block diagram of a flow migration device in one embodiment;
[0052] FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] OVS (Open vSwitch) is a software virtual switch deployed on a server for packet forwarding in virtual networks. The OVS-DPDK-based aggregate member port traffic load migration involves using DPDK (Data Plane Development Kit) technology to accelerate and optimize OVS performance, especially when dealing with large-scale network traffic and virtual machines. Correspondingly, the OVS-DPDK-based aggregate member port traffic load migration refers to dynamically adjusting the load of aggregate member ports (i.e., virtual ports participating in traffic aggregation) in the process of forwarding virtual network packets using OVS-DPDK to achieve balanced traffic distribution and optimal resource utilization.
[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 100,000 bytes and is greater than 3% of the traffic of the migration destination, traffic migration will be triggered. However, this setting faces challenges in high-speed network environments.
[0056] Considering that the speed limit of physical network cards equipped in current mainstream servers is generally 25Gbps or even higher, this is an extremely large number when converted into bytes. In comparison, the migration trigger threshold of 100,000 bytes seems relatively small. This means that when the overall network traffic is low and far from reaching the speed limit of the network card, traffic migration may be triggered frequently just because of the slight traffic difference between member ports. Traffic migration itself is not a costless operation. It requires the intervention of the OVS revalidator process to refresh the flow table. Frequent flow table refreshes will not only increase overhead, but may also cause a series of problems. Among them, the most significant is that it may cause probabilistic packet loss, which in turn affects 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 refreshes in a high-speed, low-traffic network environment. This not only wastes resources, but may also have a negative impact on the stability and performance of the network.
[0058] To improve this situation, you can adjust the trigger conditions for OVS traffic migration. By setting a more reasonable threshold that matches the network card speed limit and network environment, you can effectively reduce unnecessary traffic migration and flow table refreshes, thereby improving network stability and performance. At the same time, this will also help OVS better adapt to future high-speed, high-density network environments.
[0059] In an exemplary embodiment, this embodiment provides a traffic migration method, which is described by taking the method applied to a host machine as an example. The host machine is configured with a virtual switch OVS bridge, and the OVS bridge is connected to at least one aggregation member port.
[0060] It is understandable that in OVS (Open vSwitch) and traffic migration scenarios, hosts refer to physical servers that have deployed OVS virtual switches and run virtual machines or containers on them. These virtual machines or containers communicate over the network through OVS, which is responsible for forwarding network traffic within and between hosts. The suggestion to add 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 is stable. This threshold value can be dynamically adjusted based on the bandwidth limit of the aggregation member port network card on the host and the actual network traffic on the current host. By setting a reasonable threshold value, you can reduce unnecessary flow table refreshes and traffic migrations while ensuring network performance, thereby reducing the risk of network packet loss.
[0061] In an exemplary embodiment, as shown in FIG1 , the traffic migration method includes:
[0062] S101, obtaining a traffic migration threshold, a to-be-forwarded traffic, and a total traffic volume of the to-be-forwarded traffic corresponding to each aggregation member port.
[0063] The traffic to be forwarded refers to the network traffic that is currently being transmitted through the aggregation member port but has not yet been forwarded. Specifically, it refers to the amount of data that has arrived at 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 this embodiment, the traffic migration threshold value corresponding to each aggregation member port is determined according to the bandwidth speed limit value of the aggregation member port. During the deployment or configuration stage, the administrator can pre-set a traffic migration threshold value for each aggregation member port based on the network policy, the bandwidth speed limit value of the aggregation member port, and the actual needs. These threshold values are stored in the configuration file, or provided and managed through the network management interface (such as API, command line interface, etc.). When obtaining the traffic migration threshold value of a certain aggregation member port, the value will first be tried to be read from the configuration file. If the threshold value is not directly provided in the configuration file, or it is designed to dynamically calculate the threshold value based on the bandwidth speed limit, then the bandwidth speed limit value of the aggregation member port will be obtained. According to the preset algorithm or rule (for example, threshold value = bandwidth speed limit value × a certain proportional coefficient), the traffic migration threshold value of the aggregation member port is calculated.
[0065] S102: If the total amount of traffic corresponding to any aggregation member port exceeds the traffic migration threshold corresponding to the aggregation member port, the aggregation member port is used as a source member port.
[0066] When starting or entering the monitoring cycle, the traffic migration threshold values of all aggregation member ports are first obtained (these values may be pre-configured or dynamically calculated based on the bandwidth limit). At the same time, the network traffic on each aggregation member port is monitored in real time, and the total traffic of each member port is calculated. For each aggregation member port, its current total traffic is compared with the corresponding traffic migration threshold value. If the total traffic of a member port is greater than or equal to its threshold value, proceed to the next step; otherwise, continue to monitor the traffic of the member port.
[0067] It is understandable that when the total traffic of a certain aggregation member port exceeds the threshold, the member port is marked as a "source member port". This usually means that the member port currently carries a large amount of traffic, and it may be considered to migrate part of its 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 operations such as determining the target member port for migration, calculating the amount of traffic to be migrated, and updating the flow table.
[0068] S103, according to the total amount of traffic corresponding to each other aggregation member port other than the source member port, select the traffic to be migrated from the traffic to be forwarded of the source member port, and select the destination member port corresponding to the traffic to be migrated from each other aggregation member port.
[0069] It is understandable that the total current traffic of all other aggregation member ports except the source member port is obtained. These data can be used to evaluate the load of each member port and determine which member ports are capable of receiving additional traffic.
[0070] Furthermore, 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. Based on these attributes, it can be determined which traffic can be migrated and the priority of migration. Based on the results of the traffic analysis, a portion 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, etc. of the traffic, as well as the load conditions of the source member port and other member ports.
[0071] Then, evaluate the load capacity and current traffic conditions of all other aggregation member ports to determine which member ports are suitable as destination member ports to receive the migrated traffic. The evaluation may consider factors such as performance indicators such as bandwidth, latency, and packet loss rate of the member ports, as well as whether the current traffic load is close to its capacity limit. Based on the evaluation results, select one or more suitable destination member ports for the traffic to be migrated. The selection may be based on a variety of strategies, such as selecting the member port with the lowest load, selecting the member port with the highest available bandwidth, or allocating it according to a load balancing algorithm. Once the traffic to be migrated and the destination member port are determined, the migration operation can be performed. This may involve updating the flow table, modifying the routing rules, or redirecting the traffic from the source member port to the destination member port through other mechanisms.
[0072] S104: Migrate the traffic to be migrated from the source member port to the destination member port.
[0073] Specifically, before migration, first formulate a clear migration strategy based on factors such as network conditions, traffic characteristics, and migration targets. The migration strategy may include the timing of migration, the size of the migration traffic, the migration priority, and the migration path. Ensure that the destination member port has the ability to receive the migration traffic, including sufficient bandwidth, processing power, and storage resources. Perform necessary configurations on the source member port and the destination member port, such as updating the routing table and flow table, to ensure that the traffic can be migrated correctly.
[0074] One or more migration channels are established between the source member port and the destination member port to transmit the traffic to be migrated. The migration channel can be a direct physical link or a logical link established by means of a virtual network, tunnel technology, etc. A traffic identification mechanism is deployed on the source member port to accurately identify the traffic to be migrated. Traffic interception technologies, such as flow table rules and filters, are used to separate the traffic to be migrated from the normal traffic of the source member port. The traffic forwarding rules of the source member port are modified to redirect the traffic to be migrated to the migration channel so that it can be transmitted to the destination member port along the preset path. The traffic to be migrated is transmitted to the destination member port through the migration channel.
[0075] In the above-mentioned traffic migration method, in the traditional technology, since the migration trigger threshold (such as 100,000 bytes) is very small relative to the speed limit of the high-speed network card (such as 25Gbps), it is easy to cause frequent triggering of traffic migration when the overall network traffic is low. The present application dynamically determines the traffic migration threshold value according to the broadband speed limit value of the aggregated member port, ensuring that the threshold value matches the actual processing capacity of the network card, thereby greatly reducing the number of unnecessary traffic migrations. In addition, when selecting the traffic to be migrated and the destination member port, the technical solution of the present application takes into account the total traffic of each aggregated member port, so that the traffic can be allocated more reasonably, avoiding the situation where some member ports are overloaded while other member ports are idle. This way of optimizing traffic distribution helps to improve the utilization rate and overall performance of network resources. The technical solution of the present application does not rely on a fixed migration trigger threshold, but dynamically determines the threshold value according to the broadband speed limit value of the aggregated member port. This enables the solution to adapt to the needs of different network environments and different network card speed limits, and enhances the scalability and flexibility.
[0076] In an exemplary embodiment, as shown in FIG2 , obtaining a traffic migration threshold corresponding to each aggregation member interface includes:
[0077] S201: For each aggregation member port, obtain an initial migration threshold value of the aggregation member port.
[0078] Optionally, after obtaining the migration threshold values, verification is performed to ensure that these values are reasonable and valid. Verification may include checking whether the threshold values are within the expected range and whether they are consistent with the actual bandwidth limit of the aggregation member ports and the network policy.
[0079] S202, verifying whether the initial migration threshold is greater than the set total amount of experienced traffic and less than the dynamic upper limit corresponding to the aggregation member port.
[0080] The dynamic upper limit value corresponding to the aggregation member port is determined according to the broadband speed limit value of the aggregation member port; specifically, the dynamic upper limit value corresponding to the aggregation member port is one quarter of the broadband speed limit value of the aggregation member port.
[0081] The specific verification process is as follows:
[0082] The OVS (Open vSwitch) master process listens for configuration change events. When it receives a message about a change in the configuration of the aggregate port traffic migration threshold, it triggers the subsequent processing flow. The OVS master process reads the currently set aggregate port traffic migration threshold from the database. Check whether the threshold is too small: If the read threshold is less than 100,000 bytes (that is, the default minimum value), the value is considered unreasonable and the threshold is set to the default 100,000 bytes. Get the bandwidth limit value of the aggregate member port and convert it to bytes (if it is not originally in bytes). If the threshold value exceeds 1 / 4 of the member port bandwidth limit, the value is considered too large and the threshold value is adjusted to 1 / 4 of the member port bandwidth limit (in bytes).
[0083] If the threshold is not explicitly specified in the command line, the OVS master process performs the following steps: Get the bandwidth limit value of the aggregation member port. Convert the bandwidth limit value to bytes. Calculate 1 / 4 of this value and use it as the threshold value for traffic migration. Apply the verified and adjusted threshold value to the OVS configuration to ensure that traffic migration decisions are made based on reasonable threshold values.
[0084] The OVS master process should then continuously monitor configuration changes to ensure that new values are acquired and applied in a timely manner when thresholds change. If network policies or member port bandwidth limits change, thresholds should be automatically updated to maintain consistency.
[0085] S203: If yes, use the initial migration threshold as the traffic migration threshold corresponding to the aggregation member port.
[0086] Optionally, if the initial migration threshold passes all validations, it can now be officially set as the traffic migration threshold for the aggregate member ports. This typically involves writing the threshold into a network traffic management configuration file or applying the threshold to the corresponding aggregate member ports through a network management interface. Even if the threshold has been set, its rationality and effectiveness should be continuously monitored. Revalidate the threshold periodically or as network conditions change to ensure that it is still between the total experienced traffic and the dynamic upper limit, and adjust accordingly.
[0087] In an exemplary embodiment, as shown in FIG3 , according to the total number of flows corresponding to each other aggregation member port other than the source member port, selecting the flow to be migrated from the flow to be forwarded of the source member port, and selecting the destination member port corresponding to the flow to be migrated from each other aggregation member port, includes:
[0088] S301, determining a flow difference between a total flow amount corresponding to a source member port and a total flow amount corresponding to each other aggregation member port other than the source member port.
[0089] Optionally, at the source member port, obtain its current total traffic volume (denoted as SourceTotal) from the traffic monitoring or statistics module. For each other aggregation member port other than the source member port, also obtain its current total traffic volume (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 volume and that of the source member port, that is, Difference_i = OtherTotal_i - SourceTotal.
[0090] S302, selecting the maximum flow difference from each flow difference.
[0091] Set an initial maximum traffic difference (MaxDifference) to a very small number (such as negative infinity), and the corresponding index (MaxIndex) to -1. Traverse 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 traversal is completed, MaxDifference is the maximum traffic difference, and MaxIndex corresponds to the index of the other aggregation member ports with the maximum difference.
[0092] S303: Select the traffic with the largest traffic difference from the traffic to be forwarded on the source member port as the migration traffic.
[0093] Specifically, the size of the traffic to be migrated from the source member port is determined based on MaxDifference. Here, the maximum traffic difference is directly used as the size of the migration traffic. From the queue or list of traffic to be forwarded on the source member port, select the traffic with the MaxDifference amount as the migration traffic. This can be achieved through various strategies, such as selecting the earliest arriving traffic, the traffic with the lowest priority, or the traffic selected according to a certain algorithm.
[0094] S304: Use the aggregation member interface corresponding to the maximum traffic difference among other aggregation member interfaces as the destination member interface corresponding to the traffic to be migrated.
[0095] Use MaxIndex to find the corresponding destination member port from the list of other aggregation member ports. Record the found destination member port for subsequent traffic migration operations.
[0096] In an exemplary embodiment, as shown in FIG4 , obtaining the to-be-forwarded traffic and the total traffic volume of the to-be-forwarded traffic corresponding to each aggregation member port includes:
[0097] S401, obtaining the traffic array structure stored in the OVS bridge.
[0098] The traffic array structure is used to store the traffic description information of each traffic to be forwarded and the aggregation member port allocated to each traffic to be forwarded.
[0099] It can be understood that in OVS, a bridge is a virtual switch that connects different interfaces (including aggregation ports). Each OVS bridge has its corresponding data structure, which contains all interfaces, flow tables, traffic statistics and other information related to the bridge. Access this data structure to obtain the traffic array structure. In the data structure of the bridge, find the traffic array structure that stores the traffic to be forwarded. This array structure usually contains the description information of the traffic (such as five-tuple, priority, VLAN tag, etc.) and the aggregation member port information assigned to each flow.
[0100] Furthermore, the flow description information of each flow to be forwarded is generated according to the five-tuple information of the flow to be forwarded. The flow description information of each flow to be forwarded is obtained by performing a hash operation on the five-tuple information of the flow to be forwarded.
[0101] It can be understood that for each flow sent, its five-tuple information is extracted: source IP address, destination IP address, layer 4 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 hash algorithm (such as MD5, SHA-1, etc., depending on the implementation of OVS).
[0102] Perform a bitwise AND operation (&) on the calculated hash value and 0xFF (the hexadecimal representation of 255) to obtain an integer between 0 and 255. This integer is an array index of the bond_entry pointer array. Use the calculated array index to access the bond_entry pointer array and obtain the bond_entry structure corresponding to the index. This structure contains member port flow information and traffic statistics related to a specific flow.
[0103] When sending traffic to be sent, a suitable member port can be selected to send the flow based on the information in the bond_entry structure. The strategy for selecting a member port may be based on various factors, such as the load, link status, and priority of the current member port. After selecting a member port and sending traffic, the traffic statistics in the bond_entry structure are updated to facilitate subsequent traffic analysis and load balancing decisions.
[0104] S402: Determine the to-be-forwarded traffic and the total traffic volume of the to-be-forwarded traffic corresponding to each aggregation member port according to the traffic array structure.
[0105] Extract the traffic description information, in particular the assigned aggregate member port identifier. Find the corresponding record in the temporary data structure based on the aggregate member port identifier. If the record does not exist, create a new record. Add the current traffic to the list of traffic to be forwarded for the aggregate member port. Update the total traffic count for the aggregate member port, usually by increasing the size of the current traffic (in bytes). For each aggregate member port, iterate through its list of traffic to be forwarded, accumulate the sizes of all traffic, and get the total traffic count for the member port. This total can be used for subsequent traffic management decisions, such as load balancing, traffic migration, etc. Arrange the information in the temporary data structure into the required format and return it to the caller. This usually includes the identifier of each aggregate member port, the list of traffic to be forwarded (possibly encapsulated in some form), and the total traffic count.
[0106] In an exemplary embodiment, in the above traffic migration method, two OVS bridges are created on the host machine, one of which (as the first OVS bridge) is used to forward traffic sent by the virtual machine or send traffic to a specified virtual machine. Two physical network cards are bound to the other bridge, and the two physical network cards are configured with a dynamic aggregation mode. This OVS bridge (as the second OVS bridge) is responsible for tunneling the message sent by the virtual machine and sending the message to the basic network, or receiving the tunnel message sent from the basic network, decapsulating it, and forwarding the decapsulated inner message to the virtual network.
[0107] The second OVS bridge mentioned above will periodically trigger the process of traffic migration. First, check whether the traffic difference between the two member ports is greater than or equal to the configured threshold value, and this difference must exceed 3% of the total traffic of the existing traffic to be forwarded at the migration destination. When the above conditions are met, select part of the traffic from the member port with larger current traffic according to the five-tuple information of the inner message and migrate it to the destination member port. When the traffic size between the member ports is close, the migration process ends. Wait for the next round of traffic migration processing. By combining the two methods of adding the traffic migration threshold configuration item and OVS automatically calculating the traffic migration threshold value based on the bandwidth value of the aggregated member port, excessively frequent traffic switching can be reduced and the stability of OVS forwarding can be improved.
[0108] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0109] Based on the same inventive concept, the embodiment of the present application also provides a traffic migration device for implementing the traffic migration method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more traffic migration device embodiments provided below can refer to the limitations on the traffic migration method above, and will not be repeated here.
[0110] In an exemplary embodiment, as shown in FIG5 , a flow migration device is provided, comprising: an acquisition module 11, a threshold verification module 12, a migration flow selection module 13 and a flow migration module 14; wherein,
[0111] The acquisition module 11 is used to obtain the traffic migration threshold value corresponding to each aggregation member port, the traffic to be forwarded and the total traffic volume of the traffic to be forwarded; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0112] A threshold verification module 12, configured to use the aggregate member port as a source member port if the total amount of traffic corresponding to any aggregate member port exceeds the traffic migration threshold value corresponding to the aggregate member port;
[0113] The migration traffic selection module 13 is used to select the traffic to be migrated from the traffic to be forwarded of the source member port according to the total traffic corresponding to each other aggregation member port other than the source member port, and select the destination member port corresponding to the traffic to be migrated from each other aggregation member port;
[0114] The traffic migration module 14 is used to migrate the traffic to be migrated from the source member port to the destination member port.
[0115] In one embodiment, the acquisition module 11 is further used to: acquire an initial migration threshold value of each aggregation member port;
[0116] Verify whether the initial migration threshold is greater than the set total amount of experience traffic and less than the dynamic upper limit corresponding to the aggregation member port; wherein the dynamic upper limit corresponding to the aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0117] If so, the initial migration threshold is used as the traffic migration threshold corresponding to the aggregation member port.
[0118] In one embodiment, the dynamic upper limit value corresponding to the aggregation member port is one quarter of the bandwidth speed limit value of the aggregation member port.
[0119] In one embodiment, the traffic migration module 14 is further used to: determine the traffic difference between the total traffic amount corresponding to the source member port and the total traffic amount corresponding to each other aggregation member port other than the source member port;
[0120] Select the maximum flow difference from each flow difference;
[0121] Select the traffic with the largest traffic difference from the traffic to be forwarded on the source member port as the migration traffic.
[0122] The aggregation member interface corresponding to the maximum traffic difference among the other aggregation member interfaces is used as the destination member interface corresponding to the traffic to be migrated.
[0123] In one embodiment, the acquisition module 11 is further used to: acquire a traffic array structure stored in the OVS bridge; wherein the traffic array structure is used to store traffic description information of each traffic to be forwarded and an aggregation member port allocated to each traffic to be forwarded; the traffic description information of each traffic to be forwarded is generated according to the five-tuple information of the traffic to be forwarded;
[0124] According to the traffic array structure, the to-be-forwarded traffic corresponding to each aggregation member port and the total traffic volume of the to-be-forwarded traffic are determined.
[0125] In one of the embodiments, the traffic description information of each traffic to be forwarded is obtained by performing a hash operation on the five-tuple information of the traffic to be forwarded.
[0126] Each module in the above-mentioned traffic migration device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0127] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG6. The 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 via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used 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 the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a traffic migration method is implemented. The display unit of the computer device is used to form a visually visible picture, which may 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, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0128] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0130] Obtaining the traffic migration threshold value, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded corresponding to each aggregation member port; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0131] If the total traffic volume of any aggregation member port exceeds the traffic migration threshold of the aggregation member port, the aggregation member port is used as the source member port.
[0132] According to the total number of flows corresponding to the other aggregation member ports other than the source member port, the flow to be migrated is selected from the flow to be forwarded of the source member ports, and the destination member port corresponding to the flow to be migrated is selected from the other aggregation member ports;
[0133] Migrate the traffic to be migrated from the source member port to the destination member port.
[0134] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0135] Obtaining the traffic migration threshold value, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded corresponding to each aggregation member port; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0136] If the total traffic volume of any aggregation member port exceeds the traffic migration threshold of the aggregation member port, the aggregation member port is used as the source member port.
[0137] According to the total number of flows corresponding to the other aggregation member ports other than the source member port, the flow to be migrated is selected from the flow to be forwarded of the source member ports, and the destination member port corresponding to the flow to be migrated is selected from the other aggregation member ports;
[0138] Migrate the traffic to be migrated 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 the traffic migration threshold value, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded corresponding to each aggregation member port; wherein the traffic migration threshold value corresponding to each aggregation member port is determined according to the broadband speed limit value of the aggregation member port;
[0141] If the total traffic volume of any aggregation member port exceeds the traffic migration threshold of the aggregation member port, the aggregation member port is used as the source member port.
[0142] According to the total number of flows corresponding to the other aggregation member ports other than the source member port, the flow to be migrated is selected from the flow to be forwarded of the source member ports, and the destination member port corresponding to the flow to be migrated is selected from the other aggregation member ports;
[0143] Migrate the traffic to be migrated from the source member port to the destination member port.
[0144] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the 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. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0145] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0146] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A traffic migration method, characterized in that: Applied to a host machine, the host machine is configured with a virtual switch OVS bridge, and the OVS bridge is connected to at least one aggregation member port; the method includes: Obtaining the traffic migration threshold value corresponding to each of the aggregation member ports, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded; wherein the traffic migration threshold value corresponding to each of the aggregation member ports is determined according to the broadband speed limit value of the aggregation member port; If the total amount of traffic corresponding to any of the aggregation member ports exceeds the traffic migration threshold corresponding to the aggregation member port, the aggregation member port is used as the source member port; According to the total amount of traffic corresponding to each other aggregation member port other than the source member port, select the traffic to be migrated from the traffic to be forwarded of the source member port, and select the destination member port corresponding to the traffic to be migrated from each of the other aggregation member ports; Migrate the traffic to be migrated from the source member port to the destination member port.
2. The method according to claim 1, characterized in that: Obtaining the traffic migration threshold corresponding to each of the aggregation member ports, including: For each aggregation member port, obtaining an initial migration threshold value of the aggregation member port; Verify whether the initial migration threshold is greater than the set total amount of experience traffic and less than the dynamic upper limit corresponding to the aggregation member port; wherein the dynamic upper limit corresponding to the aggregation member port is determined according to the broadband speed limit value of the aggregation member port; If yes, the initial migration threshold is used as the traffic migration threshold corresponding to the aggregation member port.
3. The method according to claim 2, characterized in that The dynamic upper limit value corresponding to the aggregation member port is one quarter of the broadband speed limit value of the aggregation member port.
4. The method according to claim 1, characterized in that The selecting the traffic to be migrated from the traffic to be forwarded of the source member port according to the total traffic amount corresponding to each other aggregation member port other than the source member port, and selecting the destination member port corresponding to the traffic to be migrated from each other aggregation member port, comprises: Determine a flow difference between a total flow amount corresponding to the source member port and a total flow amount corresponding to each other aggregation member port other than the source member port; Select the maximum flow difference from each flow difference; Selecting, from the to-be-forwarded traffic of the source member port, traffic with the maximum traffic difference as migration traffic; The aggregation member port corresponding to the maximum flow difference among the other aggregation member ports is used as the destination member port corresponding to the flow to be migrated.
5. The method according to claim 1, characterized in that Obtain the to-be-forwarded traffic corresponding to each aggregation member port and the total traffic volume of the to-be-forwarded traffic, including: Obtaining a traffic array structure stored in the OVS bridge; wherein the traffic array structure is used to store traffic description information of each traffic to be forwarded and an aggregation member port allocated to each traffic to be forwarded; and the traffic description information of each traffic to be forwarded is generated according to the five-tuple information of the traffic to be forwarded; According to the traffic array structure, the to-be-forwarded traffic corresponding to each of the aggregation member ports and the total traffic volume of the to-be-forwarded traffic are determined.
6. The method according to claim 5, characterized in that The traffic description information of each of the traffic flows to be forwarded is obtained by performing a hash operation on the five-tuple information of the traffic flows to be forwarded.
7. A flow migration device, characterized in that: The device is configured on a host machine, wherein a virtual switch OVS bridge is configured on the host machine, and the OVS bridge is connected to at least one aggregation member port; the device comprises: An acquisition module, used to acquire the traffic migration threshold value corresponding to each of the aggregation member ports, the traffic to be forwarded, and the total traffic volume of the traffic to be forwarded; wherein the traffic migration threshold value corresponding to each of the aggregation member ports is determined according to the broadband speed limit value of the aggregation member port; A threshold verification module, configured to use the aggregation member port as a source member port if the total amount of traffic corresponding to any of the aggregation member ports exceeds the traffic migration threshold value corresponding to the aggregation member port; A migration traffic selection module, configured to select the traffic to be migrated from the traffic to be forwarded of the source member port according to the total number of traffic corresponding to each other aggregation member port other than the source member port, and select a destination member port corresponding to the traffic to be migrated from each other aggregation member port; The traffic migration module is used to migrate the traffic to be migrated from the source member port to the destination member port.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Flow sharing method and equipment
CN104821922A
Load balancing method and equipment
CN113132249A
Method for realizing uninterrupted multicast traffic during migration of virtual machine
CN114143252A
Bandwidth allocation method and device, equipment and storage medium
CN117319322A
Data stream segmentation method, device and equipment and computer readable storage medium
CN117579543A
Cited By
Cloud desktop virtual network equipment and network card straight-through on-demand hybrid forwarding method
CN120750833A