Routing information maintenance method, device, network equipment and storage medium
By adjusting the forwarding weight values in the multi-path group forwarding table, the problem of reduced bandwidth utilization caused by shortest path congestion was solved, achieving more efficient network resource utilization.
Patent Information
- Application Number
- CN202380009545.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-06-28
AI Technical Summary
After the shortest path in the best path table is modified to a non-shortest path, network bandwidth utilization decreases.
By adjusting the forwarding weight value of each path in the multi-path group forwarding table, the load on the shortest path is reduced, outgoing interface congestion is alleviated, and the resources of each path are fully utilized.
This improves the overall bandwidth utilization of the network and avoids the reduction in bandwidth utilization caused by directly disabling the shortest path.
Smart Images

Figure CN119586104B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, network device, and storage medium for maintaining routing information. Background Technology
[0002] Adaptive routing is a technology that makes dynamic routing decisions based on changes in network topology and traffic load. Based on adaptive routing, network devices can proactively detect link congestion and then select the shortest and least congested path to forward packets.
[0003] Network devices can create and maintain a bestpath table based on routing information and link congestion status. Each bestpath table stores the best path corresponding to a destination Internet Protocol (IP) address. This best path can be the shortest path to the destination IP address. If the shortest path becomes congested, it will be modified to a non-shortest path to the destination IP address.
[0004] When the optimal path in the best path table is modified to a non-shortest path, network devices will use the non-shortest path to forward packets containing that destination IP address, and the shortest path will be deactivated, resulting in reduced network bandwidth utilization. Summary of the Invention
[0005] This application provides a routing information maintenance method, apparatus, network device, and storage medium to address the problem of reduced network bandwidth utilization after the shortest path in the best path table is modified. Specifically, the solutions include the following:
[0006] In a first aspect, embodiments of this application provide a routing information maintenance method applied to a first network device. The first network device includes a multi-path group forwarding table, wherein the first multi-path group corresponding to the multi-path group forwarding table includes the shortest path and non-shortest paths, and each path is used to indicate the path between the first network device and a second network device; the forwarding table entry for the shortest path includes the first outgoing interface of the first network device; the method includes:
[0007] When the traffic carried by the shortest path causes congestion at the first outgoing interface, the preset routing policy corresponding to the multi-path group forwarding table is obtained.
[0008] Based on the preset routing strategy, the forwarding weight value of each path in the first multi-path group is adjusted. The forwarding weight value of each path is used to represent the proportion of traffic carried by that path when the path is selected from the first multi-path group for packet forwarding.
[0009] In one possible implementation, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the method further includes:
[0010] Calculate the shortest path and non-shortest path between the device and the second network device;
[0011] A software forwarding table entry is generated for each shortest path and each non-shortest path to obtain the software forwarding table. Each software forwarding table entry includes a forwarding weight value for a path, and the initial forwarding weight value for non-shortest paths is 0.
[0012] For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry except for the forwarding weight value N times to obtain N hardware forwarding table entries. Then, distribute the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table.
[0013] Wherein, N = the forwarding weight value of the software forwarding table entry * the number of preset entries in the hardware forwarding table / the sum of all forwarding weight values included in the software forwarding table entry.
[0014] In one possible implementation, the multipath group forwarding table includes a route type flag; obtaining the preset routing policy corresponding to the multipath group forwarding table includes:
[0015] Obtain the preset routing policy corresponding to the route type tag;
[0016] The preset routing strategy includes at least one of the following strategies: adjusting the forwarding load of the congested outgoing interface to 0, reducing the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reducing the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
[0017] In one possible implementation, the first network device stores a first interface status table and a second interface status table corresponding to the multipath group forwarding table. The first interface status table includes the interface status of each outgoing interface of the first network device, and the second interface status table includes the bandwidth occupancy of the outgoing interface by the traffic carried by each path in the first multipath group.
[0018] Before obtaining the preset routing policy corresponding to the multi-path group forwarding table when the traffic carried by the shortest path causes congestion on the first outgoing interface, the method further includes:
[0019] If the interface status of the first interface in the first interface status table changes to a congested state, then the first bandwidth occupancy of the traffic carried by the shortest path on the first outgoing interface is obtained from the second interface status table.
[0020] If the first bandwidth occupancy meets the preset congestion condition, then it is determined that the traffic carried by the shortest path causes the first outgoing interface to be congested.
[0021] In one possible implementation, the first interface status table further includes the bandwidth usage and buffer usage of each outgoing interface; the method further includes:
[0022] Every preset time interval, for each outgoing interface in the first interface status table, update the bandwidth usage and buffer usage of that outgoing interface;
[0023] If the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold, then the interface status of the outgoing interface is set to congested state.
[0024] In one possible implementation, adjusting the forwarding weight value of each path in the first multipath group based on the preset routing policy includes:
[0025] Based on the preset routing policy and the bandwidth occupancy of each outgoing interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0026] In one possible implementation, multiple paths between the first network device and the third network device form a second multipath group. When the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the multipath group forwarding table.
[0027] Secondly, embodiments of this application provide a routing information maintenance apparatus applied to a first network device. The first network device includes a multi-path group forwarding table, wherein the first multi-path group corresponding to the multi-path group forwarding table includes the shortest path and non-shortest paths, and each path is used to indicate the path between the first network device and a second network device; the forwarding table entry for the shortest path includes the first outgoing interface of the first network device; the apparatus includes:
[0028] The acquisition module is used to acquire the preset routing policy corresponding to the multi-path group forwarding table when the traffic carried by the shortest path causes congestion of the first outgoing interface.
[0029] The adjustment module is used to adjust the forwarding weight value of each path in the first multi-path group based on the preset routing strategy. The forwarding weight value of each path is used to represent the proportion of traffic carried by the path when the path is selected for packet forwarding from the first multi-path group.
[0030] In one possible implementation, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the generation module is used for:
[0031] Calculate the shortest path and non-shortest path between the device and the second network device;
[0032] A software forwarding table entry is generated for each shortest path and each non-shortest path to obtain the software forwarding table. Each software forwarding table entry includes a forwarding weight value for a path, and the initial forwarding weight value for non-shortest paths is 0.
[0033] For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry except for the forwarding weight value N times to obtain N hardware forwarding table entries. Then, distribute the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table.
[0034] Wherein, N = the forwarding weight value of the software forwarding table entry * the number of preset entries in the hardware forwarding table / the sum of all forwarding weight values included in the software forwarding table entry.
[0035] In one possible implementation, the multipath group forwarding table includes a route type flag; the acquisition module is specifically used for:
[0036] Obtain the preset routing policy corresponding to the route type tag; the preset routing policy includes at least one of the following policies: adjust the forwarding load of the congested outgoing interface to 0, reduce the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reduce the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
[0037] In one possible implementation, the first network device stores a first interface status table and a second interface status table corresponding to the multipath group forwarding table. The first interface status table includes the interface status of each outgoing interface of the first network device, and the second interface status table includes the bandwidth occupancy of the outgoing interface by the traffic carried by each path in the first multipath group. The device further includes a determination module.
[0038] The acquisition module is further configured to, if the interface status of the first interface in the first interface status table changes to a congested state, obtain from the second interface status table the first bandwidth occupancy of the traffic carried by the shortest path on the first outgoing interface.
[0039] The determining module is configured to determine that the traffic carried by the shortest path causes the first outgoing interface to be congested if the first bandwidth occupancy meets the preset congestion conditions.
[0040] In one possible implementation, the first interface status table further includes the bandwidth usage and buffer usage of each outgoing interface; the device further includes an update module and a setting module.
[0041] The update module is used to update the bandwidth usage and buffer usage of each outgoing interface in the first interface status table at preset intervals.
[0042] The setting module is used to set the interface status of the outgoing interface to a congested state if the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold.
[0043] In one possible implementation, the adjustment module is specifically used for:
[0044] Based on the preset routing policy and the bandwidth occupancy of each outgoing interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0045] In one possible implementation, multiple paths between the first network device and the third network device form a second multipath group. When the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the multipath group forwarding table.
[0046] Thirdly, embodiments of this application provide a first network device, the first network device including a multi-path group forwarding table, the first multi-path group corresponding to the multi-path group forwarding table including the shortest path and non-shortest paths, each path being used to indicate the path between the first network device and a second network device; the forwarding table entry for the shortest path includes the first outgoing interface of the first network device; the first network device includes:
[0047] processor;
[0048] transceiver;
[0049] A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions cause the processor to perform the following steps:
[0050] When the traffic carried by the shortest path causes congestion at the first outgoing interface, the preset routing policy corresponding to the multi-path group forwarding table is obtained.
[0051] Based on the preset routing strategy, the forwarding weight value of each path in the first multi-path group is adjusted. The forwarding weight value of each path is used to represent the proportion of traffic carried by that path when the path is selected from the first multi-path group for packet forwarding.
[0052] In one possible implementation, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the machine-executable instructions further cause the processor to perform the following steps:
[0053] Calculate the shortest path and non-shortest path between the device and the second network device;
[0054] A software forwarding table entry is generated for each shortest path and each non-shortest path to obtain the software forwarding table. Each software forwarding table entry includes a forwarding weight value for a path, and the initial forwarding weight value for non-shortest paths is 0.
[0055] For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry except for the forwarding weight value N times to obtain N hardware forwarding table entries. Then, distribute the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table.
[0056] Wherein, N = the forwarding weight value of the software forwarding table entry * the number of preset entries in the hardware forwarding table / the sum of all forwarding weight values included in the software forwarding table entry.
[0057] In one possible implementation, the multipath group forwarding table includes a route type flag; the machine-executable instructions further cause the processor to perform the following steps:
[0058] Obtain the preset routing policy corresponding to the route type tag; the preset routing policy includes at least one of the following policies: adjust the forwarding load of the congested outgoing interface to 0, reduce the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reduce the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
[0059] In one possible implementation, the first network device stores a first interface status table and a second interface status table corresponding to the multipath group forwarding table. The first interface status table includes the interface status of each outgoing interface of the first network device, and the second interface status table includes the bandwidth occupancy of the outgoing interface by the traffic carried by each path in the first multipath group.
[0060] The machine-executable instructions also cause the processor to perform the following steps:
[0061] If the interface status of the first interface in the first interface status table changes to a congested state, then the first bandwidth occupancy of the traffic carried by the shortest path on the first outgoing interface is obtained from the second interface status table.
[0062] If the first bandwidth occupancy meets the preset congestion condition, then it is determined that the traffic carried by the shortest path causes the first outgoing interface to be congested.
[0063] In one possible implementation, the first interface state table also includes the bandwidth usage and buffer usage of each outgoing interface; the machine-executable instructions further cause the processor to perform the following steps:
[0064] Every preset time interval, for each outgoing interface in the first interface status table, update the bandwidth usage and buffer usage of that outgoing interface;
[0065] If the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold, then the interface status of the outgoing interface is set to congested state.
[0066] In one possible implementation, the machine-executable instructions further cause the processor to perform the following steps:
[0067] Based on the preset routing policy and the bandwidth occupancy of each outgoing interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0068] In one possible implementation, multiple paths between the first network device and the third network device form a second multipath group. When the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the multipath group forwarding table.
[0069] Fourthly, embodiments of this application provide a machine-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method described in the first aspect.
[0070] Fifthly, embodiments of this application provide a computer program product that causes the processor to implement the method described in the first aspect.
[0071] Using the above technical solution, when the traffic carried by the shortest path causes congestion at the first outgoing interface, the preset routing policy corresponding to the multi-path group forwarding table is obtained. Then, the first network device adjusts the forwarding weight value of each path in the first multi-path group based on the preset routing policy corresponding to the multi-path group forwarding table. It can be seen that in this embodiment, when the traffic carried by the shortest path causes congestion at the first outgoing interface, the shortest path where the first outgoing interface is located is not directly disabled. Instead, the forwarding weight value of each path in the first multi-path group is adjusted. Since the forwarding weight value of each path represents the proportion of traffic carried by that path when a packet is selected in the first multi-path group, the forwarding load of each path changes after adjusting the forwarding weight value, which can reduce the load on the shortest path, thereby alleviating congestion at the first outgoing interface, fully utilizing the resources of each path, and improving the overall bandwidth utilization of the network. Attached Figure Description
[0072] The accompanying drawings, which are provided to further understand this application and constitute a part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.
[0073] Figure 1 This is a schematic diagram of the structure of a networking system provided in an embodiment of this application;
[0074] Figure 2 A flowchart illustrating a routing information maintenance method provided in this application embodiment;
[0075] Figure 3a An exemplary schematic diagram of a first type of software forwarding table provided in the embodiments of this application;
[0076] Figure 3b An exemplary schematic diagram of a first type of hardware forwarding table provided in an embodiment of this application;
[0077] Figure 4a An exemplary schematic diagram of a second type of software forwarding table provided in the embodiments of this application;
[0078] Figure 4b An exemplary schematic diagram of a second type of hardware forwarding table provided in the embodiments of this application;
[0079] Figure 5a An exemplary schematic diagram of a third type of software forwarding table provided in the embodiments of this application;
[0080] Figure 5b An exemplary schematic diagram of a third type of hardware forwarding table provided in the embodiments of this application;
[0081] Figure 6 This is a schematic diagram of another networking system provided in an embodiment of this application;
[0082] Figure 7a An exemplary schematic diagram of the fourth type of software forwarding table provided in the embodiments of this application;
[0083] Figure 7b An exemplary schematic diagram of the fourth type of hardware forwarding table provided in the embodiments of this application;
[0084] Figure 8 This is a schematic diagram of another networking structure provided in the embodiments of this application;
[0085] Figure 9a An exemplary schematic diagram of the fifth software forwarding table provided in the embodiments of this application;
[0086] Figure 9b An exemplary schematic diagram of the fifth type of hardware forwarding table provided in the embodiments of this application;
[0087] Figure 10 This is a schematic diagram of the structure of a routing information maintenance device provided in an embodiment of this application;
[0088] Figure 11 This is a schematic diagram of the structure of a network device provided in an embodiment of this application. Detailed Implementation
[0089] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments in this application are within the scope of protection of this application.
[0090] like Figure 1 As shown, Figure 1 An exemplary network system used in an embodiment of this application is illustrated. This network system includes: a source device, a destination device, an ingress device, a transit device 1, a transit device 2, and a transit device 3. Wherein, Figure 1 In this diagram, S represents the source device, and D1 and D2 represent the destination devices. After receiving a message from the source device, the ingress device can forward the message to the destination device through a relay device. The source and destination devices can be servers, virtual machines, or other similar devices.
[0091] Ingress and relay devices can calculate the shortest path and loop-free non-shortest path between themselves and the destination IP address or IP network segment based on the shortest path first algorithm. Taking the ingress device as an example, it can calculate the shortest path and loop-free non-shortest path between itself and D1. Specifically, the paths from outgoing interface 1 to D1 and from outgoing interface 2 to D1 are the shortest paths, while the paths from outgoing interface 3 to D1 and from outgoing interface 4 to D1 are loop-free non-shortest paths.
[0092] A non-shortest path without loops refers to a non-shortest path in which there are no loops. The non-shortest paths described in the subsequent embodiments of this application are all free of loops.
[0093] To improve network bandwidth utilization, this application provides a routing information maintenance method. This method can be applied to Internet Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), or Segment Routing Internet Protocol Version 6 (SRv6) networks, specifically in campus networks, data center networks, and wide area networks (WANs). This method can be executed by a first network device; for example, the first network device can be... Figure 1 The entry or transfer equipment in the process.
[0094] The first network device includes a multipath group forwarding table, which includes forwarding entries for each path in the first multipath group. The first multipath group corresponding to the multipath group forwarding table includes the shortest path and non-shortest paths. The forwarding entries for the shortest path include the first outgoing interface of the first network device.
[0095] Each path indicates the path between the first network device and the second network device. This can be understood as indicating a path to the same destination IP address or the same destination IP network segment, where the destination IP address is the IP address of the second network device, and the destination IP network segment is the IP network segment containing the IP address of the second network device.
[0096] The multi-path group forwarding table is used to guide packet forwarding. Each forwarding entry in the multi-path group forwarding table includes the next hop, the outgoing interface, and the forwarding weight value of the path corresponding to that forwarding entry.
[0097] It should be noted that the multi-path group forwarding table in this embodiment is located in an overall forwarding table, which may include multiple multi-path group forwarding tables. In other words, each multi-path group forwarding table can be an entry in the overall forwarding table.
[0098] like Figure 2 As shown, the routing information maintenance method provided in this application includes the following steps:
[0099] S201. When the traffic carried by the shortest path causes congestion on the first outgoing interface, obtain the preset routing policy corresponding to the multi-path group forwarding table.
[0100] It is understandable that the first outgoing interface is the outgoing interface included in the shortest path forwarding table entry in the multi-path group forwarding table. The first outgoing interface may also be located in other paths, that is, multiple paths can share the first outgoing interface to forward traffic.
[0101] When the first outgoing interface is congested, and the traffic carried by the shortest path causes the first outgoing interface to be congested, it indicates that the forwarding load of the shortest path is large. The preset routing policy corresponding to the multi-path group forwarding table can be obtained to adjust the forwarding load of multiple paths.
[0102] S202. Based on the preset routing policy, adjust the forwarding weight value of each path in the first multipath group.
[0103] The forwarding weight value for each path indicates the proportion of traffic carried by that path when it is selected for packet forwarding from the first multi-path group. In other words, the higher the forwarding weight value of a path, the greater the proportion of traffic carried by that path when it is used for packet forwarding; that is, the path will be used to forward more packets.
[0104] Using the above method, when the traffic carried by the shortest path causes congestion at the first outgoing interface, a preset routing policy corresponding to the multi-path group forwarding table is obtained. Then, the first network device adjusts the forwarding weight value of each path in the first multi-path group based on the preset routing policy corresponding to the multi-path group forwarding table. It can be seen that in this embodiment, when the traffic carried by the shortest path causes congestion at the first outgoing interface, the shortest path where the first outgoing interface is located is not directly disabled. Instead, the forwarding weight value of each path in the first multi-path group is adjusted. Since the forwarding weight value of each path represents the proportion of traffic carried by that path when a packet is selected in the first multi-path group, the forwarding load of each path changes after adjusting the forwarding weight value. This reduces the load on the shortest path, thereby alleviating congestion at the first outgoing interface, fully utilizing the resources of each path, and improving the overall bandwidth utilization of the network.
[0105] It should be noted that the multiple paths between the first network device and the third network device constitute the second multipath group. When the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the aforementioned multipath group forwarding table.
[0106] Understandably, if multiple multipath groups of the first network device are identical, then all multipath groups can share the same multipath group forwarding table. This eliminates the need to create and store a separate multipath group forwarding table for each multipath group, saving storage resources. More importantly, it improves path update speed. If adjustments to the multipath group forwarding tables corresponding to multiple multipath groups are required, the adjustments can be made directly to the shared multipath group forwarding table, rather than adjusting each multipath group forwarding table separately, thus improving update speed and reducing processing overhead.
[0107] For example, the path from the first network device to destination device 1 includes: shortest path A, non-shortest path B, and non-shortest path C; the path from the first network device to destination device 2 also includes: shortest path A, non-shortest path B, and non-shortest path C. That is, the paths from the first network device to destination device 1 and from the first network device to destination device 2 are exactly the same. In this case, the IP addresses of destination device 1 and destination device 2 can share a single multipath group forwarding table.
[0108] In this embodiment of the application, the aforementioned multi-path group forwarding table includes a software forwarding table and a hardware forwarding table; during execution Figure 2 Prior to this process, a multipath forwarding table and a hardware forwarding table have been generated in the first network device.
[0109] The software forwarding table and hardware forwarding table are generated through the following steps:
[0110] Step 1: Calculate the shortest path and non-shortest path between the device and the second network device.
[0111] The first network device can calculate the shortest path and non-shortest path between the first network device and the second network device based on the shortest path first algorithm.
[0112] Specifically, the destination IP address or destination IP network segment of the first network device can be obtained, and then the shortest path and non-shortest path between the first network device and the destination IP address can be calculated, or the shortest path and non-shortest path between the first network device and the destination IP network segment can be calculated.
[0113] The number of shortest paths between the first network device and the second network device is at least one, and the number of non-shortest paths can be zero or more. In the case where there are no non-shortest paths and there are multiple shortest paths, the multiple shortest paths included in the first multipath group constitute equal-cost multi-path routing (ECMP).
[0114] Step 2: Generate a software forwarding table entry for each shortest path and each non-shortest path to obtain the software forwarding table. Each software forwarding table entry includes the forwarding weight value of a path, and the initial forwarding weight value of the non-shortest path is 0.
[0115] Understandably, the software forwarding table includes the shortest path and non-shortest paths calculated in step 1. The first network device can prioritize using the shortest path for packet forwarding. If the shortest path is not congested, it can choose not to use the non-shortest path for packet forwarding. Therefore, the initial weight value of the shortest path can be 1, and the initial weight value of the non-shortest path can be 0.
[0116] like Figure 3a As shown, Figure 3a This example illustrates a software forwarding table shared by n destination IP addresses. Figure 3a The left side shows n destination IP addresses and their corresponding path group identifiers, which are the destination IP addresses and corresponding path group identifiers of the destination devices D1 to Dn, respectively.
[0117] For example, the destination IP address of D1 is 119.1.1.2 / 32, and the destination IP address of Dn is 121.1.1.2 / 32. Assume the first network device and... Figure 3a Each path group between destination devices in the process includes two shortest paths and two non-shortest paths.
[0118] Figure 3a The right side shows the software forwarding table shared by the destination IP addresses of destination devices D1 to Dn. As an example, this software forwarding table includes 4 software forwarding table entries.
[0119] The first software forwarding entry includes the next hop 1 corresponding to a shortest path, and the forwarding weight value 1 for that shortest path.
[0120] The second software forwarding entry includes the next hop 2 corresponding to the other shortest path, and the forwarding weight value 1 for that shortest path.
[0121] The third software forwarding entry includes a next hop of 1 for a non-shortest path and a forwarding weight of 0 for that non-shortest path.
[0122] The fourth software forwarding entry includes the next hop 2 for another non-shortest path, and the forwarding weight value 0 for that non-shortest path.
[0123] It should be noted that, Figure 3a Each software forwarding entry also includes an outgoing interface. Figure 3a Not shown in the image.
[0124] Step 3: For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry (excluding the forwarding weight value) N times to obtain N hardware forwarding table entries. Send the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table.
[0125] Where N = the forwarding weight value of the software forwarding table entry * the number of preset entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0126] The preset number of table entries can be set based on experience; for example, the preset number of table entries can be 128.
[0127] Understandably, after the first network device sends the hardware forwarding table entries to the hardware resources and obtains the hardware forwarding table, the forwarding chip of the first network device can use the hardware forwarding table in the hardware resources to forward packets.
[0128] Among them, software forwarding entries with a forwarding weight of 0 are not currently used for packet forwarding and are in a standby state. Therefore, there is no need to distribute software forwarding entries with a forwarding weight of 0 to hardware resources.
[0129] As an example, based on Figure 3a The hardware forwarding table obtained from the software forwarding table shown is as follows: Figure 3b As shown, Figure 3b IP address on the left and Figure 3a The IP addresses on the left are the same, so we will not repeat them here.
[0130] Figure 3b Taking a hardware forwarding table with a default number of 128 entries as an example, Figure 3a The forwarding weight values of the third and fourth entries in the table are both 0, so they do not need to be sent to the hardware forwarding table. Figure 3a The first and second software forwarding table entries in the table both have a forwarding weight value of 1, and can each be copied 64 times and then sent to the hardware forwarding table.
[0131] so, Figure 3b The hardware forwarding table contains the same first 64 hardware forwarding entries, and each forwarding entry includes the next hop of the shortest path 1.
[0132] Furthermore, the last 64 hardware forwarding entries in this hardware forwarding table are identical, and each forwarding entry includes the next hop 2 of the other shortest path.
[0133] It should be noted that, Figure 3b Each hardware forwarding table entry also includes an outgoing interface. Figure 3b Not shown in the image.
[0134] It is understandable that if the number of entries in the hardware forwarding table decreases, there is a possibility that a packet might match a hardware forwarding table entry, but that entry is deleted before the packet is forwarded, resulting in packet loss. In this embodiment, the number of entries in the hardware forwarding table is a fixed value, meaning that changes in the path weight will not cause changes in the number of entries in the hardware forwarding table, thus avoiding packet loss.
[0135] In another embodiment of this application, the first network device stores a first interface status table and a second interface status table corresponding to a multipath group forwarding table. The first interface status table includes the bandwidth usage, buffer usage, and interface status of each outgoing interface of the first network device, while the second outgoing interface status table includes the bandwidth usage of the outgoing interface for the traffic carried by each path in the first multipath group.
[0136] The first interface status table is a comprehensive status table of all traffic on each outgoing interface of the first network device that has adaptive routing enabled. As an example, let's take... Figure 1 Taking the output interfaces of the ingress device as output interface 1, output interface 2, output interface 3 and output interface 4 as an example, the status table of the first interface of the ingress device is shown in Table 1.
[0137] Table 1
[0138]
[0139] The interface status can be normal, congested, or recovered, and the initial status of each outgoing interface is set to normal.
[0140] The first network device can update the bandwidth usage and buffer usage of each outgoing interface in the first interface status table at preset intervals. If the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold, then the interface status of the outgoing interface is set to congested state.
[0141] For example, the preset duration can be 5 milliseconds.
[0142] Among them, the preset bandwidth threshold is the high bandwidth threshold, and the preset buffer threshold is the high buffer threshold.
[0143] The specific methods by which the first network device determines the interface status include:
[0144] If the bandwidth occupancy of an interface reaches the high bandwidth threshold, or the buffer occupancy reaches the high buffer buffer threshold, then the interface state of that interface is set to congested state. If the interface changes from normal state or recovery state to congested state, then the first network device determines that the interface is congested.
[0145] When an interface is in a congested state, if the updated bandwidth occupancy of the interface is lower than the high bandwidth threshold, and the updated buffer occupancy is lower than the high buffer threshold, then the interface state of the interface is set to the recovery state.
[0146] When an interface is in recovery mode, if the updated bandwidth occupancy of the interface is lower than the low bandwidth threshold, and the updated buffer occupancy is lower than the low buffer threshold, then the interface status of the interface is set to normal mode.
[0147] The aforementioned high bandwidth threshold, low bandwidth threshold, high buffer threshold, and low buffer threshold are pre-set statically based on experience.
[0148] Alternatively, artificial intelligence can be used to intelligently and dynamically set high bandwidth thresholds, low bandwidth thresholds, high buffer thresholds, and low buffer thresholds based on network conditions.
[0149] For example, a deep learning model can be pre-trained and a threshold update cycle can be pre-set. Every time the threshold update cycle occurs, the bandwidth usage and buffer usage of each output interface are input into the deep learning model to obtain the updated bandwidth high threshold, bandwidth low threshold, buffer high threshold, and buffer low threshold output by the deep model.
[0150] Furthermore, the first network device stores a second interface status table, which includes the bandwidth usage of each outgoing interface corresponding to the multipath group forwarding table. As an example, multipath group forwarding table 1 includes outgoing interfaces 1, 2, 3, and 4; multipath group forwarding table 2 includes outgoing interfaces 1 and 3; and multipath group forwarding table 3 includes outgoing interfaces 2 and 4. The second interface status table stored in the first network device is shown in Table 2.
[0151] Table 2
[0152]
[0153] In Table 2, M represents the shortest path and N represents a non-shortest path; the number after “:” indicates the bandwidth usage of the outgoing interface for the traffic carried by the path.
[0154] As shown in Table 2, the multi-path group forwarding table 1 includes three shortest paths and one non-shortest path. The three shortest paths are shortest path 1, shortest path 2, and shortest path 3. The bandwidth usage of traffic carried by shortest path 1 to outgoing interface 1 is 'a'; the bandwidth usage of traffic carried by shortest path 2 to outgoing interface 2 is 'b'; the bandwidth usage of traffic carried by shortest path 3 to outgoing interface 4 is 'd'; and the bandwidth usage of traffic carried by the non-shortest path to outgoing interface 3 is 'c'.
[0155] Multipath forwarding table 2 includes one shortest path and one non-shortest path. The bandwidth usage of the shortest path on outgoing interface 3 is f; the bandwidth usage of the non-shortest path on outgoing interface 1 is e.
[0156] Multipath forwarding table 3 includes one shortest path and one non-shortest path. The bandwidth usage of the shortest path on outgoing interface 4 is g; the bandwidth usage of the non-shortest path on outgoing interface 2 is h.
[0157] Before obtaining the preset routing policy corresponding to the multi-path group forwarding table when the traffic carried by the shortest path causes congestion on the first outgoing interface in S201 above, the method further includes:
[0158] If the interface status of the first interface in the first interface status table changes to a congested state, then the shortest path traffic carrying the first bandwidth occupancy of the first outgoing interface is obtained from the second interface status table, and it is determined whether the first bandwidth occupancy meets the preset congestion conditions.
[0159] The preset congestion condition can be: among the bandwidth occupancy of each path using the first outgoing interface, the first bandwidth occupancy is the largest.
[0160] In other words, if the shortest path containing the first outgoing interface has the largest bandwidth usage for the first outgoing interface, it means that the traffic carried by the shortest path is causing congestion at the first outgoing interface.
[0161] Alternatively, the preset congestion condition can be that the second bandwidth occupancy is greater than a specified bandwidth threshold, which is less than the high bandwidth threshold mentioned above.
[0162] The following example illustrates this, assuming that the maximum bandwidth of each output interface is 1000kbps, the maximum buffer size is 1000 bytes, the high bandwidth threshold is 800kbps, the low bandwidth threshold is 200kbps, the high buffer threshold is 800 bytes, and the low buffer threshold is 200 bytes.
[0163] by Figure 1 Taking the output interfaces of the ingress device as output interface 1, output interface 2, output interface 3 and output interface 4 as an example, the status table of the first interface of the ingress device is shown in Table 3.
[0164] Table 3
[0165]
[0166] According to Table 3, when the outgoing interface 1 in Table 3 is set to a congested state, the ingoing device determines that the outgoing interface 1 has entered a congested state.
[0167] Assume that the ingress device includes multipath group forwarding table 1, multipath group forwarding table 2 and multipath group forwarding table 3. Multipath group forwarding table 1 includes outgoing interfaces 1, 2, 3 and 4 respectively. Multipath group forwarding table 2 includes outgoing interfaces 1 and 3 respectively. Multipath group forwarding table 3 includes outgoing interfaces 2 and 4 respectively. The second interface status table corresponding to the multipath group forwarding table stored by the first network device is shown in Table 4.
[0168] Table 4
[0169]
[0170]
[0171] As can be seen from Table 4, for outgoing interface 1, the traffic carried by the shortest path corresponding to multipath group forwarding table 1 has the largest bandwidth consumption on outgoing interface 1. Therefore, it can be determined that the traffic carried by the shortest path is causing congestion on outgoing interface 1.
[0172] Using this method, it is possible to determine in a timely manner whether the first outgoing interface is congested based on the first interface status table. If the first outgoing interface is determined to be congested, the path that caused the congestion can also be determined. In this way, the weight values of each path in the multi-path forwarding table corresponding to the path can be adjusted, which can prevent the congestion from worsening and improve bandwidth utilization.
[0173] In another embodiment of this application, the multipath group forwarding table includes a route type flag. As an example, the route type flag may occupy a field of the software forwarding table.
[0174] In step S201 above, obtaining the preset routing policy corresponding to the multi-path group forwarding table can be specifically implemented as follows:
[0175] Obtain the preset routing policy corresponding to the route type tag; the preset routing policy includes at least one of the following policies: adjust the forwarding load of the congested outgoing interface to 0, reduce the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reduce the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
[0176] As an example, the preset routing policy corresponding to route type flag 1 is to adjust the forwarding load of the congested outgoing interface to 0, that is, not to continue using the congested outgoing interface to forward packets; the preset routing policy corresponding to route type flag 2 is to reduce the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths; the preset routing policy corresponding to route type flag 3 is to reduce the forwarding load of the congested outgoing interface and increase the forwarding load of non-shortest paths. This application does not limit the form of the route type flag.
[0177] It should be noted that the preset routing strategies in this application embodiment are not limited to the above three types, and can be flexibly set according to the actual scenario.
[0178] Using the above method, the preset routing policy corresponding to the route type flag can be matched by setting a route type flag in the multipath group forwarding table. This allows for flexible adjustment of the preset routing policy used in the multipath group forwarding table entries based on the route type flag, thereby improving overall network performance.
[0179] After determining the preset routing policy, S202, based on the preset routing policy, adjust the forwarding weight value of each path in the first multipath group, specifically including:
[0180] Based on the preset routing policy and the bandwidth usage of each interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0181] The first network device can determine the path whose forwarding weight value needs to be adjusted based on a preset routing policy.
[0182] If the preset routing policy is to adjust the forwarding load of the congested outgoing interface to 0, then the forwarding weight value of the congested outgoing interface can be adjusted to 0, and the path load of the outgoing interface that is not congested in the first multipath group can be used to share the traffic of the shortest path where the first outgoing interface is located.
[0183] If the preset routing strategy aims to reduce the forwarding load on congested outgoing interfaces without increasing the forwarding load on non-shortest paths, then the following calculations can be performed according to multiple preset ratios: If the traffic of the shortest path containing the first outgoing interface is evenly distributed to the other uncongested shortest paths, will the outgoing interfaces of the other shortest paths become congested? This determines the maximum preset ratio that will not cause congestion on the outgoing interfaces of other shortest paths, and the forwarding weight value of each shortest path is adjusted according to this preset ratio. These multiple preset ratios are sequentially decreasing ratios; for example, multiple preset ratios could include 1 / 2, 1 / 4, and 1 / 8.
[0184] Assuming that calculations determine that after allocating half of the traffic carried by the shortest path containing the first outgoing interface to other shortest paths, the outgoing interfaces of the other shortest paths will not experience congestion, then the forwarding weight values of each shortest path will be adjusted according to the ratio of half.
[0185] If the preset routing strategy is to reduce the forwarding load on congested outgoing interfaces and increase the forwarding load on non-shortest paths, then the following calculations can be performed according to multiple preset ratios: If the traffic of the shortest path containing the first outgoing interface is evenly distributed to the other non-shortest paths that are not congested, will the outgoing interfaces of the other non-shortest paths become congested? This determines the maximum preset ratio that will not cause congestion on the outgoing interfaces of other non-shortest paths, and the forwarding weight value of each path is adjusted according to this preset ratio.
[0186] Based on the examples in Table 4 above, assuming the preset routing strategy is to reduce the forwarding load of congested outgoing interfaces and increase the forwarding load of non-shortest paths, the forwarding weight value of each path in the multipath group corresponding to multipath group forwarding table 1 can be adjusted.
[0187] For ease of description, the four paths corresponding to entry 1 in the multi-path group forwarding table in Table 4 are referred to as Path 1, Path 2, Path 3, and Path 4, respectively. According to Table 3, it can be determined that the outgoing interfaces 3 and 4 of the non-shortest paths are not congested. Therefore, it can be calculated whether outgoing interfaces 3 and 4 will become congested if half of the traffic on outgoing interface 1 of Path 1 is evenly distributed to outgoing interfaces 3 of Path 3 and 4 of Path 4. If not, the forwarding weight values corresponding to Path 1 to 4 can be re-determined according to the 1 / 2 ratio.
[0188] The calculated bandwidth usage of each output interface is shown in Table 5. The 300kbps traffic in output interface 1 is evenly distributed to output interface 3 and output interface 4. It can be seen that after adjustment, the bandwidth usage of output interface 3 is 550kbps and the bandwidth usage of output interface 4 is 450kbps. Neither exceeds the high bandwidth threshold, and neither will cause congestion.
[0189] Table 5
[0190]
[0191] Assuming that any one of the outgoing interfaces 2, 3, and 4 is likely to become congested, we calculate whether outgoing interfaces 2, 3, and 4 will become congested if 1 / 4 of the traffic on outgoing interface 1 of path 1 is evenly distributed to outgoing interfaces 3 of path 2, 3, and 4. If not, the forwarding weights for paths 1 to 4 can be recalculated according to a 1 / 4 ratio. If any one of the outgoing interfaces is likely to become congested, the calculation continues according to a 1 / 8 ratio, and so on.
[0192] According to the example in Table 5, if it is determined that the forwarding weight values corresponding to paths 1 to 4 can be re-determined at a ratio of 1 / 2, then the forwarding weight values included in the four software forwarding table entries of the multi-path group forwarding table 1 will be adjusted from 1, 1, 0, 0 to 1 / 2, 1, 1 / 4, 1 / 4, which is 2, 4, 1, 1.
[0193] The following describes how to update software and hardware forwarding tables:
[0194] In one example, suppose the default routing policy is to reduce the forwarding load on congested outgoing interfaces and increase the forwarding load on non-shortest paths. Figure 3a Based on this, the forwarding weight values of the four software forwarding entries can be adjusted from 1, 1, 0, 0 to 2, 4, 1, 1. After adjustment, as follows: Figure 4a As shown, this can distribute half of the traffic on the path corresponding to the first software forwarding entry evenly between two non-shortest paths.
[0195] As an example, taking 1000 packets forwarded by the first network device as an example, before adjusting the forwarding weight values, the number of packets forwarded by outgoing interface 1 is 1000*1 / 2 = 500, the number of packets forwarded by outgoing interface 2 is 1000*1 / 2 = 500, and the number of packets forwarded by outgoing interface 3 and outgoing interface 4 is 0. After adjusting the forwarding weight values, the number of packets forwarded by outgoing interface 1 is 1000*2 / (2+4+1+1) = 250, the number of packets forwarded by outgoing interface 2 is 1000*4 / (2+4+1+1) = 500, the number of packets forwarded by outgoing interface 3 is 1000*1 / (2+4+1+1) = 125, and the number of packets forwarded by outgoing interface 4 is 1000*1 / (2+4+1+1) = 125. That is, half of the traffic on outgoing interface 1 is evenly distributed to outgoing interface 3 and outgoing interface 4.
[0196] In obtaining Figure 4a After the software forwarding table entries are added, the hardware forwarding table needs to be updated accordingly. The updated hardware forwarding table is as follows: Figure 4b As shown.
[0197] The number of copies required for each software forwarding entry are as follows:
[0198] The number of times the first software forwarding entry was copied is: 2*128 / (2+4+1+1)=32;
[0199] The number of times the second software forwarding entry was copied is: 4*128 / (2+4+1+1)=64;
[0200] The number of times the third software forwarding entry was copied is: 1*128 / (2+4+1+1)=16;
[0201] The number of times the fourth software forwarding entry was copied is: 1*128 / (2+4+1+1)=16.
[0202] After the replication is complete, all fields in the software forwarding tables except for the forwarding weight value can be sent to the hardware forwarding table to obtain, as shown below. Figure 4bThe hardware forwarding table shown.
[0203] In another example, suppose the default routing policy is to reduce the forwarding load on congested outgoing interfaces without increasing the forwarding load on non-shortest paths. Figure 3a Based on this, the forwarding weight values of the four software forwarding entries can be adjusted from 1, 1, 0, 0 to 1, 3, 0, and 0. After adjustment, as shown below... Figure 5a As shown. This allows half of the flow on one shortest path to be evenly distributed to another shortest path.
[0204] Taking 1000 packets forwarded by the first network device as an example, before adjusting the forwarding weight values, the number of packets forwarded by outgoing interface 1 was 1000 * 1 / 2 = 500, and the number of packets forwarded by outgoing interface 2 was also 1000 * 1 / 2 = 500. After adjusting the forwarding weight values, the number of packets forwarded by outgoing interface 1 is 1000 * 1 / (1+3) = 250, the number of packets forwarded by outgoing interface 2 is 1000 * 3 / (1+3) = 750, and the number of packets forwarded by outgoing interface 3 and outgoing interface 4 is 0. In other words, half of the packets on outgoing interface 1 are now distributed to outgoing interface 2.
[0205] In obtaining Figure 5a After the software forwarding table entries are shown, the hardware forwarding table needs to be updated accordingly. The updated hardware forwarding table is as follows: Figure 5b As shown.
[0206] The number of copies required for each software forwarding entry are as follows:
[0207] The number of times the first software forwarding entry was copied is: 1*128 / (1+3+0+0)=32;
[0208] The number of times the second software forwarding entry was copied is: 3*128 / (1+3+0+0)=96;
[0209] The number of times the third software forwarding entry was copied is: 0*128 / (1+3+0+0)=0;
[0210] The number of times the fourth software forwarding entry was copied is: 0*128 / (1+3+0+0)=0.
[0211] After the replication is complete, all fields in the software forwarding tables except for the forwarding weight value can be sent to the hardware forwarding table to obtain, as shown below. Figure 5b The hardware forwarding table shown.
[0212] Using the above method, when the first outgoing interface is congested, the first network device can adjust the forwarding weight value of the path corresponding to each forwarding table entry according to the preset routing policy of the multi-path group forwarding table. That is, the first network device can utilize paths corresponding to other forwarding table entries to share the load of packets that originally needed to be forwarded through the first outgoing interface, reducing the load pressure on the first outgoing interface. By fully utilizing other paths in the network to forward packets, bandwidth utilization is improved, and while supporting large-scale networking, it can meet the requirements of high throughput, low latency, and low cost.
[0213] The method provided in this application embodiment can also be applied to leaf-spine topology networking systems, such as... Figure 6 As shown, Figure 6 An example is shown with two Spine devices and two Leaf devices. The two Spine devices are designated Spine device 1 and Spine device 2, and the two Leaf devices are designated Leaf device 1 and Leaf device 2.
[0214] In this system, Leaf device 1 is the source device, and Leaf device 2 is the destination device. Leaf device 1 can send packets to Leaf device 2. Taking Leaf device 1 as an example, Leaf device 1 calculates two paths: the path from outgoing interface 1 to Leaf device 2 and the path from outgoing interface 2 to Leaf device 2 are both shortest paths. Therefore, Leaf device 1's software forwarding table includes these two shortest paths, which form an ECMP path. The specific details of this software forwarding table are as follows: Figure 7a As shown.
[0215] Figure 7a An example is shown in Figure 6 The software forwarding table in Leaf device 1 in the network system shown. Figure 7a On the left is the destination IP address of D1 and its corresponding path group identifier. The destination IP address of D1 is the IP address of Leaf device 2. For example, the destination IP address of D1 is 119.1.1.2 / 32.
[0216] The software forwarding table generated by Leaf device 1 based on this path group includes two software forwarding table entries. The first software forwarding table entry includes the next hop of the shortest path (nexthop 1) and the forwarding weight value (1). The second software forwarding table entry includes the next hop of the other shortest path (nexthop 2) and the forwarding weight value (1).
[0217] Figure 7b for Figure 7a The corresponding hardware forwarding table, Figure 7b The hardware forwarding table contains the same first 64 hardware forwarding entries, and each forwarding entry includes the next hop of the shortest path 1.
[0218] Furthermore, the last 64 hardware forwarding entries in this hardware forwarding table are identical, and each forwarding entry includes the next hop 2 of the other shortest path.
[0219] The method provided in this application embodiment can also be applied to each group in a Dragonfly topology networking system. For example... Figure 8 As shown, Figure 8 The dashed rectangle in the middle represents group 1, which includes the Ingress device, the Transit device, and the Edge device. Figure 8 In the diagram, S represents the source device and D1 represents the destination device. The source device is connected to group 1 through the ingress device, and the destination device is connected to group 1 through the edge device.
[0220] Taking the ingress device as an example, the ingress device can calculate the shortest path and non-shortest path between itself and the destination device. The paths from outgress interface 1 to the destination device and from outgress interface 2 to the destination device are the shortest paths, while the paths from outgress interface 3 to the destination device and from outgress interface 4 to the destination device are the non-shortest paths.
[0221] Figure 9a An example is shown in Figure 8 The network system shown includes a software forwarding table in the entry device. Figure 9a On the left is the destination IP address of D1 and its corresponding path group identifier. The destination IP address of D1 is the IP address of the destination device. For example, the destination IP address of D1 is 119.1.1.2 / 32.
[0222] In the software forwarding table, the first software forwarding entry includes the next hop 1 corresponding to the shortest path, and the forwarding weight value 1 of the shortest path.
[0223] The second software forwarding entry includes the next hop 2 corresponding to the other shortest path, and the forwarding weight value 1 for that shortest path.
[0224] The third software forwarding entry includes a next hop of 1 for a non-shortest path and a forwarding weight of 0 for that non-shortest path.
[0225] The fourth software forwarding entry includes the next hop 2 for another non-shortest path, and the forwarding weight value 0 for that non-shortest path.
[0226] Figure 9b for Figure 9a The corresponding hardware forwarding table, Figure 7b The hardware forwarding table contains the same first 64 hardware forwarding entries, and each forwarding entry includes the next hop of the shortest path 1.
[0227] Furthermore, the last 64 hardware forwarding entries in this hardware forwarding table are identical, and each forwarding entry includes the next hop 2 of the other shortest path.
[0228] Based on the same concept, embodiments of this application provide a routing information maintenance device. This device is applied to a first network device, which includes a multi-path group forwarding table. The first multi-path group corresponding to the multi-path group forwarding table includes the shortest path and non-shortest paths. Each path is used to indicate the path between the first network device and a second network device. The shortest path forwarding table entry includes the first outgoing interface of the first network device. Figure 10 As shown, the device includes:
[0229] The acquisition module 1001 is used to acquire the preset routing policy corresponding to the multi-path group forwarding table when the traffic carried by the shortest path causes congestion on the first outgoing interface.
[0230] The adjustment module 1002 is used to adjust the forwarding weight value of each path in the first multi-path group based on a preset routing strategy. The forwarding weight value of each path is used to represent the proportion of traffic carried by the path when the path is selected for packet forwarding from the first multi-path group.
[0231] Optionally, the multipath group forwarding table includes software forwarding tables and hardware forwarding tables; the device also includes a generation module:
[0232] Generate modules for:
[0233] Calculate the shortest path and non-shortest path between the device and the second network device;
[0234] A software forwarding table entry is generated for each shortest path and each non-shortest path to obtain a software forwarding table. Each software forwarding table entry includes the forwarding weight value of a path, and the initial forwarding weight value of the non-shortest path is 0.
[0235] For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry except for the forwarding weight value N times to obtain N hardware forwarding table entries. Then, distribute the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table.
[0236] Where N = the forwarding weight value of the software forwarding table entry * the number of preset entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0237] Optionally, the multipath group forwarding table includes a route type flag; module 1001 is specifically used for:
[0238] Obtain the preset routing policy corresponding to the route type tag; the preset routing policy includes at least one of the following policies: adjust the forwarding load of the congested outgoing interface to 0, reduce the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reduce the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
[0239] Optionally, the first network device stores a first interface status table and a second interface status table corresponding to the multipath group forwarding table. The first interface status table includes the interface status of each outgoing interface of the first network device, and the second interface status table includes the bandwidth occupancy of the outgoing interface by the traffic carried by each path in the first multipath group. The device also includes a determination module.
[0240] The acquisition module 1001 is also used to obtain the first bandwidth occupancy of the first outgoing interface from the second interface status table if the interface status of the first interface in the first interface status table changes to a congested state.
[0241] The determination module is used to determine the traffic carried by the shortest path that causes congestion at the first outgoing interface if the first bandwidth occupancy meets the preset congestion conditions.
[0242] Optionally, the first interface status table also includes the bandwidth usage and buffer usage of each outgoing interface; the device also includes an update module and a setting module:
[0243] The update module is used to update the bandwidth usage and buffer usage of each outgoing interface in the first interface status table at preset intervals.
[0244] The setting module is used to set the interface status of the outgoing interface to congested state if the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold.
[0245] Optionally, adjustment module 1002 is specifically used for:
[0246] Based on the preset routing policy and the bandwidth usage of each outgoing interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0247] Optionally, multiple paths between the first network device and the third network device form a second multipath group. If the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the multipath group forwarding table.
[0248] Based on the same concept, embodiments of this application also provide a first network device, the first network device including a multi-path group forwarding table, the first multi-path group corresponding to the multi-path group forwarding table including the shortest path and non-shortest paths, each path being used to indicate the path between the first network device and a second network device; the forwarding table entry for the shortest path includes the first outgoing interface of the first network device; such as Figure 11 As shown, the first network device includes:
[0249] Processor 1101;
[0250] Transceiver 1104;
[0251] Machine-readable storage medium 1102 stores machine-executable instructions that can be executed by processor 1101; the machine-executable instructions cause processor 1101 to perform the following steps:
[0252] When the traffic carried by the shortest path causes congestion on the first outgoing interface, obtain the preset routing policy corresponding to the multi-path group forwarding table;
[0253] Based on the preset routing policy, the forwarding weight value of each path in the first multi-path group is adjusted. The forwarding weight value of each path is used to represent the proportion of traffic carried by that path when the path is selected for packet forwarding from the first multi-path group.
[0254] Optionally, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the machine-executable instructions also cause the processor 1101 to perform the following steps:
[0255] Calculate the shortest path and non-shortest path between the device and the second network device;
[0256] A software forwarding table entry is generated for each shortest path and each non-shortest path to obtain a software forwarding table. Each software forwarding table entry includes the forwarding weight value of a path, and the initial forwarding weight value of the non-shortest path is 0.
[0257] For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry except for the forwarding weight value N times to obtain N hardware forwarding table entries. Then, distribute the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table.
[0258] Where N = the forwarding weight value of the software forwarding table entry * the number of preset entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0259] Optionally, the multipath group forwarding table includes a route type flag; machine-executable instructions also cause processor 1101 to perform the following steps:
[0260] Obtain the preset routing policy corresponding to the route type tag; the preset routing policy includes at least one of the following policies: adjust the forwarding load of the congested outgoing interface to 0, reduce the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reduce the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
[0261] Optionally, the first network device stores a first interface status table and a second interface status table corresponding to the multipath group forwarding table. The first interface status table includes the interface status of each outgoing interface of the first network device, and the second interface status table includes the bandwidth usage of the outgoing interface by the traffic carried by each path in the first multipath group.
[0262] The machine-executable instructions also cause the processor 1101 to perform the following steps:
[0263] If the interface status of the first interface in the first interface status table changes to a congested state, then the bandwidth occupancy of the first outgoing interface carried by the shortest path is obtained from the second interface status table.
[0264] If the first bandwidth occupancy meets the preset congestion condition, then the traffic carried by the shortest path is determined to cause congestion at the first outgoing interface.
[0265] Optionally, the first interface status table also includes the bandwidth usage and buffer usage for each output interface; the machine-executable instructions also cause the processor 1101 to perform the following steps:
[0266] Every preset time interval, for each outgoing interface in the first interface status table, update the bandwidth usage and buffer usage of that outgoing interface.
[0267] If the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold, then the interface status of the outgoing interface is set to congested state.
[0268] Optionally, the machine-executable instructions also cause the processor 1101 to perform the following steps:
[0269] Based on the preset routing policy and the bandwidth usage of each outgoing interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0270] Optionally, multiple paths between the first network device and the third network device form a second multipath group. If the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the multipath group forwarding table.
[0271] exist Figure 11The system may also include a communication bus 1103. The processor 1101, machine-readable storage medium 1102, and transceiver 1104 communicate with each other via the communication bus 1103. The communication bus 1103 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0272] The transceiver 1104 can be a wireless communication module, which interacts with other devices under the control of the processor 1101.
[0273] The machine-readable storage medium 1102 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the machine-readable storage medium may also be at least one storage device located remotely from the aforementioned processor.
[0274] The processor 1101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0275] Based on the same inventive concept, and according to the routing information maintenance method provided in the above embodiments of this application, this application also provides a machine-readable storage medium storing machine-executable instructions that can be executed by a processor. The processor is prompted by the machine-executable instructions to implement the steps of the above-described routing information maintenance method.
[0276] 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 the steps of the routing information maintenance method described above.
[0277] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0278] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for maintaining routing information, characterized in that, The method is applied to a first network device, which includes a multipath group forwarding table. The first multipath group corresponding to the multipath group forwarding table includes the shortest path and non-shortest paths. Each path is used to indicate the path between the first network device and the second network device. The shortest path forwarding table entry includes the first outgoing interface of the first network device; the method includes: When the traffic carried by the shortest path causes congestion at the first outgoing interface, the preset routing policy corresponding to the multi-path group forwarding table is obtained. Based on the preset routing strategy, the forwarding weight value of each path in the first multi-path group is adjusted. The forwarding weight value of each path is used to represent the proportion of traffic carried by the path when the path is selected for packet forwarding from the first multi-path group. The multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the method further includes: Calculate the shortest path and non-shortest path between the device and the second network device; A software forwarding table entry is generated for each shortest path and each non-shortest path to obtain the software forwarding table. Each software forwarding table entry includes a forwarding weight value for a path, and the initial forwarding weight value for non-shortest paths is 0. For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry except for the forwarding weight value N times to obtain N hardware forwarding table entries. Then, distribute the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table. Where N = the forwarding weight value of the software's forwarding table entry. The sum of the preset number of entries in the hardware forwarding table and the sum of the forwarding weight values included in the software forwarding table entries.
2. The method according to claim 1, characterized in that, The multi-path group forwarding table includes a route type flag; obtaining the preset routing policy corresponding to the multi-path group forwarding table includes: Obtain the preset routing policy corresponding to the route type tag; The preset routing strategy includes at least one of the following strategies: adjusting the forwarding load of the congested outgoing interface to 0, reducing the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reducing the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
3. The method according to claim 1, characterized in that, The first network device stores a first interface status table and a second interface status table corresponding to the multipath group forwarding table. The first interface status table includes the interface status of each outgoing interface of the first network device, and the second interface status table includes the bandwidth usage of the outgoing interface by the traffic carried by each path in the first multipath group. Before obtaining the preset routing policy corresponding to the multi-path group forwarding table when the traffic carried by the shortest path causes congestion on the first outgoing interface, the method further includes: If the interface status of the first interface in the first interface status table changes to a congested state, then the first bandwidth occupancy of the traffic carried by the shortest path on the first outgoing interface is obtained from the second interface status table. If the first bandwidth occupancy meets the preset congestion condition, then it is determined that the traffic carried by the shortest path causes the first outgoing interface to be congested.
4. The method according to claim 3, characterized in that, The first interface status table also includes the bandwidth usage and buffer usage of each outgoing interface; the method further includes: Every preset time interval, for each outgoing interface in the first interface status table, update the bandwidth usage and buffer usage of that outgoing interface; If the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold, then the interface status of the outgoing interface is set to congested state.
5. The method according to claim 3, characterized in that, The step of adjusting the forwarding weight value of each path in the first multi-path group based on the preset routing policy includes: Based on the preset routing policy and the bandwidth occupancy of each outgoing interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
6. The method according to claim 1, characterized in that, Multiple paths between the first network device and the third network device form a second multipath group. When the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the multipath group forwarding table.
7. A routing information maintenance device, characterized in that, The method is applied to a first network device, which includes a multipath group forwarding table. The first multipath group corresponding to the multipath group forwarding table includes the shortest path and non-shortest paths. Each path is used to indicate the path between the first network device and the second network device. The shortest path forwarding table entry includes the first outgoing interface of the first network device; the device includes: The acquisition module is used to acquire the preset routing policy corresponding to the multi-path group forwarding table when the traffic carried by the shortest path causes congestion of the first outgoing interface. The adjustment module is used to adjust the forwarding weight value of each path in the first multi-path group based on the preset routing strategy. The forwarding weight value of each path is used to represent the proportion of traffic carried by the path when the path is selected for packet forwarding from the first multi-path group. The multi-path group forwarding table includes software forwarding tables and hardware forwarding tables; the device also includes a generation module. The generation module is used for: Calculate the shortest path and non-shortest path between the device and the second network device; A software forwarding table entry is generated for each shortest path and each non-shortest path to obtain the software forwarding table. Each software forwarding table entry includes a forwarding weight value for a path, and the initial forwarding weight value for non-shortest paths is 0. For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry except for the forwarding weight value N times to obtain N hardware forwarding table entries. Then, distribute the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table. Where N = the forwarding weight value of the software's forwarding table entry. The sum of the preset number of entries in the hardware forwarding table and the sum of the forwarding weight values included in the software forwarding table entries.
8. The apparatus according to claim 7, characterized in that, The multipath group forwarding table includes a route type flag; the acquisition module is specifically used for: Obtain the preset routing policy corresponding to the route type tag; The preset routing strategy includes at least one of the following strategies: adjusting the forwarding load of the congested outgoing interface to 0, reducing the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reducing the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
9. The apparatus according to claim 7, characterized in that, The first network device stores a first interface status table and a second interface status table corresponding to the multipath group forwarding table. The first interface status table includes the interface status of each outgoing interface of the first network device, and the second interface status table includes the bandwidth occupancy of the outgoing interface by the traffic carried by each path in the first multipath group. The device also includes a determination module. The acquisition module is further configured to, if the interface status of the first interface in the first interface status table changes to a congested state, obtain from the second interface status table the first bandwidth occupancy of the traffic carried by the shortest path on the first outgoing interface. The determining module is configured to determine that the traffic carried by the shortest path causes the first outgoing interface to be congested if the first bandwidth occupancy meets the preset congestion conditions.
10. The apparatus according to claim 9, characterized in that, The first interface status table also includes the bandwidth usage and buffer usage of each outgoing interface; the device also includes an update module and a setting module: The update module is used to update the bandwidth usage and buffer usage of each outgoing interface in the first interface status table at preset intervals. The setting module is used to set the interface status of the outgoing interface to a congested state if the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold.
11. The apparatus according to claim 9, characterized in that, The adjustment module is specifically used for: Based on the preset routing policy and the bandwidth occupancy of each outgoing interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
12. The apparatus according to claim 7, characterized in that, Multiple paths between the first network device and the third network device form a second multipath group. When the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the multipath group forwarding table.
13. A first network device, characterized in that, The first network device includes a multi-path group forwarding table, wherein the first multi-path group corresponding to the multi-path group forwarding table includes the shortest path and non-shortest paths, and each path is used to indicate the path between the first network device and the second network device; the forwarding table entry for the shortest path includes the first outgoing interface of the first network device; the first network device includes: processor; transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions cause the processor to perform the following steps: When the traffic carried by the shortest path causes congestion at the first outgoing interface, the preset routing policy corresponding to the multi-path group forwarding table is obtained. Based on the preset routing strategy, the forwarding weight value of each path in the first multi-path group is adjusted. The forwarding weight value of each path is used to represent the proportion of traffic carried by the path when the path is selected for packet forwarding from the first multi-path group. The multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the machine-executable instructions further cause the processor to perform the following steps: Calculate the shortest path and non-shortest path between the device and the second network device; A software forwarding table entry is generated for each shortest path and each non-shortest path to obtain the software forwarding table. Each software forwarding table entry includes a forwarding weight value for a path, and the initial forwarding weight value for non-shortest paths is 0. For each software forwarding table entry with a non-zero forwarding weight value, copy the information in the software forwarding table entry except for the forwarding weight value N times to obtain N hardware forwarding table entries. Then, distribute the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table. Where N = the forwarding weight value of the software's forwarding table entry. The sum of the preset number of entries in the hardware forwarding table and the sum of the forwarding weight values included in the software forwarding table entries.
14. The first network device according to claim 13, characterized in that, The multipath group forwarding table includes a route type flag; the machine-executable instructions also cause the processor to perform the following steps: Obtain the preset routing policy corresponding to the route type tag; the preset routing policy includes at least one of the following policies: adjust the forwarding load of the congested outgoing interface to 0, reduce the forwarding load of the congested outgoing interface without increasing the forwarding load of non-shortest paths, and reduce the forwarding load of the congested outgoing interface while increasing the forwarding load of non-shortest paths.
15. The first network device according to claim 13, characterized in that, The first network device stores a first interface status table and a second interface status table corresponding to the multipath group forwarding table. The first interface status table includes the interface status of each outgoing interface of the first network device, and the second interface status table includes the bandwidth usage of the outgoing interface by the traffic carried by each path in the first multipath group. The machine-executable instructions also cause the processor to perform the following steps: If the interface status of the first interface in the first interface status table changes to a congested state, then the first bandwidth occupancy of the traffic carried by the shortest path on the first outgoing interface is obtained from the second interface status table. If the first bandwidth occupancy meets the preset congestion condition, then it is determined that the traffic carried by the shortest path causes the first outgoing interface to be congested.
16. The first network device according to claim 15, characterized in that, The first interface status table also includes the bandwidth usage and buffer usage of each outgoing interface; the machine-executable instructions further cause the processor to perform the following steps: Every preset time interval, for each outgoing interface in the first interface status table, update the bandwidth usage and buffer usage of that outgoing interface; If the updated bandwidth usage of the outgoing interface reaches a preset bandwidth threshold, or the updated buffer usage of the outgoing interface reaches a preset buffer threshold, then the interface status of the outgoing interface is set to congested state.
17. The first network device according to claim 15, characterized in that, The machine-executable instructions also cause the processor to perform the following steps: Based on the preset routing policy and the bandwidth occupancy of each outgoing interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
18. The first network device according to claim 13, characterized in that, Multiple paths between the first network device and the third network device form a second multipath group. When the first multipath group and the second multipath group are the same, the first multipath group and the second multipath group share the multipath group forwarding table.
19. A machine-readable storage medium, characterized in that, The device stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implement the method of any one of claims 1-6.
20. A computer program product, characterized in that, The computer program product causes the processor to implement the method of any one of claims 1-6.
Citation Information
Patent Citations
Coding-aware wireless mesh network multi-path routing method for avoiding congestion
CN107846706A
Message forwarding method and device
CN116074236A