Background technology
BGP (BorderGatewayProtocol, Border Gateway Protocol) is a kind of for the dynamic routing protocol between AS (AutonomousSystem, autonomous system).The classical definition of one autonomous system is the set of router under an administrative organization controls, and it uses IGP (InteriorGatewayProtocol, Interior Gateway Protocol) and common metric value to E-Packet to other autonomous systems.
Every route is intended to the next hop address of its correspondence, and for common route, its next hop address is in the direct-connected network segment of router.In BGP, due to the particularity of agreement itself, the next hop address of the route that it produces is not likely to be the neighbours that current router is joined directly together.A kind of common reason includes: do not change down hop when issuing routing iinformation between IBGP (Interior Border Gateway Protocol).Another kind causes that the next hop address of route entry is not the situation of the same network segment address of certain interface of router and is: static configuration route.
In this case, in order to message is correctly forwarded, router must first find one directly up to address (searching the IGP route table items set up), arrive the down hop of instruction in routing table by this address.In above process, the route going to direct reachable address is referred to as dependence route, and router depends on these routes and instructs message to forward.The process relying on route is found to be exactly route iteration (recursion) according to next hop address.Needing the route being iterated can be static routing, BGP route etc., is called that iteration route.Route iteration function can make route table items relatively more flexible, does not rely on specific interface.
Owing to route learning, iteration are dynamic and complicated processes, in above process it is possible that one be routed across successive ignition after iterate to self situation, this phenomenon is called the loop iteration of route.Such as, under application-specific scene, such as manual configuration two route, they backup each other, simultaneously again can load balancing, as shown in Figure 1, this networking includes router A, B, C and service server Server1, Server2, and the IP address that IP address is 1.1.1.1, Server2 of Server1 is 2.2.2.2.The route table items of configuration access server following (form is: destination address/mask down hop) on router A:
RT1:1.1.1.1/32serial0
RT2:2.2.2.2/32serial1
RT3:1.1.1.1/322.2.2.2
RT4:2.2.2.2/321.1.1.1
Wherein, RT1 and RT3 is equal-cost route, and they backup each other, and RT2 and RT4 is equal-cost route, and they backup each other.RT3 and RT4 is the route of manual configuration, its next hop address be not directly up to address, route for iteration.Under this scene, in fact it could happen that loop iteration, for instance:
When RT3 is carried out route iteration, using the next hop address 2.2.2.2 of RT3 as destination address find the next hop address of RT2, RT2 be directly up to address;RT3 iterates to after on RT2, forms equal-cost route with RT1, and RT1 is the dependence route of RT4, therefore triggers RT4 iteration again;
After RT4 iterates to equal-cost route (RT1, RT3) again, form equal-cost route with RT2, and RT2 is the dependence route of RT3, therefore RT3 iteration again is again triggered, RT3 iterates to again equal-cost route (RT2, RT4), thus again triggering RT4 iteration again, constantly circulates.
Router is required to detection and stops loop iteration.
Detailed description of the invention
On the router during configuration static routing, or bgp router from neighbours' bgp router receive BGP route time, be typically due to the down hop of this route be not this router directly up to address, thus trigger and carry out route iteration.After route iteration completes, route iteration result can be issued local routing table by router, in order to use this route iteration result to instruct message to forward, and for bgp router, also can continue iteration result to spread to neighbours' bgp router.
In practical application, the master control borad of some router is configured with RIB (RoutingInformationBase, Routing information database) table, cable card board is configured with FIB (ForwardingInformationBase, forwarding information database) table, for this router, in the RIB table of router master control borad, generally configure static routing, or bgp router receives from neighbours' bgp router and is configured to the RIB table of master control borad after BGP route, now can trigger router master control borad and this route is carried out route iteration.After route iteration completes, route iteration result can be issued in the fib table of cable card board by router master control borad.
Route iteration process in above-mentioned flow process has been improved by the embodiment of the present invention.
In the embodiment of the present invention, router records the Iterative path information of iteration route in route iteration process, and the Iterative path information of this iteration route according to record, judge current iteration to dependence route for described iteration route maybe this dependence itself route iteration route in occurred out-of-date, in the routing table except when the front lookup dependence route in the route beyond route that relies on iterated to carries out route iteration, if iteration failure in continuing iterative process, then stop iterative process, to avoid the occurrence of loop iteration.
Considering to be generally directed to an iteration route in route iteration process, can iterate to a plurality of route, these route each self-corresponding Iterative path and are called subpath, and the set of all subpaths is called the Iterative path that this iteration route.If iterating to a plurality of equal-cost route, and these equal-cost routes have identical forwarding information (such as outgoing interface or tunnel), in such cases, subpath the shortest for length in subpath corresponding to these equal-cost routes is retained by router, and other subpath is deleted, to guarantee iteration to go out the forwarding information of redundancy.After carrying out the process of above-mentioned redundant forwarding information, router judges that whether the Iterative path that the obtained Iterative path of this route iteration process and this iteration route previous route iteration process obtained is identical, if identical, then stops route iteration process.
Fig. 2 illustrates the route iteration flow process that the embodiment of the present invention provides.Generally, when situations below occurs, iteration route is carried out route iteration by triggering:
Situation 1: manual configuration static state iteration route on the router;
Situation 2: receive BGP route from other router;
Situation 3: the route that iteration route relies on changes, i.e. the route prefix that iteration route relies on there occurs change, it is necessary to iteration route iteration again.Here, the route prefix of dependence becomes of equal value from wall scroll.Such as, this iteration route RTA had be carried out route iteration, but worked as route and the RTC formation equal-cost route that RTB iteration goes out, and RTC is the dependence route of RTA, now triggers RTA and re-starts route iteration.
As in figure 2 it is shown, this flow process comprises the steps that
Step 201, the master control borad of router address for the purpose of the next hop address that iteration route, in the RIB table of master control borad search next hop address directly up to route, carry out route iteration, obtain Iterative path and record Iterative path.
In this step, the next hop address found in the routing table directly up to route, it is common that IGP route.Match iteration route, and when this iteration route the outgoing interface that iteration goes out this router, also include this iteration route.
In an iterative process, Iterative path according to record judges, as occurred iterating to iteration route itself, or identical rely on route occur more than once in same Iterative path, then it is judged to that loop iteration occurs, in RIB table (do not comprise be currently found dependence route) is needed to continue to search for relying on route, until finding is not dependence route or the iteration failure of loop iteration.
Step 202, after iteration completes, judges whether there is, in the route iterated to, the equal-cost route that forwarding information is identical according to the Iterative path of record, if it has, then proceed to step 203, otherwise proceeds to step 204.
In this step, if going out a plurality of equal-cost route for a route iteration, then check for the situation that forwarding information is identical, if it is present only retain the shortest in the Iterative path of these equal-cost routes one, to guarantee iteration to go out the forwarding information of redundancy.Wherein, for common route, described forwarding information can be interface or down hop;Routeing for MPLS (Multi-ProtocolLabelSwitching, multiprotocol label switching), described forwarding information can be tunnel relevant information, such as Tunnel Identifier.
Step 203, selects the path that length is the shortest from the subpath corresponding to the equal-cost route that forwarding information is identical, is retained in Iterative path, is deleted by other subpath from Iterative path.Then step 204 is proceeded to.
Step 204, it is judged that whether current iteration path and this iteration route previous Iterative path identical, if identical, then terminate route iteration process;Otherwise, step 201 is proceeded to during the iteration again that is once triggered on this iteration route.
If the route iterated in above-mentioned flow process and the IGP route equivalence in routing table, and when this IGP route is the dependence route that other iteration route, then triggers and this other iteration route is carried out iteration again.Again the iterative process of other iteration described route is similar with above-mentioned flow process, does not repeat them here.
In above-mentioned flow process, by Iterative path record in the RIB table of master control borad, certainly can be arranged to the data structure of record Iterative path information also for iteration route, and Iterative path record iteration being route is in this data structure.
Considering that substantial amounts of iteration route is likely to have identical Iterative path, for this situation, Iterative path can be carried out multiplexing by the embodiment of the present invention, in order to save internal memory, improves treatment effeciency.Concrete, the data structure of record Iterative path information can be arranged to, Iterative path record iteration being route is in this data structure, if there being multiple iteration route to have identical Iterative path, then for these iteration route a Iterative path information of only record, if namely multiple iteration route has identical Iterative path, then corresponding to a little iteration route record portion Iterative path.
By above-mentioned flow process, the identical route that relies on can only occur once on wall scroll Iterative path, once identical dependence route occurs on wall scroll iteration route, then show that this Iterative path there occurs loop iteration, now stop iterative process, so can in time, accurately detect and stop iteration, to avoid the occurrence of Routing loops.
Below still for the scene shown in Fig. 1, the route iteration flow process that the invention process provides is described.
As it is shown in figure 1, this networking includes router A, B, C and service server Server1, Server2, the IP address that IP address is 1.1.1.1, Server2 of Server1 is 2.2.2.2.As follows in the route having route on A configuration access server:
RT1:1.1.1.1/32serial0
RT2:2.2.2.2/32serial1
RT3:1.1.1.1/322.2.2.2
RT4:2.2.2.2/321.1.1.1
First, RT3 due to down hop be not directly up to, iterate on RT2, its iterative process is: for the purpose of next hop address 2.2.2.2 address search in RIB table next hop address directly up to route, find RT2, using the outgoing interface of RT2 as the outgoing interface record of RT3 in RIB routing table, iteration success, produce Iterative path:
2.2.2.2----> 2.2.2.2/32serial1
After the success of RT3 iteration, form equal-cost route with RT1.
RT4 due to down hop neither directly up to, iterate on equal-cost route (RT1, RT3), its iterative process is: for the purpose of next hop address 1.1.1.1 address search in RIB table next hop address directly up to route, find RT1 and RT3 (wherein RT3 outgoing interface after above-mentioned route iteration it was confirmed that on this router).Respectively using the outgoing interface of RT1 and RT3 as the outgoing interface record of RT4 in RIB routing table, produce Iterative path, including 2 single sub path 1 and 2:
1.1.1.1---> [1] 1.1.1.1/32serial0
[2] 1.1.1.1/322.2.2.2----> 2.2.2.2/32serial1
After the success of RT4 iteration, equal-cost route is formed with RT2, trigger RT3 iteration again, its iterative process is: for the purpose of next hop address 2.2.2.2 address search in RIB table next hop address directly up to route, find RT2 and RT4 (wherein RT3 outgoing interface after above-mentioned route iteration it was confirmed that on this router), produce Iterative path, including 3 single sub path 1,2,3:
2.2.2.2----> [1] 2.2.2.2/32serial1
[2] 2.2.2.2/321.1.1.1----> 1.1.1.1/32serial0
[3] 1.1.1.1/322.2.2.2----> 2.2.2.2/32serial1
In this Iterative path, subpath 1 identical with 3 forwarding informations (namely outgoing interface is identical), therefore only retain the subpath 1 that Iterative path is shorter, obtain revised Iterative path:
2.2.2.2----> [1] 2.2.2.2/32serial1
[2] 2.2.2.2/321.1.1.1----> 1.1.1.1/32serial0
Owing to RT3 is the dependence route of RT4, after RT3 iteration again, result is different from last iteration, therefore triggers RT4 iteration again, obtains Iterative path:
1.1.1.1----> [1] 1.1.1.1/32serial0
[2] 1.1.1.1/322.2.2.2----> 2.2.2.2/32serial1
[3] 2.2.2.2/321.1.1.1----> 1.1.1.1/32serial0
In this Iterative path, subpath 1 identical with 3 forwarding informations (namely outgoing interface is identical), therefore only retain the subpath 1 that Iterative path is shorter, obtain revised Iterative path:
1.1.1.1----> [1] 1.1.1.1/32serial0
[2] 1.1.1.1/322.2.2.2----> 2.2.2.2/32serial1
After RT4 iteration again, iteration result is identical with the last time, therefore stops iteration.
So far, above-mentioned route iteration process terminates.
Application the above embodiment of the present invention, it is possible not only to solve loop iteration problem, the mutually redundant network application utilizing loop iteration to realize can also be supported, such as, in the network architecture shown in above-mentioned Fig. 1, by the route RT1 of static configuration, RT2, RT3, RT4, actually it is configured with a plurality of mutually redundant forward-path, accurately iteration can go out effective forwarding information and will not ceaselessly iteration in the scenario above.
It should be noted that above-described embodiment describes for router, the equipment with above-mentioned functions can also is that switching equipment, such as three-tier switch.Here, the equipment with the function that the embodiment of the present invention provides is referred to as route exchange device.
Based on identical technology design, the embodiment of the present invention additionally provides a kind of route exchange device, can be applicable to above-mentioned flow process.
Referring to Fig. 3, for the route exchange device that the embodiment of the present invention provides, this equipment can include master control borad 31 and cable card board 32, and master control borad 31 comprises the steps that
Route iteration module 311, for when route iteration is triggered, carrying out route iteration process to iteration route;Wherein, the Iterative path of iteration route is recorded in carrying out route iteration process, and the Iterative path of this iteration route according to record, judge current iteration to dependence route for described iteration route maybe this dependence itself route iteration route in occurred out-of-date, in the routing table except when front iterate to rely on route beyond route in search dependence route carry out route iteration;
Route sending-down module 312, for being issued in the routing table of cable card board 32 by the iteration result of route iteration module 311, in order to instruct message to forward.
Further, route iteration module 311 is additionally operable to: if in the routing table except when front iterate to rely on route beyond route in, do not find dependence route, then stop route iteration process.
Further, route iteration module 311 is additionally operable to: if obtaining a plurality of equal-cost route for an iteration route iteration, and the forwarding information of described a plurality of equal-cost route is identical, then according to the iteration subpath that described a plurality of equal-cost route is corresponding, iteration subpath the shortest for wherein length is retained in the Iterative path of this iteration route, other iteration subpath is deleted from the Iterative path that this iteration route;Judge that whether the Iterative path that the obtained Iterative path of this route iteration process and this iteration route previous route iteration process obtained is identical, if identical, then stop route iteration process.Wherein, described forwarding information includes outgoing interface or the Tunnel Identifier of route.
Concrete, route iteration module 311 is when the Iterative path that two or more iteration route is identical, corresponding to having the iteration route of identical Iterative path, and the only a Iterative path of record.
In sum, the embodiment of the present invention passes through the Iterative path that superposition record is complete in route iteration process, and check that the identical route that relies on only occurs once on wall scroll Iterative path based on this, a plurality of Iterative path to a route, Iterative path according to the preferred identical forwarding information of Iterative path length, realize the accurately detection of loop iteration, stop iteration in time, and realize mutually redundant network application.
It will be appreciated by those skilled in the art that the module in the device in embodiment can describe according to embodiment to carry out being distributed in the device of embodiment, it is also possible to carry out respective change and be disposed other than in one or more devices of the present embodiment.The module of above-described embodiment can merge into a module, it is also possible to is further split into multiple submodule.
Through the above description of the embodiments, those skilled in the art is it can be understood that can add the mode of required general hardware platform by software to the present invention and realize, naturally it is also possible to by hardware, but in a lot of situation, the former is embodiment more preferably.Based on such understanding, the part that prior art is contributed by technical scheme substantially in other words can embody with the form of software product, this computer software product is stored in a storage medium, including some instructions with so that a station terminal equipment (can be mobile phone, personal computer, server, or the network equipment etc.) perform the method described in each embodiment of the present invention.
The above is only the preferred embodiment of the present invention; it should be pointed out that, for those skilled in the art, under the premise without departing from the principles of the invention; can also making some improvements and modifications, these improvements and modifications also should look protection scope of the present invention.