A routing iteration method and device
By establishing a dependency chain between routes and using the iteration results of the dependent party for routing iteration, the problem of duplication of iterative routing paths is solved, and the efficiency of routing iteration and system performance are improved.
Patent Information
- Application Number
- CN202310407124.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2043-04-11
AI Technical Summary
In the prior art, the iterative paths of different iterative routes may partially overlap or be exactly the same, resulting in many repeated iterative processes and reducing the efficiency of routing iteration.
By establishing dependency chains between routes and using the iteration results of the dependent party for routing iteration, the relying party avoids the need to iteratively search for paths, thus reducing repetitive and ineffective iteration processes.
It improves the efficiency of route iterative updates, reduces the time required for route convergence, and reduces the consumption of system resources.
Smart Images

Figure CN116389346B_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of network communication technology, and in particular to a routing iteration method and device. [Background technology]
[0002] Network equipment usually consists of a main control board and line cards. The routing table entries on the main control board are mainly composed of the destination prefix and the next hop, which are stored in the RIB (Routing Information Base) module. Depending on whether the next hop is a directly connected neighbor, the next hop can be divided into a direct next hop (DNH) and an indirect next hop (INH). The routing table entry with the next hop of DNH is in an activated state and can be directly sent from the main control board to the forwarding table (FIB) in the line card. Base) is used to guide the forwarding of IP packets. The initial state of the routing table entry with the next hop of INH (called iterative routing) is inactive. It needs to obtain the DNH to the destination prefix through routing iteration before it can enter the active state (which can be sent to the line card). The specific process of routing iteration is to find the route to the next hop of the route to be iterated. If the next hop of the found route is still INH, continue to find the route to the INH, and repeat this process until the next hop of the route is DNH. The number of times the route to the next hop is found during the routing iteration is called the routing iteration depth. All the found routes are arranged in order to obtain the iterative path of the route.
[0003] Routing iteration is the main computing task of routing table management. The quality of routing iteration method directly affects the performance of network equipment and the quality of network services. Inefficient routing iteration method will consume too many system resources on the one hand, and reduce the routing convergence speed on the other hand, resulting in the inability of business traffic to switch to the optimal transmission path in time, which deteriorates the service quality of the business.
[0004] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. [Summary of the invention]
[0005] The technical problem to be solved by the present invention is that the iteration paths of different iterative routes are likely to be partially overlapped or completely the same, while in the prior art, different partially overlapping routes need to be iterated separately, which will lead to many repeated iteration processes and low efficiency of route iteration.
[0006] The present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides a routing iteration method, comprising:
[0008] Establish dependencies between routes based on the next hop of each route in the routing table;
[0009] When a route change occurs, updating the dependency relationship between the routes;
[0010] According to the dependency relationship between routes, the routes are iteratively updated; wherein, according to the routing path of the dependent party in a dependency relationship, the routing path of the relying party is generated, thereby realizing the iterative update of the routing of the relying party.
[0011] Preferably, establishing a dependency relationship between routes according to the next hop of each route in the routing table specifically includes:
[0012] If the next hop of the first route is an indirect next hop INH, then find the resolution route of the INH and establish a dependency relationship in which the first route depends on the resolution route; wherein the resolution route of the INH is the activated route that has the longest match with the destination prefix of the INH.
[0013] Preferably, performing iterative updating of routes according to dependencies between routes specifically includes:
[0014] A dependency chain is established according to a first dependency relationship with the transit route as a dependent party and a second dependency relationship with the transit route as a dependent party; wherein, in the dependency chain, the second dependent party depends on the transit route, and the transit route depends on the first dependent party, the first dependent party is the dependent party in the first dependency relationship; and the second dependent party is the dependent party in the second dependency relationship;
[0015] According to the dependency chain, the routing is iteratively updated; wherein, after the lower routing in the dependency chain is iteratively updated, the iterative update of the upper routing in the dependency chain is triggered.
[0016] Preferably, when a first activated route is added to the routing table, updating the dependency relationship between the routes specifically includes:
[0017] Searching for a second route whose next hop is a first INH in all routes whose next hop is an indirect next hop INH; wherein the first INH is an INH that matches the destination prefix of the first activated route;
[0018] If the first INH does not have a resolution route, use the first activation route as the resolution route of the first INH, and establish a dependency relationship in which the second route depends on the resolution route of the first INH;
[0019] If the first INH has a resolution route, and the destination prefix of the first activated route is longer than the destination prefix of the resolution route, updating the resolution route of the first INH according to the first activated route, and updating the dependency relationship with the second route as the relying party;
[0020] Otherwise, no updates are performed on the dependencies between routes.
[0021] Preferably, updating the resolution route of the first INH according to the first activation route specifically includes:
[0022] Under the assumption that the first activation route is the resolution route of the first INH, iterate and obtain the iteration path of the first INH in sequence; wherein the iteration path of the first INH is specifically: starting from the first INH, iterate and obtain a set of sequentially arranged INHs;
[0023] If, in the process of obtaining the iterative path of the first INH, the INH obtained in the latest iteration already exists in the iterative path obtained in the previous iteration, the resolution route of the first INH is not updated;
[0024] Otherwise, the first activated route is used as a new resolution route, and the new resolution route is used to replace the original resolution route of the first INH.
[0025] Preferably, when a first activated route is newly added to the routing table, the iterative updating of the routes according to the dependency relationship between the routes further includes:
[0026] Find all routes that are directly or indirectly dependent on the second route, and form a corresponding dependency chain;
[0027] The second route is updated according to the first activated route, and the iterative update of the second route triggers the iterative update of each route in the dependency chain in sequence.
[0028] Preferably, when deleting the second activated route in the routing table, updating the dependency relationship between the routes further includes:
[0029] Searching for a third route whose next hop is a second INH among all routes whose next hop is an indirect next hop INH; wherein the second INH is an INH whose second activated route is a resolved route;
[0030] After deleting the second activated route, check whether there is a third activated route matching the second INH destination prefix in the routing table; if so, update the resolution route of the second INH according to the third activated route that has the longest match with the second INH destination prefix, and update the dependency relationship with the third route as the relying party;
[0031] If there is no third activated route matching the second INH destination prefix, the resolved route of the second INH is deleted, and the third route and all routes directly or indirectly dependent on the third route are put into an inactivated state.
[0032] Preferably, the dependency relationship is expressed as a routing storage structure and an INH storage structure;
[0033] The route storage structure stores routes and INH resolution linked lists, and the INH resolution linked list is mounted with the INH that uses the route as the resolution route;
[0034] The INH is located in a corresponding INH storage structure, and the INH storage structure further stores a reference routing chain list, and the reference routing chain list is used to mount a fourth route whose next hop is the INH, thereby forming a dependency relationship in which the fourth route depends on the resolved route of the INH.
[0035] Preferably, the routing table is stored in the form of an AVL tree structure, and uses the network prefix and the network prefix length as indexes.
[0036] In a second aspect, the present invention further provides a routing iteration device, for implementing the routing iteration method described in the first aspect, the device comprising:
[0037] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the routing iteration method described in the first aspect.
[0038] In a third aspect, the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the routing iteration method described in the first aspect.
[0039] The present invention forms a dependency chain between routes and performs route iteration using the iteration result of the dependent party, so that the dependent party does not need to iterate to find the path, thereby avoiding repeated and invalid iteration processes, improving the efficiency of route iteration updates, and reducing the time required for route convergence. In the preferred embodiment of the present invention, a storage structure of a dependency chain for supporting the route iteration process of the present invention is also provided, and the dependency is stored through INH, which simplifies the maintenance and update process of the dependency chain and ensures that the route iteration update process is more comprehensive and complete.
Brief Description of the Drawings
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 It is a flowchart of a routing iteration method provided by an embodiment of the present invention;
[0042] Figure 2 It is a flowchart of a routing iteration method provided by an embodiment of the present invention;
[0043] Figure 3 It is a flowchart of a routing iteration method provided by an embodiment of the present invention;
[0044] Figure 4 It is a flowchart of a routing iteration method provided by an embodiment of the present invention;
[0045] Figure 5 It is a schematic diagram of an application scenario of a routing iteration method provided by an embodiment of the present invention;
[0046] Figure 6 It is a routing representation scheme in an application scenario of a routing iteration method provided by an embodiment of the present invention;
[0047] Figure 7 is a schematic diagram of a dependency chain of a routing iteration method provided by an embodiment of the present invention;
[0048] Figure 8 It is a flowchart of a routing iteration method provided by an embodiment of the present invention;
[0049] Fig. 9 It is a schematic diagram of a storage structure of a dependency chain of a routing iteration method provided by an embodiment of the present invention;
[0050] Fig.10 It is a schematic diagram of the architecture of a routing iteration device provided by an embodiment of the present invention. [Specific implementation method]
[0051] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0052] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0053] Embodiment 1:
[0054] Embodiment 1 of the present invention provides a routing iteration method, such as Figure 1 As shown, specifically including:
[0055] In step 201, a dependency relationship between routes is established according to the next hop of each route in the routing table.
[0056] Among them, from the perspective of a single route, there may be routes that depend on the node, and the node may also depend on other routes, that is, in one dependency relationship, the route may be the relying party, and in another dependency relationship, the route may be the dependent party. The relying party and the dependent party are relative to a relationship, or the routes in a relationship, rather than being absolutely fixed.
[0057] In step 202, when a route change occurs, the dependency relationship between the routes is updated.
[0058] The routing changes include: adding a route, deleting a route, changing a route path, changing a route status, etc.
[0059] In step 203, the routes are iteratively updated according to the dependency relationship between routes; wherein, the routing path of the relying party is generated according to the routing path of the relied party in a dependency relationship, thereby implementing the iterative update of the routing of the relying party.
[0060] As an optional implementation, the dependency between the routes is expressed through the next hop of the routes. For example, if route A depends on its next hop a, and its next hop a depends on route B, then the dependency can be expressed through route A depending on next hop a, and next hop a depending on route B.
[0061] The iterative update of the routing also includes: using the routing status of the relied party to update the routing status of the relying party, and using the routing path of the relied party to update the routing path of the relying party.
[0062] This embodiment establishes a dependency relationship between routes, and generates the routing path of the relying party from the routing path of the dependent party in the dependency relationship, thereby eliminating the need to re-iterate the routing of the relying party. When there are parts that are identical in the iterative paths of multiple routes, the identical parts only need to be iterated once, thereby avoiding repeated iteration processes, improving the efficiency of routing iteration updates, and reducing the time required for routing convergence.
[0063] This embodiment also provides a specific implementation method for establishing a dependency relationship between routes according to the next hop of each route in the routing table, which specifically includes:
[0064] If the next hop of the first route is an indirect next hop INH, then find the resolution route of the INH and establish a dependency relationship in which the first route depends on the resolution route; wherein the resolution route of the INH is the activated route that has the longest match with the destination prefix of the INH.
[0065] If the next hop of the first route is a direct next hop DNH, the first route can directly reach the destination address through its next hop without relying on other routes.
[0066] The destination prefix matching is a commonly used route query mechanism in the prior art, and the route with the longest destination prefix is the most accurate.
[0067] Since the dependency relationship of routes is complicated, in order to make it easier to perform iterative update of routes, there is also the following preferred embodiment, that is, performing iterative update of routes according to the dependency relationship between routes, such as Figure 2 As shown, specifically including:
[0068] In step 301, a dependency chain is established based on a first dependency relationship with the transit route as the dependent party and a second dependency relationship with the transit route as the dependent party; wherein, in the dependency chain, the second dependent party depends on the transit route, and the transit route depends on the first dependent party, the first dependent party is the dependent party in the first dependency relationship, and the second dependent party is the dependent party in the second dependency relationship.
[0069] In step 302, iterative updates of routes are performed according to the dependency chain; wherein, after iterative updates of lower-layer routes in the dependency chain are performed, iterative updates of upper-layer routes in the dependency chain are triggered.
[0070] Among them, since a single route is used as the perspective, there may be other routes that depend on this route, and this route may also depend on other routes, that is, this route is both the dependent party in one dependency relationship and the dependent party in another dependency relationship. Therefore, this route can be used as a transit route to form a corresponding dependency chain.
[0071] The first dependency relationship and the second dependency relationship do not refer to a specific dependency relationship, but refer to the fact that the dependent party of one relationship and the dependent party of another relationship are the same route (i.e., the transit route mentioned above), then the relationship with the route as the dependent party is called the first dependency relationship, and the relationship with the route as the dependent party is called the second dependency relationship. For example, there is a dependency relationship relation-1 in which the dependent party is rout1 and the dependent party is rout2, and another dependency relationship relation-2 in which the dependent party is rout2 and the dependent party is rout3, then relation-2 is called the first dependency relationship, and relation-1 is called the second dependency relationship, thus forming a dependency chain in which rout1 depends on rout2, and rout2 depends on rout3. For the convenience of expression, the dependency relationship is expressed in the form of an arrow pointing (i.e., the symbol "->"), and the dependency chain is expressed as rout1->rout2->rout3.
[0072] In actual use, not only two dependency relationships can generate a dependency chain, but multiple dependency relationships can also generate a dependency chain. For example, based on the existence of relation-1 and relation-2, there is also a dependency relationship relation-3. The dependent party of relation-3 is rout3, and the dependent party is rout4. At this time, the dependency chain formed is rout1->rout2->rout3->rout4. When forming the rout1->rout2->rout3 part, relation-1 is the second dependency and relation-2 is the first dependency. When forming the rout2->rout3->rout4 part, relation-2 is the second dependency and relation-3 is the first dependency.
[0073] The upper-layer route and the lower-layer route do not refer to a specific route, but are relative descriptions in the dependency chain. The one located in the dependency chain in the direction of the dependent party is called the upper layer in the dependency chain, and the one located in the direction of the dependent party in the dependency chain is called the lower layer in the dependency chain. For example, if there is a dependency chain of rout1->rout2->rout3->rout4, then relative to both rout3 and rout4, rout3 is the upper-layer route, and rout4 is the lower-layer route. Relative to both rout2 and rout3, rout2 is the upper-layer route, and rout3 is the lower-layer route. After rout4 is iteratively updated, the iterative update of rout3 is triggered, and then the iterative update of rout2 is triggered. In subsequent embodiments, rout1 is also called the top-level route, and rout4 is also called the bottom-level route.
[0074] This embodiment also provides a more specific implementation method of generating a dependency chain, which specifically includes:
[0075] Add nodes to the dependency chain in sequence. Specifically, find the dependency with the target route as the dependent party, add the dependent party in the dependency to the top level of the dependency chain, until the route that depends on the target route cannot be found, and the dependency chain is established; wherein, the route at the top level of the dependency chain after the last node addition is used as the target route when the next node is added; when adding the first node to the dependency chain, the route with the next hop as the direct next hop DNH is used as the first node of the dependency chain.
[0076] The dependency chain is not limited to a linked list storage or management structure, but is used to characterize the dependency between routes. There may be one or more dependency chains, and there may be intersections of routes in multiple dependency chains.
[0077] The bottom layer and top layer of the dependency chain are just a way of expression, that is, if two adjacent nodes are taken from the dependency chain from bottom to top, the route of the node close to the bottom layer is the dependent party, and the route of the node close to the top layer is the dependent party. It does not limit the structure of the dependency chain.
[0078] This embodiment forms a dependency chain between routes and performs route iteration by using the iteration result of the dependent party. When a route outside the dependency chain changes, the iterative update of the route is not triggered, thereby avoiding an invalid iteration process. The routing path of the relying party is generated by the routing path of the dependent party in the dependency relationship, so there is no need to re-iterate the routing of the relying party. When there are parts in the iteration paths of multiple routes that are the same, the same parts only need to be iterated once, thereby avoiding repeated iteration processes, improving the efficiency of routing iteration updates, and reducing the time required for routing convergence.
[0079] In actual situations, when there are many routes in a dependency chain and the resulting dependency chain is long, how to orderly implement the iterative update of each route in the dependency chain? In response to this problem, in combination with the above embodiments, there is the following preferred embodiment, namely, the iterative update of routes according to the dependency chain, specifically: from the bottom layer of the dependency chain to the top layer of the dependency chain, route iteration is performed for the route of each node in turn, wherein, between two adjacent nodes, the route close to the top layer is iteratively updated according to the route close to the bottom layer. In a preferred embodiment, the iterative update of the route of the relying party can be directly performed according to the resolved route corresponding to the next hop of the relying party.
[0080] In the case where the route changes, there is also a preferred implementation method of this embodiment, which specifically includes: starting from the changed route, establishing a new dependency relationship according to the next hop of the changed route, and iterating to obtain the routing path of the changed route.
[0081] According to the routing path of the changed routing, iterative routing updates are performed on all relying parties that use the changed routing as direct or indirect relying parties.
[0082] For example, when there is a dependency chain of rout1->rout2->rout3->rout4, when the next hop of rout3 changes, a new dependency is established based on the next hop of rout3. For example, if the original rout3 dependency on rout4 is changed to rout3 dependency on rout5, the routing of rout3 is iteratively updated again, and then the routing paths of rout2 and rout1 are updated in turn based on the routing path of rout3, thereby completing the iterative update of the three routes of rout1, rout2 and rout3 caused by the routing change of rout3.
[0083] This embodiment updates the routes from the direction of the dependent party to the direction of the relying party in an iterative form, so that the iterative update of each route in the dependency chain is carried out in an orderly manner, and the iteration of the routes in the dependency chain is not triggered when irrelevant routes outside the corresponding dependency chain change, thereby avoiding repeated iterations and invalid iterations and improving the efficiency of route iterations.
[0084] In actual usage, there are usually multiple dependency chains in the network according to the different destination addresses of each route. In this scenario, when there is a scenario where a new route is added, in order to ensure that the iterative update of the route is carried out normally, one of the most commonly used implementation methods is: re-generate the dependency relationship according to the next hop of the route, so as to iteratively update the route. However, this implementation method usually involves traversing each route in the network, which consumes a lot of resources and time. In view of this problem, in combination with the above embodiments, there is the following preferred embodiment, that is, when the first activated route is added to the routing table, the dependency relationship between the routes is updated, such as Figure 3 As shown, specifically including:
[0085] In step 401, a second route whose next hop is a first INH is searched among all routes whose next hop is an indirect next hop INH; wherein the first INH is an INH matching the destination prefix of the first activated route.
[0086] In step 402, if the first INH does not have a resolution route, the first activation route is used as the resolution route of the first INH, and a dependency relationship is established in which the second route depends on the resolution route.
[0087] In step 403, if the first INH has a resolution route and the destination prefix of the first activated route is longer than the destination prefix of the resolution route, the resolution route of the first INH is updated according to the first activated route, and the dependency relationship with the second route as the dependent party is updated.
[0088] In step 404, otherwise, the inter-route dependency relationship is not updated.
[0089] When the destination prefix length of the resolved route is longer than the destination prefix length of the first activated route, the dependency relationship between routes is not updated.
[0090] This embodiment determines whether the first activated route affects the existing dependency by matching the destination prefix of the first activated route, thereby updating the dependency and iterating the routes only for the relevant routes, thereby reducing the time and resources required for regenerating the dependency.
[0091] Among them, a most direct implementation method of updating the resolution route of the first INH according to the first activated route is to directly use the first activated route as a new resolution route to replace the original resolution route of the first INH. In this way, a routing loop may occur when performing route iteration update due to changes in the dependency relationship between routes. In view of this problem, in combination with the above embodiments, a preferred embodiment is provided, that is, updating the resolution route of the first INH according to the first activated route, such as Figure 4 As shown, specifically including:
[0092] In step 501, assuming that the first activation route is the resolution route of the first INH, the iteration path of the first INH is iterated in sequence; wherein the iteration path of the first INH is specifically: starting from the first INH, a set of sequentially arranged INHs obtained by iteration.
[0093] In step 502, if, in the process of acquiring the iterative path of the first INH, the INH obtained in the latest iteration already exists in the iterative path obtained in the previous iteration, the resolution route of the first INH is not updated.
[0094] In step 503, otherwise, the first activated route is used as a new resolution route, and the new resolution route is used to replace the original resolution route of the first INH.
[0095] The iteration path does not refer to a set of specific INH sequences, but changes continuously during the iteration process.
[0096] The iterative process is as follows: in the first iteration, the iterative path includes the first INH, the next hop INH of the first activated route is found, which is the INH obtained in the first iteration, and the INH obtained in the first iteration is added to the iterative path.
[0097] The INH obtained in the previous iteration is used as the transit INH, and the resolution route of the transit INH is searched. The next hop INH of the resolution route is the INH obtained in this iteration, and the INH obtained in this iteration is added to the iteration path.
[0098] The last and this are relative. For example, if there are three adjacent iterations, including the first iteration, the second iteration and the third iteration, when the second iteration is the current iteration, the last iteration is the first iteration, and when the third iteration is the current iteration, the last iteration is the second iteration. The latest iteration is the most recent iteration. If only the above three iterations are performed, the latest iteration is the third iteration, and the corresponding last iteration is the second iteration.
[0099] For example, if the next hop INH of the first activated route is INH1, the resolved route of INH1 is rout1, and the next hop INH of rout1 is INH2. The iteration process is to iterate toward the bottom layer of the dependency relationship in sequence, wherein, in the first iteration, the iteration path includes the first INH, when the iteration obtains INH1, when the iteration obtains INH2, the iteration path obtained last time includes the first INH and INH1, and if the first INH is INH2, then when the iteration obtains INH2, INH2 already exists in the obtained iteration path, and it is considered that if the first activated route is used as the resolved route of the first INH, a routing loop will occur, so the resolved route of the first INH is not updated.
[0100] When DNH is obtained in the iteration, it means that the complete iteration path of the first INH is obtained. If the INH obtained in each iteration does not exist in the obtained iteration path, that is, there is no repeated INH in the iteration path, then step 503 is entered, and the first activation route is used as the resolution route of the first INH.
[0101] When the first activated route is added and causes the update of the route dependency, the route needs to be iteratively updated again. A common implementation method is to form a new dependency chain and iteratively update from the bottom layer of the dependency chain to the top layer of the dependency chain.
[0102] Here, a preferred implementation is also provided, that is, when a first activated route is added to the routing table, the iterative update of the routes according to the dependency relationship between the routes also includes:
[0103] Find all routes that are directly or indirectly dependent on the second route, and form a corresponding dependency chain;
[0104] The second route is updated according to the first activated route, and the iterative update of the second route triggers the iterative update of each route in the dependency chain in sequence.
[0105] When the second activated route is deleted from the routing table, the updating of the dependency relationship between the routes further includes:
[0106] Among all routes whose next hop is an indirect next hop INH, a third route whose next hop is a second INH is searched; wherein the second INH is an INH with the second activated route as a resolved route.
[0107] After deleting the second activated route, check whether there is a third activated route matching the second INH destination prefix in the routing table; if so, update the resolution route of the second INH according to the third activated route that has the longest match with the second INH destination prefix, and update the dependency relationship with the third route as the dependent party.
[0108] If there is no third activated route matching the second INH destination prefix, the resolved route of the second INH is deleted, and the third route and all routes directly or indirectly dependent on the third route are put into an inactivated state.
[0109] The status of the route includes: an activated state and an inactivated state. When the corresponding route can iterate to obtain the destination address, the route is in the activated state, otherwise, the route is in the inactivated state.
[0110] When there is no resolution route for the next hop of the third route, it means that the third route cannot be iterated to the destination address, and the third route is in an inactive state. Since other routes depend on the third route, other routes cannot be iterated to obtain the destination address, so they are in an inactive state.
[0111] In the above embodiment, the most commonly used implementation method of the dependency chain is: set up a corresponding linked list, one linked list corresponds to one dependency chain, and each routing pointer is stored in the linked list. This method is simple and easy to implement, but in actual situations, there may be routing intersections in multiple dependency chains, such as multiple routes may have the same next hop, that is, one dependent party may correspond to multiple dependent parties. If a linked list is used for storage of a dependency chain, when the corresponding dependent party route changes, it is necessary to traverse all linked lists to find out whether there is a changed route in the corresponding linked list, which consumes more resources and time. In order to facilitate the management of routing and dependency chains, this embodiment also provides the following preferred embodiment, that is, the dependency relationship is expressed as a routing storage structure and an INH storage structure.
[0112] The route storage structure stores routes and an INH resolution chain table, and the INH resolution chain table mounts an INH with the route as the resolution route.
[0113] The INH is located in a corresponding INH storage structure, and the INH storage structure further stores a reference routing chain list, and the reference routing chain list is used to mount a fourth route whose next hop is the INH, thereby forming a dependency relationship in which the fourth route depends on the resolved route of the INH.
[0114] Among them, the mounting can be understood as a pointer to the mounting object in the corresponding linked list, that is, the INH itself is stored in the INH storage structure, and in the corresponding INH resolution linked list, the pointer to the INH is stored, and the route is also stored in the route storage structure, and the pointer to the corresponding route is stored in the reference route linked list, so that the relationship chain between the route, the next hop INH of the route, and the resolution route of the INH can be realized through the INH resolution linked list and the reference route linked list, thereby using INH as a transit to express the dependency between the routes.
[0115] This embodiment uses INH as a transit to express the dependency relationship between routes. When the route changes, only the referenced route chain table and the INH resolution chain table need to be changed without a large-scale update of the dependency chain.
[0116] In actual situations, the link distribution of the network topology itself has a certain degree of complexity. On this basis, the number of routes in the network is even larger. If the dependency chain is directly expressed through the route, it may cause the complexity of the storage structure used to store the dependency chain to be too high or the number to be too large, so that it occupies more resources, and when the route changes, it is more difficult to maintain and update the corresponding dependency chain. This embodiment expresses the dependency chain through the route storage structure and the INH storage structure, so there is no need to consider the intersection between the dependency chains, and by making each INH correspond to a reference route chain list, all routes with the INH as the next hop can be iteratively updated through the INH, making the iterative update of the route more comprehensive.
[0117] In order to quickly find a route matching the INH destination prefix when the resolution route of INH is deleted, so as to update the resolution route, there is the following preferred implementation:
[0118] The routing table is stored in the form of an AVL tree structure. When storing, the routing table is stored in the form of an AVL tree structure, and the network prefix and the network prefix length are used as indexes, so that alternative routes can be quickly found through the index and the parsed route is updated.
[0119] The "first", "second" and "third" in this embodiment do not have any special limiting meanings. They are used for description only to facilitate the description of different individuals in a category of objects and should not be interpreted as having special limiting meanings in order or other aspects.
[0120] Embodiment 2:
[0121] The present invention is based on the method described in Example 1, combined with specific application scenarios, and uses technical descriptions in related scenarios to illustrate the implementation process of the present invention in characteristic scenarios.
[0122] This embodiment uses Figure 5 As an example, the network topology scenario includes six routers, R1, R2, R3, R4, R5 and R6. The routers communicate with each other through IGP and BGP protocols. The local interface IP and outbound interface IP addresses of the routers are as follows: Figure 5 As shown, the outbound interfaces on router R1 are configured with IP addresses 12.0.0.10 / 24 and 12.1.0.10 / 24 respectively. On router R1, the corresponding routing table is configured as follows Figure 6As shown, RT2 is a static route, and the next hop of RT2 is 12.0.0.10, which is directly adjacent to router R1, so the next hop of RT2 is a direct next hop, that is, DNH, and accordingly, its routing status is activated. RT3, RT4, and RT5 are routes to be iterated, among which the next hop 2.2.2.2 of RT3 is the same as the destination address of RT2, so RT3 depends on RT2; the next hop of RT4 and the next hop of RT5 are both 3.3.3.3, which are the same as the destination address of RT3, that is, RT4 and RT5 both depend on RT3.
[0123] Then the dependency relationship is formed according to the routing table, and two dependency chains are formed as follows Figure 7 As shown, the arrow points from the relying party to the dependent party, that is, the first dependency chain is RT5 depends on RT3, RT3 depends on RT2, and the second dependency chain is RT4 depends on RT3, RT3 depends on RT2.
[0124] In this scenario, only RT4 and RT5 have the same next hop. However, in actual use, the network topology is usually more complex, and more routes may have the same next hop. When multiple routes have the same next hop, the dependent parties corresponding to these multiple routes are the same. Therefore, the next hop is used to express the dependency between each route to simplify the dependency formation process, reduce time occupancy, and reduce resource occupancy when storing dependencies. Its specific implementation includes:
[0125] Take the next hop of RT3 as INH1 (2.2.2.2), and its corresponding resolved route as RT2; the next hops of RT4 and RT5 are the same, both INH2 (3.3.3.3), and their corresponding resolved route is RT3 as an example; when this expression is used, the route it depends on can be obtained through the next hop of the corresponding route, which is expressed as resolved route in the above text, without generating multiple dependencies for multiple routes with the same next hop.
[0126] After the corresponding dependency chain is formed, since the next hop of RT2 is DNH, the route is iteratively updated to the dependent party starting from the activated route RT2. One implementation method is as follows: Figure 8 As shown, specifically including:
[0127] In step 601, set the route variable Rout1 equal to the corresponding activated route; proceed to step 602; in this embodiment, the corresponding activated route is RT2.
[0128] In step 602, find the INH with Rout1 as the resolved route, further find one or more Rout2 with the INH as the next hop, perform iterative update of Rout2, and store all Rout2 in the queue; then proceed to step 603.
[0129] In step 603, the corresponding routes are taken out from the queue in sequence, and the route variable Rout1 is set equal to the taken out routes, and the process goes to step 602 until the queue is empty, and then the process ends.
[0130] The iterative update of Rout2 in step 602 specifically includes: updating the routing state of Rout2 according to Rout1, since the routing state of RT2 is activated in this embodiment, the corresponding Rout2 is also activated. It also includes: determining the routing path of Rout2 according to the routing path of Rout1.
[0131] When adding an activated route, for example, in the routing table of router R1, a newly added activated route RT2A is added, the destination address of the route RT2A is 2.2.2.2 / 32, the next hop is 12.1.0.10, and a new direct next hop DNH2 is added on R1: GE0 / 0 / 112.1.0.10. RT2A is compared with other routes in the routing table to obtain: RT2A matches the RT2 prefix and the RT2A prefix length is longer, then RT2A is used to replace the RT2 position in the dependency chain, that is, the resolved route RT2 of INH1 is changed to RT2A, and the iterative update of each route in the dependency chain is triggered by the update of the dependency, and the route iterative update process triggered by RT2A replacing RT2 is consistent with the implementation idea of the process described in the above steps 601-step 603, which will not be repeated here.
[0132] There is also a situation where, when the newly added activated route is used with the original route (hereinafter referred to as the original route) whose prefix matches the newly added activated route, a routing loop may be formed. In view of this situation, this embodiment further includes:
[0133] Under the assumption that the first activated route is the resolved route of the first INH, the iterative path of the first INH is obtained iteratively in sequence. If, in the process of obtaining the iterative path of the first INH, the INH obtained in the latest iteration already exists in the iterative path obtained in the previous iteration, the activated route is not used to replace the original route; the first INH is the INH with the original route as the resolved route.
[0134] As in Figure 5In the topology scenario shown, a new route RT2B is added, the destination address of the route is 2.2.2.2 / 32, and the next hop is 3.3.3.3. Since RT2B matches the prefix of RT2 and the prefix length of RT2B is longer, RT3 is traversed from the position of RT2B to the lower layer of the dependency relationship. The next hop of RT3 is 2.2.2.2, that is, INH1, and the resolved route of INH1 is RT2. If RT2 is replaced with RT2B, a routing loop of RT2B->RT3->RT2B will be formed, so RT2B is not used to replace the position of RT2 in the dependency chain.
[0135] When deleting an activated route, such as when deleting the above RT2A, first search the routing table for a route that matches the prefix of the route to be deleted. If a matching route can be found, replace the position of the route to be deleted in the dependency relationship with the matching route, and then delete the activated route. For example, in this embodiment, if RT2 matches the routing prefix of RT2A, RT2 is used to replace RT2A, and the dependency chain is updated, and the iterative update of the routing of the dependency chain is triggered. The process is consistent with the implementation idea of the process described in the above steps 601-603, and will not be repeated here. If a route that matches the prefix of the route to be deleted cannot be found, the routing status in the corresponding dependency chain is updated to the pending resolution status, and the dependency chain is deleted.
[0136] This embodiment also provides a specific storage form of the corresponding dependency chain, such as Fig. 9 The routing storage structure and the INH storage structure are shown. The routing storage structure stores the routing and INH resolution linked lists (i.e. Fig. 9 The INH is located in the corresponding INH storage structure, and the INH storage structure also stores the reference route list (i.e. Fig. 9 The referring route chain list is used to mount the fourth route whose next hop is the INH, thereby forming a dependency relationship in which the fourth route depends on the resolved route of the INH. The INH storage structure also stores Resolving_route, i.e., a pointer to the resolved route of the INH. Thus, the corresponding dependency chain can be obtained through each pointer between the route and the INH.
[0137] Embodiment 3:
[0138] like Fig.10 , which is a schematic diagram of the architecture of a routing iteration device according to an embodiment of the present invention. The routing iteration device according to this embodiment includes one or more processors 21 and a memory 22. Fig.10A processor 21 is taken as an example.
[0139] The processor 21 and the memory 22 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0140] The memory 22, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs and non-volatile computer executable programs, such as the routing iteration method in Example 1. The processor 21 executes the routing iteration method by running the non-volatile software programs and instructions stored in the memory 22. The memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 22 may optionally include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the processor 21 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0141] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, the routing iteration method in the above embodiment 1 is executed, for example, the above described Figure 1-Figure 4 as well as Figure 8 The steps shown.
[0142] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.
[0143] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0144] 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 and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A routing iteration method, characterized in that: include: Establish dependencies between routes based on the next hop of each route in the routing table; When a route change occurs, updating the dependency relationship between the routes; Iteratively update the routes according to the dependency relationship between the routes; wherein, according to the routing path of the dependent party in a dependency relationship, the routing path of the relying party is generated, thereby realizing iterative update of the routing of the relying party; When a first activated route is added to the routing table, the updating of the dependency relationship between the routes specifically includes: searching for a second route whose next hop is a first INH in all routes whose next hop is an indirect next hop INH; wherein the first INH is an INH that matches the destination prefix of the first activated route; If there is no resolution route for the first INH, the first activated route is used as the resolution route of the first INH, and a dependency relationship is established in which the second route depends on the resolution route of the first INH; if there is a resolution route for the first INH, and the destination prefix of the first activated route is longer than the destination prefix of the resolution route, the resolution route of the first INH is updated according to the first activated route, and the dependency relationship with the second route as the dependent party is updated; otherwise, the dependency relationship between routes is not updated.
2. The routing iteration method according to claim 1, characterized in that: The step of establishing a dependency relationship between routes according to the next hop of each route in the routing table specifically includes: If the next hop of the first route is an indirect next hop INH, then find the resolution route of the INH and establish a dependency relationship in which the first route depends on the resolution route; wherein the resolution route of the INH is the activated route that has the longest match with the destination prefix of the INH.
3. The routing iteration method according to claim 1, characterized in that: The iterative updating of routes according to the dependency relationship between routes specifically includes: A dependency chain is established according to a first dependency relationship with the transit route as a dependent party and a second dependency relationship with the transit route as a dependent party; wherein, in the dependency chain, the second dependent party depends on the transit route, and the transit route depends on the first dependent party, the first dependent party is the dependent party in the first dependency relationship; and the second dependent party is the dependent party in the second dependency relationship; According to the dependency chain, the routing is iteratively updated; wherein, after the lower routing in the dependency chain is iteratively updated, the iterative update of the upper routing in the dependency chain is triggered.
4. The routing iteration method according to claim 1, characterized in that: The updating of the resolution route of the first INH according to the first activation route specifically includes: Under the assumption that the first activation route is the resolution route of the first INH, iterate and obtain the iteration path of the first INH in sequence; wherein the iteration path of the first INH is specifically: starting from the first INH, iterate and obtain a set of sequentially arranged INHs; If, in the process of obtaining the iterative path of the first INH, the INH obtained in the latest iteration already exists in the iterative path obtained in the previous iteration, the resolution route of the first INH is not updated; Otherwise, the first activated route is used as a new resolution route, and the new resolution route is used to replace the original resolution route of the first INH.
5. The routing iteration method according to claim 1, characterized in that: When a first activated route is added to the routing table, the iterative updating of the routes according to the dependencies between the routes further includes: Find all routes that are directly or indirectly dependent on the second route, and form a corresponding dependency chain; The second route is updated according to the first activated route, and the iterative update of the second route triggers the iterative update of each route in the dependency chain in sequence.
6. The routing iteration method according to claim 1, characterized in that: When the second activated route is deleted from the routing table, the updating of the dependency relationship between the routes further includes: Searching for a third route whose next hop is a second INH among all routes whose next hop is an indirect next hop INH; wherein the second INH is an INH whose second activated route is a resolved route; After deleting the second activated route, check whether there is a third activated route matching the second INH destination prefix in the routing table; if so, update the resolution route of the second INH according to the third activated route that has the longest match with the second INH destination prefix, and update the dependency relationship with the third route as the relying party; If there is no third activated route matching the second INH destination prefix, the resolved route of the second INH is deleted, and the third route and all routes directly or indirectly dependent on the third route are put into an inactivated state.
7. The routing iteration method according to claim 1, characterized in that: The dependency relationship is manifested as a routing storage structure and an INH storage structure; The route storage structure stores routes and INH resolution linked lists, and the INH resolution linked list is mounted with the INH that uses the route as the resolution route; The INH is located in a corresponding INH storage structure, and the INH storage structure further stores a reference routing chain list, and the reference routing chain list is used to mount a fourth route whose next hop is the INH, thereby forming a dependency relationship in which the fourth route depends on the resolved route of the INH.
8. The routing iteration method according to claim 1, characterized in that: The routing table is stored in the form of an AVL tree structure, and uses the network prefix and the network prefix length as indexes.
9. A routing iteration device, characterized in that: The device comprises: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the routing iteration method described in any one of claims 1-8.
Citation Information
Patent Citations
Routing table manager using pseudo routes
WO2007000733A2