CN104935508B - A kind of method and device preventing route loop - Google Patents
A kind of method and device preventing route loop Download PDFInfo
- Publication number
- CN104935508B CN104935508B CN201410101284.3A CN201410101284A CN104935508B CN 104935508 B CN104935508 B CN 104935508B CN 201410101284 A CN201410101284 A CN 201410101284A CN 104935508 B CN104935508 B CN 104935508B
- Authority
- CN
- China
- Prior art keywords
- routing
- former
- router
- new
- command message
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000005540 biological transmission Effects 0.000 claims description 27
- 238000012544 monitoring process Methods 0.000 claims description 7
- 238000004891 communication Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 7
- 230000004087 circulation Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000005389 magnetism Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the present application discloses a kind of method and device for preventing route loop, is related to the communications field, can be lifted at routing convergence speed when route loop occurs in routing, and eliminates the hop count limitation of routing information protocol network maximum network diameter.The specific scheme is that router obtains after newly routing, when the former path length for routing identical as the subnet prefix of the new routing, the described former routing new routings different with the source network address of the new routing, described of the router is less than the former path length routed and the former path length routed is equal to the predetermined upper limit, the router sends command message according to the new routing and monitors whether receive the command message in the given time, if receiving the command message in the given time, the new routing is abandoned;If not receiving the command message in the given time, the former routing is abandoned, carries out message forwarding according to the new routing.The application is for preventing route loop.
Description
Technical field
The present invention relates to the communications field more particularly to a kind of method and devices for preventing route loop.
Background technique
Routing information protocol (Routing Information Protocol, referred to as: RIP) is assisted as the routing of the first generation
View is still supported by vast network vendors so far.Routing information protocol is a kind of Routing Protocol based on distance vector, can
Support a variety of Linktypes.Because routing information protocol configuration is simple, upper hand is easy, it is able in a large amount of network planning
Implement.
In practical application, firstly the need of solving the problems, such as it is how to prevent Routing Loop when selection routing
Road.It includes horizontal segmentation (Split Horizon), band that routing information protocol was supported, which prevents route loop method,
Horizontal segmentation (Split Horizon with poisoned reverse), the triggering update (Trigger inversely poisoned
Update), count to infinity (Infinite Count).Although routing information protocol has the above method for preventing route loop,
It is the inherent shortcoming due to the route learning mechanism of routing information protocol, i.e. router A notice is routed to router B, router B
The next-hop of label switching path is the network address of router A if receiving routing, so that routing information protocol is for whole network
Topological not macroscopical concept.Therefore routing information protocol can not prevent the appearance of route loop, and count to infinity is just needed to know
Not Shi Foucun route loop, to prevent route loop from existing.Count to infinity is i.e.: if indicate the path length of routing
Metric (Metric) is up to 16 jumps, then thinks that the routing is unreachable when path length reaches 16 jumps, route loop occurs, lose
Abandon the routing.Because the router number in route loop is indefinite, the prior art may be needed when route loop occurs in the routing
Repeatedly to recycle in route loop just can judge the routing there are route loops.
So prior art routing convergence speed when route loop occurs in routing is lower, routing iinformation association is existed simultaneously
Discussing network maximum network diameter is 16 limitations jumped.
Summary of the invention
The embodiment of the present invention provides a kind of method and device for preventing route loop, this method and device, can be lifted at
There is routing convergence speed when route loop in routing, and eliminates the hop count limit of routing information protocol network maximum network diameter
System.
In order to achieve the above objectives, the embodiment of the present invention adopts the following technical scheme that
In a first aspect, a kind of method for preventing route loop is provided, and after router obtains new routing, the method packet
It includes:
If subnet prefix in the former routing of the router is identical as the subnet prefix in the new routing, the original
Source network address in routing is different from the source network address in the new routing, the router calculates the road of the former routing
Whether electrical path length is equal to the predetermined upper limit;
When the path length of the former routing is equal to the predetermined upper limit, the router sends order according to the new routing
Message, the command message have unique identification;
According to the unique identification, whether the router monitoring receives the command message in the given time;
If the router receives the command message in the given time, the router abandons the new road
By;
If the router does not receive the command message in the given time, the router abandons the former road
By carrying out message forwarding according to the new routing.
With reference to first aspect, in the first possible implementation of the first aspect, if the path of the former routing
Length is equal to the predetermined upper limit, and the router sends command message according to the new routing, comprising:
When the path length of the former routing is equal to the predetermined upper limit, the router is within a preset time period according to institute
It states new routing and sends at least one described command message.
With reference to first aspect with the first possible implementation, in second of possible implementation of first aspect
In, the method also includes:
If the path length of the former routing is less than the predetermined upper limit, the router abandons the former routing, according to institute
The new routing for stating acquiring unit acquisition carries out message forwarding.
With reference to first aspect with any one in the first or second of possible implementation, the of first aspect
In three kinds of possible implementations, source network address of the unique identification by the command message, purpose network address, agreement
Number and message numbering composition.
Second aspect provides a kind of device for preventing route loop, comprising:
Acquiring unit, for obtaining new routing;
Computing unit, after obtaining the new routing for the acquiring unit, if in the former routing of the router
Subnet prefix is identical as the subnet prefix in the new routing, in source network address and the new routing in the former routing
Source network address is different and the path length of the new routing is less than the path length of the former routing, calculate the former road
By path length whether be equal to the predetermined upper limit;
Transmission unit, if the path length for the computing unit to calculate the former routing is equal to the predetermined upper limit,
Command message is sent according to the new routing that the acquiring unit obtains, the command message has unique identification;
Receiving unit, for according to the unique identification, whether monitoring to receive the transmission unit in the given time
The command message sent;
Updating unit, if received described in the transmission unit transmission in the given time for the receiving unit
Command message abandons the new routing that the acquiring unit obtains;If the receiving unit does not receive in the given time
The command message sent to the transmission unit abandons the former routing;
After the transmission unit is also used to the updating unit discarding former routing, obtained according to the acquiring unit
The new routing carries out message forwarding.
In conjunction with second aspect, in the first possible implementation of the second aspect, when the computing unit calculates
When the path length of the former routing is equal to the predetermined upper limit, the transmission unit is specifically used within a preset time period according to institute
The new routing for stating acquiring unit acquisition sends at least one described command message.
In conjunction with second aspect and the first possible implementation, in second of possible implementation of second aspect
In, when the path length that the computing unit calculates the former routing is less than the predetermined upper limit, the updating unit abandons institute
State former routing;The transmission unit is also used to after the updating unit abandons the former routing, is obtained according to the acquiring unit
The new routing taken carries out message forwarding.
In conjunction with second aspect and the first or second of possible implementation, in the third possible reality of second aspect
In existing mode, the unique identification is compiled by the source network address of the command message, purpose network address, protocol number and message
Number composition.
The third aspect provides a kind of signal processing apparatus, comprising: receiver, processor, transmitter, memory and bus,
Wherein, the receiver, the processor, the transmitter and the memory are connected with each other by the bus,
Wherein, the receiver, for obtaining new routing;
The processor, after obtaining the new routing for the receiver, if in the former routing of the router
Subnet prefix is identical as the subnet prefix in the new routing, in source network address and the new routing in the former routing
Source network address is different and the path length of the new routing is less than the path length of the former routing, calculate the former road
By path length whether be equal to the predetermined upper limit;
The transmitter, if the path length for the processor to calculate the former routing is equal to the predetermined upper limit,
Command message is sent according to the new routing that the receiver obtains, the command message has unique identification;
The receiver is also used to monitor whether receive the order report that the transmitter is sent in the given time
Text, wherein the unique identification is for confirming the command message;
The processor, if be also used to the receiver receives the described of the transmitter transmission in the given time
Command message abandons the new routing that the receiver obtains;If the receiver does not receive institute in the given time
The command message of transmitter transmission is stated, the former routing is abandoned;
After the transmitter is also used to the processor discarding former routing, obtained according to the receiver described new
Routing carries out message forwarding.
In conjunction with the third aspect, in the first possible implementation of the third aspect, when the processor calculates institute
When stating the path length of former routing equal to the predetermined upper limit, the transmitter is specifically used for connecing according to described within a preset time period
It receives the new routing that device obtains and sends at least one described command message.
In conjunction with the third aspect and the first possible implementation, in second of possible implementation of the third aspect
In, when the path length that the processor calculates the former routing is less than the predetermined upper limit, the processor abandons the original
Routing;The transmitter is also used to after the processor abandons the former routing, is obtained according to the receiver described new
Routing carries out message forwarding.
In conjunction with any one in the third aspect and the first or second of possible implementation, the of the third aspect
In three kinds of possible implementations, source network address of the unique identification by the command message, purpose network address, agreement
Number and message numbering composition.
The method and device provided in an embodiment of the present invention for preventing route loop, can be with router according to the new routing of acquisition
The command message whether is received after sending command message to decide whether to carry out message forwarding according to the new routing, thus
The routing convergence speed when route loop occurs in new routing is improved, and it is straight to eliminate routing information protocol network maximum network
The hop count of diameter limits.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram for method for preventing route loop that the embodiment of the present invention provides;
Fig. 2 is a kind of flow diagram for method for preventing route loop that another embodiment of the present invention provides;
Fig. 3 is a kind of use environment schematic diagram for method for preventing route loop that another embodiment of the present invention provides;
Fig. 4 is a kind of structural schematic diagram for device for preventing route loop that the embodiment of the present invention provides;
Fig. 5 is the structural schematic diagram for the device that the another kind that the embodiment of the present invention provides prevents route loop;
Fig. 6 is a kind of structural schematic diagram for device for preventing route loop that the embodiment of the present invention provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that the described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this
Embodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative efforts
Example is applied, shall fall within the protection scope of the present invention.
The embodiment of the present invention provides a kind of method for preventing route loop, after obtaining new routing for router, ginseng
According to shown in Fig. 1, comprising the following steps:
If subnet prefix 101, in the former routing of the router is identical as the subnet prefix in the new routing, institute
The path length for stating the source network address new routing different and described from the source network address in the new routing in former routing is small
When the path length of the former routing, whether the path length that the router calculates the former routing is equal to the predetermined upper limit.
The reason of doing so be, in practice route loop result from the new routing that the router obtains for
When the not homologous more excellent routing of the former routing and the former routing open circuit, the path length of the original routing can become automatically at this time
More it is equal to the predetermined upper limit.It is therefore desirable to calculating judgement is carried out to whether the path length of the former routing is equal to the predetermined upper limit,
With confirm it is described it is new routing there are route loops a possibility that.When the path length of the former routing is equal to the predetermined upper limit, institute
The new possibility for routing and having there are route loop is stated, needs to identify the new routing with the presence or absence of route loop.
102, when the path length of the former routing is equal to the predetermined upper limit, the router is sent according to the new routing
Command message, the command message have unique identification.
Specifically, the unique identification by the source network address of the command message, purpose network address, protocol number and
Message numbering composition.
103, according to the unique identification, whether the router monitoring receives the order report in the given time
Text, i.e., the described unique identification is for confirming the command message.
Specifically, if receiving the order with the command message issued with identical unique identification in the given time
Message, then to have received the command message in the given time;If not receiving in the given time described with sending
Command message has the command message of identical unique identification, then not have received the command message in the given time;It can
What it is with understanding is the router when receiving the command message again, the time stab information of this command message record and is skipped
Node with issue when be it is not identical, judge whether that the command message received should be referred to by receiving the command message here
It is identical as the actual content of the command message of sending and unique identification.
If 104, the router receives the command message in the given time, the router abandons described new
Routing.
Reason for doing so is that after the router sends command message according to the new routing, if the road
The command message can be received by device, then it is assumed that there are route loop, the router abandons the new road for the new routing
By.
Optionally, when the path length of the former routing is equal to the predetermined upper limit, the router can be when preset
Between in section according to described at least one described command message of new routing transmission.The benefit done so is to send multiple orders
Message can prevent command message from losing because of network congestion.As long as having received any one of described command message, then it is assumed that
There are route loops for the new routing, abandon the new routing.
If 105, the router does not receive the command message in the given time, described in the router abandons
Original routing carries out message forwarding according to the new routing.
Specifically, abandoning the former routing, while carrying out message forwarding according to the new routing, institute in the router
The new routing can be received by routing information protocol by stating router, add the routing number for being newly routed to routing information protocol
According in library.
This method further include: if the path length of the former routing is less than the predetermined upper limit, described in the router abandons
Original routing carries out message forwarding according to the new routing.
In the new routing that the router obtains there are when route loop, using provided in an embodiment of the present invention above-mentioned
Prevent the method for route loop as follows come the benefit for eliminating route loop, because the router is sent and is monitored whether in pre- timing
It is interior to receive the command message with unique identification with unique identification, one cycle need to be only carried out in the route loop
It just can detect that and have received the command message, confirming the new routing with this, there are the route loops, avoid existing
The multiple circulation that the method for preventing route loop may cause avoids routing iinformation association to improve routing convergence speed
Discuss the hop count limitation of network maximum network diameter.
Such as: the hop count of routing information protocol network maximum network diameter is limited to 16 jumps at present, when the jump that one routes
When number reaches 16 jump, it is believed that the routing is unreachable or generates route loop, if a routing generates route loop, this road at this time
By the number of nodes in loop be 4, it is every complete a route loop then the routing hop count increase by 4, occur loop before, the routing
Node includes this 4 nodes in constituting, therefore hop count is at least 4;After route loop occurs, need between this 4 each node again into
The circulation of 3 route loops of row, the route loop identification that the hop count of the routing can be only achieved 16 jumps, trigger routing information protocol,
I.e. triggering prevents the count to infinity in route loop technology at present;And every progress one cycle is required by minimum pre- timing
Between, confirm that the time of route loop is directly proportional to the number for needing to carry out route loop circulation, if the predetermined time is 30
Second, then it completes 3 circulations and confirms there are route loop, is finally completed routing convergence and at least needs 90 seconds;If routing information protocol
The hop count of the maximum network diameter of network jumps for 256 or more greatly, then the route loop of above-mentioned 4 node occurs in a routing
When, the route loop cycle-index to be carried out can be increase accordingly, and the acknowledging time needed can be too long, and routing convergence speed is excessively slow,
It is difficult to apply in practice, so, current routing information protocol network just has the hop count limitation of maximum network diameter.And this hair
The method for preventing route loop that bright embodiment provides, when route loop occurs for a certain routing, it is only necessary to this Routing Loop
Road, which carries out one cycle, can confirm that there are route loops, to improve routing convergence speed, also avoid routing iinformation
The hop count of protocol network maximum network diameter limits.
The method provided in an embodiment of the present invention for preventing route loop can send life according to the new routing of acquisition with router
The command message whether is received to decide whether to carry out message forwarding according to the new routing, to improve after enabling message
Routing convergence speed when route loop occurs in the new routing, and eliminate routing information protocol network maximum network diameter
Hop count limitation.
The embodiment of the present invention provides a kind of method for preventing route loop, specifically for running the IPv4 of routing information protocol
(Internet Protocol version4, Internet Protocol Version 4) network, referring to shown in Fig. 2, comprising the following steps:
In order to illustrate the embodiments of the present invention more clearly, it referring to shown in Fig. 3, prevents from routing to provided in an embodiment of the present invention
The method of loop is illustrated.Router R1 to router R5 is in the same IPv4 network using routing information protocol
In router interconnected, route loop generate process it is as follows:
Before route loop generates, router R1 and router R4 connected interface G0/1 are disconnected, router R1 to router
R4 is as follows for the routing table of this original routing 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
When open circuit occurs for link between router R1 and router R5, router R1 is by this in routing information protocol database
The metric of the path length of item original routing is changed to the predetermined upper limit 16 from 1, if router R1 is connected with router R4 at this time
Mouthful G0/1 becomes access from open circuit, and from interface G0/1 receive the subnet prefix 100.0.0.0/24 that router R4 is sent it is identical,
Path length be 4 new routing, then because routing information protocol database Central Plains routing path length metric be 16 and
Newly receiving this new routing becomes 5 in the metric that the router receives way of escape electrical path length, admits the best of the examinees this new routing, uses
Original in this new item routing substitution routing information protocol database routes, and routing in router R1 database becomes:
100.0.0.0/24Metric:5next-hop:14.0.0.4
After this new routing update of router R1 in routing information protocol database, change is not only path length
Metric, there are also next-hops (next-hop) to have become 14.0.0.4 from 0.0.0.0, router R1 to R4 pairs of router at this time
The routing table that this is routed in 100.0.0.0/24 is as follows:
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
At this point, Network status is abnormal, and subnet prefix is because the new routing that former routing is generated route loop replaces updating
100.0.0.0/24 there is route loop in routing.For these reasons, when above-mentioned route loop occurs in new routing, with routing
For device R1, route loop is prevented by following steps.
201, router obtains new routing.
Specifically, it is 4 that the subnet prefix that router R1 acquisition router R4 is sent, which is 100.0.0.0/24 path length,
New routing, routing table are as follows:
R4:
100.0.0.0/24Metric:4next-hop:34.0.0.3
202, the router judges whether the path length of the new routing is equal to the predetermined upper limit.
Specifically, router R1 judges above-mentioned subnet prefix for the road of 100.0.0.0/24 newly routed referring to shown in Fig. 3
Whether electrical path length is equal to 16.
203, when the path length of the new routing is less than the predetermined upper limit, path of the router to the new routing
Length adds 1.
Specifically, router R1 is that 100.0.0.0/24 path length is to above-mentioned subnet prefix at this time referring to shown in Fig. 3
4 path length newly routed adds 1 to become 5, and routing table becomes:
R1:
100.0.0.0/24Metric:5next-hop:14.0.0.4
204, the router judges the subnet prefix in the former routing of the router and the subnet in the new routing
Whether prefix is identical.
This method further include:
Referring to step 202 obtain as a result, when the path length of the new routing be equal to the predetermined upper limit when, execute step
204。
205, when the new routing is identical as the subnet prefix of the former routing, the router judges the new routing
It is whether identical as the source network address of the former routing.
206, when the new routing is not identical as the source network address of the former routing, the router calculates described new
Whether the path length of routing is equal to the predetermined upper limit.
207, when the path length of the new routing is less than the predetermined upper limit, the router judges the road of the new routing
Whether electrical path length is less than the path length of the former routing.
208, when the path length of the new routing is less than the path length of the former routing, the router calculates institute
Whether the path length for stating former routing is equal to the predetermined upper limit.
The reason of doing so be, in practice route loop result from the new routing that the router obtains for
When the not homologous more excellent routing of the former routing and the former routing open circuit, the path length of the original routing can become automatically at this time
More it is equal to the predetermined upper limit.Sentence so needing whether to be equal to the predetermined upper limit 16 to the former path length routed calculate
Disconnected, to confirm the new routing, there are the possibility of route loop, when the path length of the former routing is equal to the predetermined upper limit 16,
The new routing needs to identify the new routing with the presence or absence of route loop there are the possibility of route loop.
209, when the path length of the former routing is equal to the predetermined upper limit, the router is sent according to the new routing
Command message, the command message have unique identification.
Specifically, it is 100.0.0.0/24 subnet prefix that router R1, which sends a purpose network address, referring to shown in Fig. 3
Network address PING message (command message), TTL(Time To Live, life span) be 64;And specify this order
The next-hop of message is 14.0.0.4, it may be assumed that message outgoing interface is G0/1, and the purpose network address is to pass through ARP(Address
Resolution Protocol, address resolution protocol) obtain the corresponding MAC(Medium/ of next-hop ip address 14.0.0.4
Media Access Control, medium access control) address, the source network address is the MAC of message outgoing interface G0/1
Location.
Router R1 records the source network address of this command message, purpose network address, protocol number and message numbering
Unique identification as this command message.And filter condition is set on the total interface of router R1, it monitors whether to receive
To this command message.
210, whether the router monitoring receives the command message in the given time, wherein the unique identification
For confirming the command message.
Specifically, referring to shown in Fig. 3, if router R1 receives the order issued with its own in the given time
Message has the command message of identical unique identification, then to have received the command message in the given time;If predetermined
The command message with the command message issued with identical unique identification is not received in time, then for not in the predetermined time
Inside have received the command message.The predetermined time can be set as 2 seconds.
211, when the router receives the command message in the given time, the router abandons described new
Routing.
Reason for this is that referring to shown in Fig. 3, after router R1 sends command message according to the new routing, such as
Router described in fruit router R1 can receive the command message, then it is assumed that there are route loops for the new routing, if road
If receiving this new routing by device R1, it will appear the route loop that subnet prefix is 100.0.0.0/24 in whole network, so
Abandon the new routing.
Because there are the router R1- router R4 in route loop to carry out above-mentioned steps for this, so routing table becomes at this time
Change as follows:
R2:metric2 → 6
R3:metric3 → 7
R4:metric4 → 8
It is found that can be because receiving institute in the given time by one cycle after router R1 obtains above-mentioned new routing
Command message is stated, to make the new routing there are the judgement of route loop, abandons the new routing.
Optionally, when the path length of the former routing is equal to the predetermined upper limit, router R1 can be in the preset time
3 command messages are sent according to the new routing in section, the preset period can be 2 seconds, and the benefit done so is to send out
Send multiple command messages that can prevent command message from losing because of network congestion, as long as having received appointing in 3 command messages
What one, then it is assumed that receive to will appear route loop if this new routing, abandon this new routing.
This method further include: referring to step 206 obtain as a result, when the new routing path length be equal to the predetermined upper limit
When, the router abandons the new routing.
Referring to step 207 obtain as a result, when the new routing path length not less than the former routing path length
When spending, the router abandons the new routing.
212, when the router does not receive the command message in the given time, described in the router discarding
Original routing carries out message forwarding according to the new routing.
Specifically, abandoning the former routing, while carrying out message forwarding according to the new routing, institute in the router
The new routing can be received by routing information protocol by stating router, add the routing number for being newly routed to routing information protocol
According in library.
This method further include: referring to step 205 obtain as a result, when the new routing with the source network of the former routing
When location is identical, the router abandons the former routing, carries out message forwarding according to the new routing.
Referring to step 208 obtain as a result, when the path length of the former routing is less than the predetermined upper limit, the router
The former routing is abandoned, carries out message forwarding according to the new routing.
Further include following methods after step 204:
213, when the new routing is not identical as the subnet prefix of the former routing, the router calculates the new road
By path length whether be equal to the predetermined upper limit.
Further, when the path length of the new routing is equal to the predetermined upper limit, referring to step 211, the router is lost
Abandon the new routing;When the path length of the new routing is less than the predetermined upper limit, referring to step 212, the router abandons institute
Former routing is stated, carries out message forwarding according to the new routing.
Referring to shown in Fig. 3, when there is route loop of the above-mentioned subnet prefix for 100.0.0.0/24, road is prevented with existing
The process for making route loop disappear by the method for loop is as follows:
In practice, the routing in routing information protocol database can be led to by running router every 30 seconds of routing information protocol
The interface for crossing operation routing information protocol is sent to realize the keep-alive routed.Router R1 waits until next routing update
Routing update is sent to router R2 within 30 seconds, wherein this new routing for being just 100.0.0.0/24 comprising subnet prefix, routing
Device R2 receives routing update, receives route processing process according to routing information protocol, the metric of path length adds 1 to become 6, looks into
Original routing of the routing information protocol database discovery there are identical subnet prefix is seen, and the two is homologous, so unconditionally accepting.More
New routing information protocol database, routing table variation are as follows:
R2:metric2 → 6
Router R2 waits until that 30 seconds routing update moment arrived and sends routing update, similar above-mentioned, R3 to router R3
Same to update routing information protocol database, routing table variation is as follows:
R3:metric3 → 7
And so on:
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 length newly routed is equal to the predetermined upper limit 16, and router R1 just can be because triggering existing prevent
The last count to infinity of route loop method and make the judgement for generating route loop, abandon this it is new route, route loop disappears
It loses.And recycled in route loop 3 times at this time, the acknowledging time of route loop lasts 90 seconds.Therefore, if network diameter mistake
Greatly, the overlength acknowledging time that can be generated, so the maximum network diameter that there is routing information protocol network is 16 limitations jumped.
And if router R1 obtain it is described it is new routing there are when route loop, use is provided in an embodiment of the present invention
The above-mentioned method for preventing route loop is as follows come the benefit for eliminating route loop, because router R1 is sent and is monitored whether predetermined
The command message with unique identification is received in time with unique identification, only need to once be followed in the route loop
Ring, which just can detect that, has received the command message, confirms the new routing there are the route loop with this, avoiding makes
It is confirmed whether that there are the multiple circulations that may cause when the route loop with the method for count to infinity, to improve routing
Convergence rate avoids the hop count limitation of routing information protocol network maximum network diameter.
The method provided in an embodiment of the present invention for preventing route loop can send life according to the new routing of acquisition with router
The command message whether is received to decide whether to carry out message forwarding according to the new routing, to improve after enabling message
Routing convergence speed when route loop occurs in the new routing, and eliminate routing information protocol network maximum network diameter
Hop count limitation.
The present invention provides a kind of device for preventing route loop, for realizing the above-mentioned method for preventing route loop, reference
Shown in Fig. 4, comprising:
Acquiring unit 401, for obtaining new routing.
Computing unit 402, after obtaining the new routing for the acquiring unit 401, if the original of the router
Subnet prefix in routing is identical as the subnet prefix in the new routing, the source network address in the former routing and described new
The path length of source network address difference and the new routing in routing is less than the path length of the former routing, calculates institute
Whether the path length for stating former routing is equal to the predetermined upper limit.
Transmission unit 403, if be equal to for the path length that the computing unit 402 calculates the former routing predetermined
The upper limit sends command message according to the new routing that the acquiring unit 401 obtains, and the command message has unique mark
Know.
Optionally, the unique identification by the source network address of the command message, purpose network address, protocol number and
Message numbering composition.
Receiving unit 404, for according to the unique identification, it is single whether monitoring receives the transmission in the given time
The command message that member 403 is sent.
Updating unit 405, if receiving the transmission unit 403 in the given time for the receiving unit 404
The command message sent abandons the new routing that the acquiring unit 401 obtains;If the receiving unit 404 exists
The command message that the transmission unit 403 is sent is not received in predetermined time, abandons the former routing.
The transmission unit 403 is also used to after the updating unit 405 abandons the former routing, according to the acquiring unit
The 401 new routings obtained carry out message forwarding.
Optionally, described when the path length that the computing unit 402 calculates the former routing is equal to the predetermined upper limit
Transmission unit 403 is specifically used for being sent to according to the new routing that the acquiring unit 401 obtains within a preset time period
A few command message.
Optionally, referring to Figure 5:
When the path length that the computing unit 402 calculates the former routing is less than the predetermined upper limit, the update is single
Member 405 abandons the former routing;The transmission unit 403 is also used to after the updating unit 405 abandons the former routing, is pressed
Message forwarding is carried out according to the new routing that the acquiring unit 401 obtains.
The device provided in an embodiment of the present invention for preventing route loop can send life according to the new routing of acquisition with router
The command message whether is received to decide whether to carry out message forwarding according to the new routing, to improve after enabling message
Routing convergence speed when route loop occurs in the new routing, and eliminate routing information protocol network maximum network diameter
Hop count limitation.
The embodiment of the present invention provides a kind of device for preventing route loop, and referring to shown in Fig. 6, this prevents route loop
Device can be embedded in or inherently micro process computer, such as: general purpose computer, customization machine, mobile phone terminal or plate
The portable equipments such as machine, this prevents the device 601 of route loop for realizing the above-mentioned method for preventing route loop, specific to wrap
It includes: at least one receiver 611, processor 612, transmitter 613, memory 614 and bus 615, at least one receiver
611, processor 612, transmitter 613 and memory 614 connect by bus 615 and complete mutual communication.
The bus 615 can be ISA(Industry Standard Architecture, industry standard architecture) it is total
Line, PCI(Peripheral Component, external equipment interconnection) bus or EISA(Extended Industry
Standard Architecture, extended industry-standard architecture) bus etc..The bus 615 can be divided into address bus,
Data/address bus, control bus etc..Only to be indicated with a thick line convenient for indicating, in Fig. 6, it is not intended that an only bus or
A type of bus.Wherein:
For memory 614 for storing executable program code, which includes computer operation instruction.Memory
614 may include high speed RAM memory, it is also possible to and it further include nonvolatile memory (non-volatile memory), such as
At least one magnetic disk storage.
Processor 612 may be a central processing unit (Central Processing Unit, referred to as CPU), or
It is specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), or is matched
It is set to the one or more integrated circuits for implementing the embodiment of the present invention.
Wherein, the receiver 611, for obtaining new routing;
The processor 612, after obtaining the new routing for the receiver 611, if the original of the router
Subnet prefix in routing is identical as the subnet prefix in the new routing, the source network address in the former routing and described new
The path length of source network address difference and the new routing in routing is less than the path length of the former routing, calculates institute
Whether the path length for stating former routing is equal to the predetermined upper limit;
The transmitter 613, if be equal to for the path length that the processor 612 calculates the former routing predetermined
The upper limit sends command message according to the new routing that the receiver 611 obtains, and the command message has unique identification;
Optionally, the unique identification by the source network address of the command message, purpose network address, protocol number and
Message numbering composition.
The receiver 611 is also used to monitor whether receive the described of the transmission of transmitter 613 in the given time
Command message, wherein the unique identification is for confirming the command message;
The processor 612, if be also used to the receiver 611 receives the transmitter 613 in the given time
The command message sent abandons the new routing that the receiver 611 obtains;If the receiver 611 is predetermined
The command message that the transmitter 613 is sent is not received in time, abandons the former routing;
The transmitter 613 is also used to after the processor 612 abandons the former routing, is obtained according to the receiver 611
The new routing taken carries out message forwarding.
Optionally, when the path length that the processor 612 calculates the former routing is equal to the predetermined upper limit, the hair
Device 613 is sent to be specifically used for sending at least one according to the new routing that the receiver 611 obtains within a preset time period
The command message.
Optionally, when the path length that the processor 612 calculates the former routing is less than the predetermined upper limit, the place
Reason device 612 abandons the former routing;The transmitter 613 is also used to after the processor 612 abandons the former routing, according to
The new routing that the receiver 611 obtains carries out message forwarding.
What is provided in present apparatus embodiment prevents the device of route loop, can integrate in the router, is applied to method
In application scenarios described in embodiment (as shown in attached drawing 1 to attached drawing 3), the function of wherein router is realized.Prevent Routing Loop
Other additional functions that the device on road may be implemented and the interactive process with other network element devices, please refer to embodiment of the method
In description to router, repeat no more herein.
The device provided in an embodiment of the present invention for preventing route loop can send life according to the new routing of acquisition with router
The command message whether is received to decide whether to carry out message forwarding according to the new routing, to improve after enabling message
Routing convergence speed when route loop occurs in the new routing, and eliminate routing information protocol network maximum network diameter
Hop count limitation.
It will be recognized by those of ordinary skill in the art that the possibility implementation of various aspects of the invention or various aspects
It can be embodied as system, method or computer program product.Therefore, each aspect of the present invention or various aspects
Possible implementation can use complete hardware embodiment, complete software embodiment (including firmware, resident software etc.), or
The form of the embodiment of integration software and hardware aspect, collectively referred to herein as " circuit ", " module " or " system ".In addition,
The possibility implementation of each aspect of the present invention or various aspects can use the form of computer program product, computer journey
Sequence product refers to the computer readable program code of storage in computer-readable medium.
Computer-readable medium can be computer-readable signal media or computer readable storage medium.Computer can
Read storage medium including but not limited to electronics, magnetism, optics, electromagnetism, infrared or semiconductor system, equipment perhaps device or
It is above-mentioned any appropriately combined, such as random access memory (RAM), read-only memory (ROM), the read-only storage of erasable programmable
Device (EPROM or flash memory), optical fiber, portable read-only memory (CD-ROM).
Processor in computer reads the computer readable program code of storage in computer-readable medium, so that place
Reason device is able to carry out function action specified in the combination of each step or each step in flow charts;It generates and implements in block diagram
Each piece or each piece of combination specified in function action device.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.
Claims (10)
1. a kind of method for preventing route loop, which is characterized in that router obtains after new routing, which comprises
If subnet prefix in the former routing of the router is identical with the subnet prefix in the new routing, described former routes
In the source network address new routing different and described from the source network address in the new routing path length be less than the original
Whether the path length of routing, the path length that the router calculates the former routing are equal to the predetermined upper limit;
When the path length of the former routing is equal to the predetermined upper limit, the router sends order report according to the new routing
Text, the command message have unique identification;
According to the unique identification, whether the router monitoring receives the command message in the given time;
If the router receives the command message in the given time, the router abandons the new routing;
If the router does not receive the command message in the given time, the router abandons the former routing,
Message forwarding is carried out according to the new routing.
2. the method according to claim 1, wherein if the path length of the former routing is equal to the predetermined upper limit
When, the router sends command message according to the new routing, comprising:
When the path length of the former routing is equal to the predetermined upper limit, the router is within a preset time period according to described new
Routing sends at least one described command message.
3. method according to claim 1 or 2, which is characterized in that the method also includes:
If the path length of the former routing is less than the predetermined upper limit, the router abandons the former routing, according to described new
Routing carries out message forwarding.
4. method according to claim 1 or 2, which is characterized in that the unique identification by the command message source net
Network address, purpose network address, protocol number and message numbering composition.
5. a kind of device for preventing route loop characterized by comprising
Acquiring unit, for obtaining new routing;
Computing unit, after obtaining the new routing for the acquiring unit, if the son in the former routing of the router
Net prefix is identical as the subnet prefix in the new routing, the source network address in the former routing and the source in the new routing
Network address difference and the path length of the new routing are less than the path length of the former routing, calculate the original routing
Whether path length is equal to the predetermined upper limit;
Transmission unit, if the path length for the computing unit to calculate the former routing is equal to the predetermined upper limit, according to
The new routing that the acquiring unit obtains sends command message, and the command message has unique identification;
Receiving unit, for according to the unique identification, whether monitoring receives the transmission unit in the given time to be sent
The command message;
Updating unit, if receiving the order that the transmission unit is sent in the given time for the receiving unit
Message abandons the new routing that the acquiring unit obtains;If the receiving unit does not receive institute in the given time
The command message of transmission unit transmission is stated, the former routing is abandoned;
After the transmission unit is also used to the updating unit discarding former routing, according to described in acquiring unit acquisition
New routing carries out message forwarding.
6. device according to claim 5, which is characterized in that when the computing unit calculates the path of the former routing
When length is equal to the predetermined upper limit, the transmission unit is specifically used within a preset time period according to acquiring unit acquisition
The new routing sends at least one described command message.
7. device according to claim 5 or 6, which is characterized in that when the computing unit calculates the former routing
When path length is less than the predetermined upper limit, the updating unit abandons the former routing;The transmission unit be also used to it is described more
After new unit abandons the former routing, message forwarding is carried out according to the new routing that the acquiring unit obtains.
8. device according to claim 5 or 6, which is characterized in that the unique identification by the command message source net
Network address, purpose network address, protocol number and message numbering composition.
9. a kind of signal processing apparatus characterized by comprising receiver, processor, transmitter, memory and bus,
In, the receiver, the processor, the transmitter and the memory are connected with each other by the bus,
Wherein, the receiver, for obtaining new routing;
The processor, after obtaining the new routing for the receiver, if the son in the former routing of the router
Net prefix is identical as the subnet prefix in the new routing, the source network address in the former routing and the source in the new routing
Network address difference and the path length of the new routing are less than the path length of the former routing, calculate the original routing
Whether path length is equal to the predetermined upper limit;
The transmitter, if the path length for the processor to calculate the former routing is equal to the predetermined upper limit, according to
The new routing that the receiver obtains sends command message, and the command message has unique identification;
The receiver is also used to monitor whether receive the command message that the transmitter is sent in the given time,
Wherein the unique identification is for confirming the command message;
The processor, if be also used to the receiver receives the order that the transmitter is sent in the given time
Message abandons the new routing that the receiver obtains;If the receiver does not receive the hair in the given time
The command message for sending device to send abandons the former routing;
After the transmitter is also used to the processor discarding former routing, according to the new routing of receiver acquisition
Carry out message forwarding.
10. device according to claim 9, which is characterized in that when the processor calculates the path of the former routing
When length is equal to the predetermined upper limit, the transmitter is specifically used within a preset time period according to described in receiver acquisition
New routing sends at least one described command message.
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 CN104935508A (en) | 2015-09-23 |
CN104935508B true 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) |
Families Citing this family (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 (5)
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9094224B2 (en) * | 2012-07-31 | 2015-07-28 | Cisco Technology, Inc. | Acknowledged multicast convergence |
-
2014
- 2014-03-18 CN CN201410101284.3A patent/CN104935508B/en active Active
Patent Citations (5)
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 |
Also Published As
Publication number | Publication date |
---|---|
CN104935508A (en) | 2015-09-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11032174B2 (en) | Service chain fault detection method and apparatus | |
CN106063203B (en) | Software defined network (SDN) particular topology INFORMATION DISCOVERY | |
US20150249587A1 (en) | Method and apparatus for topology and path verification in networks | |
US20170005882A1 (en) | Service Chain Management Method, System and Device | |
CA2931515A1 (en) | Multi-domain source routed forwarding based on collaborating network controllers | |
CN109361600B (en) | Method and equipment for acquiring path identifier | |
CN108270673B (en) | File transmitting method, device and system | |
CN103841022A (en) | Method and device for building tunnel | |
EP3131239A1 (en) | Method and apparatus for path establishment | |
CN105577416B (en) | Service function chain operation, management and maintenance method and node equipment | |
CN109756521B (en) | NSH message processing method, device and system | |
CN106165322A (en) | Agency to redundant manipulator Routing Protocol | |
CN105591798B (en) | The method, apparatus of OAM Information is transmitted in DCN | |
CN106878186B (en) | The method of routing update, the network equipment and system in network | |
CN108965204A (en) | A kind of method and device of automatic realization IOAM encapsulation | |
CN108259261B (en) | Path detection method and device | |
CN104935508B (en) | A kind of method and device preventing route loop | |
CN103746828A (en) | Method and device for network node management | |
CN111464440A (en) | Communication method and device | |
US10250477B2 (en) | Method and controller for announcing bandwidth of cluster system | |
CN106254099B (en) | Information synchronization method and device based on network element equipment | |
JP2015514374A (en) | Method for receiving information, method for transmitting information and apparatus thereof | |
CN106506375B (en) | A kind of route renewing method and device | |
US10680900B2 (en) | BGP logical topology generation method, and device | |
CN104301221B (en) | A kind of method and device of route messages |
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 |
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. |
|
TR01 | Transfer of patent right |