Background technology
RIP is a kind of distance vector routing protocol, and its biggest advantage 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, in the internet, has a wide range of applications, 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 the RIP message is encapsulated in the UDP message, and the router of configuration RIP uses udp port numbers 520 message that transmits and receive data, and propagates routing iinformation through message; The RIP message is divided into two types, 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 regularly upgrade, or trigger and upgrade.Message comprises all or part route table items in sender's routing table.
RIP is subjected to the control of four timers, is respectively to upgrade (Update), aging (Timeout), inhibition (Suppress) and Garbage-Collect timer, wherein:
The Update timer has defined the time interval of sending routing update.
The Timeout timer has defined the routing aging time.If in ageing time, do not receive the renewal message about certain bar route, then the metric of this route in routing table will be set to 16.
The Suppress timer has defined the duration that the RIP route is in holddown.When the metric of a route becomes 16, this route will get into holddown.Be suppressed state, only just can be routed device less than 16 routing update and receive, replacing unreachable route from same neighbours and metric.
The Garbage-Collect timer has defined a route and has become 16 beginnings from metric, in routing table, is deleted institute's elapsed time up to it.At Garbage-Collect in the time, RIP outwards sends the renewal of this route with 16 as metric, if Garbage-Collect is overtime, this route does not still obtain upgrading, and then this route will be by thoroughly deletion from routing table.
The running of RIP is following:
01: behind the router startup RIP, just can send request message (Request message) to adjacent router; After adjacent RIP router was received request message, response should be asked, and loopback comprises the response message (Response message) of local routing table information.
02: after router is received response message, upgrade local routing table, send to trigger to neighboring router simultaneously and upgrade message, the announcement routing update information; After neighboring router is received and triggered the renewal message, send to trigger to its neighboring router separately again and upgrade message.After a series of triggering was upgraded, each router can both obtain and keep up-to-date routing iinformation.
RIP adopts aging mechanism that overtime route is carried out burin-in process, to guarantee the real-time and the validity of route.
BFD is the unified testing mechanism of a cover the whole network; The forwarding that is used for fast detecting, monitor network link or IP route is communicated with situation; Guarantee can fast detecting arrive communication failure between the neighbours, thereby set up the alternate channel restoring communication fast, the assurance business is proceeded.
BFD provides the quick fault testing mechanism of general, standardized a, media independent, protocol-independent; Can be each upper-layer protocol such as Routing Protocol, multiprotocol label switching (MPLS, Multi-Protocol Label Switching) etc. the fault of two-way forward-path between two routers of fast detecting uniformly.
BFD mechanism is set up session on two routers, be used for monitoring the two-way forward-path between two routers, is the upper-layer protocol service.BFD itself is discovery mechanism not; But notify itself and who to set up session by the upper-layer protocol that quilt is served; If session foundation back is not received the BFD control message of opposite end then is thought and break down in detection time, the upper-layer protocol that notice is served, upper-layer protocol is handled accordingly.
The working method of BFD session has following two kinds:
One, control message mode: the both link ends session is through control message interaction monitoring Link State.
Two, Echo message mode: a certain end of link is transmitted by the other end through sending the Echo message, realizes the bidirectional test to link.
It is following that process is set up in the BFD session:
01: the upper-layer protocol module is found neighbours through the Hello mechanism of oneself and is connected;
02: the upper-layer protocol module is all announced the module to BFD with neighbours' parameter and detected parameters (comprising destination address and source address etc.) when having set up new neighborhood;
Neighbours are calculated and set up to the 03:BFD module according to the parameter of receiving.
Fig. 1 has provided the sketch map that adopts BFD mechanism to handle network failure, and as shown in Figure 1, when network broke down, concrete processing procedure is: 1, the BFD module detected the link/network fault; 2, the BFD module is removed the BFD neighbor session; 3, it is unreachable that the BFD module is notified local upper-layer protocol module BFD neighbours; 4, local upper-layer protocol module is ended the upper-layer protocol neighborhood; If have backup path in 5 networks, router will be selected backup path.
RIP relies on periodically and sends the routing update request as testing mechanism, when not receiving routing update at the appointed time, thinks not revival of this route, and this mode can not respond link failure fast.When RIP and BFD interlock used BFD to detect link failure, RIP can cancel the inefficacy route fast, reduces other professional influences.
The purpose of RIP and BFD interlock is in order to accelerate the convergence time of RIP, not need to wait for 180 seconds ageing timer times of RIP regulation again, but does not change the operating mechanism of RIP itself.
The RIP interlock BFD provide two kinds of detection modes:
One, directly-connected neighbor adopts echo message single-hop detection mode, could set up the BFD session when having route to send in the opposite end.
Two, indirectly connected neighbours adopt the two-way detection mode of control (control) message, send when two ends have route mutually, and the interface and the receiving interface that enable BFD could be set up the BFD session between the neighbours when being same interface.
When the session two ends of detecting RIP directly connected subnet (being a jumping of IP message), be fit to adopt the unidirectional detection mode of echo of BFD, still, the echo mode then can lose efficacy when arriving neighbours through multi-hop.
When RIP and BFD interlock,, could set up the BFD session when having route to send in the opposite end for the echo message single-hop detection mode of directly-connected neighbor employing BFD.Like this; When 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 that carries in the message; And triggering BFD module creation BFD session; Receive the BFD back message using of router B when the BFD of router-A module after, the BFD session switches to the UP state from DOWN.
If the BFD module of router-A can not receive the BFD message of router B in preset duration; Then think link occurs fault between router-A, B; The BFD session switches to the DOWN state from UP; And notice RIP module BFD session DOWN; All routes that RIP module deletion router B sends are deleted the BFD session simultaneously.
But; Link single-pass between router-A, B; As: router-A to the link failure of router B but router B to the link of router-A just often; The RIP response message of the route of carrying renewal that the RIP module of router-A still can continue to receive that router B sends; So just, can trigger the BFD module foundation of router-A and the BFD session of router B; After treating that failure is set up in the BFD session; The BFD module of router-A can be notified RIP module deletion route again; This process can ceaselessly repeat, and it shows as route and does not stop concussion.
In addition; If only delete route from the UP migration for just notifying the RIP module under the situation of Down in the BFD session; Then when link just is single-channel fault from the outset always; The BFD session status just can't be moved to the UP state from DOWN; The BFD session switches to the DOWN state from UP situation just can not appear yet; But this moment, the RIP module still can be learnt the route of end-to-end router, will occur the phenomenon that the RIP module can't be deleted route all the time like this.
It is thus clear that; When RIP and BFD interlock; If link single-pass; The RIP module still can be learnt route, but the situation that route does not stop to shake or route can't be deleted can occur, even have backup link in the network like this; Route also can't switch to backup link; Route can't restrain, can only be through human intervention control, and the route that could accomplish backup link is switched.
Summary of the invention
The method and apparatus that the present invention provides RIP interlock BFD to set up route, the RIP route when avoiding the link single-pass can't be deleted the phenomenon with route oscillation.
Technical scheme of the present invention is achieved in that
A kind of routing information protocol RIP interlock bi-directional session detects the method that BFD sets up route, and this method comprises:
First equipment receives first RIP response message that second equipment is sent; Second equipment is added to RIP neighbours, and sets up the BFD session, if session is set up successfully with second equipment; Then, the route of second equipment is added in the routing table to the route of second device request, second equipment;
First equipment receives the follow-up RIP response message of sending of second equipment, with the route of second equipment in the routing update routing table in this message;
BFD session Down between first device discovery and second equipment deletes second equipment from RIP neighbours, simultaneously the route of second equipment is deleted from routing table.
Said and second equipment further comprises after setting up the BFD session:
When failure is set up in the BFD session, second equipment is deleted from RIP neighbours.
Said equipment is router or switch.
A kind of equipment comprises:
The RIP module: first RIP response message that second equipment that receives is sent is added to RIP neighbours with second equipment, and second device identification is carried at the BFD session sets up in the indication and send to the BFD module; The result is set up in the session that reception BFD module is sent, if this result indicates and sets up successfully, then sends the full routing table request of RIP to second equipment, and the route that second equipment returns is added in the routing table; The follow-up RIP response message of sending of second equipment that receives is with the route of second equipment in the routing update routing table in this message; When receive that the BFD module sends carry the BFD session Down indication of second device identification time, second equipment is deleted from RIP neighbours, simultaneously the route of second equipment is deleted from routing table;
BFD module: receive said BFD session and set up indication, set up the BFD session, the result is set up in session send to the RIP module with second equipment; When the BFD session Down that finds with second equipment room, send the BFD session Down indication of carrying second device identification to the RIP module.
Said RIP module is further used for, and the session of sending when the BFD module is set up the result and indicated when setting up failure, and second equipment is deleted from RIP neighbours.
Said equipment is router or switch.
The RIP route can't be deleted the generation with the route oscillation phenomenon when compared with prior art, the present invention had avoided the link single-pass.
Embodiment
Below in conjunction with accompanying drawing and specific embodiment the present invention is remake further detailed explanation.
The RIP interlock BFD that Fig. 2 provides for the embodiment of the invention sets up the method flow diagram of route, and as shown in Figure 2, its concrete steps are following:
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 through following mode:
The RIP module of router-A is searched router B sign in the RIP of self maintained neighbor list, if do not find, confirm that then this RIP response message is first RIP response message that router B sends; Otherwise, confirm 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 sign 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 RIP module of router-A triggers BFD module foundation of self and the BFD session between router B.
Step 204: the BFD module and the router B of router-A set up the BFD session, judges whether to set up successfully, if, execution in step 206; Otherwise, execution in step 205.
Step 205: the BFD module of router-A is sent the BFD session to the RIP of router-A module and is set up the failure indication, and the RIP module of router-A is deleted router B sign from the RIP neighbor list, and this flow process finishes.
Step 206: the BFD module of router-A is sent the indication of link bilateral to the RIP of router-A module; The RIP module of router-A is sent the full routing table request message of RIP to router B; The RIP module of router B receives this message; Return 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 the message self.
Step 208: the BFD module of router-A is found the BFD session DOWN with router B; Then send session DOWN notice to the RIP of router-A module; The RIP module of router-A is deleted router B sign from the RIP neighbor list of self, delete the route of the router B of self simultaneously.
Can find out from embodiment illustrated in fig. 2: because router-A is only when receiving first RIP response message of router B; Just set up RIP neighbours and trigger and to set up the BFD session; And, the BFD session just asks route after setting up successfully to router B; And the route of adding router B; And when receiving the follow-up RIP response message of router B; Only carry out routing update and do not carry out the action that the BFD session is set up; When BFD session Down; The route of deletion router B; Like this; When the link single-pass between router-A and router B; Even router-A receives the RIP response message of router B; Router-A can not repeat to set up route yet, has avoided route can't delete the generation with the 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 invention sets up the composition sketch map 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 that receives is sent is added to RIP neighbours with second equipment, and second device identification is carried at the BFD session sets up in the indication and send to BFD module 32; The result is set up in the session that reception BFD module 32 is returned, if this result indicates and sets up successfully, then sends the full routing table request of RIP to second equipment, and the route that second equipment returns is added in the routing table; The follow-up RIP response message of sending of second equipment that receives is with the route of second equipment in the routing update routing table in this message; When receive that BFD module 32 sends carry the BFD session Down indication of second device identification time, second equipment is deleted from RIP neighbours, simultaneously the route of second equipment is deleted from routing table.
RIP module 31 is further used for, and the session of returning when BFD module 32 is set up the result and indicated when setting up failure, and second equipment is deleted from RIP neighbours.
BFD module 32: receive the BFD session foundation indication of carrying second device identification that RIP module 31 is sent, set up the BFD session, the result is set up in session return to RIP module 31 with second equipment; When the BFD session Down that finds with second equipment room, send the BFD session Down indication of carrying second device identification to RIP module 31.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.