CN116389346A - Route iteration method and device - Google Patents

Route iteration method and device Download PDF

Info

Publication number
CN116389346A
CN116389346A CN202310407124.0A CN202310407124A CN116389346A CN 116389346 A CN116389346 A CN 116389346A CN 202310407124 A CN202310407124 A CN 202310407124A CN 116389346 A CN116389346 A CN 116389346A
Authority
CN
China
Prior art keywords
route
inh
iteration
routes
dependency relationship
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310407124.0A
Other languages
Chinese (zh)
Inventor
郑浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Third Generation Communication Technology Co ltd
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Nanjing Third Generation Communication Technology Co ltd
Fiberhome Telecommunication Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Third Generation Communication Technology Co ltd, Fiberhome Telecommunication Technologies Co Ltd filed Critical Nanjing Third Generation Communication Technology Co ltd
Priority to CN202310407124.0A priority Critical patent/CN116389346A/en
Publication of CN116389346A publication Critical patent/CN116389346A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the technical field of network communication, and provides a routing iteration method and device. Wherein the method comprises: establishing a dependency relationship among routes according to the next hop of each route in the routing table; when route change occurs, updating the dependency relationship among the routes; according to the dependency relationship among the routes, carrying out iterative updating of the routes; and generating the routing path of the relying party according to the routing path of the relied party in a section of the dependency relationship, thereby realizing iterative updating of the routing of the relying party. The invention makes the relying party unnecessary to search the path by forming the dependency chain among routes and carrying out route iteration by using the iteration result of the relied party, thereby avoiding repeated and invalid iteration processes, improving the efficiency of route iteration update and shortening the time required by route convergence.

Description

Route iteration method and device
[ field of technology ]
The present invention relates to the field of network communications technologies, and in particular, to a routing iteration method and apparatus.
[ background Art ]
The network device is generally composed of a main control board and a line card, wherein a routing table item on the main control board is mainly composed of a destination prefix and a Next hop, the routing table item is stored in a RIB (Routing Information Base ) module, the Next hop can be divided into a Direct Next Hop (DNH) and a Indirect Next Hop (INH) according to whether the Next hop is a Direct neighbor, the routing table item of the DNH is in an activated state, the main control board can directly send the routing table item to the line card (FIB, forwarding Information Base) so as to guide the forwarding of an IP message, the routing table item of the INH (called an iteration route) is in a non-activated state, the Next hop can enter the activated state (can be sent to the line card) after the DNH reaching the destination prefix is obtained through route iteration, the specific process of route iteration is to find the route reaching the Next hop of the iteration route, if the found route is still INH, the route reaching the Next hop is found, the route is iterated, the route is found in the iteration process of the iteration sequence, and the iteration process is repeated until the route reaching the Next hop is found in the iteration sequence.
The routing iteration is a main calculation task of routing table management, the advantages and disadvantages of the routing iteration method directly affect the performance of network equipment and the quality of network service, and the inefficient routing iteration method can consume excessive system resources on one hand and reduce the routing convergence speed on the other hand, so that the service flow cannot be switched to an optimal transmission path in time, and the service quality of the service is deteriorated.
In view of this, overcoming the drawbacks of the prior art is a problem to be solved in the art.
[ invention ]
The invention solves the technical problem that the iteration paths of different iteration routes are likely to be partially overlapped or completely the same, and in the prior art, the different partially overlapped routes are required to be respectively iterated, so that a plurality of repeated iteration processes are caused, and the iteration efficiency of the routes is low.
The invention adopts the following technical scheme:
in a first aspect, the present invention provides a routing iteration method, including:
establishing a dependency relationship among routes according to the next hop of each route in the routing table;
when route change occurs, updating the dependency relationship among the routes;
according to the dependency relationship among the routes, carrying out iterative updating of the routes; and generating the routing path of the relying party according to the routing path of the relied party in a section of the dependency relationship, thereby realizing iterative updating of the routing of the relying party.
Preferably, the establishing a dependency relationship between routes according to a next hop of each route in the routing table specifically includes:
if the next hop of the first route is indirect next hop INH, finding out an analytical route of the INH, and establishing a dependency relationship of the first route depending on the analytical route; the analytical route of the INH is an activation route which is longest matched with the INH destination prefix.
Preferably, the performing iterative update of the route according to the dependency relationship between routes specifically includes:
establishing a dependency chain according to a first dependency relationship taking the transit route as a relying party and a second dependency relationship taking the transit route as a relied party; wherein in the dependency chain, a second relying party depends on the transit route, and the transit route depends on a first relied party, which is a relied party in a first dependency relationship; the second relying party is a relying party in a second dependency relationship;
according to the dependency chain, performing iterative updating of the route; and triggering the iterative updating of the upper layer route in the dependency chain after the iterative updating of the lower layer route in the dependency chain.
Preferably, when the first active route is newly added in the route table, the updating the dependency relationship between the routes specifically includes:
searching a second route with the next hop as the first INH in the routes with all the next hops as indirect next hops INH; wherein the first INH is an INH matched with the first active route destination prefix;
if the first INH does not have the analysis route, the first activation route is used as the analysis route of the first INH, and the dependency relationship of the second route depending on the analysis route of the first INH is established;
if the first INH has an analysis route and the destination prefix of the first activation route is longer than the destination prefix of the analysis route, updating the analysis route of the first INH according to the first activation route and updating the dependency relationship taking the second route as a relying party;
otherwise, the dependency relationship between routes is not updated.
Preferably, the updating the resolved route of the first INH according to the first activation route specifically includes:
sequentially and iteratively acquiring an iteration path of the first INH under the condition that the first activation route is assumed to be the analysis route of the first INH; the iteration path of the first INH specifically includes: starting from a first INH, iterating to obtain a set of INH sequences;
If the INH obtained by the latest iteration exists in the iteration path obtained by the last iteration in the process of obtaining the iteration path of the first INH, not updating the analysis route of the first INH;
otherwise, taking the first activation route as a new analysis route, and replacing the original analysis route of the first INH by using the new analysis route.
Preferably, when the first active route is newly added in the routing table, the performing iterative update of the route according to the dependency relationship between routes further includes:
finding all routes directly or indirectly depending on the second route to form a corresponding dependence relation chain;
and updating the second route according to the first activated route, and sequentially triggering the iterative updating of each route in the dependency chain by the iterative updating of the second route.
Preferably, when deleting the second active route in the route table, the updating the dependency relationship between the routes further includes:
searching a third route with the next hop as a second INH in the routes with all the next hops as indirect next hops INH; wherein the second INH is an INH using the second activation route as a resolution route;
after deleting the second active route, searching whether a third active route matched with the second INH destination prefix exists in the routing table; if so, updating the analysis route of the second INH according to a third activation route which is longest matched with the second INH destination prefix, and updating a dependency relationship taking the third route as a relying party;
If there is no third active route matching the second INH destination prefix, deleting the resolved route of the second INH and making the third route and all routes directly or indirectly dependent on the third route enter an inactive state.
Preferably, the dependency relationship is represented by a route storage structure and an INH storage structure;
the routing storage structure stores a routing and an INH analysis linked list, and the INH analysis linked list is provided with an INH taking the routing as an analysis routing;
the INH is located in a corresponding INH storage structure, and the INH storage structure is further stored with a reference route linked list, wherein the reference route linked list is used for mounting a fourth route of which the next hop is the INH, so that a dependency relationship of the fourth route depending on the analytical route of the INH is formed.
Preferably, the routing table is stored in the form of an AVL tree structure and indexed by network prefix and network prefix length.
In a second aspect, the present invention further provides a routing iteration device, configured to implement the routing iteration method according to the first aspect, where the device includes:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor for performing the routing iteration method of the first aspect.
In a third aspect, the present invention also provides a non-volatile computer storage medium storing computer executable instructions for execution by one or more processors to perform the method of route iteration of the first aspect.
The invention makes the relying party unnecessary to search the path by forming the dependency chain among routes and carrying out route iteration by using the iteration result of the relied party, thereby avoiding repeated and invalid iteration processes, improving the efficiency of route iteration update and shortening the time required by route convergence. In a preferred scheme of the invention, a storage structure for supporting the dependency chain in the routing iteration process is also provided, the dependency is stored through INH, the maintenance and update process of the dependency chain is simplified, and the routing iteration update process is ensured to be more complete.
[ description of the drawings ]
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the drawings that are required to be used in the embodiments of the present invention will be briefly described below. It is evident that the drawings described below are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 is a schematic flow chart of a route iteration method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a route iteration method according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of a route iteration method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of a route iteration method according to an embodiment of the present invention;
fig. 5 is an application scenario schematic diagram of a routing iteration method provided in an embodiment of the present invention;
fig. 6 is a schematic diagram of a route representation in an application scenario of a route iteration method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a dependency chain of a routing iteration method according to an embodiment of the present invention;
fig. 8 is a schematic flow chart of a route iteration method according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a storage structure of a dependency chain of a routing iteration method according to an embodiment of the present invention;
fig. 10 is a schematic architecture diagram of a routing iteration device according to an embodiment of the present invention.
[ detailed description ] of the invention
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
Example 1:
the embodiment 1 of the invention provides a routing iteration method, as shown in fig. 1, specifically including:
in step 201, a dependency relationship between routes is established according to the next hop of each route in the routing table.
Where, with a single route as a cut-in view, there may be a route that depends on the node, but the node may also depend on other routes, i.e. in one dependency the route may be a relying party, while in another dependency the route may be a depended party, the relying party and depended party being relative to one relationship, or a route in a relationship, rather than being absolutely fixed.
In step 202, when a route change occurs, the dependency relationship between routes is updated.
Wherein the routing variations include: addition of routes, deletion of routes, path change of routes, route state change, and the like.
In step 203, according to the dependency relationship between routes, performing iterative update of routes; and generating the routing path of the relying party according to the routing path of the relied party in a section of the dependency relationship, thereby realizing iterative updating of the routing of the relying party.
As an alternative implementation manner, the dependency relationship between the routes is transited through the next hop of the routes, if the route a depends on the next hop a, and the next hop a depends on the route B, the dependency relationship may be transited through the route a depends on the next hop a, and the next hop a depends on the route B.
The iterative updating of the route further comprises: the routing state of the relying party is updated using the routing state of the relied party and the routing path of the relying party is updated using the routing path of the relied party.
In the embodiment, the dependency relationship among the routes is established, and the route path of the dependent party in the dependency relationship generates the route path of the dependent party, so that the re-iteration of the route of the dependent party is not needed, and when parts of the iterative paths of a plurality of routes are identical, the identical parts only need to be iterated once, thereby avoiding repeated iteration processes, improving the efficiency of route iteration update and shortening the time required by route convergence.
The embodiment also provides a specific implementation manner for establishing a dependency relationship between routes according to the next hop of each route in the routing table, which specifically comprises the following steps:
if the next hop of the first route is indirect next hop INH, finding out an analytical route of the INH, and establishing a dependency relationship of the first route depending on the analytical route; the analytical route of the INH is an activation route which is longest matched with the INH destination prefix.
If the next hop of the first route is direct next hop DNH, the first route can directly reach the destination address through the next hop without depending on other routes.
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.
Because the dependency relationship of the routes is complicated, in order to facilitate the iterative update of the routes, there is also a preferred embodiment of performing the iterative update of the routes according to the dependency relationship between the routes, as shown in fig. 2, specifically including:
in step 301, a dependency chain is established according to a first dependency relationship taking a transit route as a relying party and a second dependency relationship taking the transit route as a relied party; wherein in the dependency chain, a second relying party depends on the transit route, and the transit route depends on a first relied party, the first relied party is a relied party in a first dependency relationship, and the second relying party is a relying party in a second dependency relationship.
In step 302, according to the dependency chain, performing iterative update of the route; and triggering the iterative updating of the upper layer route in the dependency chain after the iterative updating of the lower layer route in the dependency chain.
In this case, since a single route is taken as a cut-in view, there may be other routes depending on the route, and the route may also depend on other routes, that is, the route is a relying party in one section of dependency relationship and a relied party in another section of dependency relationship, so that the route can be taken as a transit route to form a corresponding dependency relationship chain.
The first dependency relationship and the second dependency relationship do not refer to a specific dependency relationship, but refer to that a dependent party of one segment of relationship and a dependent party of another segment of relationship are the same route (i.e. the above transit route), and a relationship in which the route is a dependent party is referred to as a first dependency relationship, and a relationship in which the route is a dependent party is referred to as a second dependency relationship. For example, there is a dependency chain in which one segment of the dependency relationship relation-1 is rout1, the dependent is rout2, the dependent in the other segment of the dependency relationship relation-2 is rout2, the dependent is rout3, the relation-2 is referred to as a first dependency relationship, the dependency relationship-1 is referred to as a second dependency relationship, and thus, the dependency chain in which rout1 depends on rout2, and rout2 depends on rout3 is formed, and for convenience of expression, the dependency chain is expressed in a form pointed by an arrow (i.e., symbol "- >"), and the dependency chain is expressed as rout1- > rout2- > rout3.
In practical use, not only two-stage dependency relationships but also multi-stage dependency relationships can generate dependency relationship chains, for example, a stage of dependency relationship-3 exists on the basis of the existence of the relationship-1 and the relationship-2, the dependent party of the relationship-3 is rout3, the dependent party is rout4, at this time, the formed dependency relationship chain is rout1- > rout2- > rout3- > rout4, when the portion of rout1- > rout2- > rout3 is formed, the relationship-1 is a second dependency relationship, the relationship-2 is a first dependency relationship, and when the portion of rout2- > rout3- > rout4 is formed, the relationship-2 is a second dependency relationship, and the relationship-3 is a first dependency relationship.
The upper layer route and the lower layer route do not refer to a specific route, but rather refer to a relative description in a dependency chain, the upper layer in the dependency chain is referred to as a dependency chain in the dependency direction in the dependency chain, the lower layer in the dependency chain is referred to as a dependency chain in the dependent direction in the dependency chain, if a dependency chain of rout1- > rout2- > rout3- > rout4 exists, rout3 is an upper layer route, rout4 is a lower layer route, rout2 is an upper layer route, and rout3 is a lower layer route, so that after the rout4 is iteratively updated, iterative update of rout3 is triggered, and further iterative update of rout2 is triggered. In subsequent embodiments, rout1 is also referred to as the top level route and rout4 is also referred to as the bottom level route.
The embodiment also provides a more specific implementation manner for generating the dependency chain, which specifically includes:
sequentially adding nodes into a dependency chain, specifically, finding a dependency relationship taking a target route as a depended party, and adding the depended party in the dependency relationship to the top layer of the dependency chain until the establishment of the dependency chain is completed when the route depended on the target route cannot be found; the route at the top layer of the dependency chain after the last node addition is finished is used as a target route when the next node addition is performed; when adding the first node into the dependency chain, taking the route with the next hop as the route reaching the next hop DNH as the first node of the dependency chain.
The dependency chain does not limit its storage or management structure to a linked list form, but rather characterizes the dependency between routes. The formed dependency chains may have one or more, and there may be a crossover of routes in the multiple dependency chains.
The bottom layer and the top layer of the dependency chain are only one expression mode, namely, two adjacent nodes are taken from the dependency chain according to the direction from the bottom to the top of the dependency chain, and then the node close to the bottom layer is routed as a depended party, and the node close to the top layer is routed as a depended party. And not to limit the structure of the dependency chain.
According to the method, the dependency chain among the routes is formed, the route iteration is carried out by using the iteration result of the depended party, when routes outside the dependency chain are changed, the iteration update of the routes is not triggered, so that an invalid iteration process is avoided, the route of the depended party is generated through the route of the depended party in the dependency relationship, and therefore re-iteration is not needed to be carried out on the route of the depended party, and when parts of the iteration routes of a plurality of routes are identical, the same parts only need to be iterated once, so that repeated iteration processes are avoided, the efficiency of route iteration update is improved, and the time required by route convergence is shortened.
In practical situations, when there are many routes in the dependency chain and the formed dependency chain is long, how to sequentially implement iterative update of each route in the dependency chain, and for this problem, in combination with the above embodiment, there is the following preferred embodiment, that is, the iterative update of routes is performed according to the dependency chain, specifically: and carrying out route iteration on the routes of each node in turn from the bottom layer of the dependency chain to the top layer of the dependency chain, wherein, between two adjacent nodes, the route close to the top layer carries out route iteration update according to the route close to the bottom layer, and in a preferred embodiment, the route iteration update of the dependent party can be directly carried out according to the analysis route corresponding to the next hop of the dependent party.
In the case of route variation, there is a preferred implementation manner in 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 iteratively obtaining a route path of the changed route.
And according to the routing path of the variable route, performing iterative updating of the routes of all the dependents taking the variable route as the directly or indirectly depended party.
For example, when there is a dependency chain of rout1- > rout2- > rout3- > rout4, when the next hop of rout3 changes, a new dependency relationship is established according to the next hop of rout3, if the original rout3 is changed from rout4 to rout3 and is dependent on rout5, the rout3 is updated again in an iteration manner, and then the routing paths of rout2 and rout1 are updated in turn according to the routing path of rout3, so as to complete the iterative update of rout1, rout2 and rout3 caused by the routing change of rout 3.
According to the method and the device, route updating is sequentially carried out from the direction of the relied party to the direction of the relying party in an iteration mode, so that iteration updating of each route in the dependence relation chain is orderly carried out, iteration of the routes in the dependence relation chain is not triggered when irrelevant routes outside the corresponding dependence relation chain are changed, repeated iteration and invalid iteration are avoided, and efficiency of route iteration is improved.
In an actual use situation, according to different destination addresses of each route, a plurality of dependency chains generally exist in a network, and in this scenario, when a newly added route exists, iteration update of the route is guaranteed to be normally performed, and one most commonly used implementation manner is as follows: generating a dependency relationship again according to the next hop of the route, so as to perform iterative update of the route, but this implementation generally involves traversing each route in the network, which consumes a large amount of resources and time, and for this problem, in combination with the above embodiment, there is a preferred embodiment that, when the first active route is newly added in the routing table, updates the dependency relationship between the routes, as shown in fig. 3, specifically including:
in step 401, among all routes with the next hop being indirect next hop INH, searching a second route with the next hop being first INH; wherein the first INH is an INH that matches the first active route destination prefix.
In step 402, if the first INH does not have a resolved route, the first active route is used as a resolved route of the first INH, and a dependency relationship of the second route depending on the resolved route is established.
In step 403, if the first INH has a resolved route and the destination prefix of the first active route is longer than the destination prefix of the resolved route, the resolved route of the first INH is updated according to the first active route, and the dependency relationship using the second route as the relying party is updated.
In step 404, otherwise, no update of inter-route dependencies is performed.
And when the destination prefix length of the analysis route is longer than that of the first activation route, updating the dependency relationship among routes is not carried out.
In the embodiment, the target prefix matching is performed on the first active route, so that whether the first active route affects the existing dependency relationship is judged, and therefore, the update of the dependency relationship and the route iteration are performed only on the relevant route, and the time and the consumed resources required for regenerating the dependency relationship are reduced.
In this way, a routing loop may occur when performing iterative update of a route due to a change of a dependency relationship between routes, and in this way, in combination with the foregoing embodiment, a preferred embodiment is provided, that is, the update of the first INH's analytical route according to the first active route, as shown in fig. 4, specifically includes:
In step 501, under the condition that the first activation route is assumed to be the analytical route of the first INH, sequentially iterating to obtain an iterated path of the first INH; the iteration path of the first INH specifically includes: starting from the first INH, the resulting set of INHs is iterated.
In step 502, if the INH obtained by the latest iteration exists in the iteration path obtained by the last iteration in the process of obtaining the iteration path of the first INH, the analytical route of the first INH is not updated.
In step 503, if not, the first active route is used as a new resolved route, and the new resolved route is used to replace the original resolved route of the first INH.
Wherein the iterative paths do not refer to some specific INH ordered sets, but rather are constantly changing with the iterative process.
The iterative process is as follows: when the iteration path comprises a first INH in the first iteration, finding the next hop INH of the first activation route, namely the INH obtained in the first iteration, and adding the INH obtained in the first iteration into the iteration path.
And searching an analysis route of the transfer INH by taking the INH obtained in the previous iteration as the transfer INH, wherein the next hop INH of the analysis route is the INH obtained in the current iteration, and adding the INH obtained in the current iteration into an iteration path.
The last iteration and the current iteration are relatively speaking, if three adjacent iterations exist, including a first iteration, a second iteration and a third iteration, when the second iteration is taken as the current iteration, the last iteration is the first iteration, and when the third iteration is taken as the current iteration, the last iteration is the second iteration. The latest iteration is the latest iteration, if only three iterations are performed, the latest iteration is the third iteration, and the corresponding last iteration is the second iteration.
For example, if the next hop INH of the first active route is INH1, the resolved route of INH1 is rout1, and the next hop INH of rout1 is INH2. The iteration process sequentially iterates to the bottom layer of the dependency relationship, wherein in the first iteration, the iteration path comprises a first INH, when INH1 is obtained through iteration, when INH2 is obtained through iteration, the iteration path obtained last time comprises the first INH and INH1, if the first INH is INH2, when INH2 is obtained through iteration, INH2 exists in the obtained iteration path, and if a first activated route is used as an analytical route of the first INH, a routing loop is caused, so that the analytical route of the first INH is not updated.
And when the iteration obtains DNH, the iteration is illustrated to obtain a complete iteration path of the first INH, if the INH obtained by each iteration does not exist in the obtained iteration path, namely, repeated INH does not exist in the iteration path, the method enters a step 503, and a first activation route is used as an analysis route of the first INH.
When a first active route is newly added and the dependency relationship of the route is updated, the iterative update of the route is needed to be carried out again, and one common implementation mode is as follows: and forming a new dependency chain, and sequentially and iteratively updating from the bottom layer of the dependency chain to the top layer of the dependency chain.
There is also provided a preferred implementation manner, that is, when the first active route is newly added in the routing table, the iterative update of the route is performed according to the dependency relationship between routes, and further including:
finding all routes directly or indirectly depending on the second route to form a corresponding dependence relation chain;
and updating the second route according to the first activated route, and sequentially triggering the iterative updating of each route in the dependency chain by the iterative updating of the second route.
When deleting the second active route in the route table, the updating the dependency relationship between the routes further comprises:
Searching a third route with the next hop as a second INH in the routes with all the next hops as indirect next hops INH; the second INH is an INH using the second activation route as a resolution route.
After deleting the second active route, searching whether a third active route matched with the second INH destination prefix exists in the routing table; if so, updating the analysis route of the second INH according to a third activation route which is longest matched with the prefix of the second INH, and updating the dependency relationship taking the third route as a relying party.
If there is no third active route matching the second INH destination prefix, deleting the resolved route of the second INH and making the third route and all routes directly or indirectly dependent on the third route enter an inactive state.
Wherein the state of the route comprises: the routing is in an active state and in an inactive state when the corresponding routing can iteratively obtain the destination address, otherwise, the routing is in the inactive state.
When the next hop of the third route does not have the resolved route, the third route is not iterated to the destination address, the third route is in an inactive state, and other routes are not iterated to obtain the destination address because the other routes depend on the third route.
In the above embodiment, the most commonly used implementation manner of the dependency chain is: setting up corresponding linked list, one corresponding to one dependency chain, storing each route pointer in the linked list. In a practical situation, there may be a route crossing in multiple dependency chains, for example, there may be multiple routes with the same next hop, that is, one depended party may correspond to multiple dependents, if one chain table is used for storing one dependency chain, when the route of the corresponding depended party changes, all the chain tables need to be traversed to find whether there is a changed route in the corresponding chain table, and more resources and time need to be consumed.
The routing storage structure is stored with a routing and INH analysis linked list, and the INH analysis linked list is provided with INH which takes the routing as analysis routing.
The INH is located in a corresponding INH storage structure, and the INH storage structure is further stored with a reference route linked list, wherein the reference route linked list is used for mounting a fourth route of which the next hop is the INH, so that a dependency relationship of the fourth route depending on the analytical route of the INH is formed.
The mounting can be understood as that pointers pointing to mounting objects are arranged in corresponding linked lists, namely INH is stored in an INH storage structure, pointers of the INH are stored in corresponding INH analysis linked lists, routes are also stored in a route storage structure, pointers pointing to corresponding routes are stored in a reference route linked list, and therefore a correlation chain between the routes and analysis routes of the next hop INH and INH of the routes can be realized through the INH analysis linked list and the reference route linked list, and INH is used as a transfer to express the dependency relationship among the routes.
In the embodiment, the INH is used as the transit to express the dependency relationship among the routes, and when the routes change, only the reference route chain table and the INH analysis chain table need to be changed, and the update of a large-scale dependency relationship chain is not needed.
In practical situations, the link distribution of the network topology has a certain complexity, on the basis of this, the number of routes in the network is larger, if the representation of the dependency chain is directly performed through the routes, the complexity or the number of storage structures for storing the dependency chain may be too high, so that more resources are occupied by the storage structures, and when the routes change, maintenance and update of the corresponding dependency chain are difficult. According to the embodiment, the dependency chain is expressed through the route storage structure and the INH storage structure, so that the cross between the dependency chains is not needed to be considered, each INH corresponds to one reference route chain table, all routes taking the INH as the next hop can be iteratively updated through the INH, and the iterative updating of the routes is more comprehensive.
In order to quickly find a route matching with the INH destination prefix when the analytical route of the INH is deleted, so as to update the analytical route, there are the following preferred implementation manners:
the routing table is stored in the form of an AVL tree structure, and when the routing table is stored, the routing table is stored in the form of the AVL tree structure, and the network prefix and the length of the network prefix are used as indexes, so that the alternative route can be quickly found through the indexes, and the analysis route is updated.
The terms "first," "second," and "third" in this embodiment have no special limitation, and the description is merely for convenience of description of different individuals in a class of objects, and should not be construed as a sequential or otherwise specifically defined meaning.
Example 2:
the invention is based on the method described in embodiment 1, and combines specific application scenes, and the implementation process in the characteristic scene of the invention is described by means of technical expression in the relevant scene.
In this embodiment, taking the network topology scenario shown in fig. 5 as an example, the network topology scenario includes six routers, i.e., R1, R2, R3, R4, R5 and R6, each router is mutually communicated through IGP and BGP protocols, the local interface IP and the outgoing interface IP address of each router are shown in fig. 5, where IP addresses 12.0.0.10/24 and 12.1.0.10/24 are respectively configured for the outgoing interfaces on the router R1, and a corresponding routing table is configured on the router R1 as shown in fig. 6, where RT2 is a static route, and the next hop of RT2 is 12.0.0.10, and is directly adjacent to the router R1, so that the next hop of RT2 is the next hop, i.e., DNH, and accordingly, the routing state is the active state. RT3, RT4 and RT5 are routes to be iterated, wherein the next hop 2.2.2 of RT3 is the same as the destination address of RT2, so RT3 depends on RT2; the next hop for RT4 and the next hop for RT5 are both 3.3.3.3, which is the same as the destination address for RT3, i.e. both RT4 and RT5 depend on RT3.
Then a dependency relationship is formed according to the routing table, and two dependency relationship chains are formed as shown in fig. 7, wherein the arrow points from the relying party to the relied party, i.e. the first dependency relationship chain is RT5 dependent on RT3, RT3 dependent on RT2, the second dependency relationship chain is RT4 dependent on RT3, and RT3 dependent on RT2.
In this scenario, only the next hops of the routes of RT4 and RT5 are the same, but in the actual use situation, the network topology is generally more complex, and there may be a case that more routes have the same next hop, and when the routes have the same next hop, the dependents corresponding to the routes are the same, so that the dependences between the routes are represented by using the representation form of the next hop, so as to simplify the forming flow of the dependences, reduce time occupation, and reduce resource occupation when storing the dependences. The specific implementation method comprises the following steps:
taking the next hop of RT3 as INH1 (2.2.2.2), and the corresponding analytical route is RT2; the next hops of RT4 and RT5 are the same and are INH2 (3.3.3.3), and the corresponding analytical route is RT 3; with this representation, the route on which it depends can be obtained through the next hop of the corresponding route, which is represented as a resolved route in the above, without generating multiple dependencies for multiple routes with the same next hop.
After the corresponding dependency chain is formed, since the next hop of RT2 is DNH, from activating the route RT2, route iterative updating is sequentially performed to the relying party, and one implementation manner thereof is as shown in fig. 8, and specifically includes:
in step 601, let the route variable Rout1 equal the corresponding active route; step 602 is entered; in this embodiment, the corresponding activation route is RT2.
In step 602, find INH with Rout1 as the analytical route, further find one or more routs 2 with the INH as the next hop, perform iterative update of routs 2, and store all routs 2 into the queue; step 603 is entered.
In step 603, the corresponding routes are sequentially fetched from the queue, and the route variable Rout1 is equal to the fetched routes, and the process proceeds to step 602, until the queue is empty, and the flow is ended.
The performing the iterative update of Rout2 in step 602 specifically includes: according to Rout1, rout2 is updated, and since in the present embodiment, the routing state of RT2 is active, the corresponding Rout2 is also active. Further comprises: from the routing path of Rout1, a routing path of Rout2 is determined.
When a new active route is added, as in the routing table of the router R1, a new active 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 the new active route R1 is added up to the next hop DNH2: GE0/0/1 12.1.0.10, comparing RT2A with other routes in the routing table: if the RT2A is matched with the RT2 prefix and the length of the RT2A prefix is longer, the RT2 position in the RT2A replacing dependency chain is changed into RT2A by using the RT2A replacing dependency chain, that is, the analysis route RT2 of INH1 is changed into RT2A, and the iteration update of each route in the dependency chain is triggered by the update of the dependency, and the route iteration update process triggered by the RT2A replacing RT2 is consistent with the process implementation thought described in the steps 601-603, and is not repeated herein.
There is also a case where a routing loop may be formed when using an original route (hereinafter also simply referred to as an original route) in which the newly added activation route matches a prefix, for which case the embodiment further includes:
under the condition that the first active route is the analytical route of the first INH, sequentially and iteratively acquiring an iterative path of the first INH, and if the INH obtained by the latest iteration exists in the iterative path obtained by the last iteration in the process of acquiring the iterative path of the first INH, replacing the position of the original route by using the active route; the first INH is the INH taking the original route as the analysis route.
In the topology scenario shown in fig. 5, the destination address of the newly added route RT2B is 2.2.2/32, the next hop is 3.3.3.3, and since RT2B is matched with the RT2 prefix and the length of the RT2B prefix is longer, the next hop of RT3 is 2.2.2.2, i.e., INH1, and the resolved route of INH1 is RT2, if RT2 is replaced with RT2B, a routing loop of RT2B- > RT3- > RT2B is formed, so that the location of RT2 in the dependency chain is not replaced by RT 2B.
When deleting the active route, for example, when deleting the RT2A, searching the route matching with the route prefix to be deleted in the route table, if the matched route can be found, replacing the position of the route to be deleted in the dependency relationship with the matched route, and deleting the active route, for example, in this embodiment, when the RT2 is matched with the route prefix of the RT2A, replacing the RT2A with the RT2, updating the dependency relationship chain, and triggering the iterative update of the route of the dependency relationship chain accordingly, wherein the process is consistent with the implementation thought of the process described in the steps 601-603, and is not repeated herein. If the route matched with the route prefix to be deleted cannot be found, the route state in the corresponding dependency relationship chain is updated to be the state to be analyzed, and the dependency relationship chain is deleted.
The embodiment also provides a specific storage form of the corresponding dependency chain, as shown in fig. 9, which is a route storage structure and an INH storage structure. The route storage structure stores a route and an INH parsing linked list (i.e., a parsing_inh_list shown in fig. 9), and the INH parsing linked list is mounted with an INH using the route as a parsing route. The INH is located in a corresponding INH storage structure, and the INH storage structure further stores a reference route link table (i.e., reference_route_list shown in fig. 9), where the reference route link table is used to mount a fourth route of which the next hop is the INH, so as to form a dependency relationship of the fourth route depending on the analytical route of the INH. The INH storage structure also stores a resolution_route, i.e. a pointer to the resolved route of the INH. So that a corresponding dependency chain can be obtained by each pointer between the route and INH.
Example 3:
fig. 10 is a schematic diagram of an architecture of a routing iteration device according to an embodiment of the present invention. The route iteration device of the present embodiment includes one or more processors 21 and a memory 22. In fig. 10, a processor 21 is taken as an example.
The processor 21 and the memory 22 may be connected by a bus or otherwise, which is illustrated in fig. 10 as a bus connection.
The memory 22 serves as a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the routing iteration method in embodiment 1. The processor 21 performs the route iteration method by running non-volatile software programs and instructions stored in the memory 22. The memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 22 may optionally include memory located remotely from processor 21, which may be connected to processor 21 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The program instructions/modules are stored in the memory 22, which when executed by the one or more processors 21, perform the route iteration method of embodiment 1 described above, e.g., perform the various steps shown in fig. 1-4 and 8 described above.
It should be noted that, because the content of information interaction and execution process between modules and units in the above-mentioned device and system is based on the same concept as the processing method embodiment of the present invention, specific content may be referred to the description in the method embodiment of the present invention, and will not be repeated here.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the embodiments may be implemented by a program that instructs associated hardware, the program may be stored on a computer readable storage medium, the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (10)

1. A method of route iteration, comprising:
establishing a dependency relationship among routes according to the next hop of each route in the routing table;
when route change occurs, updating the dependency relationship among the routes;
according to the dependency relationship among the routes, carrying out iterative updating of the routes; and generating the routing path of the relying party according to the routing path of the relied party in a section of the dependency relationship, thereby realizing iterative updating of the routing of the relying party.
2. The route iteration method of claim 1, wherein the establishing a dependency relationship between routes according to a next hop of each route in the routing table specifically comprises:
If the next hop of the first route is indirect next hop INH, finding out an analytical route of the INH, and establishing a dependency relationship of the first route depending on the analytical route; the analytical route of the INH is an activation route which is longest matched with the INH destination prefix.
3. The route iteration method according to claim 1, wherein the performing the iterative update of the route according to the dependency relationship between routes specifically includes:
establishing a dependency chain according to a first dependency relationship taking the transit route as a relying party and a second dependency relationship taking the transit route as a relied party; wherein in the dependency chain, a second relying party depends on the transit route, and the transit route depends on a first relied party, which is a relied party in a first dependency relationship; the second relying party is a relying party in a second dependency relationship;
according to the dependency chain, performing iterative updating of the route; and triggering the iterative updating of the upper layer route in the dependency chain after the iterative updating of the lower layer route in the dependency chain.
4. The route iteration method of claim 1, wherein updating the dependency relationship between routes when the first active route is newly added in the route table comprises:
Searching a second route with the next hop as the first INH in the routes with all the next hops as indirect next hops INH; wherein the first INH is an INH matched with the first active route destination prefix;
if the first INH does not have the analysis route, the first activation route is used as the analysis route of the first INH, and the dependency relationship of the second route depending on the analysis route of the first INH is established;
if the first INH has an analysis route and the destination prefix of the first activation route is longer than the destination prefix of the analysis route, updating the analysis route of the first INH according to the first activation route and updating the dependency relationship taking the second route as a relying party;
otherwise, the dependency relationship between routes is not updated.
5. The route iteration method of claim 4, wherein updating the resolved route of the first INH according to the first active route specifically comprises:
sequentially and iteratively acquiring an iteration path of the first INH under the condition that the first activation route is assumed to be the analysis route of the first INH; the iteration path of the first INH specifically includes: starting from a first INH, iterating to obtain a set of INH sequences;
If the INH obtained by the latest iteration exists in the iteration path obtained by the last iteration in the process of obtaining the iteration path of the first INH, not updating the analysis route of the first INH;
otherwise, taking the first activation route as a new analysis route, and replacing the original analysis route of the first INH by using the new analysis route.
6. The route iteration method of claim 4, wherein when a first active route is newly added to the routing table, the iterative updating of the route is performed according to the dependency relationship between routes, and further comprising:
finding all routes directly or indirectly depending on the second route to form a corresponding dependence relation chain;
and updating the second route according to the first activated route, and sequentially triggering the iterative updating of each route in the dependency chain by the iterative updating of the second route.
7. The route iteration method of claim 1, wherein said updating the dependency relationship between the routes when the second active route is deleted from the routing table, further comprises:
searching a third route with the next hop as a second INH in the routes with all the next hops as indirect next hops INH; wherein the second INH is an INH using the second activation route as a resolution route;
After deleting the second active route, searching whether a third active route matched with the second INH destination prefix exists in the routing table; if so, updating the analysis route of the second INH according to a third activation route which is longest matched with the second INH destination prefix, and updating a dependency relationship taking the third route as a relying party;
if there is no third active route matching the second INH destination prefix, deleting the resolved route of the second INH and making the third route and all routes directly or indirectly dependent on the third route enter an inactive state.
8. The route iteration method of claim 1, wherein the dependency relationship is represented by a route storage structure and an INH storage structure;
the routing storage structure stores a routing and an INH analysis linked list, and the INH analysis linked list is provided with an INH taking the routing as an analysis routing;
the INH is located in a corresponding INH storage structure, and the INH storage structure is further stored with a reference route linked list, wherein the reference route linked list is used for mounting a fourth route of which the next hop is the INH, so that a dependency relationship of the fourth route depending on the analytical route of the INH is formed.
9. The route iteration method of claim 1, wherein the routing table is stored in the form of an AVL tree structure and indexed by network prefix and network prefix length.
10. A route iteration apparatus, the apparatus comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor for performing the routing iteration method of any one of claims 1-9.
CN202310407124.0A 2023-04-11 2023-04-11 Route iteration method and device Pending CN116389346A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310407124.0A CN116389346A (en) 2023-04-11 2023-04-11 Route iteration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310407124.0A CN116389346A (en) 2023-04-11 2023-04-11 Route iteration method and device

Publications (1)

Publication Number Publication Date
CN116389346A true CN116389346A (en) 2023-07-04

Family

ID=86980497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310407124.0A Pending CN116389346A (en) 2023-04-11 2023-04-11 Route iteration method and device

Country Status (1)

Country Link
CN (1) CN116389346A (en)

Similar Documents

Publication Publication Date Title
US10574574B2 (en) System and method for BGP sFlow export
US6968393B1 (en) Method and apparatus for an attribute oriented routing update
US20150381557A1 (en) Container name server and method for container name resolution
US9143335B2 (en) Multicast route cache system
US8565247B2 (en) Techniques for efficiently updating routing information upon shortest path tree computation
US20140211800A1 (en) Accelerated MAC address resolution for IPv6 traffic with IS-IS Protocol
US20130322298A1 (en) Network Topology Discovery
US20140092762A1 (en) Techniques for efficiently updating routing information
CN110138663B (en) Method for implementing new generation network using data as center
CN107707474B (en) Route distribution method and system
JP6195014B2 (en) COMMUNICATION SYSTEM, COMMUNICATION METHOD, RELAY DEVICE, AND COMMUNICATION PROGRAM
CN104380289B (en) Service-aware distributed hash table is route
WO2017190559A1 (en) Routing searching method, device, allocation node, searching node, and ingress node
CN106803809B (en) Message forwarding method and device
CN108696438A (en) The retransmission method and device of BIER messages
US10536368B2 (en) Network-aware routing in information centric networking
CN110234147A (en) The static routing dispositions method of lighting control system network
CN105282041A (en) Method and device of flooding on the basis of ISIS (intermediate system to intermediate system)
CN110233801B (en) Route updating method and device
US11689442B2 (en) Routing in fat tree networks using negative disaggregation advertisements
US7969995B2 (en) Method and apparatus for constructing a forwarding database for a data communications network
CN114338524A (en) Method and system for improving large-scale container cloud cluster network Service performance
CN111245725B (en) Future network implementation method based on distribution
US7334048B1 (en) Method and apparatus for fast route table update
CN113810274A (en) Route processing method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination