Table item updating method and device, electronic equipment and storage medium
By dynamically adjusting the bandwidth occupancy rate and forwarding weight values in the driving layer of network equipment, the bandwidth utilization reduction problem caused by the shortest path congestion in the direct-connected topological network is solved, and more efficient traffic sharing and bandwidth utilization are achieved.
Patent Information
- Application Number
- CN202411373661.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In a direct-connected topological network, when the shortest path is congested, the network device will switch traffic to the non-shortest path, resulting in the bandwidth resources of the shortest path being unable to be fully utilized, reducing the overall bandwidth utilization of the network.
In the driving layer of the network device, the current bandwidth occupancy rate of each shortest path and non-shortest path interface is obtained at a preset time, and the target bandwidth occupancy rate of each interface is determined based on the high waterline threshold and the low waterline threshold, and the target bandwidth occupancy rate of each interface is calculated. Forwarding weight value, update the forwarding bandwidth value in the hardware register table entry to optimize traffic bearer.
It improves the overall bandwidth utilization of the network, avoids all traffic switching to the shortest or non-shortest path, ensures that both the shortest path and the non-shortest path can carry traffic, improves bandwidth utilization efficiency, and reduces packet loss and routing convergence time.
Smart Images

Figure CN119211108A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a table entry updating method, device, electronic device and storage medium. Background Art
[0002] Adaptive routing is a technology that makes dynamic routing decisions based on changes in network topology and traffic load. Through adaptive routing technology, network devices can select the best path based on real-time network status, link quality, bandwidth utilization and other conditions to improve network performance and reliability.
[0003] In a direct-connect topology network, each network device has multiple selectable forwarding paths. The inlet network device of the direct-connect topology network can execute an adaptive routing algorithm to select the optimal forwarding path for the message, and store the information of the optimal forwarding path in the optimal forwarding path table. The inlet network device will subsequently use the forwarding path in the optimal forwarding path table to forward the message. Taking sending a message to a destination IP address as an example, if the shortest path between the inlet network device and the device where the destination IP address is located is not congested, the information of the shortest path is stored in the optimal forwarding path table. If the shortest path is congested, the information of the non-shortest path is stored in the optimal forwarding path table.
[0004] That is to say, when the shortest path is congested, the ingress network device will use adaptive routing technology to switch all business traffic on the shortest path to a non-shortest path, resulting in the bandwidth resources of the shortest path not being fully utilized, and reducing the overall bandwidth utilization of the network. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a table entry update method, device, electronic device and storage medium to improve the overall bandwidth utilization of the network. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a table entry updating method, which is applied to a driver layer of a network device, and the method includes:
[0007] Obtain the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at a preset time interval;
[0008] If the current bandwidth occupancy of any interface exceeds the high watermark threshold or drops below the low watermark threshold, the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface are determined based on the current bandwidth occupancy of each shortest path interface, the current bandwidth occupancy of each non-shortest path interface, the high watermark threshold and the low watermark threshold;
[0009] Based on the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface, the forwarding weight value of each shortest path interface and the forwarding weight value of each non-shortest path interface are calculated, and the forwarding bandwidth value in the hardware register table entry corresponding to each interface is updated based on the calculated forwarding weight value.
[0010] In a possible implementation, the determining the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface based on the bandwidth occupancy of each shortest path interface, the bandwidth occupancy of each non-shortest path interface, the high watermark threshold, and the low watermark threshold includes:
[0011] Calculate a first sum, a first average, and a first maximum value of the current bandwidth occupancy rate of each shortest path interface;
[0012] Calculate the second sum and the second average of the current bandwidth occupancy rates of the non-shortest path interfaces;
[0013] Based on the relationship between the first sum, the first average, the first maximum value, the second sum, the second average, the high watermark threshold, and the low watermark threshold, a target bandwidth occupancy rate of each shortest path interface and a target bandwidth occupancy rate of each non-shortest path interface are determined.
[0014] In a possible implementation, determining the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface based on the relationship between the first sum, the first average, the first maximum value, the second sum, the second average, the high watermark threshold, and the low watermark threshold includes:
[0015] When the first average value is less than or equal to the high watermark threshold and the second average value is 0, if the first maximum value is greater than the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface is the first average value and the target bandwidth occupancy rate of each non-shortest path interface is 0;
[0016] When the first average value is greater than the high watermark threshold and the second average value is 0, after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold as a goal, determining the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface;
[0017] When the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth occupancy rate of each shortest path interface exceeds the high watermark threshold if each shortest path interface carries the traffic corresponding to the second sum value; if not, determine the target bandwidth occupancy rate of each shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface, and determine that the target bandwidth occupancy rate of each non-shortest path interface is 0; if so, determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface and each non-shortest path interface;
[0018] When the first average value is greater than the high watermark threshold and the second average value is greater than 0, or when the first average value is greater than the low watermark threshold and less than or equal to the high watermark threshold, and the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, after each shortest path interface and each non-shortest path interface jointly carries the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold as a goal, determining the target bandwidth occupancy of each shortest path interface and each non-shortest path interface;
[0019] In the case where the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, determine whether the bandwidth occupancy of each shortest path interface will exceed the high watermark threshold if the traffic corresponding to the first sum value and the second sum value is carried by each shortest path interface; if not, determine the target bandwidth occupancy of each shortest path interface according to the traffic corresponding to the first sum value and the second sum value carried by each shortest path interface, and determine the bandwidth occupancy of each non-shortest path interface to be 0; if so, determine the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface with the goal that after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold;
[0020] When the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high watermark threshold, if each shortest path interface carries the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each shortest path interface will not exceed the high watermark threshold, then according to the traffic corresponding to the first sum value and the second sum value carried by each shortest path interface, the target bandwidth occupancy of each shortest path interface is determined, and the bandwidth occupancy of each non-shortest path interface is determined to be 0.
[0021] In a possible implementation, obtaining the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at a preset time interval includes:
[0022] Obtaining the number of messages forwarded by each shortest path interface and each non-shortest path interface at every preset time interval;
[0023] For each interface, the ratio between the difference between the number of packets of the interface obtained in two consecutive times and the preset time length is used as the current bandwidth occupancy rate of the interface.
[0024] In a possible implementation, after obtaining the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at every preset time period, the method further includes:
[0025] If the occupied space of the interface buffer of any interface is greater than or equal to the preset space threshold, the current bandwidth occupancy rate of the interface is updated to 100%.
[0026] In a possible implementation, after obtaining the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at every preset time period, the method further includes:
[0027] Receiving service messages through the shortest path interface or the non-shortest path interface;
[0028] If the service message includes an ECN mark, and the value of the ECN mark is the first value or the second value, recording the interface receiving the service message as a non-congested state;
[0029] If the service message includes an ECN mark, and the value of the ECN mark is a third value, recording the interface of the service message as a congested state;
[0030] When the state of any interface changes from a non-congested state to a congested state, the current bandwidth occupancy rate of the interface is updated to 100%.
[0031] In a second aspect, an embodiment of the present application provides a table entry update device, which is applied to a driver layer of a network device, and the device includes:
[0032] An acquisition module, used to acquire the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at a preset time interval;
[0033] A determination module, configured to determine a target bandwidth occupancy rate of each shortest path interface and a target bandwidth occupancy rate of each non-shortest path interface based on the current bandwidth occupancy rate of each shortest path interface, the current bandwidth occupancy rate of each non-shortest path interface, the high watermark threshold and the low watermark threshold if the current bandwidth occupancy rate of any interface exceeds the high watermark threshold or drops below the low watermark threshold;
[0034] An update module is used to calculate the forwarding weight value of each shortest path interface and the forwarding weight value of each non-shortest path interface based on the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface, and update the forwarding bandwidth value in the hardware register table entry corresponding to each interface based on the calculated forwarding weight value.
[0035] In a possible implementation, the determining module is specifically configured to:
[0036] Calculate a first sum, a first average, and a first maximum value of the current bandwidth occupancy rate of each shortest path interface;
[0037] Calculate the second sum and the second average of the current bandwidth occupancy rates of the non-shortest path interfaces;
[0038] Based on the relationship between the first sum, the first average, the first maximum value, the second sum, the second average, the high watermark threshold, and the low watermark threshold, a target bandwidth occupancy rate of each shortest path interface and a target bandwidth occupancy rate of each non-shortest path interface are determined.
[0039] In a possible implementation, the determining module is specifically configured to:
[0040] When the first average value is less than or equal to the high watermark threshold and the second average value is 0, if the first maximum value is greater than the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface is the first average value and the target bandwidth occupancy rate of each non-shortest path interface is 0;
[0041] When the first average value is greater than the high watermark threshold and the second average value is 0, after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold as a goal, determining the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface;
[0042] When the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth occupancy rate of each shortest path interface exceeds the high watermark threshold if each shortest path interface carries the traffic corresponding to the second sum value; if not, determine the target bandwidth occupancy rate of each shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface, and determine that the target bandwidth occupancy rate of each non-shortest path interface is 0; if so, determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface and each non-shortest path interface;
[0043] When the first average value is greater than the high watermark threshold and the second average value is greater than 0, or when the first average value is greater than the low watermark threshold and less than or equal to the high watermark threshold, and the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, after each shortest path interface and each non-shortest path interface jointly carries the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold as a goal, determining the target bandwidth occupancy of each shortest path interface and each non-shortest path interface;
[0044] In the case where the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, determine whether the bandwidth occupancy of each shortest path interface will exceed the high watermark threshold if the traffic corresponding to the first sum value and the second sum value is carried by each shortest path interface; if not, determine the target bandwidth occupancy of each shortest path interface according to the traffic corresponding to the first sum value and the second sum value carried by each shortest path interface, and determine the bandwidth occupancy of each non-shortest path interface to be 0; if so, determine the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface with the goal that after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold;
[0045] When the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high watermark threshold, if each shortest path interface carries the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each shortest path interface will not exceed the high watermark threshold, then according to the traffic corresponding to the first sum value and the second sum value carried by each shortest path interface, the target bandwidth occupancy of each shortest path interface is determined, and the bandwidth occupancy of each non-shortest path interface is determined to be 0.
[0046] In a possible implementation, the acquisition module is specifically used to:
[0047] Obtaining the number of messages forwarded by each shortest path interface and each non-shortest path interface at every preset time interval;
[0048] For each interface, the ratio between the difference between the number of packets of the interface obtained in two consecutive times and the preset time length is used as the current bandwidth occupancy rate of the interface.
[0049] In a possible implementation, the acquisition module is further used to:
[0050] If the occupied space of the interface buffer of any interface is greater than or equal to the preset space threshold, the current bandwidth occupancy rate of the interface is updated to 100%.
[0051] In a possible implementation, the acquisition module is further used to:
[0052] Receiving service messages through the shortest path interface or the non-shortest path interface;
[0053] If the service message includes an ECN mark, and the value of the ECN mark is the first value or the second value, recording the interface receiving the service message as a non-congested state;
[0054] If the service message includes an ECN mark, and the value of the ECN mark is a third value, recording the interface of the service message as a congested state;
[0055] When the state of any interface changes from a non-congested state to a congested state, the current bandwidth occupancy rate of the interface is updated to 100%.
[0056] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0057] Memory, used to store computer programs;
[0058] The processor is used to implement the method described in the first aspect when executing the program stored in the memory.
[0059] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0060] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect above.
[0061] By adopting the above technical scheme, the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface can be obtained at preset time intervals. When the current bandwidth occupancy rate of any interface exceeds the high watermark threshold or drops below the low watermark threshold, the network device does not switch all traffic to the shortest path or all to the non-shortest path, but determines the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path based on the current bandwidth occupancy rate of each shortest path interface, the current bandwidth occupancy rate of each non-shortest path interface, the high watermark threshold and the low watermark threshold, and then calculates the forwarding weight value of each interface based on the determined target bandwidth occupancy rate, and updates the forwarding bandwidth value in the hardware register table item corresponding to each interface based on the calculated forwarding weight value. In this way, each subsequent interface can carry traffic according to the target bandwidth occupancy rate, that is, both the shortest path and the non-shortest path can carry traffic, which can improve the overall bandwidth utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0063] Figure 1 A structural diagram of a direct-connect topology network of a large supercomputing center provided in an embodiment of the present application;
[0064] Figure 2 An exemplary schematic diagram of a switching process between a shortest path and a non-shortest path provided in an embodiment of the present application;
[0065] Figure 3 It is a schematic diagram of the communication process between the driver and the platform in the related technology;
[0066] Figure 4 A flowchart of a table entry updating method provided in an embodiment of the present application;
[0067] Figure 5 A schematic diagram of a networking architecture for adaptive routing provided in an embodiment of the present application;
[0068] Figure 6 A schematic diagram of a table entry updating method provided in an embodiment of the present application;
[0069] Figure 7 A schematic diagram of a table entry updating method provided in an embodiment of the present application;
[0070] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0072] To facilitate understanding, the relevant terms involved in the embodiments of the present application are first introduced.
[0073] Equal-Cost Multi-Path (ECMP): is a routing algorithm used to distribute data traffic to multiple paths with the same cost to achieve load balancing and improve network fault tolerance.
[0074] Unequal-Cost Multi-Path (UCMP): is a routing algorithm used to distribute data traffic to multiple paths with different costs to achieve more effective load balancing and resource utilization. Compared with ECMP, the UCMP algorithm allows traffic to be distributed on different paths according to traffic size or other indicators, rather than simply distributing traffic evenly.
[0075] Adaptive routing: A routing method in which network devices, such as routers or switches, can dynamically adjust routing selection based on current network conditions and load conditions. Using adaptive routing technology, network devices can select the best path based on real-time network status, link quality, and bandwidth utilization to improve network performance and network reliability.
[0076] At present, the construction of large-scale supercomputing center networks requires the interconnection of large-scale computing nodes, but the expansion of cluster size leads to increased network latency and deployment costs, which cannot meet the computing power and deployment requirements. The direct topology network has the advantages of large access scale and small network diameter. Therefore, adaptive routing technology can be combined with the direct topology network and applied to large-scale supercomputing center networks. When the shortest path is unobstructed, the shortest path is selected to forward messages; when the shortest path is congested, the non-congested non-shortest path is selected to forward messages, which can make full use of network links and improve bandwidth utilization. While supporting large-scale networking, it meets the requirements of high throughput, low latency and low cost.
[0077] like Figure 1 As shown, Figure 1This is a direct connection topology network of a large supercomputing center. As an example, the network includes 9 network groups. The rectangles in each network group represent switches, and the dots connected to the rectangles represent computing nodes, that is, servers. The lines between switches in the same group represent local links, the lines between switches in different groups represent global links, and the lines between servers and switches represent access links.
[0078] by Figure 1 Taking the communication between the second switch in the top network group (referred to as switch 1) and the third switch in the bottom network group (referred to as switch 2) as an example, there are two forwarding paths between switch 1 and switch 2. The shortest path is the path between switch 1-switch 3-switch 2, and the non-shortest path is the path between switch 1-switch 4-switch 5-switch 6-switch 7-switch 2.
[0079] If the server connected to switch 1 needs to access the server connected to switch 2, when the shortest path between switch 1 and switch 2 is unobstructed, switch 1 forwards the server's access data along the shortest path; when the shortest path is congested, the adaptive routing technology is triggered, and switch 1 switches to forwarding the server's access data along a non-shortest path. This can make full use of network links and improve bandwidth utilization.
[0080] The following is an introduction to the working principle of adaptive routing.
[0081] In a direct-connect topology network, each network node has multiple forwarding paths to choose from. The entry network node (ingress node, referred to as the ingress node) of the message can execute an adaptive routing algorithm to select the optimal forwarding path for the message. Subsequent non-entry network nodes (non-ingress nodes) can directly forward the message by looking up the routing table without having to reselect the forwarding path.
[0082] Each ingress node needs to maintain a table for storing the optimal forwarding path information based on the routing information and the congestion status of the link, referred to as the best path table. Taking a certain destination IP address as an example, if the shortest path between the ingress node and the destination IP address is not congested, the best path table stores the path information of the shortest path; if the shortest path is congested, the best path table stores the path information of the non-shortest path to the destination IP address.
[0083] like Figure 2 As shown, Figure 2 In the figure, taking the example of computing node S sending a message to computing node D, the switching process between the shortest path and the non-shortest path is demonstrated.
[0084] Figure 2The filled portion in the upper rectangle represents the weighted sum of the bandwidth utilization level and the queue depth level of interface 1 on the ingress node connected to the egress node. The lower line in each rectangle represents the low watermark of the weighted sum of the bandwidth utilization level and the queue depth level. The upper line in each rectangle represents the high watermark of the weighted sum of the bandwidth utilization level and the queue depth level. Figure 2 The unfilled small rectangle on ingress node 1 represents interface 1, and the small rectangle filled with black represents interface 2.
[0085] See also Figure 2 In (1), the destination IP address in the optimal path table of the ingress node is the IP address of node D, the outgoing interface is interface 1, and the path type is the shortest path within the group. The shortest path for computing node S to send a message to computing node D is S->1->3->D. Since the weighted sum of the bandwidth utilization level and the queue depth level of interface 1 of ingress node 1 has not reached the high watermark at this time, interface 1 is not congested. Therefore, when ingress node 1 receives a message sent from computing node S to computing node D, the optimal forwarding path found in the optimal path table is the shortest path, and the outgoing interface is interface 1. Ingress node 1 can send the message through interface 1 according to the information in the optimal path table.
[0086] See also Figure 2 In (2), the weighted sum of the bandwidth utilization level and the queue depth level of interface 1 exceeds the high watermark, that is, interface 1 is congested. In this case, the path information of the shortest path in the network through interface 1 in the optimal path table is deleted and replaced with the path information of the non-shortest path in the network. That is, the destination IP address stored in the optimal path table is the IP address of node D, the outgoing interface is interface 2, and the path type is the non-shortest path in the group. The non-shortest path for computing node S to send a message to computing node D is S->1->4->3->D.
[0087] When ingress node 1 receives a message sent by computing node S to computing node D, the optimal forwarding path found in the optimal path table is a non-shortest path, and the outbound interface is interface 2. The ingress interface can send the message through interface 2 according to the information in the optimal path table.
[0088] See also Figure 2 In (3), the weighted sum of the bandwidth utilization level and the queue depth level of interface 1 drops below the high watermark. In this case, the path information stored in the optimal path table is still the non-shortest path. Therefore, when ingress node 1 receives a message sent by computing node S to computing node D, the optimal forwarding path found in the optimal path table is the non-shortest path, and the outbound interface is interface 2. The ingress interface can send the message through interface 2 according to the information in the optimal path table.
[0089] See also Figure 2In (4), the weighted sum of the bandwidth utilization level and the queue depth level of interface 1 drops below the low watermark. In this case, the path information of the optimal path stored in the optimal path table is modified to the path information of the shortest path. Therefore, when ingress node 1 receives a message sent by computing node S to computing node D, the optimal forwarding path found in the optimal path table is the shortest path, and the outbound interface is interface 1. The ingress interface can send the message through interface 1 according to the information in the optimal path table.
[0090] From the above process, it can be seen that when the shortest path is congested, the path information in the optimal path table will be modified to the path information of the non-shortest path, and then the traffic originally carried by the shortest path will be switched to the non-shortest path. This will cause the bandwidth resources of the shortest path to be unable to be fully utilized, resulting in a decrease in the overall bandwidth utilization of the network.
[0091] In addition, when the traffic load of the network link fluctuates or changes, such as Figure 3 As shown, the driver layer of the network device senses the occupancy of the interface bandwidth and the congestion status of the interface, and then reports the interface bandwidth and congestion status to the platform software layer. The platform software layer then uses an adaptive routing algorithm to calculate and process, and then notifies the driver layer of the newly calculated new path information, so that the driver layer can perform path switching and traffic switching. In this process, the driver layer of the network device needs to communicate with the platform software layer and then with the driver layer. The process is cumbersome and time-consuming, and packet loss is prone to occur in this process. For short-term network load change scenarios, the switching speed of this switching method cannot meet the stability and timeliness requirements of the network.
[0092] In order to solve the above problems, the embodiment of the present application provides a table entry updating method, which is applied to the driver layer of the network device, such as Figure 4 As shown, the method includes:
[0093] S401. Obtain the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at a preset time interval.
[0094] The preset time length is a preset empirical value, for example, the preset time length may be 10 ms.
[0095] The network device has at least one shortest path interface and at least one non-shortest path interface, each shortest path has a shortest path interface, and each non-shortest path has a non-shortest path interface. It can be understood that the shortest path interface refers to the outgoing interface on the network device connected to the shortest path, and the non-shortest path interface refers to the outgoing interface on the network device connected to the non-shortest path.
[0096] S402. If the current bandwidth occupancy of any interface exceeds the high watermark threshold or drops below the low watermark threshold, the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface are determined based on the current bandwidth occupancy of each shortest path interface, the current bandwidth occupancy of each non-shortest path interface, the high watermark threshold and the low watermark threshold.
[0097] If the current bandwidth usage of any interface exceeds the high watermark threshold, it means that the interface is currently congested, so the traffic carried by each path needs to be readjusted. If the current bandwidth usage of any interface drops from above the low watermark threshold to below the low watermark threshold, it means that the path where the interface is located carries less traffic, so the traffic carried by each path can be further adjusted to improve the overall bandwidth utilization of the network.
[0098] S403. Based on the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface, calculate the forwarding weight value of each shortest path interface and the forwarding weight value of each non-shortest path interface, and update the forwarding bandwidth value in the hardware register table entry corresponding to each interface based on the calculated forwarding weight value.
[0099] Among them, the forwarding weight value of the interface is the product of the bandwidth of the interface and the bandwidth occupancy rate of the interface. After the forwarding weight value of the interface is calculated, the forwarding bandwidth value in the hardware register table entry corresponding to the interface in the switching chip can be updated to the forwarding weight value. The forwarding bandwidth value is used to indicate the amount of packets that the interface can forward.
[0100] Taking a 100G interface as an example, if the target bandwidth occupancy rate of the interface is 60%, the forwarding weight value of the interface is 100G*60%=60G, and then the hardware register table entry of the interface inside the switching chip is updated to set the forwarding bandwidth value of the interface to 60G, that is, the amount of packets allocated to the interface is 60G.
[0101] It is understandable that the subsequent network device forwards the message according to the updated hardware register table entry, so that the traffic can be load-balanced on each path according to the forwarding weight value of each path interface.
[0102] In one implementation, a hardware register table is stored in the forwarding chip, and the register table includes a hardware register table entry corresponding to each interface.
[0103] In another implementation manner, the forwarding chip stores the interface information of each interface, and the interface information of each interface includes a hardware register table entry of the interface.
[0104] By adopting this method, the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface can be obtained at preset time intervals. When the current bandwidth occupancy rate of any interface exceeds the high watermark threshold or decreases below the low watermark threshold, the network device does not switch all traffic to the shortest path or all to the non-shortest path, but determines the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path based on the current bandwidth occupancy rate of each shortest path interface, the current bandwidth occupancy rate of each non-shortest path interface, the high watermark threshold and the low watermark threshold, and then calculates the forwarding weight value of each interface based on the determined target bandwidth occupancy rate, and updates the forwarding bandwidth value in the hardware register table item corresponding to each interface based on the calculated forwarding weight value. In this way, each subsequent interface can carry traffic according to the target bandwidth occupancy rate, that is, both the shortest path and the non-shortest path can carry traffic, which can improve the overall bandwidth utilization.
[0105] In addition, since the above processes are all executed by the driver layer of the network device and do not rely on the platform software layer, there is no need for the driver layer of the network device to communicate with the platform software layer during the process of adjusting the weights of each forwarding path interface. This can improve the update efficiency of the hardware register table entries corresponding to the interface, improve the convergence time of the routing, and thus improve the traffic switching speed, which can significantly reduce packet loss and provide a "no packet loss, low latency" lossless network environment for data center networks and supercomputing centers.
[0106] In some embodiments of the present application, the above S401, obtaining the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at every preset time period, can be specifically implemented as follows:
[0107] The number of packets forwarded by each shortest path interface and each non-shortest path interface is obtained at preset time intervals.
[0108] For each interface, the ratio between the difference between the number of packets of the interface obtained twice in succession and the preset time length is used as the current bandwidth occupancy of the interface.
[0109] For example, for an interface, the number of packets forwarded by the interface obtained for the first time is X, and the number of packets forwarded by the interface obtained 10 ms later is Y. Then, the current bandwidth occupancy of the interface is (YX) / 10.
[0110] In this way, the current bandwidth occupancy rate of each interface can be accurately obtained, so that the load of each path can be accurately adjusted based on the current bandwidth occupancy rate later.
[0111] In an optional implementation, after the above S401, obtaining the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at every preset time, the method further includes:
[0112] If the occupied space of the interface buffer of any interface is greater than or equal to the preset space threshold, the current bandwidth occupancy rate of the interface is updated to 100%.
[0113] Among them, the preset space threshold can be set based on actual conditions, for example, it can be set to 50% of the total space size of the interface buffer, that is, if the occupied space size of the interface buffer of any interface exceeds 50%, it is determined that the interface is congested, and the current bandwidth occupancy rate of the interface can be updated to 100%, so as to trigger the update of the table entry in time.
[0114] In another optional implementation, based on any of the above implementations, after the above S401, obtaining the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface every preset time period, the method further includes the following steps:
[0115] Step 1: Receive a service message through the shortest path interface or the non-shortest path interface.
[0116] Step 2: If the service message includes an explicit congestion notification (ECN) mark, and the value of the ECN mark is the first value or the second value, the interface receiving the service message is recorded as a non-congested state; if the service message includes the ECN mark, and the value of the ECN mark is the third value, the interface of the service message is recorded as a congested state.
[0117] The first value is 01, the second value is 10, and when the ECN mark is 01 or 01, it indicates that there is no congestion on the link between the network device and the network device that sends the service message. The third value is 11, and when the ECN mark is 11, it indicates that there is congestion on the link between the network device and the network device that sends the service message.
[0118] It should be noted that the above “01”, “10” and “11” are all binary values.
[0119] Specifically, the driver layer can create an ACL table entry, and match the message carrying the ECN mark through the ACL table entry. For example, the matching domain of the ACL table entry can be to carry the ECN mark, and the action domain is if the value of the ECN mark is 01 or 10, then the state of the interface receiving the service message is recorded as a non-congested state; if the value of the ECN mark is 11, then the state of the interface receiving the service message is recorded as a congested state.
[0120] It should be noted that if the value of the ECN mark is 11, it means that there is congestion in the front path direction of the interface receiving the service message. In order to alleviate the congestion in the front path direction, the state of the interface can be recorded as a congested state to reduce the number of messages sent to the front path through the service message, thereby alleviating the congestion in the front path direction.
[0121] For example, if network device A is connected to network device B through interface 1, and network device A receives service message 1 from network device B through interface 1, and the value of the ECN mark carried in service message 1 is 11, it means that network device B is congested. Therefore, network device A records the status of interface 1 as a congested status, so that the forwarding weight value of interface 1 can be reduced later, thereby reducing the traffic forwarded to network device B through interface 1, so as to alleviate the congestion of network device B.
[0122] Step 3: When the state of any interface changes from a non-congested state to a congested state, the current bandwidth occupancy rate of the interface is updated to 100%.
[0123] By adopting this method, when congestion occurs in the front path direction of the interface, the current bandwidth occupancy rate of the interface is updated to 100% to adjust the traffic carried by the path where the interface is located, which can alleviate the congestion problem of the path where the interface is located and improve the overall network performance.
[0124] On the basis of the above embodiment, in the above S402, if the current bandwidth occupancy of any interface exceeds the high watermark threshold or drops below the low watermark threshold, the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface are determined based on the current bandwidth occupancy of each shortest path interface, the current bandwidth occupancy of each non-shortest path interface, the high watermark threshold and the low watermark threshold, which can be specifically implemented as follows:
[0125] Step A: Calculate a first sum, a first average, and a first maximum value of the current bandwidth occupancy rate of each shortest path interface; and calculate a second sum and a second average value of the current bandwidth occupancy rate of each non-shortest path interface.
[0126] In the embodiment of the present application, the bandwidth occupancy rate of each shortest path interface is represented as {p1, p2, ..., p m}, where p1 represents the bandwidth occupancy of the first shortest path interface, p2 represents the bandwidth occupancy of the second shortest path interface, and p m Indicates the bandwidth usage of the mth shortest path interface, where m is the number of shortest path interfaces.
[0127] The bandwidth occupancy of each non-shortest path interface is expressed as {q1,q2,…,q n}, where q1 represents the bandwidth utilization of the first non-shortest path interface, q2 represents the bandwidth utilization of the second non-shortest path interface, and q n Indicates the bandwidth usage of the nth non-shortest path interface, where n is the number of non-shortest path interfaces.
[0128] The first sum is The first average value is The first maximum value is p max =max{p1,p2,…,p m}.
[0129] The second sum is The second average is
[0130] Step B: Determine the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface based on the relationship between the first sum, the first average, the first maximum, the second sum, and the second average and the high watermark threshold and the low watermark threshold.
[0131] In the embodiment of the present application, the low watermark threshold and the high watermark threshold are both thresholds of bandwidth occupancy set based on experience. The low watermark threshold is denoted as α, and the high watermark threshold is denoted as β.
[0132] Step B specifically includes the following 6 situations:
[0133] Case 1: When the first average value is less than or equal to the high watermark threshold and the second average value is 0, if the first maximum value is greater than the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface is the first average value, and the target bandwidth occupancy rate of each non-shortest path interface is 0.
[0134] In addition, when the first average value is less than or equal to the high watermark threshold and the second average value is 0, if the first maximum value is less than or equal to the high watermark threshold, there is no need to adjust the target bandwidth occupancy of each interface.
[0135] Case 1 can be expressed as:
[0136]
[0137] p i ′ represents the target bandwidth occupancy of each shortest path interface, q j ′ Indicates the target bandwidth usage of each non-shortest path interface.
[0138] in, and This indicates that the average bandwidth usage of each shortest path interface does not exceed the high watermark threshold, and there is no traffic on non-shortest paths. max ≤β indicates that the bandwidth usage of each shortest path interface does not exceed the high watermark threshold. In this case, there is no need to update the UCMP adaptive routing. max >β indicates that among the shortest path interfaces, the bandwidth usage of some interfaces exceeds the high watermark threshold. In this case, UCMP adaptive routing needs to be updated. After load balancing among the shortest paths, the bandwidth utilization of each shortest path interface can be kept below the high watermark threshold. Therefore, there is no need to distribute traffic to non-shortest paths. Therefore, the target bandwidth utilization set for each shortest path interface and each non-shortest path interface is q j ′ =0.
[0139] Case 2: When the first average value is greater than the high watermark threshold and the second average value is 0, after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold as the goal, and the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface are determined.
[0140] In one implementation, the peak-shaving and valley-filling method can be used to adjust part of the traffic carried by the shortest path interface to the non-shortest path interface, so that the bandwidth occupancy rate of each shortest path interface and each non-shortest path interface is lower than the high watermark threshold. Other load-sharing methods can also be used to determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface, so that each determined target bandwidth occupancy rate is lower than the high watermark threshold.
[0141] For example, it can be determined that the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface are both the third average value, and the third average value is the average value of the current bandwidth occupancy rate of each shortest path interface and the current bandwidth occupancy rate of each non-shortest path interface. The third average value can be expressed as
[0142] Case 2 can be expressed as:
[0143]
[0144]
[0145] Among them, when and When , it means that the average bandwidth utilization of each shortest path interface exceeds the high watermark threshold, that is, after load balancing between the shortest paths, the bandwidth utilization of each shortest path interface cannot be reduced below the high watermark threshold. At this time, non-shortest paths need to participate in traffic load sharing. Therefore, the target bandwidth utilization set for each shortest path interface and each non-shortest path interface is
[0146] Case 3: When the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth occupancy rate of each shortest path interface will exceed the high watermark threshold if the traffic corresponding to the second sum value is carried by each shortest path interface; if not, determine the target bandwidth occupancy rate of each shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface, and determine the target bandwidth occupancy rate of each non-shortest path interface to be 0; if so, determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface and each non-shortest path interface;
[0147] Among them, the ratio between the second sum and the number of shortest path interfaces can be calculated to obtain a fourth average value. If the fourth average value is less than or equal to the high watermark threshold, it means that if the traffic corresponding to the second sum is carried by each shortest path interface, the bandwidth occupancy rate of each shortest path interface will not exceed the high watermark threshold.
[0148] Furthermore, if the fourth average value is less than or equal to the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface is the fourth average value, and the target bandwidth occupancy rate of each non-shortest path interface is 0, or other methods can be used to determine the target bandwidth occupancy rate of each shortest path interface, as long as it is ensured that the bandwidth occupancy rate of each shortest path interface does not exceed the high watermark threshold; if the fourth average value is greater than the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface are both the fifth average value, and the fifth average value is the ratio between the second sum and the total number of interfaces of the shortest path and the non-shortest path, or the peak shaving and valley filling method can be used to determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface, so that the determined target bandwidth occupancy rates are all lower than the high watermark threshold.
[0149] Among them, the number of shortest path interfaces is m, and the number of non-shortest path interfaces is n, then the fifth average value can be expressed as The sixth average can be expressed as
[0150] Case 3 can be specifically expressed as:
[0151]
[0152]
[0153] Among them, when and , it means that there is no traffic forwarding on the shortest path, and only traffic forwarding on the non-shortest path exists, and the traffic needs to be switched to the shortest path. This means that after all traffic is switched back to the shortest path, the bandwidth usage of each shortest path interface will not exceed the high watermark threshold. q j ′ =0; otherwise, if Then non-shortest paths are required to participate in traffic sharing, that is, set
[0154] Case 4: When the first average value is greater than the high watermark threshold and the second average value is greater than 0, after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum and the second sum, the bandwidth occupancy of each interface is lower than the high watermark threshold as the goal, and the target bandwidth occupancy of each shortest path interface and each non-shortest path interface is determined.
[0155] In one implementation, the peak-shaving and valley-filling method can be used to adjust part of the traffic carried by the shortest path interface to part of the shortest path interface or part of the non-shortest path interface to ensure that the target bandwidth occupancy rate of each interface is lower than the high watermark threshold. Other load-sharing methods can also be used to determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface, so that the determined target bandwidth occupancy rate is lower than the high watermark threshold.
[0156] For example, it may be determined that the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface are both the third average value.
[0157] Case 4 can be specifically expressed as:
[0158]
[0159] when and , it means that the bandwidth usage of the shortest path interface has exceeded the high watermark threshold, and there is also traffic forwarding on the non-shortest path. At this time, the shortest path and the non-shortest path need to be re-load-shared for traffic forwarding, that is, set
[0160] Case 5: When the first average value is greater than the low watermark threshold and less than or equal to the high watermark threshold, and the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum and the second sum, the bandwidth occupancy of each interface is lower than the high watermark threshold as the goal, and the target bandwidth occupancy of each shortest path interface and each non-shortest path interface is determined.
[0161] In one implementation, the peak-shaving and valley-filling method can be used to adjust part of the traffic carried by the shortest path interface to part of the shortest path interface or part of the non-shortest path interface to ensure that the target bandwidth occupancy rate of each interface is lower than the high watermark threshold. Other load-sharing methods can also be used to determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface, so that the determined target bandwidth occupancy rate is lower than the high watermark threshold.
[0162] For example, it may be determined that the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface are both the third average value.
[0163] Case 5 can be specifically expressed as:
[0164]
[0165] Among them, when and If the bandwidth usage of any interface in the shortest path exceeds the high watermark threshold, the shortest path and non-shortest path need to be re-load-shared for traffic forwarding, that is, set Otherwise no action is required.
[0166] Case 6: When the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, determine whether the bandwidth occupancy of each shortest path interface will exceed the high watermark threshold if each shortest path interface carries the traffic corresponding to the first sum and the second sum; if not, determine the target bandwidth occupancy of each shortest path interface according to the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and determine the bandwidth occupancy of each non-shortest path interface to be 0; if so, determine the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface with the goal that after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum and the second sum, the bandwidth occupancy of each interface is lower than the high watermark threshold.
[0167] Among them, the ratio of the sum of the first sum and the second sum to the number of shortest path interfaces can be calculated to obtain a sixth average value. If the sixth average value is less than or equal to the high watermark threshold, it means that if the traffic corresponding to the first sum and the second sum is carried by each shortest path interface, the bandwidth occupancy rate of each shortest path interface will not exceed the high watermark threshold.
[0168] Furthermore, if the sixth average value is less than or equal to the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface is the sixth average value, and the target bandwidth occupancy rate of each non-shortest path interface is 0, or other methods can be used to determine the target bandwidth occupancy rate of each shortest path interface, as long as it is ensured that the bandwidth occupancy rate of each shortest path interface does not exceed the high watermark threshold; if the sixth average value is greater than the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface are both the third average value, or the peak shaving and valley filling method can be used to determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface, so that the determined target bandwidth occupancy rates are all lower than the high watermark threshold;
[0169] When the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high watermark threshold, if each shortest path interface carries the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each shortest path interface will not exceed the high watermark threshold, then according to the traffic corresponding to the first sum value and the second sum value carried by each shortest path interface, the target bandwidth occupancy of each shortest path interface is determined, and the bandwidth occupancy of each non-shortest path interface is determined to be 0.
[0170] Among them, it can be determined that the target bandwidth occupancy rate of each shortest path interface is the sixth average value, and the target bandwidth occupancy rate of each non-shortest path interface is 0, or other methods can be used to determine the target bandwidth occupancy rate of each shortest path interface, as long as it is ensured that the bandwidth occupancy rate of each shortest path interface does not exceed the high watermark threshold.
[0171] Among them, the sixth average value can be expressed as
[0172] Case 6 can be specifically expressed as:
[0173]
[0174] Among them, when and When , it indicates that the average bandwidth usage of each shortest path interface is lower than the low watermark threshold. At this time, traffic is still being forwarded on the non-shortest path. Therefore, it is necessary to consider switching the traffic on the non-shortest path back to the shortest path.
[0175] If p max>β, that is, the bandwidth usage of some interfaces on the shortest path exceeds the high watermark threshold, and the traffic needs to be load-balanced again. That is, assuming that all traffic is forwarded only along the shortest path, the bandwidth usage of each shortest path interface will not exceed the high watermark threshold. q j ′ = 0, so that all traffic is forwarded only on the shortest path; if That is, when the bandwidth usage of each shortest path interface does not exceed the high watermark threshold, each shortest path is not enough to forward all traffic, then the shortest path and non-shortest path need to participate in the forwarding sharing, that is, set
[0176] If p max ≤β, that is, the bandwidth usage of the shortest path interface does not exceed the high watermark threshold, and after the traffic carried by the non-shortest path is switched back to the shortest path, the bandwidth usage of each interface will not exceed the high watermark threshold. q j ′ =0, otherwise no setting is required.
[0177] Through the settings in the above cases, the bandwidth usage of each interface can be kept below the high watermark threshold as much as possible, avoiding serious network congestion and improving the overall bandwidth utilization of the network.
[0178] The following is an introduction to the method of adjusting the target bandwidth usage of each interface with specific examples. Figure 5 As shown, Figure 5 is a networking diagram of adaptive routing. Figure 5 The example includes device 1, device 2, and device 3, where device 1 has three outbound interfaces, namely interface 1, interface 2, and interface 3. There are two shortest paths between device 1 and device 2, and interface 1 and interface 2 are the outbound interfaces on device 1 corresponding to the two shortest paths, respectively. Interface 3 is the outbound interface of the non-shortest path between device 1 and device 3. The bandwidths of interface 1, interface 2, and interface 3 are equal.
[0179] Assume that the low watermark threshold is 50%, the high watermark threshold is 70%, and {x, y, z} represent the current bandwidth usage of interface 1, interface 2, and interface 3 respectively. Then, as the current bandwidth usage of each interface changes, the process of updating the target bandwidth usage for each interface is as follows:
[0180] (1) The current bandwidth usage of interface 1, interface 2, and interface 3 are {30%, 30%, 0} respectively. That is, only the shortest path is currently forwarding traffic, and non-shortest paths are not forwarding traffic. In addition, the bandwidth usage of interface 1 and interface 2 are both below the low watermark threshold. At this time, no update is triggered:
[0181] {30%,30%,0%} → Do not update
[0182] (2) The current bandwidth utilization of interface 1 and interface 2 increases, that is, the current bandwidth utilization of interface 1, interface 2, and interface 3 are {60%, 50%, 0%} respectively. At this time, the bandwidth utilization of each shortest path interface does not reach the high watermark threshold, and no update is triggered:
[0183] {60%,50%,0%} → Do not update
[0184] (3) The current bandwidth usage of interface 1, interface 2, and interface 3 is changed to {80%, 30%, 0%}. The current bandwidth usage of interface 1 exceeds the high watermark threshold and needs to be triggered to update:
[0185] {80%,30%,0%}→{55%,55%,0%}
[0186] (4) When congestion occurs on interface 1 (buffer alarm on interface 1 or ECN congestion marking message is received), the current bandwidth utilization of interface 1, interface 2 and interface 3 is changed to {100%, 80%, 0%}. After load balancing between interface 1 and interface 2, the bandwidth utilization of interface 1 and interface 2 still exceeds the high watermark threshold. At this time, non-shortest paths need to participate in load sharing and forwarding, triggering an update:
[0187] {100%,80%,0%}→{60%,60%,60%}
[0188] (5) The current bandwidth usage of interface 1, interface 2, and interface 3 is changed to {0%, 0%, 60%}. Only non-shortest path traffic is forwarded. At this time, the non-shortest path traffic needs to be switched back to the shortest path, triggering an update:
[0189] {0%,0%,60%} → {30%,30%,0%}
[0190] (6) The current bandwidth usage of interface 1, interface 2, and interface 3 is changed to {90%, 70%, 20%}. The current bandwidth usage of interface 1 and interface 2 exceeds the high watermark threshold. Therefore, a non-shortest path is required to share part of the traffic, triggering an update:
[0191] {90%,70%,20%}→{60%,60%,60%}
[0192] (7) The current bandwidth usage of interface 1, interface 2, and interface 3 is changed to {90%, 30%, 10%}. The bandwidth usage of interface 1 exceeds the high watermark threshold. Interface 2 and the non-shortest path need to share part of the traffic, triggering an update:
[0193] {90%,30%,10%}→{43%,43%,43%}
[0194] (8) The current bandwidth usage of interface 1, interface 2, and interface 3 is changed to {65%, 55%, 20%}. Since the current bandwidth usage of interface 1 and interface 2 is between the low watermark and the high watermark, no update is triggered:
[0195] {65%,55%,20%} → Do not update
[0196] (9) The current bandwidth usage of interface 1, interface 2, and interface 3 is changed to {80%, 20%, 20%}. If only the shortest path is used for load balancing, the bandwidth usage of interface 1 and interface 2 will not reach the high watermark threshold. Therefore, only the shortest path is set to participate in traffic sharing forwarding, and non-shortest paths are not used for traffic sharing forwarding, triggering an update:
[0197] {80%,20%,20%}→{60%,60%,0}
[0198] (10) The current bandwidth usage of interface 1, interface 2, and interface 3 is changed to {80%, 20%, 80%}. If only the shortest path is used for load balancing, the bandwidth usage of interface 1 and interface 2 will reach the high watermark threshold. Therefore, the shortest path and non-shortest path will jointly participate in traffic sharing and forwarding, triggering an update:
[0199] {80%,20%,80%}→{60%,60%,60%}
[0200] This method can share the traffic load between the shortest path and the non-shortest path, improve the overall bandwidth utilization of the network, and provide a "high-throughput" network environment for data center networks and supercomputing center networks.
[0201] The above methods in the embodiments of the present application can be implemented by the driver layer of the network device, such as Figure 6As shown, an interface bandwidth detection task, an interface buffer congestion detection task, and an interface ECN congestion marking message detection task can be created at the driver layer. When any detection task meets the alarm condition, the driver UCMP will be triggered to perform software refresh, so that the UCMP software in the driver calculates the target bandwidth occupancy of each interface based on the current bandwidth occupancy of each interface. After completing the calculation of the target bandwidth occupancy, the driver directly uses the calculated target bandwidth occupancy to update the hardware register table entry. In this process, the platform software layer of the network device does not need to be involved, the update efficiency is high, and packet loss can be avoided.
[0202] Corresponding to the above method embodiment, Figure 7 As shown, the embodiment of the present application also provides a table entry updating device, which is applied to a driver layer of a network device, and the device includes:
[0203] An acquisition module 701 is used to acquire the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at a preset time interval;
[0204] The determination module 702 is used to determine the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface based on the current bandwidth occupancy of each shortest path interface, the current bandwidth occupancy of each non-shortest path interface, the high watermark threshold and the low watermark threshold if the current bandwidth occupancy of any interface exceeds the high watermark threshold or drops below the low watermark threshold;
[0205] Update module 703 is used to calculate the forwarding weight value of each shortest path interface and the forwarding weight value of each non-shortest path interface based on the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface, and update the forwarding bandwidth value in the hardware register table entry corresponding to each interface based on the calculated forwarding weight value.
[0206] Optionally, the determination module 702 is specifically configured to:
[0207] Calculate a first sum, a first average, and a first maximum value of the current bandwidth occupancy rate of each shortest path interface;
[0208] Calculate the second sum and the second average of the current bandwidth occupancy rates of the non-shortest path interfaces;
[0209] Based on the relationship between the first sum, the first average, the first maximum value, the second sum, the second average, the high watermark threshold, and the low watermark threshold, a target bandwidth occupancy rate of each shortest path interface and a target bandwidth occupancy rate of each non-shortest path interface are determined.
[0210] Optionally, the determination module 702 is specifically configured to:
[0211] When the first average value is less than or equal to the high watermark threshold and the second average value is 0, if the first maximum value is greater than the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface is the first average value and the target bandwidth occupancy rate of each non-shortest path interface is 0;
[0212] When the first average value is greater than the high watermark threshold and the second average value is 0, after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold as the goal, determine the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface;
[0213] When the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth occupancy rate of each shortest path interface will exceed the high watermark threshold if each shortest path interface carries the traffic corresponding to the second sum value; if not, determine the target bandwidth occupancy rate of each shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface, and determine the target bandwidth occupancy rate of each non-shortest path interface to be 0; if so, determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface and each non-shortest path interface;
[0214] When the first average value is greater than the high watermark threshold and the second average value is greater than 0, or when the first average value is greater than the low watermark threshold and less than or equal to the high watermark threshold, and the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum and the second sum, the bandwidth occupancy of each interface is lower than the high watermark threshold as a goal, determine the target bandwidth occupancy of each shortest path interface and each non-shortest path interface;
[0215] When the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, determine whether the bandwidth occupancy rate of each shortest path interface will exceed the high watermark threshold if each shortest path interface carries the traffic corresponding to the first sum and the second sum; if not, determine the target bandwidth occupancy rate of each shortest path interface according to the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and determine the bandwidth occupancy rate of each non-shortest path interface to be 0; if so, determine the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface with the goal that the bandwidth occupancy rate of each interface is lower than the high watermark threshold after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum and the second sum;
[0216] When the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high watermark threshold, if each shortest path interface carries the traffic corresponding to the first sum and the second sum, the bandwidth occupancy of each shortest path interface will not exceed the high watermark threshold, then according to the traffic corresponding to the first sum and the second sum carried by each shortest path interface, the target bandwidth occupancy of each shortest path interface is determined, and the bandwidth occupancy of each non-shortest path interface is determined to be 0.
[0217] Optionally, the acquisition module 701 is specifically configured to:
[0218] Obtaining the number of messages forwarded by each shortest path interface and each non-shortest path interface at every preset time interval;
[0219] For each interface, the ratio between the difference between the number of packets of the interface obtained in two consecutive times and the preset time length is used as the current bandwidth occupancy rate of the interface.
[0220] Optionally, the acquisition module 701 is further used for:
[0221] If the occupied space of the interface buffer of any interface is greater than or equal to the preset space threshold, the current bandwidth occupancy rate of the interface is updated to 100%.
[0222] Optionally, the acquisition module 701 is further used for:
[0223] Receiving service messages through the shortest path interface or the non-shortest path interface;
[0224] If the service message includes an ECN mark, and the value of the ECN mark is the first value or the second value, recording the interface receiving the service message as a non-congested state;
[0225] If the service message includes an ECN mark, and the value of the ECN mark is a third value, recording the interface of the service message as a congested state;
[0226] When the state of any interface changes from a non-congested state to a congested state, the current bandwidth occupancy rate of the interface is updated to 100%.
[0227] The present application also provides an electronic device, such as Figure 8 As shown, it includes a processor 801 , a communication interface 802 , a memory 803 and a communication bus 804 , wherein the processor 801 , the communication interface 802 , and the memory 803 communicate with each other via the communication bus 804 .
[0228] Memory 803, used for storing computer programs;
[0229] The processor 801 is used to implement the method steps in the above method embodiment when executing the program stored in the memory 803.
[0230] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0231] The communication interface is used for communication between the above electronic device and other devices.
[0232] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0233] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0234] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above table entry updating methods are implemented.
[0235] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any table entry updating method in the above embodiments.
[0236] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0237] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0238] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0239] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A table entry updating method, characterized in that: Applied to the driver layer of a network device, the method comprises: Obtain the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at a preset time interval; If the current bandwidth occupancy of any interface exceeds the high watermark threshold or drops below the low watermark threshold, the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface are determined based on the current bandwidth occupancy of each shortest path interface, the current bandwidth occupancy of each non-shortest path interface, the high watermark threshold and the low watermark threshold; Based on the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface, the forwarding weight value of each shortest path interface and the forwarding weight value of each non-shortest path interface are calculated, and the forwarding bandwidth value in the hardware register table entry corresponding to each interface is updated based on the calculated forwarding weight value.
2. The method according to claim 1, characterized in that The step of determining the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface based on the bandwidth occupancy rate of each shortest path interface, the bandwidth occupancy rate of each non-shortest path interface, the high watermark threshold and the low watermark threshold comprises: Calculate a first sum, a first average, and a first maximum value of the current bandwidth occupancy rate of each shortest path interface; Calculate the second sum and the second average of the current bandwidth occupancy rates of the non-shortest path interfaces; Based on the relationship between the first sum, the first average, the first maximum value, the second sum, the second average, the high watermark threshold, and the low watermark threshold, a target bandwidth occupancy rate of each shortest path interface and a target bandwidth occupancy rate of each non-shortest path interface are determined.
3. The method according to claim 2, characterized in that The determining of the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface based on the relationship between the first sum, the first average, the first maximum value, the second sum, the second average, the high watermark threshold, and the low watermark threshold comprises: When the first average value is less than or equal to the high watermark threshold and the second average value is 0, if the first maximum value is greater than the high watermark threshold, it is determined that the target bandwidth occupancy rate of each shortest path interface is the first average value and the target bandwidth occupancy rate of each non-shortest path interface is 0; When the first average value is greater than the high watermark threshold and the second average value is 0, after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold as a goal, determining the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface; When the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth occupancy rate of each shortest path interface exceeds the high watermark threshold if each shortest path interface carries the traffic corresponding to the second sum value; if not, determine the target bandwidth occupancy rate of each shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface, and determine that the target bandwidth occupancy rate of each non-shortest path interface is 0; if so, determine the target bandwidth occupancy rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value carried by each shortest path interface and each non-shortest path interface; When the first average value is greater than the high watermark threshold and the second average value is greater than 0, or when the first average value is greater than the low watermark threshold and less than or equal to the high watermark threshold, and the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, after each shortest path interface and each non-shortest path interface jointly carries the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold as a goal, determining the target bandwidth occupancy of each shortest path interface and each non-shortest path interface; In the case where the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is greater than the high watermark threshold, determine whether the bandwidth occupancy of each shortest path interface will exceed the high watermark threshold if the traffic corresponding to the first sum value and the second sum value is carried by each shortest path interface; if not, determine the target bandwidth occupancy of each shortest path interface according to the traffic corresponding to the first sum value and the second sum value carried by each shortest path interface, and determine the bandwidth occupancy of each non-shortest path interface to be 0; if so, determine the target bandwidth occupancy of each shortest path interface and the target bandwidth occupancy of each non-shortest path interface with the goal that after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each interface is lower than the high watermark threshold; When the first average value is less than or equal to the low watermark threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high watermark threshold, if each shortest path interface carries the traffic corresponding to the first sum value and the second sum value, the bandwidth occupancy of each shortest path interface will not exceed the high watermark threshold, then according to the traffic corresponding to the first sum value and the second sum value carried by each shortest path interface, the target bandwidth occupancy of each shortest path interface is determined, and the bandwidth occupancy of each non-shortest path interface is determined to be 0.
4. The method according to claim 1, characterized in that: The obtaining of the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at preset intervals includes: Obtaining the number of messages forwarded by each shortest path interface and each non-shortest path interface at every preset time interval; For each interface, the ratio between the difference between the number of packets of the interface obtained in two consecutive times and the preset time length is used as the current bandwidth occupancy rate of the interface.
5. The method according to claim 1 or 4, characterized in that: After obtaining the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at every preset time period, the method further includes: If the occupied space of the interface buffer of any interface is greater than or equal to the preset space threshold, the current bandwidth occupancy rate of the interface is updated to 100%.
6. The method according to claim 1 or 4, characterized in that: After obtaining the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at every preset time period, the method further includes: Receiving service messages through the shortest path interface or the non-shortest path interface; If the service message includes an ECN mark, and the value of the ECN mark is the first value or the second value, recording the interface receiving the service message as a non-congested state; If the service message includes an ECN mark, and the value of the ECN mark is a third value, recording the interface of the service message as a congested state; When the state of any interface changes from a non-congested state to a congested state, the current bandwidth occupancy rate of the interface is updated to 100%.
7. A table entry updating device, characterized in that: Applied to the driver layer of a network device, the device comprises: An acquisition module, used for acquiring the current bandwidth occupancy rate of each shortest path interface and each non-shortest path interface at a preset time interval; A determination module, configured to determine a target bandwidth occupancy rate of each shortest path interface and a target bandwidth occupancy rate of each non-shortest path interface based on the current bandwidth occupancy rate of each shortest path interface, the current bandwidth occupancy rate of each non-shortest path interface, the high watermark threshold and the low watermark threshold if the current bandwidth occupancy rate of any interface exceeds the high watermark threshold or drops below the low watermark threshold; An update module is used to calculate the forwarding weight value of each shortest path interface and the forwarding weight value of each non-shortest path interface based on the target bandwidth occupancy rate of each shortest path interface and the target bandwidth occupancy rate of each non-shortest path interface, and update the forwarding bandwidth value in the hardware register table entry corresponding to each interface based on the calculated forwarding weight value.
8. The device according to claim 7, characterized in that The determination module is specifically used for: Calculate a first sum, a first average, and a first maximum value of the current bandwidth occupancy rate of each shortest path interface; Calculate the second sum and the second average of the current bandwidth occupancy rates of the non-shortest path interfaces; Based on the relationship between the first sum, the first average, the first maximum value, the second sum, the second average, the high watermark threshold, and the low watermark threshold, a target bandwidth occupancy rate of each shortest path interface and a target bandwidth occupancy rate of each non-shortest path interface are determined.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-6 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Flow forwarding method, device, equipment and medium
CN113746734A
Method for realizing ECMP flow load balancing and electronic equipment
CN114095441A
Message forwarding method and device
CN116074236A
Route adjustment method and apparatus, and electronic device
CN117081984A
Flow level dynamic load balancing
US9379981B1
