CN104935508A - Method and device for preventing routing loop - Google Patents
Method and device for preventing routing loop Download PDFInfo
- Publication number
- CN104935508A CN104935508A CN201410101284.3A CN201410101284A CN104935508A CN 104935508 A CN104935508 A CN 104935508A CN 201410101284 A CN201410101284 A CN 201410101284A CN 104935508 A CN104935508 A CN 104935508A
- Authority
- CN
- China
- Prior art keywords
- route
- command message
- new route
- router
- path
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000012544 monitoring process Methods 0.000 claims description 8
- 230000005540 biological transmission Effects 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 abstract description 3
- 230000009191 jumping Effects 0.000 description 24
- 230000008859 change Effects 0.000 description 6
- 230000008901 benefit Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000004590 computer program Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000013439 planning Methods 0.000 description 1
- 239000002574 poison Substances 0.000 description 1
- 231100000614 poison Toxicity 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method and a device for preventing routing loop. The method and the device relate to the communication field and can improve a route convergence speed and eliminates a hop number restriction for a maximal network diameter of a routing information protocol when the routing loop occurs in the route. The method and the device are characterized in that: after the router acquires a new route, when the subnet prefix of the original route of the router is same with that of the new route, the source network address of the original route is different from that of the new route, the path length of the new route is smaller than that of the original route and the path length of the original route is equal with a preset upper limit, the router transmits a command message according to the new route and monitors whether the command message is reduced in a preset time, and if the command message is received in the preset time, the new route is discarded; and if the command message is not received in the preset time, the original route is discarded, and message forwarding is performed according to the new route. The method and the device of the invention are used for preventing routing loop.
Description
Technical field
The present invention relates to the communications field, particularly relate to a kind of method and the device that prevent route loop.
Background technology
Routing information protocol (Routing Information Protocol, be called for short: RIP) as the first generation Routing Protocol so far still support by vast network vendors.Routing information protocol is a kind of Routing Protocol based on distance vector, can support multiple Linktype.Because routing information protocol configuration is simple, left-hand seat is easy, so implemented in a large amount of network plannings.
In practical application, select the problem first needing during route to solve how to prevent Routing Loop
Road.The horizontal segmentation (Split Horizon with poisoned reverse) that route loop method that what routing information protocol was supported prevent comprises horizontal segmentation (Split Horizon), poison with reverse, Trigger update (TriggerUpdate), count to infinity (Infinite Count).Although routing information protocol has the above method preventing route loop, but the inherent shortcoming of the route learning mechanism due to routing information protocol, namely router-A notices route to router B, if router B accepts route, the down hop of label switching path is the network address of router-A, makes routing information protocol not have the concept of macroscopic view for whole network topology.Therefore routing information protocol cannot prevent the appearance of route loop, just needs count to infinity to identify whether to there is route loop, thus prevents route loop from existing.Count to infinity is namely: if represent, the metric (Metric) of the path of route is 16 jumpings to the maximum, then thinks that this route is unreachable, occur route loop, abandon this route when path reaches 16 jumpings.Because the router number in route loop is indefinite, prior art may need when route loop appears in this route repeatedly to circulate in route loop just to judge that this route exists route loop.
So prior art route convergence rate when route loop appears in route is lower, there is the restriction that routing information protocol network maximum network diameter is 16 jumpings simultaneously.
Summary of the invention
Embodiments of the invention provide a kind of method and the device that prevent route loop, the method and device, can be lifted at routing convergence speed when route loop appears in route, and eliminate the jumping figure restriction of routing information protocol network maximum network diameter.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, provides a kind of method preventing route loop, and after router obtains new route, described method comprises:
If whether the path that the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of described router and different, the described router of source network address in described new route calculate described former route equals the predetermined upper limit;
When the path of described former route equals predetermined in limited time upper, described router sends command message according to described new route, and described command message has unique identification;
According to described unique identification, whether described router monitoring receives described command message in the given time;
If described router receives described command message in the given time, described router abandons described new route;
If described router does not receive described command message in the given time, described router abandons described former route, carries out message repeating according to described new route.
In conjunction with first aspect, in the first possible implementation of first aspect, if the path of described former route equals the predetermined upper limit, described router sends command message according to described new route, comprising:
When the path of described former route equals predetermined in limited time upper, described router sends command message described at least one according to described new route within the time period of presetting.
In conjunction with first aspect and the first possible implementation, in the implementation that the second of first aspect is possible, described method also comprises:
If the path of described former route is less than the predetermined upper limit, described router abandons described former route, and the described new route obtained according to described acquiring unit carries out message repeating.
In conjunction with any one in first aspect and the possible implementation of the first or the second, in the third possible implementation of first aspect, described unique identification is made up of the source network address of described command message, the object network address, protocol number and message numbering.
Second aspect, provides a kind of device preventing route loop, comprising:
Acquiring unit, for obtaining new route;
Computing unit, after obtaining described new route for described acquiring unit, if and the path of described new route different with the source network address in described new route of the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of described router is less than the path of described former route, whether the path calculating described former route equals the predetermined upper limit;
Transmitting element, if the path calculating described former route for described computing unit equals the predetermined upper limit, the described new route obtained according to described acquiring unit sends command message, and described command message has unique identification;
Receiving element, for according to described unique identification, monitors the described command message whether receiving described transmitting element in the given time and send;
Updating block, if the described command message receiving the transmission of described transmitting element for described receiving element in the given time, abandons the described new route that described acquiring unit obtains; If described receiving element does not receive the described command message that described transmitting element sends in the given time, abandon described former route;
After described transmitting element also abandons described former route for described updating block, the described new route obtained according to described acquiring unit carries out message repeating.
In conjunction with second aspect, in the first possible implementation of second aspect, the path calculating described former route when described computing unit equals predetermined in limited time upper, and described transmitting element sends command message described at least one specifically for the described new route obtained according to described acquiring unit within the time period of presetting.
In conjunction with second aspect and the first possible implementation, in the implementation that the second of second aspect is possible, the path calculating described former route when described computing unit is less than predetermined in limited time upper, and described updating block abandons described former route; Described transmitting element is also for after abandoning described former route at described updating block, and the described new route obtained according to described acquiring unit carries out message repeating.
In conjunction with second aspect and the possible implementation of the first or the second, in the third possible implementation of second aspect, described unique identification is made up of the source network address of described command message, the object network address, protocol number and message numbering.
The third aspect, provides a kind of signal processing apparatus, comprising: receiver, processor, transmitter, memory and bus, and wherein, described receiver, described processor, described transmitter and described memory are interconnected by described bus,
Wherein, described receiver, for obtaining new route;
Described processor, after obtaining described new route for described receiver, if and the path of described new route different with the source network address in described new route of the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of described router is less than the path of described former route, whether the path calculating described former route equals the predetermined upper limit;
Described transmitter, if the path calculating described former route for described processor equals the predetermined upper limit, the described new route obtained according to described receiver sends command message, and described command message has unique identification;
Described receiver, also for monitoring the described command message whether receiving described transmitter in the given time and send, wherein said unique identification is for confirming described command message;
Described processor, if the described command message also receiving the transmission of described transmitter for described receiver in the given time, abandons the described new route that described receiver obtains; If described receiver does not receive the described command message that described transmitter sends in the given time, abandon described former route;
After described transmitter also abandons described former route for described processor, the described new route obtained according to described receiver carries out message repeating.
In conjunction with the third aspect, in the first possible implementation of the third aspect, the path calculating described former route when described processor equals predetermined in limited time upper, and described transmitter sends command message described at least one specifically for the described new route obtained according to described receiver within the time period of presetting.
In conjunction with the third aspect and the first possible implementation, in the implementation that the second of the third aspect is possible, the path calculating described former route when described processor is less than predetermined in limited time upper, and described processor abandons described former route; Described transmitter is also for after abandoning described former route at described processor, and the described new route obtained according to described receiver carries out message repeating.
In conjunction with any one in the third aspect and the possible implementation of the first or the second, in the third possible implementation of the third aspect, described unique identification is made up of the source network address of described command message, the object network address, protocol number and message numbering.
Method and the device of what the embodiment of the present invention provided prevent route loop, whether receive described command message after sending command message with router according to the new route obtained to determine whether carrying out message repeating according to described new route, thus the routing convergence speed improved when route loop appears in new route, and eliminate the jumping figure restriction of routing information protocol network maximum network diameter.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
A kind of schematic flow sheet preventing the method for route loop that Fig. 1 provides for embodiments of the invention;
A kind of schematic flow sheet preventing the method for route loop that Fig. 2 provides for another embodiment of the present invention;
A kind of environment for use schematic diagram preventing the method for route loop that Fig. 3 provides for another embodiment of the present invention;
A kind of structural representation preventing the device of route loop that Fig. 4 provides for embodiments of the invention;
Fig. 5 prevents the structural representation of the device of route loop for another kind that embodiments of the invention provide;
A kind of structural representation preventing the device of route loop that Fig. 6 provides for embodiments of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiments of the invention provide a kind of method preventing route loop, after obtaining new route, with reference to shown in Fig. 1, comprise the following steps for router:
If the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of 101 described routers is different with the source network address in described new route and path that is described new route is less than the path of described former route time, whether the path that described router calculates described former route equals the predetermined upper limit.
The reason so done is, in reality route loop all result from the described new route that described router obtains be with described former route not the more excellent route of homology and described former route open circuit time, now the path of described former route automatically can change to and equal the predetermined upper limit.So, need whether the predetermined upper limit is equaled to the path of described former route and carry out calculating judgement, to confirm that described new route exists the possibility of route loop.When the path of described former route equals predetermined in limited time upper, described new route has the possibility that there is route loop, needs whether there is route loop to described new route and identifies.
102, when the path of described former route equals predetermined in limited time upper, described router sends command message according to described new route, and described command message has unique identification.
Concrete, described unique identification is made up of the source network address of described command message, the object network address, protocol number and message numbering.
103, according to described unique identification, whether described router monitoring receives described command message in the given time, and namely described unique identification is for confirming described command message.
Concrete, with the described command message sent, there is identical uniquely identified command message if receive in the given time, then for have received described command message in the given time; With the described command message sent, there is identical uniquely identified command message if do not receive in the given time, then for not have received described command message in the given time; Be understandable that this router is when again receiving this command message, the time stab information of this command message record and the node skipped be not identical when sending, judge whether here to receive described command message should refer to the actual content of the command message received and the command message sent and unique identification identical.
If 104 described routers receive described command message in the given time, described router abandons described new route.
The reason done like this is, after described router sends command message according to described new route, if described router can receive described command message, then think that described new route exists route loop, described router abandons described new route.
Optionally, when the path of described former route equals predetermined in limited time upper, described router can send command message described at least one according to described new route within the time period of presetting.The benefit so done is, sends multiple described command message and can prevent command message from losing because of network congestion.As long as have received any one in described command message, then think that described new route exists route loop, abandon described new route.
If 105 described routers do not receive described command message in the given time, described router abandons described former route, carries out message repeating according to described new route.
Concrete, abandon described former route at described router, while carrying out message repeating according to described new route, described router can receive described new route by routing information protocol, adds described being newly routed in the routing database of routing information protocol.
The method also comprises: if the path of described former route is less than the predetermined upper limit, described router abandons described former route, carries out message repeating according to described new route.
When there is route loop in the described new route that described router obtains, the above-mentioned method of route loop that prevents adopting the embodiment of the present invention to provide is as follows to the benefit eliminating route loop, there is uniquely identified command message because whether described router sends and monitor to receive in the given time there is unique identification, only once need circulate in described route loop and just can detect and have received described command message, confirm that described new route exists described route loop with this, avoid the existing repeatedly circulation preventing the method for route loop from may cause, thus improve routing convergence speed, avoid the jumping figure restriction of routing information protocol network maximum network diameter.
Such as: the jumping figure of routing information protocol network maximum network diameter is restricted to 16 jumpings at present, when the jumping figure of a route reaches 16 jumping, think that this route is unreachable or produces route loop, if now a route produces route loop, nodes in this route loop is 4, and the jumping figure often completing route loop then this route increases by 4, before there is loop, comprise this 4 nodes in the node formation of this route, therefore jumping figure is at least 4; After there is route loop, need the circulation carrying out 3 route loops between this 4 each node again, the jumping figure of this route just can reach 16 jumpings, trigger the route loop identification of routing information protocol, namely triggers the count to infinity prevented at present in route loop technology; And often once circulate and all need through the minimum scheduled time, confirm that the time of route loop is directly proportional to needing the number of times carrying out route loop circulation, if the described scheduled time is 30 seconds, then completes 3 circulation confirmations and there is route loop, finally complete routing convergence and at least need 90 seconds; If the jumping figure of the maximum network diameter of routing information protocol network is 256 jumpings or larger, then when the route loop of above-mentioned 4 nodes appears in a route, the route loop cycle-index of carrying out can corresponding increase, the acknowledging time needed can be long, routing convergence speed is excessively slow, application is difficult to, so current routing information protocol network just has the jumping figure restriction of maximum network diameter in reality.And the method preventing route loop that embodiments of the invention provide, when a certain route generation route loop, only needing once circulates to this route loop can confirm to there is route loop, thus improve routing convergence speed, also just avoid the jumping figure restriction of routing information protocol network maximum network diameter.
The method of what the embodiment of the present invention provided prevent route loop, whether receive described command message after sending command message with router according to the new route obtained to determine whether carrying out message repeating according to described new route, thus the routing convergence speed improved when route loop appears in described new route, and eliminate the jumping figure restriction of routing information protocol network maximum network diameter.
The embodiment of the present invention provides a kind of method preventing route loop, specifically for running the IPv4(Internet Protocol version4 of routing information protocol, Internet Protocol Version 4) network, with reference to shown in Fig. 2, comprise the following steps:
In order to be illustrated more clearly in the embodiment of the present invention, with reference to shown in Fig. 3, the method for route loop that prevents that the embodiment of the present invention provides is described.Router R1 is to router R5, and be in the interconnective router in the IPv4 network of same use routing information protocol, route loop production process is as follows:
Before route loop produces, router R1 and router R4 connected interface G0/1 disconnects, and router R1 to router R4 is as follows for the routing table of this former route of 100.0.0.0/24:
R1:
100.0.0.0/24Metric:1next-hop:0.0.0.0
R2:
100.0.0.0/24Metric:2next-hop:12.0.0.1
R3:
100.0.0.0/24Metric:3next-hop:23.0.0.2
R4:
100.0.0.0/24Metric:4next-hop:34.0.0.3
Link generation open circuit between router R1 and router R5, the metric of the path of this former route in routing information protocol database is changed to the predetermined upper limit 16 from 1 by router R1, if now router R1 and router R4 connected interface G0/1 becomes path from open circuit, and from interface G0/1 receive router R4 send subnet prefix 100.0.0.0/24 identical, path is the new route of 4, then because the metric of path of routing information protocol database Central Plains route is 16 and newly receive the metric that this new route receives rear path length at described router and become 5, admit the best of the examinees this new route, the former route in routing information protocol database is substituted by this new bar route, routing variable in router R1 database
For:
100.0.0.0/24Metric:5next-hop:14.0.0.4
After router R1 this new routing update in routing information protocol database, the metric being not only path changed, also have down hop (next-hop) to become 14.0.0.4 from 0.0.0.0, now router R1 is as follows for the routing table of this route of 100.0.0.0/24 to router R4:
R1:
100.0.0.0/24Metric:5next-hop:14.0.0.4
R2:
100.0.0.0/24Metric:2next-hop:12.0.0.1
R3:
100.0.0.0/24Metric:3next-hop:23.0.0.2
R4:
100.0.0.0/24Metric:4next-hop:34.0.0.3
Now, because former route is replaced upgrading by the new route producing route loop, network condition is abnormal, and subnet prefix is that route loop appears in the route of 100.0.0.0/24.For these reasons, when above-mentioned route loop appears in new route, for router R1, route loop is prevented by following steps.
201, router obtains new route.
Concrete, router R1 obtains subnet prefix that router R4 sends to be 100.0.0.0/24 path be 4 new route, routing table is as follows:
R4:
100.0.0.0/24Metric:4next-hop:34.0.0.3
202, described router judges whether the path of described new route equals the predetermined upper limit.
Concrete, with reference to shown in Fig. 3, router R1 judges above-mentioned subnet prefix is whether the path of the new route of 100.0.0.0/24 equals 16.
203, when the path of described new route is less than predetermined in limited time upper, the path of described router to described new route adds 1.
Concrete, with reference to shown in Fig. 3, now the path of router R1 to above-mentioned subnet prefix to be 100.0.0.0/24 path the be new route of 4 adds 1 and becomes 5, and routing table becomes:
R1:
100.0.0.0/24Metric:5next-hop:14.0.0.4
204, described router judges that whether the subnet prefix in the former route of described router is identical with the subnet prefix in described new route.
The method also comprises:
With reference to the result that step 202 draws, when the path of described new route equals predetermined in limited time upper, perform step 204.
205, when described new route is identical with the subnet prefix of described former route, described router judges that whether described new route is identical with the source network address of described former route.
206, when described new route is not identical with the source network address of described former route, whether the path that described router calculates described new route equals the predetermined upper limit.
207, when the path of described new route is less than predetermined in limited time upper, described router judges whether the path of described new route is less than the path of described former route.
208, when the path of described new route is less than the path of described former route, whether the path that described router calculates described former route equals the predetermined upper limit.
The reason so done is, in reality route loop all result from the described new route that described router obtains be with described former route not the more excellent route of homology and described former route open circuit time, now the path of described former route automatically can change to and equal the predetermined upper limit.So need whether equal the predetermined upper limit 16 to the path of described former route to carry out calculating judgement, to confirm that described new route exists the possibility of route loop, when the path of described former route equals the predetermined upper limit 16, there is the possibility of route loop in described new route, needs whether there is route loop to described new route and identify.
209, when the path of described former route equals predetermined in limited time upper, described router sends command message according to described new route, and described command message has unique identification.
Concrete, with reference to shown in Fig. 3, router R1 sends the PING message (command message) that an object network address is the network address of 100.0.0.0/24 subnet prefix, TTL(Time To Live, life span) be 64; And specify the down hop of this command message to be 14.0.0.4, that is: message outgoing interface is G0/1, the described object network address is by ARP(Address Resolution Protocol, address resolution protocol) MAC(Medium/Media AccessControl that the next-hop ip address 14.0.0.4 that obtains is corresponding, medium access control) address, described source network address is the MAC Address of message outgoing interface G0/1.
Router R1 records the source network address of this command message, the object network address, protocol number and the message numbering unique identification as this command message.And filter condition is set on the total interface of router R1, whether monitoring can receive this command message.
210, whether described router monitoring receives described command message in the given time, and wherein said unique identification is for confirming described command message.
Concrete, with reference to shown in Fig. 3, if router R1 receives the described command message sent with himself in the given time have identical uniquely identified command message, then for have received described command message in the given time; With the described command message sent, there is identical uniquely identified command message if do not receive in the given time, then for not have received described command message in the given time.The described scheduled time can be set as 2 seconds.
211, when described router receives described command message in the given time, described router abandons described new route.
The reason done like this is, with reference to shown in Fig. 3, after router R1 sends command message according to described new route, if router can receive described command message described in router R1, then think that described new route exists route loop, if router R1 accepts this new route, in whole network, there will be the route loop that subnet prefix is 100.0.0.0/24, so abandon this new route.
The router R1-router R4 existed in route loop because of this all carries out above-mentioned steps, so now routing table change is as follows:
R2:metric2→6
R3:metric3→7
R4:metric4→8
Known, after router R1 obtaining above-mentioned new route, just because receiving described command message in the given time, thus the judgement that this new route exists route loop can be made through once circulating, abandoning this new route.
Optionally, when the path of described former route equals predetermined in limited time upper, router R1 can send 3 described command messages according to described new route within the time period of presetting, the time period of presetting can be 2 seconds, the benefit so done is, sends multiple described command message and can prevent command message from losing because of network congestion, as long as have received any one in 3 command messages, then think that the words accepting this new route there will be route loop, abandon this new route.
The method also comprises: the result drawn with reference to step 206, and when the path of described new route equals predetermined in limited time upper, described router abandons described new route.
With reference to the result that step 207 draws, when the path of described new route is not less than the path of described former route, described router abandons described new route.
212, when described router does not receive described command message in the given time, described router abandons described former route, carries out message repeating according to described new route.
Concrete, abandon described former route at described router, while carrying out message repeating according to described new route, described router can receive described new route by routing information protocol, adds described being newly routed in the routing database of routing information protocol.
The method also comprises: the result drawn with reference to step 205, when described new route is identical with the source network address of described former route, described router abandons described former route, carries out message repeating according to described new route.
With reference to the result that step 208 draws, when the path of described former route is less than predetermined in limited time upper, described router abandons described former route, carries out message repeating according to described new route.
Also following methods is comprised after step 204:
213, when described new route is not identical with the subnet prefix of described former route, whether the path that described router calculates described new route equals the predetermined upper limit.
Further, when the path of described new route equals the predetermined upper limit, with reference to step 211, described router abandons described new route; When the path of described new route is less than the predetermined upper limit, with reference to step 212, described router abandons described former route, carries out message repeating according to described new route.
With reference to shown in Fig. 3, when occurring that above-mentioned subnet prefix is the route loop of 100.0.0.0/24, as follows by the existing process preventing the method for route loop from making route loop disappear:
In reality, the router running routing information protocol can send by the interface running routing information protocol the keep-alive realizing route the route in routing information protocol database in every 30 seconds.Router R1 waits until 30 seconds of next routing update to router R2 transmission routing update, wherein just comprise this new route that subnet prefix is 100.0.0.0/24, router R2 receives routing update, route processing flow process is received according to routing information protocol, the metric of path adds 1 and becomes 6, check that routing information protocol database finds to exist the former route of same subnet prefix, and the two homology, so unconditionally accept.Upgrade routing information protocol database, routing table change is as follows:
R2:metric2→6
Router R2 waits until that the routing update moment of 30 seconds arrives to router R3 and sends routing update, and similar above-mentioned, R3 upgrades routing information protocol database equally, and routing table change is as follows:
R3:metric3→7
The like:
R4:metric4→8
R1:metric5→9
R2:metric6→10
R3:metric7→11
R4:metric8→12
R1:metric9→13
R2:metric10→14
R3:metric11→15
R4:metric12→16
So far the metric of the path of new route equals the predetermined upper limit 16, and router R1 just existingly can prevent the last count to infinity of route loop method and makes the judgement producing route loop because triggering, and abandons this new route, route loop disappearance.And now circulated in route loop 3 times, the acknowledging time of route loop lasts 90 seconds.Therefore, if network diameter is excessive, the overlength acknowledging time that can produce, so the maximum network diameter being present in routing information protocol network is the restriction of 16 jumpings.
If and router R1 obtain described new route there is route loop time, the above-mentioned method of route loop that prevents adopting the embodiment of the present invention to provide is as follows to the benefit eliminating route loop, there is uniquely identified command message because whether router R1 sends and monitor to receive in the given time there is unique identification, only once need circulate in described route loop and just can detect and have received described command message, confirm that described new route exists described route loop with this, avoid the repeatedly circulation that may cause when using the method for count to infinity to be confirmed whether to there is described route loop, thus improve routing convergence speed, avoid the jumping figure restriction of routing information protocol network maximum network diameter.
The method of what the embodiment of the present invention provided prevent route loop, whether receive described command message after sending command message with router according to the new route obtained to determine whether carrying out message repeating according to described new route, thus the routing convergence speed improved when route loop appears in described new route, and eliminate the jumping figure restriction of routing information protocol network maximum network diameter.
The invention provides a kind of device preventing route loop, for realizing the above-mentioned method preventing route loop, with reference to shown in Fig. 4, comprising:
Acquiring unit 401, for obtaining new route.
Computing unit 402, after obtaining described new route for described acquiring unit 401, if and the path of described new route different with the source network address in described new route of the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of described router is less than the path of described former route, whether the path calculating described former route equals the predetermined upper limit.
Transmitting element 403, if the path calculating described former route for described computing unit 402 equals the predetermined upper limit, the described new route obtained according to described acquiring unit 401 sends command message, and described command message has unique identification.
Optionally, described unique identification is made up of the source network address of described command message, the object network address, protocol number and message numbering.
Receiving element 404, for according to described unique identification, monitors the described command message whether receiving described transmitting element 403 in the given time and send.
Updating block 405, if the described command message receiving the transmission of described transmitting element 403 for described receiving element 404 in the given time, abandons the described new route that described acquiring unit 401 obtains; If described receiving element 404 does not receive the described command message that described transmitting element 403 sends in the given time, abandon described former route.
After described transmitting element 403 also abandons described former route for described updating block 405, the described new route obtained according to described acquiring unit 401 carries out message repeating.
Optionally, the path calculating described former route when described computing unit 402 equals predetermined in limited time upper, and described transmitting element 403 sends command message described at least one specifically for the described new route obtained according to described acquiring unit 401 within the time period of presetting.
Optionally, with reference to shown in Fig. 5:
The path calculating described former route when described computing unit 402 is less than predetermined in limited time upper, and described updating block 405 abandons described former route; Described transmitting element 403 is also for after described updating block 405 abandons described former route, and the described new route obtained according to described acquiring unit 401 carries out message repeating.
The device of what the embodiment of the present invention provided prevent route loop, whether receive described command message after sending command message with router according to the new route obtained to determine whether carrying out message repeating according to described new route, thus the routing convergence speed improved when route loop appears in described new route, and eliminate the jumping figure restriction of routing information protocol network maximum network diameter.
Embodiments of the invention provide a kind of device preventing route loop, with reference to shown in Fig. 6, this prevents the device of route loop from can embed or inherently micro-process computer, such as: all-purpose computer, customization machine, the portable equipment such as mobile phone terminal or purl machine, this prevents the device 601 of route loop for realizing the above-mentioned method preventing route loop, specifically comprise: at least one receiver 611, processor 612, transmitter 613, memory 614 and bus 615, this at least one receiver 611, processor 612, transmitter 613 and memory 614 are connected by bus 615 and complete mutual communication.
This bus 615 can be ISA(Industry Standard Architecture, industry standard architecture) bus, PCI(Peripheral Component, peripheral component interconnect) bus or EISA(ExtendedIndustry Standard Architecture, extended industry-standard architecture) bus etc.This bus 615 can be divided into address bus, data/address bus, control bus etc.For ease of representing, only representing with a thick line in Fig. 6, but not representing the bus only having a bus or a type.Wherein:
Memory 614 is for stores executable programs code, and this program code comprises computer-managed instruction.Memory 614 may comprise high-speed RAM memory, still may comprise nonvolatile memory (non-volatile memory), such as at least one magnetic disc store.
Processor 612 may be a central processing unit (Central Processing Unit, referred to as CPU), or specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), or be configured to the one or more integrated circuits implementing the embodiment of the present invention.
Wherein, described receiver 611, for obtaining new route;
Described processor 612, after obtaining described new route for described receiver 611, if and the path of described new route different with the source network address in described new route of the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of described router is less than the path of described former route, whether the path calculating described former route equals the predetermined upper limit;
Described transmitter 613, if the path calculating described former route for described processor 612 equals the predetermined upper limit, the described new route obtained according to described receiver 611 sends command message, and described command message has unique identification;
Optionally, described unique identification is made up of the source network address of described command message, the object network address, protocol number and message numbering.
Described receiver 611, also for monitoring the described command message whether receiving described transmitter 613 in the given time and send, wherein said unique identification is for confirming described command message;
Described processor 612, if the described command message also receiving the transmission of described transmitter 613 for described receiver 611 in the given time, abandons the described new route that described receiver 611 obtains; If described receiver 611 does not receive the described command message that described transmitter 613 sends in the given time, abandon described former route;
After described transmitter 613 also abandons described former route for described processor 612, the described new route obtained according to described receiver 611 carries out message repeating.
Optionally, the path calculating described former route when described processor 612 equals predetermined in limited time upper, and described transmitter 613 sends command message described at least one specifically for the described new route obtained according to described receiver 611 within the time period of presetting.
Optionally, the path calculating described former route when described processor 612 is less than predetermined in limited time upper, and described processor 612 abandons described former route; Described transmitter 613 is also for after described processor 612 abandons described former route, and the described new route obtained according to described receiver 611 carries out message repeating.
The device preventing route loop provided in this device embodiment, can be in the router integrated, is applied to (as shown in accompanying drawing 1 to accompanying drawing 3) in the application scenarios described by embodiment of the method, realizes the function of wherein router.Other additional functions preventing the device of route loop from can realize and the reciprocal process with other network element devices, please refer to the description of routers in embodiment of the method, here repeat no more.
The device of what the embodiment of the present invention provided prevent route loop, whether receive described command message after sending command message with router according to the new route obtained to determine whether carrying out message repeating according to described new route, thus the routing convergence speed improved when route loop appears in described new route, and eliminate the jumping figure restriction of routing information protocol network maximum network diameter.
One of ordinary skill in the art will appreciate that the possible implementation of various aspects of the present invention or various aspects can be embodied as system, method or computer program.Therefore, the possible implementation of each aspect of the present invention or various aspects can adopt complete hardware embodiment, completely software implementation (comprising firmware, resident software etc.), or the form of the embodiment of integration software and hardware aspect, is all referred to as " circuit ", " module " or " system " here.In addition, the possible implementation of each aspect of the present invention or various aspects can adopt the form of computer program, and computer program refers to the computer readable program code be stored in computer-readable medium.
Computer-readable medium can be computer-readable signal media or computer-readable recording medium.Computer-readable recording medium is including but not limited to electronics, magnetic, optics, electromagnetism, infrared or semiconductor system, equipment or device, or aforesaid appropriately combined arbitrarily, as random access memory (RAM), read-only memory (ROM), Erasable Programmable Read Only Memory EPROM (EPROM or flash memory), optical fiber, portable read-only memory (CD-ROM).
Processor in computer reads the computer readable program code be stored in computer-readable medium, makes processor can perform the function action specified in the combination of each step or each step in flow charts; Generate the device implementing the function action specified in the combination of each block of block diagram or each piece.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.
Claims (10)
1. prevent a method for route loop, it is characterized in that, after router obtains new route, described method comprises:
And if the path of described new route different with the source network address in described new route of the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of described router is less than the path of described former route, whether the path that described router calculates described former route equals the predetermined upper limit;
When the path of described former route equals predetermined in limited time upper, described router sends command message according to described new route, and described command message has unique identification;
According to described unique identification, whether described router monitoring receives described command message in the given time;
If described router receives described command message in the given time, described router abandons described new route;
If described router does not receive described command message in the given time, described router abandons described former route, carries out message repeating according to described new route.
2. method according to claim 1, is characterized in that, if the path of described former route equals predetermined in limited time upper, described router sends command message according to described new route, comprising:
When the path of described former route equals predetermined in limited time upper, described router sends command message described at least one according to described new route within the time period of presetting.
3. method according to claim 1 and 2, is characterized in that, described method also comprises:
If the path of described former route is less than the predetermined upper limit, described router abandons described former route, carries out message repeating according to described new route.
4. the method according to any one of claim 1-3, is characterized in that, described unique identification is made up of the source network address of described command message, the object network address, protocol number and message numbering.
5. prevent a device for route loop, it is characterized in that, comprising:
Acquiring unit, for obtaining new route;
Computing unit, after obtaining described new route for described acquiring unit, if and the path of described new route different with the source network address in described new route of the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of described router is less than the path of described former route, whether the path calculating described former route equals the predetermined upper limit;
Transmitting element, if the path calculating described former route for described computing unit equals the predetermined upper limit, the described new route obtained according to described acquiring unit sends command message, and described command message has unique identification;
Receiving element, for according to described unique identification, monitors the described command message whether receiving described transmitting element in the given time and send;
Updating block, if the described command message receiving the transmission of described transmitting element for described receiving element in the given time, abandons the described new route that described acquiring unit obtains; If described receiving element does not receive the described command message that described transmitting element sends in the given time, abandon described former route;
After described transmitting element also abandons described former route for described updating block, the described new route obtained according to described acquiring unit carries out message repeating.
6. device according to claim 5, it is characterized in that, the path calculating described former route when described computing unit equals predetermined in limited time upper, and described transmitting element sends command message described at least one specifically for the described new route obtained according to described acquiring unit within the time period of presetting.
7. the device according to claim 5 or 6, is characterized in that, the path calculating described former route when described computing unit is less than predetermined in limited time upper, and described updating block abandons described former route; Described transmitting element is also for after abandoning described former route at described updating block, and the described new route obtained according to described acquiring unit carries out message repeating.
8. the device according to any one of claim 5-7, is characterized in that, described unique identification is made up of the source network address of described command message, the object network address, protocol number and message numbering.
9. a signal processing apparatus, is characterized in that, comprising: receiver, processor, transmitter, memory and bus, and wherein, described receiver, described processor, described transmitter and described memory are interconnected by described bus,
Wherein, described receiver, for obtaining new route;
Described processor, after obtaining described new route for described receiver, if and the path of described new route different with the source network address in described new route of the source network address in identical from the subnet prefix in described new route, the described former route of the subnet prefix in the former route of described router is less than the path of described former route, whether the path calculating described former route equals the predetermined upper limit;
Described transmitter, if the path calculating described former route for described processor equals the predetermined upper limit, the described new route obtained according to described receiver sends command message, and described command message has unique identification;
Described receiver, also for monitoring the described command message whether receiving described transmitter in the given time and send, wherein said unique identification is for confirming described command message;
Described processor, if the described command message also receiving the transmission of described transmitter for described receiver in the given time, abandons the described new route that described receiver obtains; If described receiver does not receive the described command message that described transmitter sends in the given time, abandon described former route;
After described transmitter also abandons described former route for described processor, the described new route obtained according to described receiver carries out message repeating.
10. device according to claim 9, it is characterized in that, the path calculating described former route when described processor equals predetermined in limited time upper, and described transmitter sends command message described at least one specifically for the described new route obtained according to described receiver within the time period of presetting.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410101284.3A CN104935508B (en) | 2014-03-18 | 2014-03-18 | A kind of method and device preventing route loop |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410101284.3A CN104935508B (en) | 2014-03-18 | 2014-03-18 | A kind of method and device preventing route loop |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104935508A true CN104935508A (en) | 2015-09-23 |
CN104935508B CN104935508B (en) | 2019-01-25 |
Family
ID=54122483
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410101284.3A Active CN104935508B (en) | 2014-03-18 | 2014-03-18 | A kind of method and device preventing route loop |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104935508B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108243100A (en) * | 2016-12-27 | 2018-07-03 | 北京华为数字技术有限公司 | The method and apparatus of detection messages loop |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1988476A (en) * | 2006-12-19 | 2007-06-27 | 武汉烽火网络有限责任公司 | Method and device for self adaptive quick loop detection and loop blocking |
CN101267363A (en) * | 2008-04-24 | 2008-09-17 | 杭州华三通信技术有限公司 | Loop testing method, system and device |
CN101425978A (en) * | 2008-12-02 | 2009-05-06 | 中兴通讯股份有限公司 | Method and device for preventing routing loop in autonomous system |
CN101582847A (en) * | 2009-06-12 | 2009-11-18 | 北京航空航天大学 | Routing oscillation test method and autonomous system (AS) |
CN101674241A (en) * | 2009-09-15 | 2010-03-17 | 杭州华三通信技术有限公司 | Method and equipment for avoiding RIP loop circuit in CE dual-homing network |
US20140036913A1 (en) * | 2012-07-31 | 2014-02-06 | Cisco Technology, Inc. | Acknowledged multicast convergence |
-
2014
- 2014-03-18 CN CN201410101284.3A patent/CN104935508B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1988476A (en) * | 2006-12-19 | 2007-06-27 | 武汉烽火网络有限责任公司 | Method and device for self adaptive quick loop detection and loop blocking |
CN101267363A (en) * | 2008-04-24 | 2008-09-17 | 杭州华三通信技术有限公司 | Loop testing method, system and device |
CN101425978A (en) * | 2008-12-02 | 2009-05-06 | 中兴通讯股份有限公司 | Method and device for preventing routing loop in autonomous system |
CN101582847A (en) * | 2009-06-12 | 2009-11-18 | 北京航空航天大学 | Routing oscillation test method and autonomous system (AS) |
CN101674241A (en) * | 2009-09-15 | 2010-03-17 | 杭州华三通信技术有限公司 | Method and equipment for avoiding RIP loop circuit in CE dual-homing network |
US20140036913A1 (en) * | 2012-07-31 | 2014-02-06 | Cisco Technology, Inc. | Acknowledged multicast convergence |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108243100A (en) * | 2016-12-27 | 2018-07-03 | 北京华为数字技术有限公司 | The method and apparatus of detection messages loop |
Also Published As
Publication number | Publication date |
---|---|
CN104935508B (en) | 2019-01-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11658905B2 (en) | Routing control method, device, and system | |
US11831526B2 (en) | Service chain fault detection method and apparatus | |
US10700891B2 (en) | Method for implementing service chain, device, and system | |
RU2682930C2 (en) | Route selection in wireless networks | |
EP3190750B1 (en) | Method and apparatus for generating service path | |
US20230116548A1 (en) | Route Processing Method and Related Device | |
CN111327545B (en) | Data sending method and device, network system and switch | |
US11343153B2 (en) | BGP logical topology generation method, and device | |
CN103746828A (en) | Method and device for network node management | |
CN111327530B (en) | Data sending method and device, network system and switch | |
CN104935508A (en) | Method and device for preventing routing loop | |
CN111327524B (en) | Flow forwarding method and system, SDN controller and computer readable storage medium | |
CN105592054B (en) | A kind for the treatment of method and apparatus of LSP message | |
CN108259292B (en) | Method and device for establishing tunnel | |
CN107612829B (en) | Method and device for acquiring path information of data message | |
CN105847458A (en) | P2P (Peer-to-Peer) caching guiding system and method based on DNS (Domain Name System) | |
CN106612563B (en) | Method and device for establishing SCTP link between network nodes | |
CN109257458A (en) | A kind of message forwarding method and device | |
US11757762B2 (en) | Service operation method and device, and storage medium and electronic device | |
CN113037631A (en) | Address transmission method and network equipment | |
KR100867000B1 (en) | Packet forwarding method for reducing packet loss in router | |
CN116800660A (en) | Method and device for generating forwarding table, storage medium and electronic device | |
JP2018170577A (en) | Communication system, edge router switching control device, edge router switching method, and edge router switching control program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20211223 Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province Patentee after: xFusion Digital Technologies Co., Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |