A table entry updating method and device, electronic equipment and storage medium
By dynamically adjusting the bandwidth utilization and forwarding weight values of the shortest and non-shortest paths at the network device driver layer, the problem of low bandwidth utilization in directly connected topology networks is solved, achieving more efficient bandwidth resource utilization and faster traffic switching.
Patent Information
- Application Number
- CN202411373661.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In a directly connected topology network, when the shortest path becomes congested, existing technologies will switch all traffic to non-shortest paths, resulting in the shortest path's bandwidth resources not being fully utilized and reducing the overall bandwidth utilization of the network.
By acquiring the current bandwidth utilization of each shortest path and non-shortest path interface at preset intervals at the driver layer of the network device, determining the target bandwidth utilization based on the high watermark threshold and low watermark threshold, calculating the forwarding weight value, and updating the forwarding bandwidth value in the hardware register table, the system ensures that both the shortest path and non-shortest path can carry traffic, thereby improving bandwidth utilization.
It enables rapid adjustment of path load when network load changes, improves the overall bandwidth utilization of the network, reduces packet loss, and provides a network environment with no packet loss and low latency.
Smart Images

Figure CN119211108B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a table entry updating method and device, an electronic device, and a storage medium. BACKGROUND
[0002] Adaptive routing is a technology of making dynamic routing decisions according to network topology and traffic load changes. Through adaptive routing technology, network devices can select the best path according to real-time network state, link quality, bandwidth utilization, and other conditions to improve network performance and reliability.
[0003] In a direct topology network, each network device has multiple selectable forwarding paths, and an entry network device of the direct topology network can execute an adaptive routing algorithm to select an optimal forwarding path of a message and store information of the optimal forwarding path in an optimal forwarding path table. The entry network device will subsequently use the forwarding path in the optimal forwarding path table to forward the message. Taking sending a message to a certain destination IP address as an example, if the shortest path between the entry 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, and if the shortest path is congested, the information of a non-shortest path is stored in the optimal forwarding path table.
[0004] That is, when the shortest path is congested, the entry network device will use adaptive routing technology to switch all traffic of the shortest path to the non-shortest path, resulting in that the bandwidth resources of the shortest path cannot be fully utilized, and resulting in that the overall bandwidth utilization of the network is reduced. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a table entry updating method and device, an electronic device, and a storage medium to improve the overall bandwidth utilization of the network. The specific technical solutions are as follows:
[0006] In a first aspect, the embodiments of the present application provide a table entry updating method applied to a driver layer of a network device, and the method comprises:
[0007] acquiring current bandwidth occupancy rates of each shortest path interface and each non-shortest path interface every preset time length;
[0008] If the current bandwidth occupancy rate of any interface exceeds the high water line threshold or decreases to below the low water line threshold, the target bandwidth occupancy rates of each shortest path interface and each non-shortest path interface are determined based on the current bandwidth occupancy rates of each shortest path interface and each non-shortest path interface, the high water line threshold, and the low water line threshold;
[0009] Based on the target bandwidth utilization of each shortest path interface and the target bandwidth utilization 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. Based on the calculated forwarding weight values, the forwarding bandwidth value in the hardware register table entry corresponding to each interface is updated.
[0010] In one possible implementation, determining the target bandwidth utilization of each shortest path interface and the target bandwidth utilization of each non-shortest path interface based on the bandwidth utilization of each shortest path interface, the bandwidth utilization of each non-shortest path interface, the high watermark threshold, and the low watermark threshold includes:
[0011] Calculate the first sum, first average, and first maximum value of the current bandwidth utilization of each shortest path interface;
[0012] Calculate the second sum and second average of the current bandwidth utilization of each non-shortest path interface;
[0013] 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined.
[0014] In one possible implementation, determining the target bandwidth utilization of each shortest path interface and the target bandwidth utilization of each non-shortest path interface based on the magnitude 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 includes:
[0015] If the first average value is less than or equal to the high watermark threshold and the second average value is 0, and the first maximum value is greater than the high watermark threshold, then the target bandwidth utilization rate of each shortest path interface is determined to be the first average value, and the target bandwidth utilization 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined with the goal that the bandwidth utilization 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 value.
[0017] If the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth utilization 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 utilization rate of each shortest path interface according to the traffic corresponding to the second sum value being carried by each shortest path interface, and determine the target bandwidth utilization rate of each non-shortest path interface to be 0. If yes, determine the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value being carried by both the shortest path interface and each non-shortest path interface.
[0018] When the first average value is greater than the high waterline threshold and the second average value is greater than 0, or when the first average value is greater than the low waterline threshold, less than or equal to the high waterline threshold, the second average value is greater than 0, and the first maximum value is greater than the high waterline threshold, the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface is determined with the goal of ensuring that the bandwidth utilization rate of each interface is lower than the high waterline threshold 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.
[0019] If the first average value is less than or equal to the low waterline threshold, the second average value is greater than 0, and the first maximum value is greater than the high waterline threshold, determine whether the bandwidth utilization rate of each shortest path interface would exceed the high waterline threshold if each shortest path interface carried the traffic corresponding to the first sum and the second sum. If not, determine the target bandwidth utilization rate of each shortest path interface based on the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and determine that the bandwidth utilization rate of each non-shortest path interface is 0. If yes, determine the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface based on the goal that the bandwidth utilization rate of each interface is lower than the high waterline 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.
[0020] If the first average value is less than or equal to the low waterline threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high waterline threshold, and if each shortest path interface carries the traffic corresponding to the first sum and the second sum, the bandwidth utilization rate of each shortest path interface will not exceed the high waterline threshold, then the target bandwidth utilization rate of each shortest path interface is determined according to the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and the bandwidth utilization rate of each non-shortest path interface is determined to be 0.
[0021] In one possible implementation, obtaining the current bandwidth utilization rate of each shortest path interface and each non-shortest path interface at preset intervals includes:
[0022] The number of packets forwarded by each shortest path interface and each non-shortest path interface is obtained at each preset time interval.
[0023] For each interface, the ratio between the difference between two consecutive acquisitions of the number of packets for that interface and the preset duration is used as the current bandwidth utilization rate of that interface.
[0024] In one possible implementation, after acquiring the current bandwidth utilization of each shortest path interface and each non-shortest path interface at preset intervals, 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 utilization of that interface will be updated to 100%.
[0026] In one possible implementation, after acquiring the current bandwidth utilization of each shortest path interface and each non-shortest path interface at preset intervals, the method further includes:
[0027] Receive service messages through the shortest path interface or the non-shortest path interface;
[0028] If the service message includes an ECN tag, and the value of the ECN tag is a first value or a second value, then the interface receiving the service message will be recorded as being in a non-congested state.
[0029] If the service message includes an ECN tag and the value of the ECN tag is a third value, then the interface of the service message is recorded as congested.
[0030] When the state of any interface changes from non-congested to congested, the current bandwidth utilization of that interface is updated to 100%.
[0031] Secondly, embodiments of this application provide an entry updating apparatus applied to the driver layer of a network device, the apparatus comprising:
[0032] The acquisition module is used to acquire the current bandwidth utilization of each shortest path interface and each non-shortest path interface at preset intervals.
[0033] The determination module is used to determine the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface based on the current bandwidth utilization rate of each shortest path interface, the current bandwidth utilization rate of each non-shortest path interface, the high watermark threshold, and the low watermark threshold if the current bandwidth utilization rate of any interface exceeds the high watermark threshold or decreases to below the low watermark threshold.
[0034] The 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 utilization rate of each shortest path interface and the target bandwidth utilization 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 one possible implementation, the determining module is specifically used for:
[0036] Calculate the first sum, first average, and first maximum value of the current bandwidth utilization of each shortest path interface;
[0037] Calculate the second sum and second average of the current bandwidth utilization of each non-shortest path interface;
[0038] 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined.
[0039] In one possible implementation, the determining module is specifically used for:
[0040] If the first average value is less than or equal to the high watermark threshold and the second average value is 0, and the first maximum value is greater than the high watermark threshold, then the target bandwidth utilization rate of each shortest path interface is determined to be the first average value, and the target bandwidth utilization 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined with the goal that the bandwidth utilization 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 value.
[0042] If the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth utilization 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 utilization rate of each shortest path interface according to the traffic corresponding to the second sum value being carried by each shortest path interface, and determine the target bandwidth utilization rate of each non-shortest path interface to be 0. If yes, determine the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value being carried by both the shortest path interface and each non-shortest path interface.
[0043] When the first average value is greater than the high waterline threshold and the second average value is greater than 0, or when the first average value is greater than the low waterline threshold, less than or equal to the high waterline threshold, the second average value is greater than 0, and the first maximum value is greater than the high waterline threshold, the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface is determined with the goal of ensuring that the bandwidth utilization rate of each interface is lower than the high waterline threshold 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.
[0044] If the first average value is less than or equal to the low waterline threshold, the second average value is greater than 0, and the first maximum value is greater than the high waterline threshold, determine whether the bandwidth utilization rate of each shortest path interface would exceed the high waterline threshold if each shortest path interface carried the traffic corresponding to the first sum and the second sum. If not, determine the target bandwidth utilization rate of each shortest path interface based on the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and determine that the bandwidth utilization rate of each non-shortest path interface is 0. If yes, determine the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface based on the goal that the bandwidth utilization rate of each interface is lower than the high waterline 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.
[0045] If the first average value is less than or equal to the low waterline threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high waterline threshold, and if each shortest path interface carries the traffic corresponding to the first sum and the second sum, the bandwidth utilization rate of each shortest path interface will not exceed the high waterline threshold, then the target bandwidth utilization rate of each shortest path interface is determined according to the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and the bandwidth utilization rate of each non-shortest path interface is determined to be 0.
[0046] In one possible implementation, the acquisition module is specifically used for:
[0047] The number of packets forwarded by each shortest path interface and each non-shortest path interface is obtained at each preset time interval.
[0048] For each interface, the ratio between the difference between two consecutive acquisitions of the number of packets for that interface and the preset duration is used as the current bandwidth utilization rate of that interface.
[0049] In one possible implementation, the acquisition module is further configured 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 utilization of that interface will be updated to 100%.
[0051] In one possible implementation, the acquisition module is further configured to:
[0052] Receive service messages through the shortest path interface or the non-shortest path interface;
[0053] If the service message includes an ECN tag, and the value of the ECN tag is a first value or a second value, then the interface receiving the service message will be recorded as being in a non-congested state.
[0054] If the service message includes an ECN tag and the value of the ECN tag is a third value, then the interface of the service message is recorded as congested.
[0055] When the state of any interface changes from non-congested to congested, the current bandwidth utilization of that interface is updated to 100%.
[0056] Thirdly, embodiments of this application provide 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] When a processor executes a program stored in memory, it implements the method described in the first aspect above.
[0059] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in the first aspect above.
[0060] Fifthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in the first aspect above.
[0061] By employing the above technical solution, the current bandwidth utilization rate of each shortest path interface and each non-shortest path interface can be obtained at preset intervals. If the current bandwidth utilization rate of any interface exceeds the high-watermark threshold or falls below the low-watermark threshold, the network device does not switch all traffic to the shortest path or all traffic to a non-shortest path. Instead, based on the current bandwidth utilization rates of each shortest path interface, each non-shortest path interface, the high-watermark threshold, and the low-watermark threshold, the target bandwidth utilization rates of each shortest path interface and each non-shortest path interface are determined. Then, based on the determined target bandwidth utilization rates, the forwarding weight value of each interface is calculated, and the forwarding bandwidth value in the corresponding hardware register table of each interface is updated based on the calculated forwarding weight value. In this way, subsequent interfaces can carry traffic according to the target bandwidth utilization rate, meaning both the shortest path and non-shortest path can carry traffic, thus improving the overall bandwidth utilization rate. Attached Figure Description
[0062] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0063] Figure 1 A structural diagram of a direct-connect topology network for a large supercomputing center provided in this application embodiment;
[0064] Figure 2 An exemplary schematic diagram illustrating a switching process between the shortest path and a non-shortest path provided in an embodiment of this application;
[0065] Figure 3 This is a schematic diagram illustrating the communication process between the driver and the platform in related technologies.
[0066] Figure 4 A flowchart of a table entry update method provided in this application embodiment;
[0067] Figure 5 This application provides a schematic diagram of an adaptive routing network architecture.
[0068] Figure 6 A schematic diagram illustrating a table entry updating method provided in an embodiment of this application;
[0069] Figure 7 This is a schematic diagram of the structure of a table entry update method provided in an embodiment of this application;
[0070] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0071] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0072] To facilitate understanding, the relevant terms involved in the embodiments of this application will be introduced first.
[0073] Equal-Cost Multi-Path (ECMP) is a routing algorithm used to distribute data traffic across multiple paths with the same cost in order to achieve load balancing and improve network fault tolerance.
[0074] Unequal-Cost Multi-Path (UCMP) is a routing algorithm used to distribute data traffic across multiple paths with different costs to achieve more efficient load balancing and resource utilization. Compared to ECMP, UCMP allows traffic to be distributed across different paths according to traffic size or other metrics, rather than simply distributing traffic evenly.
[0075] Adaptive routing: A routing method in which network devices, such as routers or switches, can dynamically adjust route selection based on current network conditions and load. Using adaptive routing technology, network devices can select the optimal path based on real-time network status, link quality, and bandwidth utilization, thereby improving network performance and reliability.
[0076] Currently, building large-scale supercomputing center networks requires interconnecting a large number of computing nodes. However, the expansion of cluster size leads to increased network latency and deployment costs, failing to meet computing power demands and deployment requirements. Directly connected topology networks, on the other hand, have the advantages of large access scale and small network diameter. Therefore, adaptive routing technology can be combined with directly connected topology networks and applied to large-scale supercomputing center networks. When the shortest path is available, the shortest path is prioritized for forwarding packets; when the shortest path is congested, a non-shortest path that is not congested is selected for forwarding packets. This can fully utilize network links, improve bandwidth utilization, and meet the requirements of high throughput, low latency, and low cost while supporting large-scale networking.
[0077] like Figure 1 As shown, Figure 1This is an example of a direct-connect topology network for a large supercomputing center. The network comprises nine network groups. Rectangles within each group represent switches, and dots connected to these rectangles represent compute nodes, i.e., servers. Connections between switches within the same group represent local links, connections between switches in different groups represent global links, and connections between servers and switches represent access links.
[0078] by Figure 1 Taking the communication between the second switch (referred to as switch 1) in the topmost network group and the third switch (referred to as switch 2) in the bottommost network group 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 a server connected to switch 1 needs to access a server connected to switch 2, when the shortest path between switch 1 and switch 2 is clear, switch 1 forwards the server's access data according to the shortest path; when the shortest path is congested, adaptive routing technology is triggered, and switch 1 switches to forwarding the server's access data according to a non-shortest path. This can fully utilize network links and improve bandwidth utilization.
[0080] The following explains how adaptive routing works.
[0081] In a directly connected topology network, each network node has multiple forwarding paths to choose from. The ingress node (or simply ingress node) can execute an adaptive routing algorithm to select the optimal forwarding path for the packet. Subsequent non-ingress nodes can forward the packet directly by looking up the routing table without having to reselect a forwarding path.
[0082] Each ingress node needs to maintain a table to store the best forwarding path information based on routing information and link congestion status. This table is called the best path table. Taking a 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 between the ingress node and the destination IP address.
[0083] like Figure 2 As shown, Figure 2 The example of computing node S sending a message to computing node D demonstrates the switching process between the shortest path and non-shortest path.
[0084] Figure 2The filled portion in the upper rectangle represents the weighted sum of the bandwidth utilization level and queue depth level of interface 1 connecting the ingress node to the egress node. The lower line in each rectangle represents the low watermark of the weighted sum of the bandwidth utilization level and queue depth level, and the upper line in each rectangle represents the high watermark of the weighted sum of the bandwidth utilization level and queue depth level. Figure 2 The small rectangles that are not filled on the input node 1 represent interface 1, and the small rectangles with black fill represent interface 2.
[0085] See 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 outgress interface is interface 1, and the path type is the shortest path within the group. The shortest path for compute node S to send a message to compute node D is S->1->3->D. Since the weighted sum of the bandwidth utilization level and queue depth level of interface 1 of ingress node 1 has not reached the high watermark, interface 1 is not congested. Therefore, when ingress node 1 receives a message sent by compute node S to compute node D, the optimal forwarding path found in the optimal path table is the shortest path, and the outgress 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 Figure 2 In (2), the weighted sum of the bandwidth utilization level and queue depth level of interface 1 exceeds the high watermark, meaning interface 1 is congested. In this case, the path information of the shortest path within the network via interface 1 in the optimal path table is deleted and replaced with the path information of the non-shortest path within 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 non-shortest path within 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 from compute node S to compute node D, the optimal forwarding path found in the optimal path table is not the shortest path, and the outgoing interface is interface 2. The ingress interface can send messages through interface 2 according to the information in the optimal path table.
[0088] See Figure 2 In (3), the weighted sum of the bandwidth utilization level and 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 path information of the non-shortest path. Therefore, when the ingress node 1 receives the message sent by the compute node S to the compute node D, the optimal forwarding path found in the optimal path table is the non-shortest path, the outgress interface is interface 2, and the ingress interface can send the message through interface 2 according to the information in the optimal path table.
[0089] See Figure 3In (4), the weighted sum of the bandwidth utilization level and queue depth level of interface 1 falls below the low waterline. 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 compute node S to compute node D, the optimal forwarding path found in the optimal path table is the shortest path, the outgoing interface is interface 1, and the ingress interface can send messages through interface 1 according to the information in the optimal path table.
[0090] As can be seen from the above process, when the shortest path becomes congested, the path information in the optimal path table will be modified to the path information of non-shortest paths. As a result, the traffic originally carried by the shortest path will be switched to non-shortest paths. This will cause the bandwidth resources of the shortest path to be underutilized, resulting in a decrease in the overall bandwidth utilization of the network.
[0091] Additionally, when the traffic load on the network link fluctuates or changes, such as Figure 4 As shown, the network device's driver layer senses the interface bandwidth occupancy and congestion status, then reports this information to the platform software layer. The platform software layer then uses an adaptive routing algorithm to calculate and process the new path information, notifying the driver layer of the newly calculated path and traffic switching. This process involves communication between the network device's driver layer, the platform software layer, and back to the driver layer, which is cumbersome and time-consuming, and prone to packet loss. For scenarios with short-term network load changes, this switching method cannot meet the network's stability and timeliness requirements.
[0092] To address the aforementioned problems, this application provides a table entry update method, which is applied to the driver layer of a network device, such as... Figure 5 As shown, the method includes:
[0093] S401. At preset intervals, obtain the current bandwidth utilization rate of each shortest path interface and each non-shortest path interface.
[0094] The preset duration is a pre-set empirical value; for example, the preset duration can be 10ms.
[0095] A network device has at least one shortest path interface and at least one non-shortest path interface. Each shortest path has one shortest path interface, and each non-shortest path has one non-shortest path interface. It can be understood that the shortest path interface refers to the outgoing interface on the network device that connects to the shortest path, and the non-shortest path interface refers to the outgoing interface on the network device that connects to the non-shortest path.
[0096] S402. If the current bandwidth utilization rate of any interface exceeds the high watermark threshold or decreases to below the low watermark threshold, then based on the current bandwidth utilization rate of each shortest path interface, the current bandwidth utilization rate of each non-shortest path interface, the high watermark threshold, and the low watermark threshold, determine the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface.
[0097] If the current bandwidth utilization of any interface exceeds the high watermark threshold, it indicates that the interface is currently congested, and therefore the traffic carried by each path needs to be readjusted. If the current bandwidth utilization of any interface decreases from above the low watermark threshold to below the low watermark threshold, it indicates that the path containing that interface is carrying less traffic, and therefore 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 utilization rate of each shortest path interface and the target bandwidth utilization rate 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] The forwarding weight value of an interface is the product of the interface's bandwidth and its bandwidth utilization rate. After calculating the forwarding weight value of the interface, 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 represent the number of packets that the interface can forward.
[0100] Taking a 100G interface as an example, if the target bandwidth utilization rate of the interface is 60%, then the forwarding weight of the interface is 100G * 60% = 60G. This updates the hardware register table entry of the interface inside the switching chip, thereby setting the forwarding bandwidth value of the interface to 60G, that is, the packet volume allocated to the interface is 60G.
[0101] Understandably, subsequent network devices forward packets according to the updated hardware register entries, so that traffic can be distributed across paths according to the forwarding weight values of each path interface.
[0102] In one implementation, the forwarding chip stores a hardware register table, which includes a hardware register table entry for each interface.
[0103] In another implementation, the forwarding chip stores the interface information for each interface, and the interface information for each interface includes the hardware register table entry for that interface.
[0104] This method acquires the current bandwidth utilization of each shortest path interface and each non-shortest path interface at preset intervals. If the current bandwidth utilization of any interface exceeds the high-watermark threshold or falls below the low-watermark threshold, the network device does not switch all traffic to the shortest path or all traffic to a non-shortest path. Instead, based on the current bandwidth utilization of each shortest path interface, each non-shortest path interface, the high-watermark threshold, and the low-watermark threshold, it determines the target bandwidth utilization of each shortest path interface and each non-shortest path interface. Then, based on the determined target bandwidth utilization, it calculates the forwarding weight value for each interface and updates the forwarding bandwidth value in the corresponding hardware register table for each interface. This ensures that subsequent interfaces carry traffic according to the target bandwidth utilization, meaning both shortest and non-shortest paths can carry traffic, thus improving overall bandwidth utilization.
[0105] In addition, since the above processes are all executed by the driver layer of the network device and do not depend on the platform software layer, the driver layer of the network device does not need to communicate with the platform software layer during the process of adjusting the weight of each forwarding path interface. This can improve the update efficiency of the hardware register entries corresponding to the interface, improve the routing convergence time, and thus improve the traffic switching speed. It can significantly reduce packet loss and provide a lossless network environment of "no packet loss and low latency" for data center networks and supercomputing centers.
[0106] In some embodiments of this application, the above-mentioned step S401, obtaining the current bandwidth utilization rate of each shortest path interface and each non-shortest path interface at preset intervals, 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 intervals.
[0108] For each interface, the ratio between the difference between two consecutive acquisitions of the number of packets for that interface and a preset duration is used as the current bandwidth utilization rate of that interface.
[0109] For example, if the number of packets forwarded by the interface is X when it is first obtained, and the number of packets forwarded by the interface is Y when it is obtained 10ms later, then the current bandwidth utilization rate of the interface is (YX) / 10.
[0110] In this way, the current bandwidth utilization of each interface can be accurately obtained, enabling the load of each path to be accurately adjusted based on the current bandwidth utilization.
[0111] In an optional implementation, after step S401, where the current bandwidth utilization of each shortest path interface and each non-shortest path interface is obtained at preset intervals, 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 utilization of that interface will be updated to 100%.
[0113] The preset space threshold can be set based on the actual situation. 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. Then, the current bandwidth utilization of the interface can be updated to 100% to trigger the update of the table entries in a timely manner.
[0114] In another optional implementation, based on any of the above implementations, after obtaining the current bandwidth utilization rate of each shortest path interface and each non-shortest path interface at preset intervals in S401, the method further includes the following steps:
[0115] Step 1: Receive service messages through the shortest path interface or a non-shortest path interface.
[0116] Step 2: If the service message includes an Explicit Congestion Notification (ECN) flag, and the value of the ECN flag is a first value or a second value, then the interface receiving the service message is recorded as non-congested; if the service message includes an ECN flag, and the value of the ECN flag is a third value, then the interface receiving the service message is recorded as congested.
[0117] The first value is 01, the second value is 10, and when the ECN is 01 or 01, it indicates that there is no congestion on the link between the network device and the network device that sent the service message. The third value is 11, and when the ECN is 11, it indicates that there is congestion on the link between the network device and the network device that sent 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 ACL entries to match packets carrying ECN tags. For example, the matching field of this ACL entry can be "carrying ECN tag," and the action field can be: if the ECN tag value is 01 or 10, then the status of the interface receiving the service packet is recorded as non-congested; if the ECN tag value is 11, then the status of the interface receiving the service packet is recorded as congested.
[0120] It should be noted that if the value of the ECN flag is 11, it indicates that there is congestion in the forward path direction of the interface receiving the service message. In order to alleviate the congestion in the forward path direction, the status of the interface can be recorded as congested, so as to reduce the number of messages sent to the forward path through the service message, thereby alleviating the congestion in the forward path direction.
[0121] For example, if network device A is connected to network device B through interface 1, and network device A receives service packet 1 from network device B through interface 1, and the ECN flag value carried in service packet 1 is 11, it indicates that network device B is congested. Therefore, network device A records the state of interface 1 as congested, so that the forwarding weight value of interface 1 can be reduced in the future, thereby reducing the traffic forwarded to network device B through interface 1 and alleviating the congestion of network device B.
[0122] Step 3: When the state of any interface changes from non-congested to congested, update the current bandwidth utilization of that interface to 100%.
[0123] Using this method, when congestion occurs in the path ahead of the interface, the current bandwidth utilization of the interface is updated to 100% to adjust the traffic carried by the path where the interface is located. This can alleviate the congestion problem of the path where the interface is located and improve the overall network performance.
[0124] Based on the above embodiments, in step S402, if the current bandwidth utilization rate of any interface exceeds the high watermark threshold or decreases below the low watermark threshold, then based on the current bandwidth utilization rate of each shortest path interface, the current bandwidth utilization rate of each non-shortest path interface, the high watermark threshold, and the low watermark threshold, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined. Specifically, this can be implemented as follows:
[0125] Step A: Calculate the first sum, first average, and first maximum value of the current bandwidth utilization of each shortest path interface; calculate the second sum and second average value of the current bandwidth utilization of each non-shortest path interface.
[0126] In this embodiment of the application, the bandwidth utilization rate of each shortest path interface is represented as {p1, p2, ..., p m}, where p1 represents the bandwidth utilization of the first shortest path interface, p2 represents the bandwidth utilization of the second shortest path interface, and p m This represents the bandwidth utilization of the m-th shortest path interface, where m is the number of shortest path interfaces.
[0127] The bandwidth utilization of each non-shortest path interface is represented 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 This represents the bandwidth utilization 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: Based on the relationship between the first sum, the first average, the first maximum, the second sum, the second average, and the high watermark threshold and the low watermark threshold, determine the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface.
[0131] In this embodiment, both the low waterline threshold and the high waterline threshold are bandwidth utilization thresholds set based on experience. The low waterline threshold is denoted as α, and the high waterline threshold is denoted as β.
[0132] Step B specifically includes the following 6 situations:
[0133] Case 1: If the first average value is less than or equal to the high watermark threshold and the second average value is 0, and the first maximum value is greater than the high watermark threshold, then the target bandwidth utilization rate of each shortest path interface is determined to be the first average value, and the target bandwidth utilization rate of each non-shortest path interface is 0.
[0134] In addition, if the first average value is less than or equal to the high watermark threshold and the second average value is 0, then if the first maximum value is less than or equal to the high watermark threshold, there is no need to adjust the target bandwidth utilization of each interface.
[0135] Case 1 can be represented as:
[0136]
[0137] p i ′ q represents the target bandwidth utilization rate of each shortest path interface. j ′ This indicates the target bandwidth utilization rate of each non-shortest path interface.
[0138] in, and This indicates that the average bandwidth utilization 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 utilization of each shortest path interface has not exceeded the high watermark threshold, and in this case, there is no need to update the UCMP adaptive route; p max >β indicates that among the shortest path interfaces, some interfaces have bandwidth utilization exceeding the high watermark threshold. In this case, UCMP adaptive routing updates are required. Because... This demonstrates that after load balancing among the shortest paths, the bandwidth utilization of each shortest path interface remains below the high watermark threshold. Therefore, there is no need to distribute traffic to non-shortest paths. Thus, the target bandwidth utilization rate 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined 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, the bandwidth utilization rate of each interface is lower than the high watermark threshold.
[0140] In one implementation, peak shaving and valley filling can be used to redirect a portion of the traffic carried by the shortest path interface to non-shortest path interfaces, ensuring that the bandwidth utilization of both shortest and non-shortest path interfaces is below the high watermark threshold. Alternatively, other load balancing methods can be used to determine the target bandwidth utilization of each shortest and non-shortest path interface, ensuring that the determined target bandwidth utilization is below the high watermark threshold.
[0141] For example, it can be determined that the target bandwidth utilization of each shortest path interface and the target bandwidth utilization of each non-shortest path interface are both third average values. The third average value is the average of the current bandwidth utilization of each shortest path interface and the current bandwidth utilization of each non-shortest path interface. The third average value can be expressed as...
[0142] Case 2 can be represented as:
[0143]
[0144]
[0145] Among them, when and When the average bandwidth utilization of each shortest path interface exceeds the high watermark threshold, it means that even after load balancing among the shortest paths, the bandwidth utilization of each shortest path interface cannot be reduced below the high watermark threshold. In this case, non-shortest path interfaces need to participate in traffic load balancing. Therefore, the target bandwidth utilization rate set for each shortest path interface and each non-shortest path interface is...
[0146] Case 3: If the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth utilization 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 utilization 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 utilization rate of each non-shortest path interface to be 0. If yes, determine the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value jointly carried by each shortest path interface and each non-shortest path interface.
[0147] The ratio between the second sum and the number of shortest path interfaces can be calculated to obtain the fourth average value. If the fourth average value is less than or equal to the high watermark threshold, it means that if each shortest path interface carries the traffic corresponding to the second sum, the bandwidth utilization 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, then the target bandwidth utilization rate of each shortest path interface is determined to be the fourth average value, and the target bandwidth utilization rate of each non-shortest path interface is 0. Alternatively, other methods can be used to determine the target bandwidth utilization rate of each shortest path interface, as long as it is ensured that the bandwidth utilization 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, then the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined to be the fifth average value. The fifth average value is the ratio between the second sum value and the total number of shortest path and non-shortest path interfaces. Alternatively, the peak shaving and valley filling method can be used to determine the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface, so that the determined target bandwidth utilization rate is lower than the high watermark threshold.
[0149] Where the number of interfaces with the shortest path is m, and the number of interfaces with non-shortest paths is n, then the fifth average can be expressed as: The sixth average can be expressed as
[0150] Case 3 can be specifically represented as:
[0151]
[0152]
[0153] Among them, when and This indicates that there is no traffic forwarding on the shortest path, and traffic forwarding only exists on non-shortest paths, requiring traffic to be switched to the shortest path. In this case, if This means that after switching all traffic back to the shortest path, the bandwidth utilization of each shortest path interface will not exceed the high watermark threshold, so it is set... q j ′ =0; otherwise, if Then, non-shortest paths need to participate in traffic sharing, i.e., setting...
[0154] Case 4: When the first average value is greater than the high watermark threshold and the second average value is greater than 0, the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface is determined with the goal of ensuring that the bandwidth utilization 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 and second sum values.
[0155] In one implementation, peak shaving and valley filling can be used to redirect some of the traffic carried by the shortest path interface to some shortest path interfaces or some non-shortest path interfaces, ensuring that the target bandwidth utilization of each interface is below the high watermark threshold. Alternatively, other load balancing methods can be used to determine the target bandwidth utilization of each shortest path interface and each non-shortest path interface, ensuring that the determined target bandwidth utilization is below the high watermark threshold.
[0156] For example, it can be determined that the target bandwidth utilization of each shortest path interface and the target bandwidth utilization of each non-shortest path interface are both the third average value.
[0157] Case 4 can be specifically represented as:
[0158]
[0159] when and When this occurs, it indicates that the bandwidth utilization of the interface with the shortest path has exceeded the high watermark threshold, and traffic forwarding also occurs on non-shortest paths. In this case, traffic forwarding needs to be reloaded by both the shortest and non-shortest paths, i.e., setting...
[0160] Case 5: When the first average value is greater than the low waterline threshold and less than or equal to the high waterline threshold, and the second average value is greater than 0, and the first maximum value is greater than the high waterline threshold, the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface is determined with the goal of ensuring that the bandwidth utilization rate of each interface is lower than the high waterline threshold after each shortest path interface and each non-shortest path interface jointly carry the traffic corresponding to the first and second sum values.
[0161] In one implementation, peak shaving and valley filling can be used to redirect some of the traffic carried by the shortest path interface to some shortest path interfaces or some non-shortest path interfaces, ensuring that the target bandwidth utilization of each interface is below the high watermark threshold. Alternatively, other load balancing methods can be used to determine the target bandwidth utilization of each shortest path interface and each non-shortest path interface, ensuring that the determined target bandwidth utilization is below the high watermark threshold.
[0162] For example, it can be determined that the target bandwidth utilization of each shortest path interface and the target bandwidth utilization of each non-shortest path interface are both the third average value.
[0163] Case 5 can be specifically represented as:
[0164]
[0165] Among them, when and If the bandwidth utilization of any interface in the shortest path exceeds the high-watermark threshold, then the traffic forwarding needs to be reloaded by both the shortest and non-shortest path interfaces. This requires setting... Otherwise, no action is required.
[0166] Case 6: If 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 utilization of each shortest path interface would exceed the high watermark threshold if each shortest path interface carried the traffic corresponding to the first and second sum values. If not, determine the target bandwidth utilization of each shortest path interface based on the traffic corresponding to the first and second sum values carried by each shortest path interface, and determine that the bandwidth utilization of each non-shortest path interface is 0. If yes, determine the target bandwidth utilization of each shortest path interface and the target bandwidth utilization of each non-shortest path interface based on the goal that the bandwidth utilization of each interface is lower than the high watermark threshold after both the shortest and non-shortest path interfaces jointly carry the traffic corresponding to the first and second sum values.
[0167] The ratio between the sum of the first and second sums and the number of shortest path interfaces can be calculated to obtain the sixth average value. If the sixth average value is less than or equal to the high watermark threshold, it means that if each shortest path interface carries the traffic corresponding to the first and second sums, the bandwidth utilization 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, then the target bandwidth utilization rate of each shortest path interface is determined to be the sixth average value, and the target bandwidth utilization rate of each non-shortest path interface is 0. Alternatively, other methods can be used to determine the target bandwidth utilization rate of each shortest path interface, as long as the bandwidth utilization 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, then the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined to be the third average value. Alternatively, peak shaving and valley filling methods can be used to determine the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface, so that the determined target bandwidth utilization rate is lower than the high watermark threshold.
[0169] If the first average value is less than or equal to the low waterline threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high waterline threshold, and if each shortest path interface carries the traffic corresponding to the first sum and the second sum, the bandwidth utilization rate of each shortest path interface will not exceed the high waterline threshold, then the target bandwidth utilization rate of each shortest path interface is determined according to the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and the bandwidth utilization rate of each non-shortest path interface is determined to be 0.
[0170] Among them, it can be determined that the target bandwidth utilization rate of each shortest path interface is the sixth average value, and the target bandwidth utilization rate of each non-shortest path interface is 0. Alternatively, other methods can be used to determine the target bandwidth utilization rate of each shortest path interface, as long as the bandwidth utilization rate of each shortest path interface does not exceed the high watermark threshold.
[0171] The sixth average can be expressed as
[0172] Case 6 can be specifically represented as:
[0173]
[0174] Among them, when and When the average bandwidth utilization of each shortest path interface is below the low waterline threshold, it indicates that traffic is still being forwarded on non-shortest paths. Therefore, it is necessary to consider switching the traffic of non-shortest paths back to the shortest paths.
[0175] If p max>β, meaning that the bandwidth utilization of some interfaces on the shortest path exceeds the high watermark threshold, in which case the traffic needs to be redistributed. If That is, assuming that all traffic will not cause the bandwidth utilization of each shortest path interface to exceed the high watermark threshold when forwarded only on the shortest path, then setting... q j ′ =0, ensuring all traffic is forwarded only along the shortest path; if If the bandwidth utilization of each shortest path interface does not exceed the high watermark threshold, and the shortest path is insufficient to forward all traffic, then both the shortest and non-shortest paths need to share the forwarding load. This is achieved by setting...
[0176] If p max ≤β means that no interface on the shortest path has a bandwidth utilization rate exceeding the high watermark threshold, and after switching traffic carried by non-shortest paths back to the shortest paths, the bandwidth utilization rate of each interface will not exceed the high watermark threshold. Therefore, setting... q j ′ =0, otherwise no setting is needed.
[0177] By configuring the above settings, the bandwidth utilization of each interface can be kept below the high watermark threshold as much as possible, avoiding severe network congestion and improving the overall bandwidth utilization of the network.
[0178] The following section uses specific examples to illustrate how to adjust the target bandwidth utilization of each interface, such as... Figure 5 As shown, Figure 5 This is a network diagram for adaptive routing. Figure 6 The system includes three devices: Device 1, Device 2, and Device 3. Device 1 has three outgoing interfaces: Interface 1, Interface 2, and Interface 3. There are two shortest paths between Device 1 and Device 2. Interface 1 and Interface 2 are the outgoing interfaces on Device 1 corresponding to these two shortest paths, respectively. Interface 3 is the outgoing interface for the non-shortest path between Device 1 and Device 3. Interfaces 1, 2, and 3 have equal bandwidth.
[0179] Assuming the low-water threshold is 50% and the high-water threshold is 70%, and {x, y, z} represent the current bandwidth utilization of interface 1, interface 2, and interface 3 respectively, the process of updating the target bandwidth utilization for each interface as the current bandwidth utilization changes is as follows:
[0180] (1) The current bandwidth utilization rates of interfaces 1, 2, and 3 are {30%, 30%, 0}, meaning that only the shortest path forwards traffic, and no traffic is forwarded on non-shortest paths. Furthermore, the bandwidth utilization rates of interfaces 1 and 2 are both below the low watermark threshold, so no update is triggered at this time.
[0181] {30%, 30%, 0%} → No update
[0182] (2) The current bandwidth utilization of interfaces 1 and 2 increases, that is, the current bandwidth utilization of interfaces 1, 2 and 3 are {60%, 50%, 0%} respectively. At this time, the bandwidth utilization of each shortest path interface has not reached the high watermark threshold, and no update is triggered:
[0183] {60%, 50%, 0%} → No update
[0184] (3) The current bandwidth utilization of interfaces 1, 2, and 3 has changed to {80%, 30%, 0%}. The current bandwidth utilization of interface 1 exceeds the high watermark threshold, requiring an update to be triggered.
[0185] {80%, 30%, 0%} → {55%, 55%, 0%}
[0186] (4) When interface 1 becomes congested (interface 1 receives a buffer alarm or an ECN congestion flag message), the current bandwidth utilization of interfaces 1, 2, and 3 changes to {100%, 80%, 0%}. After load balancing between interfaces 1 and 2, if the bandwidth utilization of interfaces 1 and 2 still exceeds the high watermark threshold, then non-shortest path components need to participate in load balancing and forwarding, triggering an update:
[0187] {100%, 80%, 0%} → {60%, 60%, 60%}
[0188] (5) The current bandwidth utilization of interfaces 1, 2, and 3 has changed to {0%, 0%, 60%}, with only non-shortest path traffic being forwarded. At this point, 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 utilization of interfaces 1, 2, and 3 changes to {90%, 70%, 20%}. The current bandwidth utilization of interfaces 1 and 2 both exceed the high watermark threshold, so a portion of the traffic needs to be shared via a non-shortest path, triggering an update:
[0191] {90%, 70%, 20%} → {60%, 60%, 60%}
[0192] (7) The current bandwidth utilization of interfaces 1, 2, and 3 has changed to {90%, 30%, 10%}. The bandwidth utilization of interface 1 exceeds the high watermark threshold, requiring interface 2 and non-shortest path to share some traffic, triggering an update:
[0193] {90%, 30%, 10%} → {43%, 43%, 43%}
[0194] (8) The current bandwidth utilization of interfaces 1, 2, and 3 has changed to {65%, 55%, 20%}. Since the current bandwidth utilization of interfaces 1 and 2 is between the low and high watermarks, no update is triggered.
[0195] {65%, 55%, 20%} → No update
[0196] (9) The current bandwidth utilization of interfaces 1, 2, and 3 is changed to {80%, 20%, 20%}. Furthermore, if only the shortest path participates in load balancing, the bandwidth utilization of interfaces 1 and 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, triggering an update:
[0197] {80%, 20%, 20%} → {60%, 60%, 0}
[0198] (10) The current bandwidth utilization of interfaces 1, 2, and 3 has changed to {80%, 20%, 80%}. If only the shortest path participates in load balancing, the bandwidth utilization of interfaces 1 and 2 will reach the high watermark threshold. Therefore, traffic sharing and forwarding will be jointly carried out by both the shortest path and non-shortest path, triggering an update:
[0199] {80%, 20%, 80%} → {60%, 60%, 60%}
[0200] This method enables load balancing of traffic between the shortest and non-shortest paths, improving the overall bandwidth utilization of the network and providing a high-throughput network environment for data center and supercomputing center networks.
[0201] The methods described in the embodiments of this application can all be implemented by the driver layer of a network device, such as... Figure 7As shown, interface bandwidth detection tasks, interface buffer congestion detection tasks, and interface ECN congestion tagging packet detection tasks can be created at the driver layer. When any detection task meets the alarm conditions, the driver's UCMP will be triggered to perform a software refresh. This allows the UCMP software in the driver to calculate the target bandwidth utilization rate of each interface based on the current bandwidth utilization rate of each interface. After the target bandwidth utilization rate is calculated, the driver directly uses the calculated target bandwidth utilization rate to update the hardware register table entries. This process does not require the participation of the network device's platform software layer, resulting in high update efficiency and avoiding packet loss.
[0202] Corresponding to the above method embodiments, such as Figure 8 As shown in the illustration, this application also provides an entry updating apparatus applied to the driver layer of a network device. The apparatus includes:
[0203] The acquisition module 701 is used to acquire the current bandwidth utilization rate of each shortest path interface and each non-shortest path interface at preset intervals.
[0204] The determination module 702 is used to determine the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface based on the current bandwidth utilization rate of each shortest path interface, the current bandwidth utilization rate of each non-shortest path interface, the high watermark threshold, and the low watermark threshold if the current bandwidth utilization rate of any interface exceeds the high watermark threshold or decreases to below the low watermark threshold.
[0205] The 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 utilization rate of each shortest path interface and the target bandwidth utilization 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, module 702 is specifically used for:
[0207] Calculate the first sum, first average, and first maximum value of the current bandwidth utilization of each shortest path interface;
[0208] Calculate the second sum and second average of the current bandwidth utilization of each non-shortest path interface;
[0209] 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined.
[0210] Optionally, module 702 is specifically used for:
[0211] If the first average value is less than or equal to the high watermark threshold and the second average value is 0, and the first maximum value is greater than the high watermark threshold, then the target bandwidth utilization rate of each shortest path interface is determined to be the first average value, and the target bandwidth utilization rate of each non-shortest path interface is determined to be 0.
[0212] When the first average value is greater than the high watermark threshold and the second average value is 0, the target bandwidth utilization of each interface is determined as follows: after each shortest path interface and each non-shortest path interface jointly carries the traffic corresponding to the first sum value, the bandwidth utilization of each interface is lower than the high watermark threshold.
[0213] If the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth utilization 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 utilization rate of each shortest path interface according to the traffic corresponding to the second sum value being carried by each shortest path interface, and determine the target bandwidth utilization rate of each non-shortest path interface to be 0. If yes, determine the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value being carried by both the shortest path interface and each non-shortest path interface.
[0214] When the first average value is greater than the high waterline threshold and the second average value is greater than 0, or when the first average value is greater than the low waterline threshold, less than or equal to the high waterline threshold, the second average value is greater than 0, and the first maximum value is greater than the high waterline threshold, the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface is determined with the goal of ensuring that the bandwidth utilization rate of each interface is lower than the high waterline 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.
[0215] If 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 utilization of each shortest path interface will exceed the high watermark threshold if each shortest path interface carries the traffic corresponding to the first and second sum values. If not, determine the target bandwidth utilization of each shortest path interface based on the traffic corresponding to the first and second sum values carried by each shortest path interface, and determine that the bandwidth utilization of each non-shortest path interface is 0. If yes, determine the target bandwidth utilization of each shortest path interface and the target bandwidth utilization of each non-shortest path interface based on the goal that the bandwidth utilization 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 and second sum values.
[0216] If the first average value is less than or equal to the low waterline threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high waterline threshold, and if each shortest path interface carries the traffic corresponding to the first and second sums, the bandwidth utilization rate of each shortest path interface will not exceed the high waterline threshold. Then, based on the traffic corresponding to the first and second sums carried by each shortest path interface, the target bandwidth utilization rate of each shortest path interface is determined, and the bandwidth utilization rate of each non-shortest path interface is determined to be 0.
[0217] Optionally, module 701 is used specifically for:
[0218] The number of packets forwarded by each shortest path interface and each non-shortest path interface is obtained at each preset time interval.
[0219] For each interface, the ratio between the difference between two consecutive acquisitions of the number of packets for that interface and the preset duration is used as the current bandwidth utilization rate of that interface.
[0220] Optionally, the acquisition module 701 is also 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 utilization of that interface will be updated to 100%.
[0222] Optionally, the acquisition module 701 is also used for:
[0223] Receive service messages through the shortest path interface or the non-shortest path interface;
[0224] If the service message includes an ECN tag, and the value of the ECN tag is a first value or a second value, then the interface receiving the service message will be recorded as being in a non-congested state.
[0225] If the service message includes an ECN tag and the value of the ECN tag is a third value, then the interface of the service message is recorded as congested.
[0226] When the state of any interface changes from non-congested to congested, the current bandwidth utilization of that interface is updated to 100%.
[0227] This application also provides an electronic device, such as... 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 through the communication bus 804.
[0228] Memory 803 is used to store computer programs;
[0229] The processor 801, when executing the program stored in the memory 803, implements the method steps in the above method embodiments.
[0230] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0231] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0232] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0233] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0234] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described table entry update methods.
[0235] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the table entry update methods described in the above embodiments.
[0236] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0237] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0238] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0239] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for updating table entries, characterized in that, The method, applied to the driver layer of a network device, includes: Get the current bandwidth utilization of each shortest path interface and each non-shortest path interface at preset intervals; If the current bandwidth utilization of any interface exceeds the high watermark threshold or decreases to below the low watermark threshold, then the target bandwidth utilization of each shortest path interface and the target bandwidth utilization of each non-shortest path interface are determined based on the current bandwidth utilization of each shortest path interface, the current bandwidth utilization of each non-shortest path interface, the high watermark threshold, and the low watermark threshold. Based on the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate 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. The determination of the target bandwidth utilization rate for each shortest path interface and the target bandwidth utilization rate for each non-shortest path interface based on the current bandwidth utilization rate of each shortest path interface, the current bandwidth utilization rate of each non-shortest path interface, the high watermark threshold, and the low watermark threshold includes: Calculate the first sum, first average, and first maximum value of the current bandwidth utilization of each shortest path interface; Calculate the second sum and second average of the current bandwidth utilization 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined.
2. The method according to claim 1, characterized in that, The determination of the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate 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 includes: If the first average value is less than or equal to the high watermark threshold and the second average value is 0, and the first maximum value is greater than the high watermark threshold, then the target bandwidth utilization rate of each shortest path interface is determined to be the first average value, and the target bandwidth utilization 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined with the goal that the bandwidth utilization 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 value. If the first average value is 0 and the second average value is greater than 0, determine whether the bandwidth utilization 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 utilization rate of each shortest path interface according to the traffic corresponding to the second sum value being carried by each shortest path interface, and determine the target bandwidth utilization rate of each non-shortest path interface to be 0. If yes, determine the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface according to the traffic corresponding to the second sum value being carried by both the shortest path interface and each non-shortest path interface. When the first average value is greater than the high waterline threshold and the second average value is greater than 0, or when the first average value is greater than the low waterline threshold, less than or equal to the high waterline threshold, the second average value is greater than 0, and the first maximum value is greater than the high waterline threshold, the target bandwidth utilization rate of each shortest path interface and each non-shortest path interface is determined with the goal of ensuring that the bandwidth utilization rate of each interface is lower than the high waterline threshold 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. If the first average value is less than or equal to the low waterline threshold, the second average value is greater than 0, and the first maximum value is greater than the high waterline threshold, determine whether the bandwidth utilization rate of each shortest path interface would exceed the high waterline threshold if each shortest path interface carried the traffic corresponding to the first sum and the second sum. If not, determine the target bandwidth utilization rate of each shortest path interface based on the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and determine that the bandwidth utilization rate of each non-shortest path interface is 0. If yes, determine the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface based on the goal that the bandwidth utilization rate of each interface is lower than the high waterline 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. If the first average value is less than or equal to the low waterline threshold, the second average value is greater than 0, and the first maximum value is less than or equal to the high waterline threshold, and if each shortest path interface carries the traffic corresponding to the first sum and the second sum, the bandwidth utilization rate of each shortest path interface will not exceed the high waterline threshold, then the target bandwidth utilization rate of each shortest path interface is determined according to the traffic corresponding to the first sum and the second sum carried by each shortest path interface, and the bandwidth utilization rate of each non-shortest path interface is determined to be 0.
3. The method according to claim 1, characterized in that, The step of acquiring the current bandwidth utilization rate of each shortest path interface and each non-shortest path interface at preset intervals includes: The number of packets forwarded by each shortest path interface and each non-shortest path interface is obtained at each preset time interval. For each interface, the ratio between the difference between two consecutive acquisitions of the number of packets for that interface and the preset duration is used as the current bandwidth utilization rate of that interface.
4. The method according to claim 1 or 3, characterized in that, After obtaining the current bandwidth utilization of each shortest path interface and each non-shortest path interface at preset intervals, 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 utilization of that interface will be updated to 100%.
5. The method according to claim 1 or 3, characterized in that, After obtaining the current bandwidth utilization of each shortest path interface and each non-shortest path interface at preset intervals, the method further includes: Receive service messages through the shortest path interface or the non-shortest path interface; If the service message includes an ECN tag, and the value of the ECN tag is a first value or a second value, then the interface receiving the service message will be recorded as being in a non-congested state. If the service message includes an ECN tag and the value of the ECN tag is a third value, then the interface of the service message is recorded as congested. When the state of any interface changes from non-congested to congested, the current bandwidth utilization of that interface is updated to 100%.
6. A table entry updating device, characterized in that, The device is applied to the driver layer of a network device and includes: The acquisition module is used to acquire the current bandwidth utilization of each shortest path interface and each non-shortest path interface at preset intervals. The determination module is used to determine the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface based on the current bandwidth utilization rate of each shortest path interface, the current bandwidth utilization rate of each non-shortest path interface, the high watermark threshold, and the low watermark threshold if the current bandwidth utilization rate of any interface exceeds the high watermark threshold or decreases to below the low watermark threshold. The 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 utilization rate of each shortest path interface and the target bandwidth utilization 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. The determining module is specifically used for: Calculate the first sum, first average, and first maximum value of the current bandwidth utilization of each shortest path interface; Calculate the second sum and second average of the current bandwidth utilization 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, the target bandwidth utilization rate of each shortest path interface and the target bandwidth utilization rate of each non-shortest path interface are determined.
7. 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, when executing a program stored in memory, implements the method described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-5.
Citation Information
Patent Citations
Method for realizing ECMP flow load balancing and electronic equipment
CN114095441A
Route adjustment method and apparatus, and electronic device
CN117081984A