Background technology
RIP is a kind of distance vector routing protocol, and the advantage of its maximum is that configuration is simple, is easy to management and operation, in the less network of the scale that is mainly used in.RIP produces early, through application for many years, has become a kind of Routing Protocol of maturation, has a wide range of applications, in internet particularly in some small-/medium-sized Intranets, such as campus network and the better simply provincialism network of structure.For more complex environment and catenet, generally do not use RIP.
RIP is based on User Datagram Protoco (UDP) (UDP, User Datagram Protocol), and RIP message is encapsulated in UDP message, and the router of configuration RIP uses udp port numbers 520 message that transmits and receive data, and propagates routing iinformation by message; RIP message is divided into two classes, is respectively:
One, request (Request) message: be used for sending route table items to neighbor request.
Two, response message: Response message or response neighbours' request message, or initiatively timing is upgraded, or trigger and upgrade.Message comprises all or part route table items in sender's routing table.
RIP is subject to the control of four timers, is respectively to upgrade (Update), aging (Timeout), inhibition (Suppress) and Garbage-Collect timer, wherein:
Update timer, has defined the time interval that sends routing update.
Timeout timer, has defined the routing aging time.If do not receive the renewal message about certain route in ageing time, the metric of this route in routing table will be set to 16.
Suppress timer, has defined the duration of RIP route in holddown.In the time that the metric of a route becomes 16, this route will enter holddown.At suppressed state, be only less than 16 routing update from same neighbourhood and metric and just can be routed device and receive, replace unreachable route.
Garbage-Collect timer, has defined a route and has become in the of 16 from metric, until its deleted institute elapsed time from routing table.Within the Garbage-Collect time, RIP outwards sends the renewal of this route using 16 as metric, if Garbage-Collect is overtime, this route is not still upgraded, and this route will thoroughly be deleted from routing table.
The running of RIP is as follows:
01: after router startup RIP, just can send request message (Request message) to adjacent router; Adjacent RIP router is received after request message, responds this request, the response message (Response message) that loopback comprises local routing table information.
02: router is received after response message, upgrades local routing table, send to trigger to neighboring router simultaneously and upgrade message, notice routing update information; Neighboring router is received to trigger and is upgraded after message, sends to trigger again upgrade message to its neighboring router separately.After a series of triggering is upgraded, each router can obtain and keep up-to-date routing iinformation.
RIP adopts aging mechanism to carry out burin-in process to overtime route, to ensure real-time and the validity of route.
BFD is the testing mechanism that a set of the whole network is unified, forwarding for fast detecting, monitor network link or IP route is communicated with situation, ensure can fast detecting arrive communication failure between neighbours, recover communication thereby Rapid Establishment plays alternate channel, the business of guarantee is proceeded.
BFD provides the quick fault testing mechanism of general, standardized a, media independent, protocol-independent, can be that each upper-layer protocol is as the fault in two-way converting path between two routers of fast detecting uniformly such as Routing Protocol, multiprotocol label switching (MPLS, Multi-Protocol Label Switching).
BFD mechanism is set up session on two routers, is used for monitoring two two-way converting paths between router, is upper-layer protocol service.BFD itself is discovery mechanism not, but notify itself and who to set up session by serviced upper-layer protocol, if do not receive within detection time after session establishment that the BFD of opposite end controls message, think and break down, notify serviced upper-layer protocol, upper-layer protocol is processed accordingly.
The working method of BFD session has following two kinds:
One, control message mode: both link ends session is by controlling message interaction monitoring Link State.
Two, Echo message mode: link one end is forwarded by the other end by sending Echo message, realizes the bidirectional test to link.
BFD session establishment process is as follows:
01: upper-layer protocol module by oneself Hello mechanism discovering neighbor and connect;
02: upper-layer protocol module, in the time having set up new neighborhood, is all noticed the module to BFD by neighbours' parameter and detected parameters (comprising destination address and source address etc.);
Neighbours are calculated and set up to 03:BFD module according to the parameter of receiving.
Fig. 1 has provided the schematic diagram that adopts BFD mechanism to process network failure, and as shown in Figure 1, in the time that network breaks down, concrete processing procedure is: 1, BFD module detects link/network fault; 2, BFD module is removed BFD neighbor session; 3, it is unreachable that BFD module is notified local upper-layer protocol module BFD neighbours; 4, local upper-layer protocol module is ended upper-layer protocol neighborhood; If there is backup path in 5 networks, router will be selected backup path.
RIP relies on and periodically sends routing update request as testing mechanism, while not receiving routing update within the appointed time, thinks not revival of this route, and this mode can not respond link failure fast.When RIP and BFD interlock are used BFD link failure to be detected, RIP can cancel inefficacy route fast, reduces the impact on other business.
The object of RIP and BFD interlock is the convergence time in order to accelerate RIP, does not need to wait for 180 seconds ageing timer times of RIP regulation again, but does not change the operating mechanism of RIP itself.
RIP interlock BFD provide two kinds of detection modes:
One, directly-connected neighbor adopts echo message single-hop detection mode, while having route to send, could set up BFD session in opposite end.
Two, indirectly connected neighbours adopt the two-way detection mode of control (control) message, when two ends mutual route sends, and enable the interface of BFD and receiving interface while being same interface, between neighbours, could set up BFD session.
When the session two ends of detecting RIP are directly connected subnet (being a jumping of IP message), be applicable to adopting the unidirectional detection mode of echo of BFD, still, while arriving neighbours through multi-hop, echo mode can lose efficacy.
In the time of RIP and BFD interlock, adopt the echo message single-hop detection mode of BFD for directly-connected neighbor, have route to send during in opposite end, could set up BFD session.Like this, in the time that the RIP of router-A module is received the RIP response message that end-to-end router B sends, add the route of the end-to-end router B carrying in message, and trigger BFD module creation BFD session, when the BFD of router-A module receives that after the BFD back message using of router B, BFD session switches to UP state from DOWN.
If the BFD module of router-A can not receive the BFD message of router B in default duration, think link occurs fault between router-A, B, BFD session switches to DOWN state from UP, and notify RIP module BFD session DOWN, RIP module is deleted all routes that router B sends, and deletes BFD session simultaneously.
But, link single-pass between router-A, B, if: router-A is to the link failure of router B but router B when normal to the link of router-A, the RIP module of router-A still can continue to receive the RIP response message of the route of carrying renewal that router B sends, so just, can trigger the BFD module foundation of router-A and the BFD session of router B, after the failure of BFD session establishment, the BFD module of router-A can notify again RIP module to delete route, this process can ceaselessly repeat, and it shows as route and does not stop concussion.
In addition, if only just notify RIP module to delete route in BFD session in the situation that UP migration is Down, in the time that link is just single-channel fault from the outset always, BFD session status just cannot move to UP state from DOWN, also just there will not be BFD session to switch to the situation of DOWN state from UP, but now RIP module still can be learnt the route of end-to-end router, so just there will be RIP module cannot delete all the time the phenomenon of route.
Visible, in the time of RIP and BFD interlock, if link single-pass, RIP module still can be learnt route, but there will be route not stop the situation of shaking or route cannot be deleted, even if there is backup link in network like this, route also cannot be switched to backup link, route cannot restrain, and can only, by human intervention control, just can complete the route handoff of backup link.
Summary of the invention
The invention provides the method and apparatus that RIP interlock BFD sets up route, the RIP route when avoiding link single-pass cannot be deleted the phenomenon with route oscillation.
Technical scheme of the present invention is achieved in that
Routing information protocol RIP interlock bi-directional session detection BFD sets up a method for route, and the method comprises:
The first equipment receives first RIP response message that the second equipment is sent, the second equipment is added to RIP neighbours, and sets up BFD session with the second equipment, if session establishment success,, to the route of second device request the second equipment, the route of the second equipment is added in routing table;
The first equipment receives the follow-up RIP response message of sending of the second equipment, with the route of the second equipment in the routing update routing table in this message;
BFD session Down between the first device discovery and the second equipment deletes the second equipment from RIP neighbours, the route of the second equipment is deleted from routing table simultaneously.
Described and the second equipment further comprises after setting up BFD session:
In the time of the failure of BFD session establishment, the second equipment is deleted from RIP neighbours.
Described equipment is router or switch.
A kind of equipment, comprising:
RIP module: first RIP response message that second equipment of reception is sent, is added to RIP neighbours by the second equipment, and the second device identification is carried in the instruction of BFD session establishment and sends to BFD module; Receive the session establishment result that BFD module is sent, if this result instruction is successfully established, send the full routing table request of RIP to the second equipment, the route that the second equipment is returned is added in routing table; The follow-up RIP response message of sending of second equipment that receives, with the route of the second equipment in the routing update routing table in this message; In the time receiving the BFD session Down instruction of carrying the second device identification that BFD module sends, the second equipment is deleted from RIP neighbours, the route of the second equipment is deleted from routing table simultaneously;
BFD module: receive described BFD session establishment instruction, set up BFD session with the second equipment, session establishment result is sent to RIP module; In the time finding with the BFD session Down of the second equipment room, send the BFD session Down instruction of carrying the second device identification to RIP module.
Described RIP module is further used for, and when the session establishment result instruction of sending when BFD module is set up unsuccessfully, the second equipment is deleted from RIP neighbours.
Described equipment is router or switch.
Compared with prior art, when the present invention has avoided link single-pass, RIP route cannot be deleted and the generation of route oscillation phenomenon.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention is further described in more detail.
The RIP interlock BFD that Fig. 2 provides for the embodiment of the present invention sets up the method flow diagram of route, and as shown in Figure 2, its concrete steps are as follows:
Step 200: RIP module and BFD module are set on router.
Step 201: for arbitrary router-A, the RIP module of router-A receives first RIP response message that end-to-end router B sends.
The RIP module of router-A can judge whether this RIP response message is first RIP response message that router B sends in the following way:
The RIP module of router-A, in the RIP of self maintained neighbor list, is searched router B mark, if do not find, determines that this RIP response message is first RIP response message that router B sends; Otherwise, determine that this RIP response message is not first RIP response message that router B sends.
Step 202: the RIP module of router-A is added router B mark in the RIP neighbor list of self maintained to, still, does not add the RIP route of the router B that message carries.
Step 203: the BFD session between the foundation of BFD module and the router B of the RIP module triggering of router-A self.
Step 204: BFD module and the router B of router-A set up BFD session, judge whether to be successfully established, and if so, perform step 206; Otherwise, execution step 205.
Step 205: the BFD module of router-A sends BFD session establishment to the RIP module of router-A and unsuccessfully indicates, the RIP module of router-A is deleted router B mark from RIP neighbor list, and this flow process finishes.
Step 206: the BFD module of router-A sends the instruction of link bilateral to the RIP module of router-A, the RIP module of router-A sends the full routing table request message of RIP to router B, the RIP module of router B receives this message, return to the RIP response message that carries the full routing table of self RIP to router-A, the RIP module of router-A receives and adds the full routing table of RIP of router B.
Step 207: the RIP module of router-A receives the follow-up RIP response message that router B sends, according to the route of the router B of the routing update of carrying in message self.
Step 208: the BFD module of router-A is found the BFD session DOWN with router B, send session DOWN notice to the RIP module of router-A, the RIP module of router-A is deleted router B mark from the RIP neighbor list of self, deletes the route of the router B of self simultaneously.
Can find out from embodiment illustrated in fig. 2: because router-A is only in the time receiving first RIP response message of router B, just set up RIP neighbours and trigger and set up BFD session, and just ask route to router B after the success of BFD session establishment, and the route of adding router B, and in the time receiving the follow-up RIP response message of router B, only carry out routing update and do not carry out the action of BFD session establishment, in the time of BFD session Down, delete the route of router B, like this, in the time of link single-pass between router-A and router B, even if router-A receives the RIP response message of router B, router-A can not repeat to set up route yet, avoid route cannot delete and the generation of route oscillation phenomenon.
The switch that is equally applicable to embodiment illustrated in fig. 2.
The employing RIP interlock BFD that Fig. 3 provides for the embodiment of the present invention sets up the composition schematic diagram of the equipment of route, and as shown in Figure 3, it mainly comprises: RIP module 31 and BFD module 32, wherein:
RIP module 31: first RIP response message that second equipment of reception is sent, is added to RIP neighbours by the second equipment, and the second device identification is carried in the instruction of BFD session establishment and sends to BFD module 32; Receive the session establishment result that BFD module 32 is returned, if this result instruction is successfully established, send the full routing table request of RIP to the second equipment, the route that the second equipment is returned is added in routing table; The follow-up RIP response message of sending of second equipment that receives, with the route of the second equipment in the routing update routing table in this message; In the time receiving the BFD session Down instruction of carrying the second device identification that BFD module 32 sends, the second equipment is deleted from RIP neighbours, the route of the second equipment is deleted from routing table simultaneously.
RIP module 31 is further used for, and when the session establishment result instruction of returning when BFD module 32 is set up unsuccessfully, the second equipment is deleted from RIP neighbours.
BFD module 32: receive the BFD session establishment instruction of carrying the second device identification that RIP module 31 is sent, set up BFD session with the second equipment, session establishment result is returned to RIP module 31; In the time finding with the BFD session Down of the second equipment room, send the BFD session Down instruction of carrying the second device identification to RIP module 31.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any amendment of making, be equal to replacement, improvement etc., within all should being included in the scope of protection of the invention.