Background technology
The router of distributed forwarding comprises master control borad and interface board, (English full name is Central Processing Unit on each interface board, independently CPU (central processing unit), English referred to as CPU) carry out forward process, master control borad belongs to the key-course of router, the routing iinformation that master control borad obtains according to Routing Protocol session interaction generates route table items, master control borad is stored in the route table items of generation in the routing table (Routing Table) of master control borad, and route table items is sent to each interface board, (English full name is Forwarding Information Database at interface board, to form forwarding information table, english abbreviation is FIB), forward layer by the FIB acquisition next hop information of query interface plate and carry out message repeating.
In dual-homing networking, as Fig. 1, router-A and router B are active/standby backup relation, router-A is primary route device, router B is backup router, under normal circumstances, the down hop that couple in router is forwarded to the fib table item that the flow in public network network uses is router-A, when router-A breaks down, the down hop of this fib table item of couple in router can be switched to router B, the network equipment and couple in router after router-A recovers in meeting and public network network are set up Routing Protocol session, the route table items of the public network network that couple in router is learnt from router-A only need to be switched to router-A by router B by down hop, can complete renewal very soon, and router-A is as core network device, may access a large amount of couple in routers or other backbone device, the route table items quantity that need to learn with respect to couple in router is more, therefore, there will be couple in router from a route table items of public network e-learning, to send to the FIB of couple in router interface board, and this route table items on router-A is not also sent to the FIB of router-A interface board.For example, after router-A fault recovery, public network network is published to router-A by Routing Protocol session by route table items 123.1.1.1, router-A joins route table items 123.1.1.1 in the transmit queue of router-A, wait for that scheduling sends to the FIB of router-A interface board, couple in router is by setting up with router-A the route table items 123.1.1.1 that the issue of public network network has also been learnt in Routing Protocol session, the down hop of the route table items 123.1.1.1 that couple in router is learnt is router-A, couple in router also joins route table items 123.1.1.1 in the transmit queue of couple in router, wait for that scheduling sends to the FIB of couple in router interface board, because the route table items that the new study of couple in router is arrived is less with respect to router-A, the speed of the FIB of the interface board that route table items 123.1.1.1 issues, and router-A is due to as core router fault recovery, need the route table items quantity of study more with respect to couple in router, therefore, the route table items that sends to interface board is also more, may occur that couple in router has sent to route table items 123.1.1.1 the FIB of couple in router interface board, and the FIB of the router-A interface board that router-A does not also send route table items 123.1.1.1, now, if receiving, couple in router need to be forwarded to the flow that destination is 123.1.1.1, the down hop of the fib table item that interface board destination is 123.1.1.1 on couple in router is router-A, couple in router can be by these traffic forwardings to router-A, because router-A is not also by the interface board of the router-A of route table items 123.1.1.1 transmission, therefore when flow arrives, can be the fib table item of 123.1.1.1 and flow is abandoned owing to can not find out destination at interface board, there is traffic loss.
In prior art, mainly by configuring two-way converting detection on the link between primary route device and couple in router, (English full name is Bidirectional Forwarding Detection, English referred to as BFD) solve problems, when detecting the slow certain hour of primary route device recovery latency, BFD make again the Link State between primary route device and couple in router recover, the Routing Protocol session establishment that can postpone primary route device and couple in router by this scheme, can realize at primary route device as far as possible and the route table items from public network e-learning being issued to the FIB of primary route device interface board, to by Routing Protocol session, send to couple in router from the route table items of primary route device study again, thereby guarantee that flow do not lose as far as possible, but there is following problem in this scheme:
1, due to by the Link State between BDF delayed recovery primary route device and couple in router, can cause other agreements that depend on Link State to can not get timely foundation, cause these other depend on Link State protocol service cannot work.
2, due to the Link State passing through between BDF delayed recovery primary route device and couple in router, the Routing Protocol session establishment that has postponed primary route device and couple in router, cause couple in router need to postpone study to the route table items from the issue of public network network, and in this process, may exist some from public network network, to be newly published to the route table items of the high priority of primary route device, as the route table items of direct connected link, the route table items of these high priorities may arrive by preference learning, these high priority route table items can preferentially send to the FIB of primary route device interface board, and these route table items still will wait until that BFD delay certain hour just can be access in router and learn, and the flow that couple in router is used these high priority route table items to forward will be lost in this process.
Embodiment
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Referring to Fig. 2, the embodiment of the present invention provides a kind of method that generates route table items in distribution router, and described distribution router comprises master control borad and interface board, comprising:
202, receive the routing update message that comprises route prefix and the first down hop;
In network, when setting up Routing Protocol session between router, the route table items that issue oneself is preserved each other, described route table items transmits by routing update message, described Routing Protocol session can be assisted instrument by internal gateway, and (English full name is Interior Gateway Protocol, english abbreviation is IGP) or Border Gateway Protocol (English full name is Border Gateway Protocol, and english abbreviation is BGP) set up.
204, according to described route prefix, in the routing table of described master control borad, obtain the first corresponding route table items, described the first route table items comprises the second down hop, and described the first down hop is added in described the first route table items and generated secondary route list item;
The route table items of learning from other network equipments in distribution router can first be stored in the routing table of master control borad, described routing table stores route table items, route table items comprises route prefix and down hop, for instance, for example, in the route table items that arrival destination address is 123.1.1.1, can store route prefix 123.1.1.1, down hop 234.1.1.1.
Route table items in described routing table is to take route prefix as index, by route prefix information in the routing update message of described reception, in described routing table, search the route table items that whether has coupling, if while finding the route table items that has coupling, in the route table items finding described in described the second down hop is added to.
206, when the priority of described the second down hop is during lower than the priority of described the first down hop, start and delete timer, the duration of described deletion timer is predefined time value, when described deletion timer then after, from described secondary route list item, delete described the second down hop and generate Third Road by list item, described Third Road is sent to the forwarding information table FIB of described interface board by list item from described routing table;
Alternatively, described predefined time value sets in advance by order line, network manager is when carrying out the network planning, according to the route table items quantity of primary route device actual storage, pre-estimate primary route device learns route table items and sends these route table items to the total time of interface board FIB when fault recovery, according to defining described predefined time value the total time of described estimation, described predefined time value is wanted long enough, guarantee in described predefined time value, the route table items of learning after the fault recovery of described primary route device has sent to the FIB of interface board.For instance, for example, before described primary route device fault, the route table items of storage adds up to 100,000, estimate that it is approximately 10 seconds that described primary route device is learnt the time of this 100,000 route table items when fault recovery, send this 100,000 route table items to time of interface board FIB be approximately 5 seconds, therefore, arrange described in advance time value regularly can be 20 seconds.
Alternatively, described predefined time value can also arrange according to different route prefix.
Alternatively, set in advance route prefix set, the down hop of the route prefix that described route prefix set is preserved need to be deleted timer by startup and be deleted.Correspondingly, before starting described deletion timer, further comprise: during the route prefix that comprises described secondary route list item in determining described route prefix set, start described deletion timer.
Alternatively, set in advance down hop set, the down hop that described down hop set is preserved need to be deleted timer by startup and be deleted.Correspondingly, before starting described deletion timer, further comprise: while comprising described the second down hop in determining described down hop set, start described deletion timer.
By the way, when route table items generates, can avoid the down hop of all route table items all to start and delete timer and carry out down hop while deleting, minimizing is to taking distribution router cpu resource, for instance, network manager is when carrying out the network planning, can know on couple in router which route table items be by primary route device from far-end public network e-learning to, therefore, on couple in router, can arrange only have by described primary route device from public network e-learning to route prefix corresponding to route table items just add to described prefix sets, when receiving described routing update message, judge while comprising the route prefix in described routing update message in described prefix sets, just by starting timer, the second down hop of the described route table items of finding at described master control borad is carried out to delayed deletion.Or, network manager is when carrying out the network planning, can know after the fault recovery of primary route device, the down hop that couple in router arrives the route table items of far-end public network network is primary route device, the down hop that is primary route device by down hop is added in described down hop set, at described master control borad, find described route table items time, while judging the second down hop that comprises described route table items in described down hop set, just by starting timer, the second down hop at described route table items is carried out to delayed deletion.
Alternatively, in described routing update message, also other down hops may be comprised, for example, the 3rd down hop can also be comprised.According to the routing rule of Routing Protocol, the down hop of equal priority just can be placed in a updating message, therefore, the priority of described the 3rd down hop and described the first down hop is identical, correspondingly, in the routing table of described master control borad, get after described the first route table items, described the 3rd down hop is added in described the first route table items together with described the first down hop.
Alternatively, in described the first route table items, also may comprise other down hops, for example, also may comprise the 4th down hop, because the priority of the down hop in route table items is identical, therefore, when described deletion timer then after, described the 4th down hop in described secondary route list item is deleted together with described the second down hop.
208, described Third Road is sent to the forwarding information table FIB of described interface board from described routing table by list item.
Alternatively, described interface board receives described Third Road that described master control borad sends by list item, and store described Third Road by list item in described FIB, form fib table item.
For the clearer description embodiment of the present invention, now illustrate, for example, in Fig. 3, router-A is primary route device, router B is standby router, during router-A normal operation, public network network is 123.1.1.1 route table items to a prefix of couple in router issue, route table items 123.1.1.1 is published to couple in router through router-A and router B, at couple in router, can receive the route table items 123.1.1.1 that down hop is router-A from router-A, at couple in router, also can receive the route table items 123.1.1.1 that down hop is router B from router B, because router-A is primary route device, B is high for priority ratio router, while storing 123.1.1.1 in the routing table of couple in router, can preferred down hop be router-A, now, from couple in router, arriving the flow that public network network object is 123.1.1.1 will send from router-A.When router-A breaks down, the down hop of route table items 123.1.1.1 can be switched to router B, now, from couple in router, arriving the flow that public network network object is 123.1.1.1 will send from router B.On couple in router, by order line, described predefined time value being set is 30 seconds, when router-A fault recovery, router-A and public network and couple in router are set up after Routing Protocol session, public network network can be issued the route table items of 123.1.1.1 to router-A, router-A can be 123.1.1.1 by comprising prefix, down hop is that the routing update message of router-A sends to couple in router, couple in router receives and in the routing table of master control borad, finds prefix after described routing update message is 123.1.1.1, down hop is the route table items of router B, using router-A as down hop, also add in route table items 123.1.1.1, start timer, the duration of described timer is described predefined time value 30 seconds, described in this, predefined time value can be adjusted by order, but the route table items that the prefix that must guarantee to store in router-A in this predefined time value is 123.1.1.1 has sent in the interface board FIB of router-A, when described timer is deleted the next hop router B of route table items 123.1.1.1 in couple in router then, by comprising down hop, be that the route table items 123.1.1.1 of router-A sends to interface board FIB, now, from couple in router, arriving the flow that the address of public network network is 123.1.1.1 will send from router-A, because the interface board of router-A has been preserved the route table items that prefix is 123.1.1.1 then at described timer, therefore, the flow that arrival destination address is 123.1.1.1 will normally be forwarded to public network network, there will not be packet loss.
Visible, a kind of method that generates route table items in distribution router is provided by the embodiment of the present invention, in dual-homing networking, when primary route device breaks down recovery, by to low priority down hop delayed deletion, guarantee that at flow primary route device interface board has been preserved corresponding fib table item, thereby can effectively avoid packet loss when arriving primary route device through couple in router.
Referring to Fig. 5, the embodiment of the present invention provides a kind of distribution router, and described distribution router comprises master control borad 502 and interface board 504, and described master control borad comprises:
Receiving element 506, for receiving the routing update message that comprises route prefix and the first down hop;
The first generation unit 508, for obtaining the first corresponding route table items according to described route prefix in the routing table of described master control borad, described the first route table items comprises the second down hop, and described the first down hop is added in described the first route table items and generated secondary route list item;
The second generation unit 510, for when the priority of described the second down hop is during lower than the priority of described the first down hop, start and delete timer, the duration of described deletion timer is predefined time value, when described deletion timer then after, from described secondary route list item, delete described the second down hop and generate Third Road by list item;
Transmitting element 512, for sending to by list item described Third Road the forwarding information table FIB of described interface board from described routing table.
In network, when setting up Routing Protocol session between router, the route table items that issue oneself is preserved each other, described route table items transmits by routing update message, described Routing Protocol session can be assisted instrument by internal gateway, and (English full name is Interior Gateway Protocol, english abbreviation is IGP) or Border Gateway Protocol (English full name is Border Gateway Protocol, and english abbreviation is BGP) set up.
The route table items of learning from other network equipments in distribution router can first be stored in the routing table of master control borad, described routing table stores route table items, route table items comprises route prefix and down hop, for instance, for example, in the route table items that arrival destination address is 123.1.1.1, can store route prefix 123.1.1.1, down hop 234.1.1.1.
Route table items in described routing table is to take route prefix as index, by route prefix information in the routing update message of described reception, in described routing table, search the route table items that whether has coupling, if while finding the route table items that has coupling, in the route table items finding described in described the second down hop is added to.
Alternatively, described master control borad 502 also comprises the first dispensing unit, and described the first dispensing unit is for setting in advance described predefined time value by order line.Network manager is when carrying out the network planning, according to the route table items quantity of primary route device actual storage, pre-estimate primary route device learns route table items and sends these route table items to the total time of interface board FIB when fault recovery, according to defining described predefined time value the total time of described estimation, described predefined time value is wanted long enough, guarantee in described predefined time value, the route table items of learning after the fault recovery of described primary route device has sent to the FIB of interface board.For instance, for example, before described primary route device fault, the route table items of storage adds up to 100,000, estimate that it is approximately 10 seconds that described primary route device is learnt the time of this 100,000 route table items when fault recovery, send this 100,000 route table items to time of interface board FIB be approximately 5 seconds, therefore, arrange described in advance time value regularly can be 20 seconds.
Alternatively, described master control borad 502 also comprises the second dispensing unit, and described the second dispensing unit is used for setting in advance route prefix set;
Correspondingly, described the second generation unit 510 further comprises before starting deletion timer:
While determining the route prefix that comprises described secondary route list item in described route prefix set, start described deletion timer.The down hop of the route prefix that described route prefix set is preserved need to be deleted timer by startup and be deleted.
Alternatively, described master control borad 502 also comprises the 3rd dispensing unit, and described the 3rd dispensing unit is used for setting in advance down hop set;
Correspondingly, described the second generation unit further comprises before starting deletion timer:
Determine while comprising described the second down hop in described down hop set, start described deletion timer.The down hop that described down hop set is preserved need to be deleted timer by startup and be deleted.
By the way, when route table items generates, can avoid the down hop of all route table items all to start and delete timer and carry out down hop while deleting, minimizing is to taking distribution router cpu resource, for instance, network manager is when carrying out the network planning, can know on couple in router which route table items be by primary route device from far-end public network e-learning to, therefore, on couple in router, can arrange only have by described primary route device from public network e-learning to route prefix corresponding to route table items just add to described prefix sets, when receiving described routing update message, judge while comprising the route prefix in described routing update message in described prefix sets, just by starting timer, the second down hop of the described route table items of finding at described master control borad is carried out to delayed deletion.Or, network manager is when carrying out the network planning, can know after the fault recovery of primary route device, the down hop that couple in router arrives the route table items of far-end public network network is primary route device, the down hop that is primary route device by down hop is added in described down hop set, at described master control borad, find described route table items time, while judging the second down hop that comprises described route table items in described down hop set, just by starting timer, the second down hop at described route table items is carried out to delayed deletion.
Alternatively, in described routing update message, also other down hops may be comprised, for example, the 3rd down hop can also be comprised.According to the routing rule of Routing Protocol, the down hop of equal priority just can be placed in a updating message, therefore, the priority of described the 3rd down hop and described the first down hop is identical, correspondingly, in the routing table of described master control borad, get after described the first route table items, described the 3rd down hop is added in described the first route table items together with described the first down hop.
Alternatively, in described the first route table items, also may comprise other down hops, for example, also may comprise the 4th down hop, because the priority of the down hop in route table items is identical, therefore, when described deletion timer then after, described the 4th down hop in described secondary route list item is deleted together with described the second down hop.
108, described Third Road is sent to the forwarding information table FIB of described interface board from described routing table by list item.
Alternatively, described interface board comprises processing unit, described processing unit, for receiving described Third Road that described master control borad sends by list item, and store described Third Road by list item in described FIB, form fib table item.
Visible, by the embodiment of the present invention, provide a kind of distribution router, in dual-homing networking, when primary route device breaks down recovery, by to low priority down hop delayed deletion, guarantee that at flow primary route device interface board has been preserved corresponding fib table item, thereby can effectively avoid packet loss when arriving primary route device through couple in router.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can complete by the relevant hardware of program command, aforementioned program can be stored in a computer read/write memory medium, this program, when carrying out, is carried out the step that comprises said method embodiment; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CDs.
Finally it should be noted that: above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to previous embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or part technical characterictic is wherein equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.