Routing information maintenance method and device, network equipment and storage medium
Patent Information
- Application Number
- CN202380009545.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2043-06-28
Smart Images

Figure CN119586104A_ABST
Abstract
Description
Routing information maintenance method, device, network equipment and storage medium Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a routing information maintenance method, apparatus, network equipment, and storage medium. Background Art
[0002] Adaptive routing technology makes dynamic routing decisions based on changes in network topology and traffic load. With adaptive routing, network devices can proactively detect link congestion and select the shortest, least congested path to forward packets.
[0003] Network devices can create and maintain best path tables based on routing information and link congestion. Each best path table stores the optimal path corresponding to a destination Internet Protocol (IP) address. The optimal path can be the shortest path to the destination IP address. If the shortest path is congested, the optimal path will be modified to a non-shortest path to the destination IP address.
[0004] After the best path in the best path table is modified to a non-shortest path, the network device uses the non-shortest path to forward packets containing the destination IP address. The shortest path will be disabled, resulting in reduced network bandwidth utilization.
[0005] Summary of the Invention
[0006] The present invention provides a method, apparatus, network device, and storage medium for maintaining routing information, which are used to address the problem of reduced network bandwidth utilization after the shortest path in the best path table is modified. The method includes the following solutions:
[0007] In a first aspect, an embodiment of the present application provides a routing information maintenance method, applied to a first network device, wherein the first network device includes a multipath group forwarding table, wherein a first multipath group corresponding to the multipath group forwarding table includes a shortest path and a non-shortest path, each path being used to indicate a path between the first network device and a second network device; the forwarding table entry for the shortest path includes a first outbound interface of the first network device; and the method includes:
[0008] When the traffic carried by the shortest path causes congestion on the first outbound interface, obtaining a preset routing policy corresponding to the multipath group forwarding table;
[0009] Based on the preset routing policy, the forwarding weight value of each path in the first multi-path group is adjusted, and the forwarding weight value of each path is used to represent the traffic proportion carried by the path when the path is selected from the first multi-path group for message forwarding.
[0010] In a possible implementation, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; and the method further includes:
[0011] Calculate the shortest path and non-shortest path between the second network device and the second network device;
[0012] Generating a software forwarding table entry for each shortest path and each non-shortest path, respectively, to obtain the software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and an initial forwarding weight value of the non-shortest path is 0;
[0013] For each software forwarding table entry with a non-zero forwarding weight, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table;
[0014] Wherein, N=the forwarding weight value of the software forwarding table entry*the preset number of entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0015] In a possible implementation, the multipath group forwarding table includes a routing type tag; and obtaining a preset routing policy corresponding to the multipath group forwarding table includes:
[0016] Obtaining a preset routing strategy corresponding to the routing type tag;
[0017] The preset routing strategy includes at least one of the following strategies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, and reducing the forwarding load of the congested outbound interface and increasing the forwarding load of the non-shortest path.
[0018] 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, wherein the first interface status table includes the interface status of each outbound interface of the first network device, and the second interface status table includes the bandwidth occupied by the traffic carried by each path in the first multipath group on the outbound interface;
[0019] Before obtaining the preset routing policy corresponding to the multipath group forwarding table when the traffic carried by the shortest path causes congestion on the first outbound interface, the method further includes:
[0020] If the interface state of the first interface in the first interface state table changes to a congested state, obtaining a first bandwidth occupancy of the first outbound interface by the traffic carried by the shortest path from the second interface state table;
[0021] If the first bandwidth occupancy satisfies a preset congestion condition, it is determined that the traffic carried by the shortest path causes congestion in the first outbound interface.
[0022] In a possible implementation, the first interface status table further includes bandwidth usage and buffer usage of each outbound interface; and the method further includes:
[0023] At predetermined intervals, for each outbound interface in the first interface status table, updating the bandwidth occupancy and buffer occupancy of the outbound interface;
[0024] If the updated bandwidth usage of the outbound interface reaches a preset bandwidth threshold, or the updated buffer usage of the outbound interface reaches a preset buffer threshold, the interface state of the outbound interface is set to a congested state.
[0025] In a possible implementation, adjusting the forwarding weight value of each path in the first multi-path group based on the preset routing policy includes:
[0026] Based on the preset routing policy and the bandwidth occupancy of each outbound interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0027] In one possible implementation, the multiple paths between the first network device and the third network device constitute a second multipath group. When the first multipath group is the same as the second multipath group, the first multipath group and the second multipath group share the multipath group forwarding table.
[0028] In a second aspect, an embodiment of the present application provides a routing information maintenance device, applied to a first network device, wherein the first network device includes a multipath group forwarding table, wherein a first multipath group corresponding to the multipath group forwarding table includes a shortest path and a non-shortest path, each path being used to indicate a path between the first network device and a second network device; the forwarding table entry for the shortest path includes a first outbound interface of the first network device; and the device includes:
[0029] An acquisition module, configured to acquire a preset routing policy corresponding to the multipath group forwarding table when the traffic carried by the shortest path causes congestion in the first outbound interface;
[0030] An 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 indicate the proportion of traffic carried by the path when the path is selected from the first multi-path group for message forwarding.
[0031] In a possible implementation, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; and the generating module is configured to:
[0032] Calculate the shortest path and non-shortest path between the second network device and the second network device;
[0033] Generating a software forwarding table entry for each shortest path and each non-shortest path, respectively, to obtain the software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and an initial forwarding weight value of the non-shortest path is 0;
[0034] For each software forwarding table entry with a non-zero forwarding weight, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table;
[0035] Wherein, N=the forwarding weight value of the software forwarding table entry*the preset number of entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0036] In a possible implementation, the multipath group forwarding table includes a route type tag; and the obtaining module is specifically configured to:
[0037] Obtain a preset routing policy corresponding to the routing type tag; the preset routing policy includes at least one of the following policies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, and reducing the forwarding load of the congested outbound interface and increasing the forwarding load of the non-shortest path.
[0038] 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, wherein the first interface status table includes the interface status of each outbound interface of the first network device, and the second interface status table includes the bandwidth occupied by the traffic carried by each path in the first multipath group on the outbound interface; the apparatus further includes a determining module:
[0039] The acquisition module is further configured to acquire, from the second interface status table, a first bandwidth occupancy of the first outbound interface by the traffic carried by the shortest path if the interface status of the first interface in the first interface status table changes to a congested state;
[0040] The determining module is configured to determine that the traffic carried by the shortest path causes congestion in the first outbound interface if the first bandwidth occupancy satisfies a preset congestion condition.
[0041] In a possible implementation, the first interface status table further includes bandwidth usage and buffer usage of each outbound interface; the apparatus further includes an updating module and a setting module:
[0042] The updating module is configured to update the bandwidth occupancy and buffer occupancy of each outbound interface in the first interface status table at predetermined intervals;
[0043] The setting module is configured to set the interface state of the outbound interface to a congested state if the updated bandwidth occupancy of the outbound interface reaches a preset bandwidth threshold, or the updated buffer occupancy of the outbound interface reaches a preset buffer threshold.
[0044] In a possible implementation, the adjustment module is specifically configured to:
[0045] Based on the preset routing policy and the bandwidth occupancy of each outbound interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0046] In one possible implementation, the multiple paths between the first network device and the third network device constitute a second multipath group. When the first multipath group is the same as the second multipath group, the first multipath group and the second multipath group share the multipath group forwarding table.
[0047] In a third aspect, an embodiment of the present application provides a first network device, the first network device including a multipath group forwarding table, the first multipath group corresponding to the multipath group forwarding table including a shortest path and a non-shortest path, each path being used to indicate a path between the first network device and a second network device; the forwarding table entry for the shortest path includes a first outbound interface of the first network device; the first network device includes:
[0048] processor;
[0049] transceiver;
[0050] A machine-readable storage medium storing machine-executable instructions capable of being executed by the processor; the machine-executable instructions prompting the processor to perform the following steps:
[0051] When the traffic carried by the shortest path causes congestion on the first outbound interface, obtaining a preset routing policy corresponding to the multipath group forwarding table;
[0052] Based on the preset routing policy, the forwarding weight value of each path in the first multi-path group is adjusted, and the forwarding weight value of each path is used to represent the traffic proportion carried by the path when the path is selected from the first multi-path group for message forwarding.
[0053] In a possible implementation, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; and the machine executable instructions further cause the processor to perform the following steps:
[0054] Calculate the shortest path and non-shortest path between the second network device and the second network device;
[0055] Generating a software forwarding table entry for each shortest path and each non-shortest path, respectively, to obtain the software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and an initial forwarding weight value of the non-shortest path is 0;
[0056] For each software forwarding table entry with a non-zero forwarding weight, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table;
[0057] Wherein, N=the forwarding weight value of the software forwarding table entry*the preset number of entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0058] In one possible implementation, the multipath group forwarding table includes a route type tag; and the machine executable instructions further cause the processor to perform the following steps:
[0059] Obtain a preset routing policy corresponding to the routing type tag; the preset routing policy includes at least one of the following policies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, and reducing the forwarding load of the congested outbound interface and increasing the forwarding load of the non-shortest path.
[0060] 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, wherein the first interface status table includes the interface status of each outbound interface of the first network device, and the second interface status table includes the bandwidth occupied by the traffic carried by each path in the first multipath group on the outbound interface;
[0061] The machine-executable instructions further cause the processor to perform the following steps:
[0062] If the interface state of the first interface in the first interface state table changes to a congested state, obtaining a first bandwidth occupancy of the first outbound interface by the traffic carried by the shortest path from the second interface state table;
[0063] If the first bandwidth occupancy satisfies a preset congestion condition, it is determined that the traffic carried by the shortest path causes congestion in the first outbound interface.
[0064] In a possible implementation, the first interface status table further includes bandwidth usage and buffer usage of each outbound interface; and the machine-executable instructions further cause the processor to execute the following steps:
[0065] At predetermined intervals, for each outbound interface in the first interface status table, updating the bandwidth occupancy and buffer occupancy of the outbound interface;
[0066] If the updated bandwidth usage of the outbound interface reaches a preset bandwidth threshold, or the updated buffer usage of the outbound interface reaches a preset buffer threshold, the interface state of the outbound interface is set to a congested state.
[0067] In one possible implementation, the machine executable instructions further cause the processor to execute the following steps:
[0068] Based on the preset routing policy and the bandwidth occupancy of each outbound interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0069] In one possible implementation, the multiple paths between the first network device and the third network device constitute a second multipath group. When the first multipath group is the same as the second multipath group, the first multipath group and the second multipath group share the multipath group forwarding table.
[0070] In a fourth aspect, an embodiment of the present application provides a machine-readable storage medium storing machine-executable instructions. When called and executed by a processor, the machine-executable instructions prompt the processor to implement the method described in the first aspect.
[0071] In a fifth aspect, an embodiment of the present application provides a computer program product, which prompts the processor to implement the method described in the first aspect.
[0072] By adopting the above technical solution, when the traffic carried by the shortest path causes congestion in the first output interface, the preset routing policy corresponding to the multi-path group forwarding table is obtained, and 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 the embodiment of the present application, when the traffic carried by the shortest path causes congestion in the first output interface, the shortest path where the first output interface is located is not directly deactivated, but the forwarding weight value of each path in the first multi-path group is adjusted. Since the forwarding weight value of each path is used to represent the proportion of traffic carried by the path when the path is selected in the first multi-path group for a message, after adjusting the forwarding weight value of each path, the forwarding load of each path will change, which can reduce the load of the shortest path, thereby alleviating the congestion of the first output interface, making full use of the resources of each path, and improving the overall bandwidth utilization of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0074] FIG1 is a schematic diagram of the structure of a networking system provided in an embodiment of the present application;
[0075] FIG2 is a flow chart of a routing information maintenance method provided in an embodiment of the present application;
[0076] FIG3a is an exemplary schematic diagram of a first software forwarding table provided in an embodiment of the present application;
[0077] FIG3 b is an exemplary schematic diagram of a first hardware forwarding table provided in an embodiment of the present application;
[0078] FIG4a is an exemplary schematic diagram of a second software forwarding table provided in an embodiment of the present application;
[0079] FIG4 b is an exemplary schematic diagram of a second hardware forwarding table provided in an embodiment of the present application;
[0080] FIG5a is an exemplary schematic diagram of a third software forwarding table provided in an embodiment of the present application;
[0081] FIG5 b is an exemplary schematic diagram of a third hardware forwarding table provided in an embodiment of the present application;
[0082] FIG6 is a schematic diagram of the structure of another networking system provided in an embodiment of the present application;
[0083] FIG7a is an exemplary schematic diagram of a fourth software forwarding table provided in an embodiment of the present application;
[0084] FIG7 b is an exemplary schematic diagram of a fourth hardware forwarding table provided in an embodiment of the present application;
[0085] FIG8 is a schematic diagram of another networking structure provided in an embodiment of the present application;
[0086] FIG9a is an exemplary schematic diagram of a fifth software forwarding table provided in an embodiment of the present application;
[0087] FIG9 b is an exemplary schematic diagram of a fifth hardware forwarding table provided in an embodiment of the present application;
[0088] FIG10 is a schematic structural diagram of a routing information maintenance device provided in an embodiment of the present application;
[0089] FIG11 is a schematic diagram of the structure of a network device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0090] To make the objectives, technical solutions, and advantages of this application more clearly understood, the present application is further described below with reference to the accompanying drawings and examples. It is apparent that the described examples are only some of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the examples in this application are intended to fall within the scope of protection of this application.
[0091] As shown in Figure 1, Figure 1 illustrates an exemplary networking system used in an embodiment of the present application. The networking system includes: a source device, a destination device, an ingress device, a transit device 1, a transit device 2, and a transit device 3. In Figure 1, S represents a source device, and D1 and D2 represent destination devices. After the ingress device receives a message sent by the source device, it can forward the message to the destination device through the transit device. The source device and the destination device can be servers, virtual machines, and other devices.
[0092] Ingress devices and transit devices can calculate the shortest path and loop-free non-shortest path to the destination IP address or destination IP network segment using the shortest path first algorithm. For example, the ingress device can calculate the shortest path and loop-free non-shortest path to D1. The paths from outbound interface 1 to D1 and from outbound interface 2 to D1 are the shortest paths, while the paths from outbound interface 3 to D1 and from outbound interface 4 to D1 are loop-free non-shortest paths.
[0093] A loop-free non-shortest path means that there is no loop in the non-shortest path. The non-shortest paths described in the subsequent embodiments of this application do not have loops.
[0094] In order to improve network bandwidth utilization, an embodiment of the present application provides a routing information maintenance method, which can be applied to Internet Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), or Internet Protocol version 6 segment routing (SRv6) networks, and can be used in campus networks, data center networks, and wide area networks. The method can be executed by a first network device, which can be, for example, the ingress device or transit device in Figure 1.
[0095] The first network device includes a multipath group forwarding table, the multipath group forwarding table includes a forwarding table entry for each path in the first multipath group, the first multipath group corresponding to the multipath group forwarding table includes a shortest path and a non-shortest path, and the forwarding table entry for the shortest path includes a first output interface of the first network device.
[0096] Each path indicates a path between the first network device and the second network device. It can be understood that each path indicates 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 where the IP address of the second network device resides.
[0097] The multipath group forwarding table is used to guide packet forwarding. Each forwarding entry in the multipath group forwarding table includes a next hop, an outbound interface, and a forwarding weight value of a path corresponding to the forwarding entry.
[0098] It should be noted that the multipath group forwarding table in the embodiment of the present application is located in an overall forwarding table, which may include multiple multipath group forwarding tables. In other words, each multipath group forwarding table can serve as a table entry in the overall forwarding table.
[0099] As shown in FIG2 , the routing information maintenance method provided in the embodiment of the present application includes the following steps:
[0100] S201: When the traffic carried by the shortest path causes congestion on a first outbound interface, obtain a preset routing policy corresponding to a multi-path group forwarding table.
[0101] It is understandable that the first outbound interface is the outbound interface included in the forwarding entry of the shortest path in the multipath group forwarding table. The first outbound interface may also be located in other paths, that is, multiple paths can share the first outbound interface to forward traffic.
[0102] When the first outbound interface is congested and the traffic carried by the shortest path causes the first outbound interface to be congested, it means that the forwarding load of the shortest path is large. The preset routing policy corresponding to the multipath group forwarding table can be obtained to adjust the forwarding loads of multiple paths.
[0103] S202: Adjust the forwarding weight value of each path in the first multi-path group based on a preset routing policy.
[0104] The forwarding weight of each path represents the proportion of traffic carried by that path when it is selected from the first multi-path group for packet forwarding. It is understood that a larger forwarding weight for a path indicates a greater proportion of traffic carried by that path when it is used for packet forwarding, meaning that the path is used to forward more packets.
[0105] Using the above method, when the traffic carried by the shortest path causes congestion in the first output interface, the preset routing policy corresponding to the multi-path group forwarding table is obtained, and 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 the embodiment of the present application, when the traffic carried by the shortest path causes congestion in the first output interface, the shortest path where the first output interface is located is not directly deactivated, but the forwarding weight value of each path in the first multi-path group is adjusted. Since the forwarding weight value of each path is used to represent the proportion of traffic carried by the path when the path is selected in the first multi-path group for a message, after adjusting the forwarding weight value of each path, the forwarding load of each path will change, which can reduce the load of the shortest path, thereby alleviating the congestion of the first output interface, making full use of the resources of each path, and improving the overall bandwidth utilization of the network.
[0106] It should be noted that the multiple paths between the first network device and the third network device constitute 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 above-mentioned multipath group forwarding table.
[0107] It is understood that if the multiple multipath groups of the first network device are identical, the multiple multipath groups can all 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 can improve path update speed. If adjustments are required to the multipath group forwarding tables corresponding to multiple multipath groups, these adjustments can be made directly to the shared multipath group forwarding table, eliminating the need to adjust each multipath group forwarding table separately. This improves the update speed of the multipath group forwarding table and reduces processing overhead.
[0108] For example, the paths from the first network device to destination device 1 include: shortest path A, non-shortest path B, and non-shortest path C; the paths from the first network device to destination device 2 include: 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 the paths 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 the same multipath group forwarding table.
[0109] In the embodiment of the present application, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; before executing the process of Figure 2, the multipath forwarding table and the hardware forwarding table have been generated in the first network device.
[0110] The software forwarding table and the hardware forwarding table are generated through the following steps:
[0111] Step 1: Calculate the shortest path and non-shortest path to the second network device.
[0112] The first network device may calculate the shortest path and the non-shortest path between the first network device and the second network device based on a shortest path first algorithm.
[0113] 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.
[0114] 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. When there are no non-shortest paths and multiple shortest paths, the multiple shortest paths included in the first multipath group are equal-cost multi-path routing (ECMP).
[0115] Step 2: Generate a software forwarding table entry for each shortest path and each non-shortest path to obtain a software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and the initial forwarding weight value of the non-shortest path is 0.
[0116] It is understood that the software forwarding table includes the shortest path and non-shortest path calculated in step 1. The first network device may preferentially use the shortest path for message forwarding, and may not use the non-shortest path for message forwarding if the shortest path is not congested. Therefore, the initial weight value of the shortest path may be 1, and the initial weight value of the non-shortest path may be 0.
[0117] As shown in FIG3a , FIG3a exemplarily shows a software forwarding table shared by n destination IP addresses. The left side of FIG3a shows n destination IP addresses and corresponding path group identifiers, which are the destination IP addresses and corresponding path group identifiers of destination devices D1 to Dn respectively.
[0118] 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 that the path groups between the first network device and each destination device in FIG3a each include two shortest paths and two non-shortest paths.
[0119] The right side of FIG3 a shows a software forwarding table shared by the destination IP addresses of the destination devices D1 to Dn. As an example, the software forwarding table includes four software forwarding table entries.
[0120] The first software forwarding table entry includes a next hop (nexthop) 1 corresponding to a shortest path and a forwarding weight value 1 of the shortest path.
[0121] The second software forwarding table entry includes the next hop 2 corresponding to another shortest path and the forwarding weight value 1 of the shortest path.
[0122] The third software forwarding table entry includes a next hop 1 corresponding to a non-shortest path and a forwarding weight value of 0 for the non-shortest path.
[0123] The fourth software forwarding table entry includes a next hop 2 corresponding to another non-shortest path and a forwarding weight value of 0 for the non-shortest path.
[0124] It should be noted that each software forwarding entry in FIG. 3 a also includes an outgoing interface, which is not shown in FIG. 3 a .
[0125] Step 3: For each software forwarding table entry with a non-zero forwarding weight, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain a hardware forwarding table.
[0126] Wherein, N=the forwarding weight value of the software forwarding table entry*the preset number of entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0127] The number of preset table entries may be set based on experience, for example, the number of preset table entries may be 128.
[0128] It is understandable that after the first network device sends the hardware forwarding table entry to the hardware resource and obtains the hardware forwarding table, the forwarding chip of the first network device can forward the message using the hardware forwarding table in the hardware resource.
[0129] The software forwarding table entry with a forwarding weight value of 0 is not currently used for packet forwarding and is in a standby state. Therefore, the software forwarding table entry with a forwarding weight value of 0 does not need to be sent to the hardware resource.
[0130] As an example, the hardware forwarding table obtained based on the software forwarding table shown in FIG3a is shown in FIG3b . The IP address on the left side of FIG3b is the same as the IP address on the left side of FIG3a , and will not be repeated here.
[0131] Figure 3b uses the example of a hardware forwarding table with 128 entries. The forwarding weights of the third and fourth entries in Figure 3a are both 0, so they do not need to be sent to the hardware forwarding table. The forwarding weights of the first and second software forwarding entries in Figure 3a are both 1, so they can each be replicated into 64 copies and then sent to the hardware forwarding table.
[0132] Therefore, the first 64 hardware forwarding table entries included in the hardware forwarding table of FIG3 b are the same, and each forwarding table entry includes the next hop 1 of the shortest path.
[0133] Furthermore, the last 64 hardware forwarding table entries included in the hardware forwarding table are identical, and each forwarding table entry includes the next hop 2 of another shortest path.
[0134] It should be noted that each hardware forwarding table entry in FIG3b also includes an outgoing interface, which is not shown in FIG3b.
[0135] It is understandable that if the number of entries in the hardware forwarding table changes from many to few, there may be a situation where a message matches a hardware forwarding table entry and the hardware forwarding table entry is deleted before the message is forwarded, resulting in packet loss. In the embodiment of the present application, the number of entries included in the hardware forwarding table is a fixed value, that is, after the weight of the path changes, it will not cause the number of entries in the hardware forwarding table to change, thereby avoiding packet loss.
[0136] In another embodiment of the present application, a 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 bandwidth usage, buffer usage, and interface status of each outbound interface of the first network device, and the second outbound interface status table includes bandwidth usage of the outbound interface for traffic carried by each path in the first multipath group.
[0137] The first interface status table is the comprehensive status of all traffic on each outbound interface of the first network device with adaptive routing enabled. For example, in Figure 1, the outbound interfaces of the ingress device are Outbound Interface 1, Outbound Interface 2, Outbound Interface 3, and Outbound Interface 4. The first interface status table of the ingress device is shown in Table 1.
[0138] Table 1
[0139] The interface status can be normal, congested, or recovered. The initial status of each outbound interface is set to normal.
[0140] The first network device can update the bandwidth occupancy and buffer occupancy of each outbound interface in the first interface status table at preset time intervals. If the updated bandwidth occupancy of the outbound interface reaches a preset bandwidth threshold, or the updated buffer occupancy of the outbound interface reaches a preset buffer threshold, the interface status of the outbound interface is set to a congested state.
[0141] For example, the preset time length may be 5 milliseconds.
[0142] The preset bandwidth threshold is a bandwidth high threshold, and the preset buffer threshold is a buffer high threshold.
[0143] The method for the first network device to determine the interface status specifically includes:
[0144] If the bandwidth occupancy of a certain interface reaches the bandwidth high threshold, or the buffer occupancy reaches the buffer high threshold, the interface state of the interface is set to the congested state. If the interface changes from the normal state or the recovery state to the congested state, the first network device determines that the interface is congested;
[0145] When an interface is in congestion, if the updated bandwidth usage of the interface is lower than the bandwidth high threshold and the updated buffer usage is lower than the buffer high threshold, the interface state is set to recovery state.
[0146] When an interface is in the recovery state, if the updated bandwidth usage of the interface is lower than the bandwidth low threshold and the updated buffer usage is lower than the buffer low threshold, the interface state is set to normal.
[0147] The above-mentioned bandwidth high threshold, bandwidth low threshold, buffer high threshold, and buffer low threshold are statically set in advance based on experience.
[0148] Alternatively, artificial intelligence can be used to intelligently and dynamically set the bandwidth high threshold, bandwidth low threshold, buffer high threshold, and buffer low threshold based on network status.
[0149] For example, a deep learning model can be pre-trained and a threshold update cycle can be pre-set. Every threshold update cycle, the bandwidth occupancy and buffer occupancy 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] The first network device also stores a second interface status table, which includes the bandwidth usage of each outbound interface corresponding to the multipath group forwarding table. As an example, multipath group forwarding table 1 includes outbound interface 1, outbound interface 2, outbound interface 3, and outbound interface 4, respectively; multipath group forwarding table 2 includes outbound interface 1 and outbound interface 3, respectively; and multipath group forwarding table 3 includes outbound interface 2 and outbound interface 4, respectively. The second interface status table stored in the first network device is shown in Table 2.
[0151] Table 2
[0152] In Table 2, M represents the shortest path, and N represents a non-shortest path. The number after ":" represents the bandwidth usage of the outbound interface by the traffic carried by the path.
[0153] Table 2 shows that multipath 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 on outbound interface 1 is a; the bandwidth usage of traffic carried by shortest path 2 on outbound interface 2 is b; the bandwidth usage of traffic carried by shortest path 3 on outbound interface 4 is d; and the bandwidth usage of traffic carried by the non-shortest path on outbound interface 3 is c.
[0154] Multipath forwarding table 2 contains one shortest path and one non-shortest path. The bandwidth usage of the shortest path on outbound interface 3 is f, and the bandwidth usage of the non-shortest path on outbound interface 1 is e.
[0155] Multipath forwarding table 3 includes a shortest path and a non-shortest path. The bandwidth usage of the shortest path on outbound interface 4 is g; the bandwidth usage of the non-shortest path on outbound interface 2 is h.
[0156] In the above S201, when the traffic carried by the shortest path causes congestion on the first outbound interface, before obtaining the preset routing policy corresponding to the multipath group forwarding table, the method further includes:
[0157] If the interface state of the first interface in the first interface state table changes to a congested state, a first bandwidth occupancy of the traffic carried by the shortest path on the first outbound interface is obtained from the second interface state table, and it is determined whether the first bandwidth occupancy meets a preset congestion condition.
[0158] The preset congestion condition may be: among the bandwidth occupancy of each path using the first outbound interface, the first bandwidth occupancy is the largest.
[0159] That is, if the shortest path where the first outbound interface is located occupies the largest amount of bandwidth for the first outbound interface, it means that the traffic carried by the shortest path causes congestion in the first outbound interface.
[0160] Alternatively, the preset congestion condition may also be that the second bandwidth occupancy is greater than a specified bandwidth threshold, and the specified bandwidth threshold is less than the above-mentioned bandwidth high threshold.
[0161] The following example illustrates this configuration. Assume that the maximum bandwidth of each outbound interface is 1000 kbps, the maximum buffer usage is 1000 bytes, the bandwidth upper threshold is 800 kbps, the bandwidth lower threshold is 200 kbps, the buffer upper threshold is 800 bytes, and the buffer lower threshold is 200 bytes.
[0162] Taking the outbound interfaces of the ingress device in FIG1 as an example, namely, outbound interface 1, outbound interface 2, outbound interface 3, and outbound interface 4, the first interface state table of the ingress device is shown in Table 3.
[0163] Table 3
[0164] According to Table 3, when the outbound interface 1 in Table 3 is set to the congested state, the ingress device determines that the outbound interface 1 enters the congested state.
[0165] Assume that the ingress device includes multipath group forwarding table 1, multipath group forwarding table 2 and multipath group forwarding table 3, the outgoing interfaces included in multipath group forwarding table 1 are outgoing interface 1, outgoing interface 2, outgoing interface 3 and outgoing interface 4 respectively, the outgoing interfaces included in multipath group forwarding table 2 are outgoing interface 1 and outgoing interface 3 respectively, and the outgoing interfaces included in multipath group forwarding table 3 are outgoing interface 2 and outgoing interface 4 respectively. The second interface status table corresponding to the multipath group forwarding table stored in the first network device is shown in Table 4.
[0166] Table 4
[0167] As shown in Table 4, for outbound interface 1, the traffic carried by the shortest path corresponding to multipath group forwarding table 1 occupies the largest amount of bandwidth on outbound interface 1. Therefore, it can be determined that the traffic carried by this shortest path causes congestion on outbound interface 1.
[0168] By adopting this method, whether the first outgoing interface is congested can be determined in a timely manner based on the first interface status table. When it is determined that the first outgoing interface is congested, the path that causes the first outgoing interface to be congested can also be determined, so that the weight values of each path corresponding to the multipath forwarding table corresponding to the path can be adjusted, thereby avoiding worsening congestion and improving bandwidth utilization.
[0169] In another embodiment of the present application, the multipath group forwarding table includes a route type tag. As an example, the route type tag may occupy a field of the software forwarding table.
[0170] In the above S201, obtaining the preset routing policy corresponding to the multi-path group forwarding table can be specifically implemented as follows:
[0171] Obtain a preset routing policy corresponding to the routing type tag; the preset routing policy includes at least one of the following policies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, and reducing the forwarding load of the congested outbound interface and increasing the forwarding load of the non-shortest path.
[0172] As an example, the preset routing policy corresponding to route type tag 1 is to adjust the forwarding load of the congested outbound interface to 0, that is, not to continue forwarding packets using the congested outbound interface; the preset routing policy corresponding to route type tag 2 is to reduce the forwarding load of the congested outbound interface and not increase the forwarding load of non-shortest paths; the preset routing policy corresponding to route type tag 3 is to reduce the forwarding load of the congested outbound interface and increase the forwarding load of non-shortest paths. The embodiments of the present application do not limit the form of the routing type tag.
[0173] It should be noted that the preset routing strategies in the embodiments of the present application are not limited to the above three and can be flexibly set according to actual scenarios.
[0174] Using this method, by setting a route type tag in the multipath group forwarding table, the default routing policy corresponding to the route type tag can be matched. This allows the default routing policy used by the multipath group forwarding table entries to be flexibly adjusted based on the route type tag, thereby improving overall network performance.
[0175] After determining the preset routing policy, S202 adjusts the forwarding weight of each path in the first multi-path group based on the preset routing policy, specifically including:
[0176] 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.
[0177] The first network device may determine a path whose forwarding weight value needs to be adjusted based on a preset routing policy.
[0178] If the preset routing policy is to adjust the forwarding load of the congested outbound interface to 0, the forwarding weight value of the congested outbound interface can be adjusted to 0, and the path load of the uncongested outbound interface in the first multipath group can be used to share the traffic of the shortest path where the first outbound interface is located.
[0179] If the preset routing policy is to reduce the forwarding load of congested outbound interfaces while not increasing the forwarding load of non-shortest paths, multiple preset ratios can be used to calculate whether the outbound interfaces of the other shortest paths would become congested if the traffic of the shortest path on which the first outbound interface resides were evenly distributed to the uncongested shortest paths of the other outbound interfaces. This determines the maximum preset ratio that will not cause congestion on the outbound interfaces of the other shortest paths, and the forwarding weight of each shortest path is adjusted based on this preset ratio. The multiple preset ratios can be successively lower ratios, for example, 1 / 2, 1 / 4, and 1 / 8.
[0180] Assuming that calculations determine that after adjusting 1 / 2 of the traffic carried by the shortest path where the first outbound interface is located to other shortest paths, congestion will not occur on the outbound interfaces of the other shortest paths, the forwarding weight values of the shortest paths are adjusted according to the ratio of 1 / 2.
[0181] If the preset routing policy is to reduce the forwarding load of congested outbound interfaces and increase the forwarding load of non-shortest paths, multiple preset ratios can be used to calculate whether congestion would occur on the outbound interfaces of the other non-shortest paths if the traffic of the shortest path on which the first outbound interface resides were evenly distributed to the non-shortest paths on which the other outbound interfaces are not congested. The maximum preset ratio that will not cause congestion on the outbound interfaces of the other non-shortest paths is determined, and the forwarding weight of each path is adjusted according to the preset ratio.
[0182] In combination with the example in Table 4 above, assuming that the preset routing policy is to reduce the forwarding load of the congested outbound interface and increase the forwarding load of the non-shortest path, the forwarding weight value of each path in the multipath group corresponding to multipath group forwarding table 1 can be adjusted.
[0183] For ease of description, the four paths corresponding to multipath group forwarding entry 1 in Table 4 are referred to as path 1, path 2, path 3, and path 4. Based on Table 3, we can determine that outbound interfaces 3 and 4 of the non-shortest paths are not congested. Therefore, we can calculate whether congestion will occur on outbound interfaces 3 and 4 if 1 / 2 of the traffic on outbound interface 1 of path 1 is evenly distributed to outbound interface 3 of path 3 and outbound interface 4 of path 4. If congestion does not occur, we can recalculate the forwarding weights for paths 1 through 4 based on a 1 / 2 ratio.
[0184] Table 5 shows the calculated bandwidth usage for each outbound interface. This shows that the 300 kbps of traffic on outbound interface 1 is evenly distributed between interfaces 3 and 4. After adjustment, the bandwidth usage of interface 3 is 550 kbps, and that of interface 4 is 450 kbps. Both rates are within the upper bandwidth threshold, and congestion is avoided.
[0185] Table 5
[0186] Assuming that congestion is detected on any of outbound interfaces 2, 3, and 4, calculate whether congestion will occur on outbound interfaces 2, 3, and 4 if 1 / 4 of the traffic on outbound interface 1 on path 1 is evenly distributed to outbound interface 3 on path 2, outbound interface 3 on path 3, and outbound interface 4 on path 4. If congestion does not occur on outbound interfaces 2, 3, and 4, recalculate the forwarding weights for paths 1 through 4 based on a 1 / 4 ratio. If congestion is detected on any outbound interface, continue the calculation based on a 1 / 8 ratio, and so on.
[0187] According to the example in Table 5, the forwarding weights corresponding to paths 1 to 4 can be re-determined at a ratio of 1 / 2. Therefore, the forwarding weights of the four software forwarding table entries in multipath group forwarding table 1 are adjusted from 1, 1, 0, 0 to 1 / 2, 1, 1 / 4, 1 / 4, that is, 2, 4, 1, 1.
[0188] The following describes how to update the software forwarding table and the hardware forwarding table:
[0189] In one example, assuming the preset routing policy is to reduce the forwarding load of the congested outbound interface and increase the forwarding load of the non-shortest path, based on Figure 3a, the forwarding weight values included in the four software forwarding table entries can be adjusted from 1, 1, 0, 0 to 2, 4, 1, 1, as shown in Figure 4a. This way, half of the traffic on the path corresponding to the first software forwarding table entry can be evenly distributed to the two non-shortest paths.
[0190] As an example, taking 1000 packets forwarded by the first network device, before adjusting the forwarding weight, the number of packets forwarded by outbound interface 1 is 1000*1 / 2=500, the number of packets forwarded by outbound interface 2 is 1000*1 / 2=500, and the number of packets forwarded by outbound interface 3 and outbound interface 4 is both 0. After adjusting the forwarding weight, the number of packets forwarded by outbound interface 1 is 1000*2 / (2+4+1+1)=250, the number of packets forwarded by outbound interface 2 is 1000*4 / (2+4+1+1)=500, the number of packets forwarded by outbound interface 3 is 1000*1 / (2+4+1+1)=125, and the number of packets forwarded by outbound interface 4 is 1000*1 / (2+4+1+1)=125. That is, half of the traffic on outbound interface 1 is evenly distributed to outbound interface 3 and outbound interface 4.
[0191] After obtaining the software forwarding table entry in FIG4a, the hardware forwarding table needs to be updated. The updated hardware forwarding table is shown in FIG4b.
[0192] The number of copies required for each software forwarding table entry is:
[0193] The number of copies of the first software forwarding table entry is: 2*128 / (2+4+1+1)=32;
[0194] The number of duplicated entries in the second software forwarding table is: 4*128 / (2+4+1+1)=64;
[0195] The number of copies of the third software forwarding table entry is: 1*128 / (2+4+1+1)=16;
[0196] The number of copies of the fourth software forwarding table entry is: 1*128 / (2+4+1+1)=16.
[0197] After the copying is completed, the fields except the forwarding weight value in each software forwarding table can be sent to the hardware forwarding table, thereby obtaining the hardware forwarding table shown in FIG4 b .
[0198] In another example, assuming the preset routing policy is to reduce the forwarding load of congested outbound interfaces while not increasing the forwarding load of non-shortest paths, based on Figure 3a, the forwarding weights of the four software forwarding entries can be adjusted from 1, 1, 0, 0 to 1, 3, 0, and 0, as shown in Figure 5a. This way, half of the traffic on one shortest path can be evenly distributed to the other shortest path.
[0199] Taking 1000 packets forwarded by the first network device as an example, before adjusting the forwarding weight, the number of packets forwarded by outbound interface 1 is 1000*1 / 2=500, and the number of packets forwarded by outbound interface 2 is 1000*1 / 2=500. After adjusting the forwarding weight, the number of packets forwarded by outbound interface 1 is 1000*1 / (1+3)=250, the number of packets forwarded by outbound interface 2 is 1000*3 / (1+3)=750, the number of packets forwarded by outbound interface 3 is 0, and the number of packets forwarded by outbound interface 4 is 0. In other words, half of the packets on outbound interface 1 are divided into outbound interface 2.
[0200] After obtaining the software forwarding table entry shown in FIG5a, the hardware forwarding table needs to be updated. The updated hardware forwarding table is shown in FIG5b.
[0201] The number of copies required for each software forwarding table entry is:
[0202] The number of copies of the first software forwarding table entry is: 1*128 / (1+3+0+0)=32;
[0203] The number of duplicated entries in the second software forwarding table is: 3*128 / (1+3+0+0)=96;
[0204] The number of copies of the third software forwarding table entry is: 0*128 / (1+3+0+0)=0;
[0205] The number of copies of the fourth software forwarding table entry is: 0*128 / (1+3+0+0)=0.
[0206] After the copying is completed, the fields except the forwarding weight value in each software forwarding table can be sent to the hardware forwarding table, thereby obtaining the hardware forwarding table shown in FIG5 b .
[0207] Using this method, when the first outbound interface is congested, the first network device can adjust the forwarding weight of the path corresponding to each forwarding table entry based on the preset routing policy corresponding to the multipath group forwarding table. This means that the first network device can use paths corresponding to other forwarding table entries to share packets that would otherwise be forwarded through the first outbound interface, reducing the load on the first outbound interface. By fully utilizing other paths in the network to forward packets, bandwidth utilization is improved, meeting the requirements of high throughput, low latency, and low cost while supporting large-scale networking.
[0208] The method provided in the embodiments of the present application can also be applied to a leaf-spine topology networking system, as shown in Figure 6, which exemplarily illustrates two spine devices and two leaf devices. The two spine devices are Spine device 1 and Spine device 2, and the two leaf devices are Leaf device 1 and Leaf device 2.
[0209] 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 outbound interface 1 to Leaf device 2 and the path from outbound interface 2 to Leaf device 2, both of which are shortest paths. Therefore, Leaf device 1's software forwarding table includes these two shortest paths, forming an ECMP path. Figure 7a shows this software forwarding table.
[0210] Figure 7a illustrates the software forwarding table in Leaf device 1 in the networking system shown in Figure 6. The left side of Figure 7a shows the D1 destination IP address and the corresponding path group identifier. The D1 destination IP address is the IP address of Leaf device 2. For example, the D1 destination IP address is 119.1.1.2 / 32.
[0211] The software forwarding table generated by Leaf device 1 based on the path group includes two software forwarding table entries. The first software forwarding table entry includes the next hop (nexthop) 1 of the shortest path and a forwarding weight value of 1. The second software forwarding table entry includes the next hop (nexthop 2) of another shortest path and a forwarding weight value of 1.
[0212] FIG7 b is the hardware forwarding table corresponding to FIG7 a . The first 64 hardware forwarding table entries included in the hardware forwarding table of FIG7 b are the same, and each forwarding table entry includes a next hop 1 of the shortest path.
[0213] Furthermore, the last 64 hardware forwarding table entries included in the hardware forwarding table are identical, and each forwarding table entry includes the next hop 2 of another shortest path.
[0214] The method provided in the embodiment of the present application can also be applied to each group in the Dragonfly topology networking system. As shown in Figure 8, the dotted rectangular box in Figure 8 represents Group 1, which includes an Ingress device, a Transit device, and an Edge device. In Figure 8, S represents the source device, and D1 represents the destination device. The source device accesses Group 1 through the ingress device, and the destination device accesses Group 1 through the edge device.
[0215] Taking the ingress device as an example, the ingress device can calculate the shortest path and non-shortest path between it and the destination device. The path from outbound interface 1 to the destination device and the path from outbound interface 2 to the destination device are the shortest paths, while the path from outbound interface 3 to the destination device and the path from outbound interface 4 to the destination device are non-shortest paths.
[0216] Figure 9a illustrates an example of the software forwarding table in the ingress device in the networking system shown in Figure 8. The left side of Figure 9a shows the D1 destination IP address and the corresponding path group identifier. The D1 destination IP address is the IP address of the destination device. For example, the D1 destination IP address is 119.1.1.2 / 32.
[0217] In the software forwarding table, the first software forwarding entry includes a next hop (nexthop) 1 corresponding to a shortest path and a forwarding weight value 1 of the shortest path.
[0218] The second software forwarding table entry includes the next hop 2 corresponding to another shortest path and the forwarding weight value 1 of the shortest path.
[0219] The third software forwarding table entry includes a next hop 1 corresponding to a non-shortest path and a forwarding weight value of 0 for the non-shortest path.
[0220] The fourth software forwarding table entry includes a next hop 2 corresponding to another non-shortest path and a forwarding weight value of 0 for the non-shortest path.
[0221] FIG9 b is the hardware forwarding table corresponding to FIG9 a . The first 64 hardware forwarding table entries included in the hardware forwarding table of FIG7 b are the same, and each forwarding table entry includes a next hop 1 of the shortest path.
[0222] Furthermore, the last 64 hardware forwarding table entries included in the hardware forwarding table are identical, and each forwarding table entry includes the next hop 2 of another shortest path.
[0223] Based on the same concept, an embodiment of the present application provides a routing information maintenance device, which is applied to a first network device. The first network device includes a multipath group forwarding table. The first multipath group corresponding to the multipath group forwarding table includes a shortest path and a non-shortest path, each path being used to indicate a path between the first network device and a second network device. The forwarding table entry for the shortest path includes a first outbound interface of the first network device. As shown in FIG10 , the device includes:
[0224] An acquisition module 1001 is configured to acquire a preset routing policy corresponding to a multipath group forwarding table when the traffic carried by the shortest path causes congestion on the first outbound interface;
[0225] 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 policy. The forwarding weight value of each path is used to represent the proportion of traffic carried by the path when the path is selected from the first multi-path group for message forwarding.
[0226] Optionally, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the device further includes a generation module:
[0227] Generate modules for:
[0228] calculating the shortest path and non-shortest path to the second network device;
[0229] Generate a software forwarding table entry for each shortest path and each non-shortest path to obtain a software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and an initial forwarding weight value of the non-shortest path is 0;
[0230] For each software forwarding table entry with a non-zero forwarding weight, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain a hardware forwarding table;
[0231] Wherein, N=the forwarding weight value of the software forwarding table entry*the preset number of entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0232] Optionally, the multipath group forwarding table includes a route type tag; the obtaining module 1001 is specifically configured to:
[0233] Obtain a preset routing policy corresponding to the routing type tag; the preset routing policy includes at least one of the following policies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, and reducing the forwarding load of the congested outbound interface and increasing the forwarding load of the non-shortest path.
[0234] 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 including the interface status of each outbound interface of the first network device, and the second interface status table including the bandwidth occupancy of the outbound interface by the traffic carried by each path in the first multipath group; the apparatus further includes a determination module:
[0235] The acquisition module 1001 is further configured to acquire, from the second interface state table, a first bandwidth occupancy of the traffic carried by the shortest path on the first outbound interface if the interface state of the first interface in the first interface state table changes to a congested state;
[0236] The determining module is configured to determine that the traffic carried by the shortest path causes congestion in the first outbound interface if the first bandwidth occupancy satisfies a preset congestion condition.
[0237] Optionally, the first interface status table further includes bandwidth occupancy and buffer occupancy of each outbound interface; the device further includes an updating module and a setting module:
[0238] An updating module, configured to update the bandwidth occupancy and buffer occupancy of each outbound interface in the first interface status table at predetermined intervals;
[0239] The setting module is configured to set the interface state of the outbound interface to a congested state if the updated bandwidth occupancy of the outbound interface reaches a preset bandwidth threshold, or the updated buffer occupancy of the outbound interface reaches a preset buffer threshold.
[0240] Optionally, the adjustment module 1002 is specifically configured to:
[0241] Based on the preset routing policy and the bandwidth usage of each outbound interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0242] Optionally, multiple paths between the first network device and the third network device form a second multipath group. When the first multipath group is the same as the second multipath group, the first multipath group and the second multipath group share a multipath group forwarding table.
[0243] Based on the same concept, an embodiment of the present application further provides a first network device, the first network device including a multipath group forwarding table, wherein a first multipath group corresponding to the multipath group forwarding table includes a shortest path and a non-shortest path, each path being used to indicate a path between the first network device and a second network device; the forwarding table entry for the shortest path includes a first outbound interface of the first network device; as shown in FIG11 , the first network device includes:
[0244] Processor 1101;
[0245] transceiver 1104;
[0246] A machine-readable storage medium 1102 stores machine-executable instructions that can be executed by the processor 1101; the machine-executable instructions prompt the processor 1101 to perform the following steps:
[0247] When the traffic carried by the shortest path causes congestion on the first outbound interface, obtaining a preset routing policy corresponding to the multipath group forwarding table;
[0248] Based on a preset routing policy, a forwarding weight value of each path in the first multipath 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 from the first multipath group for message forwarding.
[0249] Optionally, the multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the machine executable instructions further cause the processor 1101 to execute the following steps:
[0250] calculating the shortest path and non-shortest path to the second network device;
[0251] Generate a software forwarding table entry for each shortest path and each non-shortest path to obtain a software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and an initial forwarding weight value of the non-shortest path is 0;
[0252] For each software forwarding table entry with a non-zero forwarding weight, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain a hardware forwarding table;
[0253] Wherein, N=the forwarding weight value of the software forwarding table entry*the preset number of entries in the hardware forwarding table / the sum of the forwarding weight values included in the software forwarding table entry.
[0254] Optionally, the multipath group forwarding table includes a route type tag; the machine executable instructions further cause the processor 1101 to perform the following steps:
[0255] Obtain a preset routing policy corresponding to the routing type tag; the preset routing policy includes at least one of the following policies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, and reducing the forwarding load of the congested outbound interface and increasing the forwarding load of the non-shortest path.
[0256] 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 including the interface status of each outbound interface of the first network device, and the second interface status table including the bandwidth occupancy of the outbound interface by the traffic carried by each path in the first multipath group;
[0257] The machine-executable instructions further cause the processor 1101 to perform the following steps:
[0258] If the interface state of the first interface in the first interface state table changes to a congested state, obtaining a first bandwidth occupancy of the traffic carried by the shortest path on the first outbound interface from the second interface state table;
[0259] If the first bandwidth occupancy satisfies a preset congestion condition, it is determined that the traffic carried by the shortest path causes congestion in the first outbound interface.
[0260] Optionally, the first interface status table further includes bandwidth usage and buffer usage of each outbound interface; the machine executable instructions further cause the processor 1101 to execute the following steps:
[0261] At predetermined intervals, for each outbound interface in the first interface state table, updating the bandwidth usage and buffer usage of the outbound interface;
[0262] If the updated bandwidth usage of the outbound interface reaches a preset bandwidth threshold, or the updated buffer usage of the outbound interface reaches a preset buffer threshold, the interface state of the outbound interface is set to a congested state.
[0263] Optionally, the machine executable instructions further cause the processor 1101 to perform the following steps:
[0264] Based on the preset routing policy and the bandwidth usage of each outbound interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
[0265] Optionally, multiple paths between the first network device and the third network device form a second multipath group. When the first multipath group is the same as the second multipath group, the first multipath group and the second multipath group share a multipath group forwarding table.
[0266] In Figure 11 , a communication bus 1103 may also be included. The processor 1101, the machine-readable storage medium 1102, and the transceiver 1104 communicate with each other via the communication bus 1103. The communication bus 1103 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, and the like.
[0267] The transceiver 1104 may be a wireless communication module, and under the control of the processor 1101 , the transceiver 1104 exchanges data with other devices.
[0268] 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 be at least one storage device located remotely from the processor.
[0269] 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 device, discrete gate or transistor logic device, discrete hardware component.
[0270] Based on the same inventive concept, according to the routing information maintenance method provided in the above embodiment of the present application, the embodiment of the present application further provides a machine-readable storage medium, wherein the machine-readable storage medium stores 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 routing information maintenance method.
[0271] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of the routing information maintenance method in the above embodiment.
[0272] 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.
[0273] 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 in the scope of protection of the present invention.
Claims
1. A method for maintaining routing information, characterized in that: Applied to a first network device, the first network device includes a multipath group forwarding table, a first multipath group corresponding to the multipath group forwarding table includes a shortest path and a non-shortest path, each path is used to indicate a path between the first network device and the second network device; The forwarding table entry of the shortest path includes the first outbound interface of the first network device; the method includes: When the traffic carried by the shortest path causes congestion on the first outbound interface, obtaining a preset routing policy corresponding to the multipath group forwarding table; Based on the preset routing strategy, the forwarding weight value of each path in the first multi-path group is adjusted, and the forwarding weight value of each path is used to indicate the proportion of traffic carried by the path when the path is selected from the first multi-path group for message forwarding.
2. The method according to claim 1, characterized in that: 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 second network device and the second network device; Generating a software forwarding table entry for each shortest path and each non-shortest path respectively, to obtain the software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and an initial forwarding weight value of the non-shortest path is 0; For each software forwarding table entry whose forwarding weight value is not 0, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table; 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 the forwarding weight values included in the software forwarding table entry.
3. The method according to claim 2, characterized in that The multipath group forwarding table includes a routing type tag; the obtaining of a preset routing strategy corresponding to the multipath group forwarding table includes: Obtaining a preset routing strategy corresponding to the routing type tag; The preset routing strategy includes at least one of the following strategies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, reducing the forwarding load of the congested outbound interface and increasing the forwarding load of the non-shortest path.
4. 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, wherein the first interface status table includes the interface status of each outbound interface of the first network device, and the second interface status table includes the bandwidth occupancy of the outbound interface by the traffic carried by each path in the first multipath group; When the traffic carried by the shortest path causes congestion of the first outbound interface, before obtaining the preset routing policy corresponding to the multipath group forwarding table, the method further includes: If the interface state of the first interface in the first interface state table changes to a congested state, obtaining a first bandwidth occupancy of the first outbound interface by the traffic carried by the shortest path from the second interface state table; If the first bandwidth occupancy satisfies a preset congestion condition, it is determined that the traffic carried by the shortest path causes congestion in the first outbound interface.
5. The method according to claim 4, characterized in that The first interface status table also includes the bandwidth occupancy and buffer occupancy of each outbound interface; the method also includes: At preset time intervals, for each outbound interface in the first interface status table, updating the bandwidth occupancy and buffer occupancy of the outbound interface; If the updated bandwidth usage of the outbound interface reaches the preset bandwidth threshold, or the updated buffer usage of the outbound interface reaches the preset buffer If the congestion threshold is exceeded, the interface status of the outbound interface is set to congested status.
6. The method according to claim 4, characterized in that The adjusting, based on the preset routing strategy, the forwarding weight value of each path in the first multipath group includes: Based on the preset routing policy and the bandwidth occupancy of each outbound interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
7. The method according to claim 1, characterized in that The multiple paths between the first network device and the third network device constitute a second multipath group. When the first multipath group is the same as the second multipath group, the first multipath group and the second multipath group share the multipath group forwarding table.
8. A routing information maintenance device, characterized in that: Applied to a first network device, the first network device includes a multipath group forwarding table, a first multipath group corresponding to the multipath group forwarding table includes a shortest path and a non-shortest path, each path is used to indicate a path between the first network device and the second network device; The forwarding table entry of the shortest path includes the first outbound interface of the first network device; the device includes: An acquisition module, used for acquiring a preset routing policy corresponding to the multipath group forwarding table when the traffic carried by the shortest path causes congestion of the first output interface; An 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 indicate the proportion of traffic carried by the path when the path is selected from the first multi-path group for message forwarding.
9. The device according to claim 8, characterized in that The multipath group forwarding table includes a software forwarding table and a hardware forwarding table; the device also includes a generation module: The generating module is used for: Calculate the shortest path and non-shortest path between the second network device and the second network device; Generating a software forwarding table entry for each shortest path and each non-shortest path respectively, to obtain the software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and an initial forwarding weight value of the non-shortest path is 0; For each software forwarding table entry whose forwarding weight value is not 0, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table; 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 the forwarding weight values included in the software forwarding table entry.
10. The device according to claim 9, characterized in that The multipath group forwarding table includes a routing type tag; the acquisition module is specifically used to: Obtaining a preset routing strategy corresponding to the routing type tag; The preset routing strategy includes at least one of the following strategies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, reducing the forwarding load of the congested outbound interface and increasing the forwarding load of the non-shortest path.
11. The device according to claim 8, 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, wherein the first interface status table includes the interface status of each outbound interface of the first network device, and the second interface status table includes the bandwidth occupied by the traffic carried by each path in the first multipath group on the outbound interface; the device also includes a determination module: The acquisition module is further configured to acquire, from the second interface status table, a first bandwidth occupancy of the traffic carried by the shortest path on the first outbound interface if the interface status of the first interface in the first interface status table changes to a congested state; The determining module is configured to determine that the traffic carried by the shortest path causes congestion in the first outbound interface if the first bandwidth occupancy satisfies a preset congestion condition.
12. The device according to claim 11, characterized in that The first interface status table also includes the bandwidth occupancy and buffer occupancy of each outbound interface; the device also includes an updating module and a setting module: The updating module is used to update the bandwidth occupancy and buffer occupancy of each outbound interface in the first interface status table at a preset time interval; The setting module is used to set the interface state of the outbound interface to a congested state if the updated bandwidth occupancy of the outbound interface reaches a preset bandwidth threshold, or the updated buffer occupancy of the outbound interface reaches a preset buffer threshold.
13. The device according to claim 11, characterized in that The adjustment module is specifically used for: Based on the preset routing policy and the bandwidth occupancy of each outbound interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
14. The device according to claim 8, characterized in that The multiple paths between the first network device and the third network device constitute a second multipath group. When the first multipath group is the same as the second multipath group, the first multipath group and the second multipath group share the multipath group forwarding table.
15. A first network device, characterized in that: The first network device includes a multipath group forwarding table, the first multipath group corresponding to the multipath group forwarding table includes a shortest path and a non-shortest path, each path is used to indicate a path between the first network device and the second network device; the forwarding table entry of the shortest path includes a first outbound 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 prompt the processor to perform the following steps: When the traffic carried by the shortest path causes congestion on the first outbound interface, obtaining a preset routing policy corresponding to the multipath group forwarding table; Based on the preset routing strategy, the forwarding weight value of each path in the first multi-path group is adjusted, and the forwarding weight value of each path is used to indicate the proportion of traffic carried by the path when the path is selected from the first multi-path group for message forwarding.
16. The first network device according to claim 15, characterized in that: 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 second network device and the second network device; Generating a software forwarding table entry for each shortest path and each non-shortest path respectively, to obtain the software forwarding table, wherein each software forwarding table entry includes a forwarding weight value of a path, and an initial forwarding weight value of the non-shortest path is 0; For each software forwarding table entry whose forwarding weight value is not 0, copy N copies of the information in the software forwarding table entry except the forwarding weight value to obtain N hardware forwarding table entries, and send the N hardware forwarding table entries to the hardware resources to obtain the hardware forwarding table; 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 the forwarding weight values included in the software forwarding table entry.
17. The first network device according to claim 16, characterized in that: The multipath group forwarding table includes a route type tag; the machine executable instructions further cause the processor to perform the following steps: Obtain a preset routing strategy corresponding to the routing type tag; the preset routing strategy includes at least one of the following strategies: adjusting the forwarding load of the congested outbound interface to 0, reducing the forwarding load of the congested outbound interface without increasing the forwarding load of the non-shortest path, reducing congestion The forwarding load of the outbound interface is increased and the forwarding load of the non-shortest path is increased.
18. The first network device according to claim 15, 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, wherein the first interface status table includes the interface status of each outbound interface of the first network device, and the second interface status table includes the bandwidth occupancy of the outbound interface by the traffic carried by each path in the first multipath group; The machine executable instructions further cause the processor to perform the following steps: If the interface state of the first interface in the first interface state table changes to a congested state, obtaining a first bandwidth occupancy of the first outbound interface by the traffic carried by the shortest path from the second interface state table; If the first bandwidth occupancy satisfies a preset congestion condition, it is determined that the traffic carried by the shortest path causes congestion in the first outbound interface.
19. The first network device according to claim 18, characterized in that: The first interface status table also includes bandwidth occupancy and buffer occupancy of each outbound interface; the machine executable instructions further cause the processor to perform the following steps: At preset time intervals, for each outbound interface in the first interface status table, updating the bandwidth occupancy and buffer occupancy of the outbound interface; If the updated bandwidth occupancy of the outbound interface reaches a preset bandwidth threshold, or the updated buffer occupancy of the outbound interface reaches a preset buffer threshold, the interface state of the outbound interface is set to a congested state.
20. The first network device according to claim 18, characterized in that: The machine executable instructions further cause the processor to perform the following steps: Based on the preset routing policy and the bandwidth occupancy of each outbound interface included in the second interface status table, the forwarding weight value of each path in the first multipath group is adjusted.
21. The first network device according to claim 15, characterized in that: The multiple paths between the first network device and the third network device constitute a second multipath group. When the first multipath group is the same as the second multipath group, the first multipath group and the second multipath group share the multipath group forwarding table.
22. A machine-readable storage medium, characterized in that: Machine executable instructions are stored, and when called and executed by a processor, the machine executable instructions prompt the processor to implement any method described in claims 1-7.
23. A computer program product, characterized in that The computer program product causes the processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for preventing stack system from generating loop and member equipment in stack system
CN101594304A
Network congestion management by packet circulation
CN104205754A
Method and device for determining message forwarding paths in multi-protocol label switching network
CN104283782A
Coding-aware wireless mesh network multi-path routing method for avoiding congestion
CN107846706A
Message forwarding method and device
CN116074236A