Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out
Clearly and completely describe, it is clear that described embodiment is only a part of embodiment of the present invention, and
It is not all, of embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art are not doing
Go out the every other embodiment obtained under creative work premise, broadly fall into the scope of protection of the invention.
One of main thought of the embodiment of the present invention may include that
Determine the first detection forwarding-table item that in forwarding-table item to be detected, fault is easily sent out, and the second detection turns
Forwarding list item, this second detection forwarding-table item is not include in forwarding-table item to be detected that described first detection forwards
The forwarding-table item of list item, and within each detection cycle, detect in forwarding-table item to be detected and be not detected
The first quantity first detection forwarding-table item and the second quantity second detection forwarding-table item.Easily send out
First detection forwarding-table item of raw fault is preferentially detected, and detects fault forwarding-table item such that it is able to shorten
Time, improve fault detection efficiency.
One embodiment of a kind of forwarding-table item fault detection method that Fig. 1 provides for the embodiment of the present invention,
The method may include that
101: determine the first detection forwarding-table item that in forwarding-table item to be detected, fault is easily sent out, and the second inspection
Survey forwarding-table item.
Wherein, this second detection forwarding-table item is not include in forwarding-table item to be detected that described first detection turns
The forwarding-table item of forwarding list item.
Router is a kind of forwarding unit, is mainly searched device by processor, forwarding engine, algorithm, is deposited
The device compositions such as reservoir, wherein, forwarding engine is the core devices in router, is responsible for the forwarding of message
And process.
Router includes different types of forwarding-table item, such as routing table, Label Forwarding Information Base etc., mainly
Generated by the computing of various control protocols by the control plane in router.The forwarding-table item conduct generated
Source forwarding-table item is stored in the internal memory of processor, can be issued to forward engine simultaneously, is deposited by forwarding engine
Store up in forwarding the memorizer that engine is corresponding.Forward engine when carrying out message forwarding etc. and processing, be to pass through
Search the forwarding-table item in its corresponding memorizer, realize the operations such as message forwarding according to forwarding-table item.
This forwarding-table item to be detected is and forwards the forwarding-table item of storage in engine correspondence memorizer, is specially
During once traveling through detection, memorizer needs the forwarding-table item being detected.
In the present embodiment, it is first determined go out the first detection forwarding-table item in this forwarding-table item to be detected, with
And second detection forwarding-table item.
This first detection forwarding-table item refers to easily occur event in the forwarding-table item that fault is easily sent out, i.e. memorizer
Barrier, causes the forwarding-table item that content is different from the content of corresponding source forwarding-table item.
Owing to the purpose of fault detect is to detect fault forwarding-table item, to implement corresponding measure,
Reduce the impact that fault causes.Therefore in the embodiment of the present application, it is first determined go out and may easily break down
First detection forwarding-table item, other forwarding-table items to be detected are i.e. as the second detection forwarding-table item.
The determination of the first detection forwarding-table item that this fault is easily sent out can have multiple implementation, real below
Execute in example and can be discussed in detail.
102: within the detection cycle, detect the first inspection of the first quantity not detected in forwarding-table item to be detected
Surveying the second detection forwarding-table item of forwarding-table item and the second quantity, described first quantity is more than or equal to 1
Positive integer, described second quantity is the positive integer more than or equal to 0.
In order to avoid taking processor resource, forwarding-table item fault detect is periodically carried out, in the detection cycle
In a number of forwarding-table item to be detected is detected.Detection forwarding-table item is i.e. to be detected turn of comparison
The content of the content of forwarding list item and source forwarding-table item corresponding to forwarding-table item to be detected is the most identical.
In the embodiment of the present application, can traversal detection multiple detection cycles each detection cycle in,
Detecting the first detection forwarding-table item of the first quantity and the second detection forwarding-table item of the second quantity, this is the years old
One detection forwarding-table item and the second detection forwarding-table item are and travel through detection process at a forwarding-table item
In, not detected forwarding-table item to be detected, thereby may be ensured that each forwarding-table item to be detected all can quilt
Detect one time.
This first quantity and the second quantity sum are equal to the forwarding-table item amount detection in the detection cycle.This is years old
One quantity and the second quantity can be the same or different.
Owing to the quantity of the first detection forwarding-table item is limited, if within a detection cycle, the most tested
When the quantity of the first detection forwarding-table item surveyed is less than this first quantity, then can examine within this detection cycle
Surveying the first the most not detected detection forwarding-table item, within this detection cycle, the second detection of detection forwards
The quantitative value of list item can be that described forwarding-table item amount detection turns with this first the most not detected detection
The difference of forwarding list item quantity.When the first detection forwarding-table item has all detected, within the detection cycle,
Only detection second can detect forwarding-table item, until all forwarding-table items to be detected are all detected one time.
Owing to, within the detection cycle, the forwarding-table item to be detected of detection includes the first detection that fault is easily sent out
Forwarding-table item so that the forwarding-table item being susceptible to fault is preferentially detected, therefore shortens and detects event
The time of barrier forwarding-table item, improve fault detection efficiency.
In a kind of possible implementation, this second quantity can be zero, thus carries out forwarding-table item fault
During detection, can first detect the first detection forwarding-table item that fault is easily sent out, the first quantity is i.e. equal to each
The forwarding-table item amount detection in detection cycle, can determine fault forwarding-table item faster.
In alternatively possible implementation, this first quantity can be more than or equal to the second quantity, due to
Second detection forwarding-table item also likely to be present the forwarding-table item broken down, in order to avoid break down
Second detection forwarding-table item can not comparatively fast be detected, can be in each detection cycle detection the second quantity
Second detection forwarding-table item, it is ensured that the balance of fault detect.
When the first quantity is identical with the second quantity, it is assumed that the first detection forwarding-table item total quantity is M, often
The forwarding-table item amount detection in one detection cycle is N, then can be divided into by the first detection forwarding-table item
M*2/N group, often group N/2 bar first detects forwarding-table item, then, within a detection cycle, can detect
N/2 bar first detects forwarding-table item and N/2 bar second detects forwarding-table item.So that
Complete one in M*2/N detection cycle and take turns the traversal for the first detection forwarding-table item, the most each detection
Cycle have detected the second detection forwarding-table item simultaneously, it is ensured that fault detect balances.
During forwarding-table item detects, if be detected that fault forwarding-table item, fault cues can be exported
Information.May also take on corresponding failure recovery measure and recover fault forwarding-table item.
Certainly, during forwarding-table item detects, it is also possible to statistics fault forwarding-table item quantity, with basis
The varying number of fault forwarding-table item, takes different faults measure.
Such as, the output fault cues information when fault forwarding-table item quantity is more than or equal to first threshold,
Or when fault forwarding-table item quantity is more than or equal to Second Threshold, takes corresponding measure to recover fault and turn
Forwarding list item etc..
In the present embodiment, when carrying out forwarding-table item fault detect, it is first determined the first inspection that fault is easily sent out
Survey forwarding-table item and the second detection forwarding-table item of this first detection forwarding-table item non-, in each detection week
In phase, the first detection forwarding-table item of the first quantity that detection is not detected and the second inspection of the second quantity
Survey forwarding-table item, so that the first detection forwarding-table item being susceptible to fault is preferentially detected,
Such that it is able to shorten the time detecting fault forwarding-table item, fault detection efficiency can be improved.
Another embodiment of a kind of forwarding-table item fault detection method that Fig. 2 provides for the embodiment of the present invention,
The method may include that
201: the lookup being used for instructing message to forward time of each forwarding-table item to be detected in calculating Preset Time
Number.
202: turn searching number of times as the first detection more than or equal to the forwarding-table item to be detected searching threshold value
Forwarding list item, the forwarding-table item to be detected of non-first detection forwarding-table item is as the second detection forwarding-table item.
Inventor finds under study for action, and a kind of possible situation of the forwarding-table item that fault is easily sent out is carrying business number
During the forwarding-table item that flow is bigger, i.e. service message forward process, the more forward table searched
?.
In the present embodiment, by calculate forwarding-table item each to be detected in Preset Time be used for instruct
The lookup number of times that message forwards, when carrying out message and forwarding, requires to look up forwarding-table item to determine forwarding phase
Pass information, this lookup number of times i.e. be statistics Preset Time in each forwarding-table item to be detected turn for message
The lookup number of times sent out.Search forwarding-table item often and be traffic streams journey relatively greatly, may be fault
The the first detection forwarding-table item easily sent out, therefore will search number of times more than or equal to search threshold value to be detected turn
Forwarding list item is as the first detection forwarding-table item.
Wherein, owing to, in router message processing procedure, the carrying business datum amount of forwarding-table item is change
, therefore to ensure the accuracy of the first detection forwarding-table item, it is also possible to periodically calculate and search number of times.
This is searched number of times can be by the lookup identification identifier (Identity, ID) in statistics forwarding-table item
Determine.Each forwarding-table item to be detected can include search id field, by non-zero different numerical value
Represent different forwarding-table item to be detected.During message forward process, if the forward table to be detected of hit
The lookup id field numerical value of item is non-zero, and for example, 1 or 2 etc., then the hit to this forwarding-table item to be detected
Number of times carries out accumulated counts, and the non-zero lookup id field of concrete can be different numerical value arranges depositing of correspondence
Storage space, the hit-count of the corresponding forwarding-table item to be detected that storage is cumulative, it is forward table to be detected
The lookup number of times of item.
203: within the detection cycle, detect the first of the first quantity not detected in forwarding-table item to be detected
Detection forwarding-table item and the second detection forwarding-table item of the second quantity.
Described first quantity is the positive integer more than or equal to 1, and described second quantity is more than or equal to 0
Positive integer.
The operation of 203 is similar to the operation of a upper embodiment step 101, and this is no longer going to repeat them.
This first quantity can be identical with this second quantity, it is also possible to different, this second quantity can be zero,
Can also be not zero, to ensure that fault detect balances.
Detect fault forwarding-table item, fault cues information can be exported, it is also possible to take fault recovery to arrange
Execute recovery fault forwarding-table item, can be discussed in detail in embodiment below.
Additionally, during forwarding-table item detects, it is also possible to statistics fault forwarding-table item quantity.With basis
The varying number of fault forwarding-table item, takes different faults measure.
Such as, the output fault cues information when fault forwarding-table item quantity is more than or equal to first threshold.
Or when fault forwarding-table item quantity is more than or equal to Second Threshold, takes corresponding measure to recover fault and turn
Forwarding list item etc..
In the present embodiment, when carrying out forwarding-table item fault detect, by every in Preset Time of statistics
The lookup number of times being used for instructing message to forward of one forwarding-table item to be detected, is more than or equal to lookup number of times
Search the to be detected of threshold value to detect as first, detecting for second of non-first detection, thus in each inspection
In the survey cycle, the first detection of the first quantity that detection is not detected and the second detection of the second quantity,
So that the first detection being susceptible to fault is preferential detected, shorten detection out of order time
Between, fault detection efficiency can be improved.
Another embodiment of a kind of forwarding-table item fault detection method that Fig. 3 provides for the embodiment of the present invention,
The method may include that
301: determine that the forwarding-table item connected for setting up communication protocol in forwarding-table item to be detected is the first inspection
Surveying forwarding-table item, the forwarding-table item of non-described first detection forwarding-table item is the second detection forwarding-table item.
Inventor finds under study for action, based in the communication connection that different communication protocol is set up, communicates to connect
The forwarding-table item that iso-ip Internetworking protocol ISO-IP (Internet Protocol, the IP) address of use is corresponding is also easily to go out
The forwarding-table item of existing fault, therefore in the present embodiment, sets up, by being used for, to be detected turn that communication protocol connects
The first detection forwarding-table item that forwarding list item is easily sent out as fault.
This different communication protocol can include Border Gateway Protocol (border gateway protocol, BGP)
Or tag distribution protocol (label distribution protocol, LDP) etc., the communication protocol set up
Connect and include that transmission control protocol (Transmission Control Protocol, TCP) connects.Due to TCP
Connect and need known source IP address, purpose IP address, tcp source port number and destination slogan.With BGP
As a example by agreement, may determine that when disposing TCP connects the IP address used, therefore can be by this IP
Route table items corresponding to address is as the project of preferential detection.
302: within the detection cycle, detect the first of the first quantity not detected in forwarding-table item to be detected
Detection forwarding-table item and the second detection forwarding-table item of the second quantity.
Described first quantity is the positive integer more than or equal to 1, and described second quantity is more than or equal to 0
Positive integer.
The operation of step 302 is similar to the operation of a upper embodiment step 101, and this is no longer going to repeat them.
This first quantity can be identical with this second quantity, it is also possible to different, this second quantity can be zero,
Can also be not zero, to ensure that fault detect balances.
Detect fault forwarding-table item, fault cues information can be exported, certainly may also take on fault extensive
Multiple measure recovers fault forwarding-table item, can be discussed in detail in embodiment below.
Additionally, during forwarding-table item detects, it is also possible to statistics fault forwarding-table item quantity.With basis
The varying number of fault forwarding-table item, takes different faults measure.
Such as, the output fault cues information when fault forwarding-table item quantity is more than or equal to first threshold.
Or when fault forwarding-table item quantity is more than or equal to Second Threshold, takes corresponding measure to recover fault and turn
Forwarding list item etc..
In the present embodiment, when carrying out forwarding-table item fault detect, by being used for setting up communication protocol even
The forwarding-table item to be detected connect is as the first detection forwarding-table item, and non-first detects the to be detected of forwarding-table item
Forwarding-table item is as the second detection forwarding-table item, thus within each detection cycle, detection is not detected
First detection forwarding-table item of the first quantity and the second detection forwarding-table item of the second quantity, so that
The the first detection forwarding-table item being susceptible to fault is preferentially detected, and shortens and detects fault forwarding-table item
Time, fault detection efficiency can be improved.
In the embodiment of forwarding-table item fault detection method shown in Fig. 2 and Fig. 3, give and determine the first detection
The possible implementation of forwarding-table item, certain embodiment of the present invention can also adopt and realize in other ways, example
As alternatively possible implementation is: determine that the first detection detection preset in forwarding-table item to be detected turns
Forwarding list item, and the second detection forwarding-table item of non-first detection forwarding-table item.
This first detection forwarding-table item preset can be the forwarding-table item to be detected selected by user, route
Device can provide corresponding interface, receives the selection request of user.
Another possible implementation is: according to historical failure record information, determine that fault is easily sent out
One detection forwarding-table item.
Namely in forwarding-table item process fault detection, fault forwarding-table item can be carried out record.Thus
When re-starting forwarding-table item fault detect, can determine what fault was easily sent out according to history information
Forwarding-table item to be detected.
A kind of forwarding-table item another embodiment of fault detection method that Fig. 4 provides for the embodiment of the present invention,
The method may include that
401: determine the first detection forwarding-table item that in forwarding-table item to be detected, fault is easily sent out, and the second inspection
Survey forwarding-table item.
Wherein, this second detection forwarding-table item is not include in forwarding-table item to be detected that described first detection turns
The forwarding-table item of forwarding list item.
Wherein it is determined that the first detection forwarding-table item that in forwarding-table item to be detected, fault is easily sent out can have multiple
Implementation, such as can by calculate each forwarding-table item to be detected in Preset Time be used for instruct report
Literary composition forward lookup number of times, using search number of times more than or equal to search threshold value forwarding-table item to be detected as
First detection forwarding-table item;
Or forwarding-table item to be detected will be used for the forwarding-table item setting up communication protocol connection as the first inspection
Surveying forwarding-table item, the forwarding-table item of non-first detection forwarding-table item is the second detection forwarding-table item;
Or this first detection forwarding-table item is the first detection forwarding-table item preset in forwarding-table item to be detected
Deng.
402: within the detection cycle, detect the first of the first quantity not detected in forwarding-table item to be detected
Detection forwarding-table item and the second detection forwarding-table item of the second quantity.
Described first quantity is the positive integer more than or equal to 1, and described second quantity is more than or equal to 0
Positive integer.
The operation of this step 402 is similar to the operation of step 102, repeats no more.
Wherein, forwarding-table item fault detect is for periodically carrying out.
This first quantity and the second quantity sum are equal to the forwarding-table item amount detection in each detection cycle.
403: if be detected that fault forwarding-table item quantity more than or equal to Second Threshold, to forwarding engine
Re-issue the source forwarding-table item that fault forwarding-table item is corresponding.
Forwarding-table item detect during, statistics fault forwarding-table item quantity, if be detected that fault
Forwarding-table item quantity is more than or equal to Second Threshold, then to forwarding engine to re-issue this fault forwarding-table item
Corresponding source forwarding-table item, to update the content of fault forwarding-table item.Wherein, this Second Threshold can be 1,
As long as now i.e. fault forwarding-table item being detected, fault forwarding-table item pair can be re-issued to forwarding engine
The source list item answered
Different types of route forwarding table items that router generates, is stored in processor as source forwarding-table item
In internal memory, if fault forwarding-table item therefore being detected, this fault forwarding-table item can be re-issued corresponding
Source forwarding-table item, storage in memory, replaces fault forwarding-table item, it is ensured that store in memorizer
The content of forwarding-table item consistent with the content of source forwarding-table item so that router can be with normal operation.
In the present embodiment, when carrying out forwarding-table item fault detect, it is first determined the first inspection that fault is easily sent out
Survey forwarding-table item, and the second detection forwarding-table item of non-first detection forwarding-table item, thus in each inspection
In the survey cycle, the of the first detection forwarding-table item of the first quantity that detection is not detected and the second quantity
Two detection forwarding-table items, so that the first detection forwarding-table item being susceptible to fault is preferentially detected,
Shorten the time detecting fault forwarding-table item, fault detection efficiency can be improved.Simultaneously when detecting
During fault forwarding-table item, it is also possible to re-issue the source forwarding-table item that this fault forwarding-table item is corresponding, to replace
Change fault forwarding-table item so that fault forwarding-table item recovers, it is ensured that router correctly runs, and reduces
On the current impact performing business.
Another embodiment of a kind of forwarding-table item fault detection method that Fig. 5 provides for the embodiment of the present invention,
The method may include that
501: determine the first detection forwarding-table item that in forwarding-table item to be detected, fault is easily sent out, and the second inspection
Survey forwarding-table item.
Wherein, this second detection forwards phenotype to be not include in forwarding-table item to be detected that this first detection forwards
The forwarding-table item of list item.
Wherein it is determined that the first detection forwarding-table item that in forwarding-table item to be detected, fault is easily sent out can have multiple
Implementation, such as can by calculate each forwarding-table item to be detected in Preset Time be used for instruct report
Literary composition forward lookup number of times, using search number of times more than or equal to search threshold value forwarding-table item to be detected as
First detection forwarding-table item;
Or forwarding-table item to be detected will be used for the forwarding-table item setting up communication protocol connection as the first inspection
Survey forwarding-table item;
Or this first detection forwarding-table item is the first detection forwarding-table item preset in forwarding-table item to be detected
Deng.
In list item to be detected, the forwarding-table item of non-first detection forwarding-table item is the second detection forwarding-table item.
502: within the detection cycle, detect the first of the first quantity not detected in forwarding-table item to be detected
Detection forwarding-table item and the second detection forwarding-table item of the second quantity.
The operation of this step 502 is similar to the operation of step 102, repeats no more.
Wherein, forwarding-table item fault detect is for periodically carrying out.
This first quantity can be identical with this second quantity, it is also possible to different, this second quantity can be zero,
Can also be not zero, to ensure that fault detect balances.
This first quantity and the second quantity sum are equal to the forwarding-table item amount detection in each detection cycle.
503: if be detected that fault forwarding-table item quantity more than or equal to the 3rd threshold value, determine described in deposit
Untapped default memory area in reservoir, by source forwarding-table item storage corresponding for described fault forwarding-table item
At described default memory area, and update the index letter indexing described fault forwarding-table item storage area address
Breath is the index information of described default storage area address.
In the present embodiment, during memorizer forwarding table memory item, being commonly stored space will not all use.Cause
This can arrange extra default memory area in memory, will mark off headspace by memorizer,
During memorizer original state, it is not used in forwarding table memory item.
If the quantity of the fault forwarding-table item detected is more than or equal to the 3rd threshold value, then fault can be turned
The source forwarding-table item that forwarding list item is corresponding is stored in this default memory area, updates index fault simultaneously and forwards
The index information that index information is described default storage area address of list item storage address.Thus carry out
During Message processing, the forwarding-table item of correspondence, this forward table can be found according to the index information updated
Item is the forwarding-table item that there is not fault.Thus ensure that the correct operation of router.
Wherein, the 3rd threshold value can be identical with Second Threshold, it is also possible to different.
As a example by forwarding-table item in forwarding-table item is as routing table, each forwarding-table item is all to there being IP address
And mask information, and the next hop information that IP address is corresponding with mask information.IP address and mask information
Storage algorithm in the router is searched in device, and next hop information is stored in as forwarding-table item content
In reservoir, algorithm is searched device and is also stored the forwarding-table item that different IP addresses is corresponding with mask information simultaneously
The index information of the storage address of content.When routeing, it is to exist according to the target ip address in message
Algorithm is searched in device and is mated, and finds the IP address and mask information mated with this target ip address,
Thus i.e. would know that the index information of the forwarding-table item of correspondence, Target IP can be found according to this index information
The storage area address of the next hop information that address is corresponding, such that it is able to read next in respective memory regions
Hop-information, it is achieved message forwarding etc. operate.
Therefore when fault forwarding-table item storage area address change in memorizer, by updating correspondence simultaneously
Index information, enabling when route querying, find this forwarding-table item.
Certainly, when quantity fault forwarding-table item being detected is more than or equal to first threshold, it is also possible to defeated
Be out of order information, to point out user's forwarding-table item to break down.
In the present embodiment, when carrying out forwarding-table item fault detect, it is first determined the first inspection that fault is easily sent out
Survey forwarding-table item, and the second detection forwarding-table item of non-first detection forwarding-table item, thus in each inspection
In the survey cycle, the of the first detection forwarding-table item of the first quantity that detection is not detected and the second quantity
Two detection forwarding-table items, so that the first detection forwarding-table item being susceptible to fault is preferentially detected,
Shorten the time detecting fault forwarding-table item, fault detection efficiency can be improved.Simultaneously when detecting
During fault forwarding-table item, it is also possible to be stored in source forwarding-table item corresponding for this fault forwarding-table item to preset and deposit
In storage area territory, update the index information of this fault forwarding-table item, it is also possible to make fault forwarding-table item simultaneously
Recover, it is ensured that router correctly runs, reduce the current impact performing business.
Fig. 6 is another embodiment of the embodiment of the present invention a kind of forwarding-table item fault detection method, the party
Method may include that
601: determine the first detection forwarding-table item that in forwarding-table item to be detected, fault is easily sent out, and the second inspection
Survey forwarding-table item.
Wherein it is determined that the first detection forwarding-table item that in forwarding-table item to be detected, fault is easily sent out can have multiple
Implementation, such as can by calculate each forwarding-table item to be detected in Preset Time be used for instruct report
Literary composition forward lookup number of times, using search number of times more than or equal to search threshold value forwarding-table item to be detected as
First detection forwarding-table item;
Or forwarding-table item to be detected will be used for setting up the first detection of the forwarding-table item that communication protocol connects
Forwarding-table item, the forwarding-table item of non-first detection forwarding-table item is as the second detection forwarding-table item;
Or this first detection forwarding-table item is the first detection forwarding-table item preset in forwarding-table item to be detected
Deng.
In list item to be detected, the forwarding-table item of non-first detection forwarding-table item is the second detection forwarding-table item
602: within the detection cycle, detect the first of the first quantity not detected in forwarding-table item to be detected
Detection forwarding-table item and the second detection forwarding-table item of the second quantity.
The operation of this step 602 is similar to the operation of step 102, repeats no more.
Wherein, forwarding-table item fault detect is for periodically carrying out.
This first quantity can be identical with this second quantity, it is also possible to different, this second quantity can be zero,
Can also be not zero, to ensure that fault detect balances.
This first quantity and the second quantity sum are equal to the forwarding-table item amount detection in each detection cycle.
603: if be detected that the quantity of fault forwarding-table item is more than or equal to Second Threshold, to forwarding engine
Re-issue the source forwarding-table item that fault forwarding-table item is corresponding.
604: whether failure judgement forwarding-table item is updated successfully, if it does not, perform step 605, if it is,
Then return step 602 and continue detection.
605: determine untapped default memory area in described memorizer, by described fault forwarding-table item pair
The source forwarding-table item answered is stored in described default storage content, and updates the described fault forwarding-table item of index and deposit
The index information that index information is described default storage area address of storage address.
It is with the embodiment difference of forwarding-table item fault detection method shown in Fig. 4 or Fig. 5, works as detection
During to fault forwarding-table item, first to forwarding engine to re-issue the source forward table that fault forwarding-table item is corresponding
, to update this fault forwarding-table item.When fault forwarding-table item recovers unsuccessfully, then this fault is forwarded
The source forwarding-table item that list item is corresponding is stored in the default memory area of memorizer, updates index described simultaneously
The index information of fault forwarding-table item storage address.Two kinds of fault recovery mode classifications are used to carry out fault extensive
Multiple, the fault recovery of fault forwarding-table item can be effectively ensured, further ensure the correct fortune of router
OK.
First source forwarding-table item corresponding for this fault forwarding-table item can certainly be stored in presetting of memorizer
In memory area, when the memory space inadequate of default memory area, e.g., less than preset value, then to turning
Carry out the coffin upon burial to hold up and re-issue the source forwarding-table item that fault forwarding-table item is corresponding, to update this fault forwarding-table item.
In the present embodiment, when carrying out forwarding-table item fault detect, it is first determined the first inspection that fault is easily sent out
Survey forwarding-table item, and the second detection forwarding-table item of non-first detection forwarding-table item, thus in each inspection
In the survey cycle, the of the first detection forwarding-table item of the first quantity that detection is not detected and the second quantity
Two detection forwarding-table items, so that the first detection forwarding-table item being susceptible to fault is preferentially detected,
Shorten the time detecting fault forwarding-table item, fault detection efficiency can be improved.Simultaneously when detecting
During fault forwarding-table item, it is also possible to re-issue the source forwarding-table item that fault forwarding-table item is corresponding, updating should
Fault forwarding-table item, if updating unsuccessfully, is then stored in source forwarding-table item corresponding for this fault forwarding-table item
Preset in memory area, update the index information of this fault forwarding-table item, it is possible to fault is forwarded simultaneously
List item recovers, it is ensured that router correctly runs.
For aforesaid each method embodiment, in order to be briefly described, therefore it is all expressed as a series of dynamic
Combining, but those skilled in the art should know, the present invention is not by described sequence of movement
Limiting, because according to the present invention, some step can use other orders or carry out simultaneously.Secondly,
Those skilled in the art also should know, embodiment described in this description belongs to preferred embodiment,
Necessary to involved action and the unit not necessarily present invention.
The knot of a kind of one embodiment of forwarding-table item failure detector that Fig. 7 provides for the embodiment of the present invention
Structure schematic diagram, this device may include that
List item determines unit 701, for determining that the first detection that in forwarding-table item to be detected, fault is easily sent out forwards
List item and the second detection forwarding-table item.Wherein, this second detection forwarding-table item is described forwarding to be detected
List item does not include the forwarding-table item of described first detection forwarding-table item.
Forwarding-table item failure detector described in the present embodiment is applied to router, and concrete is desirably integrated into
In the processor of router.
Wherein it is determined that the first detection forwarding-table item that fault is easily sent out can use multiple implementation, as
A kind of possible implementation, as shown in Figure 8, this forwarding-table item determines that unit 801 may include that
Computing unit 801, in calculate Preset Time each forwarding-table item to be detected be used for instruct message
The lookup number of times forwarded.
Wherein, this computing unit specifically in each measurement period, each in calculating Preset Time is treated
The lookup number of times being used for instructing message to forward of detection forwarding-table item.
List item determines subelement 802, for searching number of times more than or equal to the forwarding to be detected searching threshold value
List item is as the first detection forwarding-table item, and the forwarding-table item to be detected of non-first detection forwarding-table item is second
Detection forwarding-table item.
Inventor finds under study for action, and a kind of possible situation of the forwarding-table item that fault is easily sent out is carrying business number
According to the forwarding-table item that flow is bigger, can be by calculating the forwarding-table item each to be detected in Preset Time
Search efficiency, the big forwarding-table item traffic streams journey of search efficiency is relatively big, easily sends out as fault
First detection forwarding-table item.
In order to ensure the accuracy of the first detection forwarding-table item, computing unit calculates lookup number of times can the cycle
Property is carried out.
As alternatively possible implementation, this list item determines that unit 701 can be treated specifically for determining
The forwarding-table item connected for setting up communication protocol in detection forwarding-table item is the first detection forwarding-table item, non-
The forwarding-table item of the first detection forwarding-table item is the second detection forwarding-table item.
Inventor finds under study for action, based in the communication connection that different communication protocol is set up, communicates to connect
The forwarding-table item that the IP address of use is corresponding is also the forwarding-table item easily broken down, therefore the present embodiment
In, set up, using forwarding-table item to be detected is used for, the first detection easily sent out as fault that communication protocol connects
Forwarding-table item.
As the implementation that another is possible, this list item determines that unit 701 can be treated specifically for determining
The the first detection forwarding-table item preset in detection forwarding-table item, and the second of non-first detection forwarding-table item
Detection forwarding-table item.
This first detection forwarding-table item preset can be the forwarding-table item to be detected selected by user, route
Device can provide corresponding interface, receives the selection request of user.
Certainly the selection of this first detection forwarding-table item can also be adopted and be realized in other ways, such as can root
According to historical failure record information, determine the first detection forwarding-table item that fault is easily sent out.
List item detector unit 702, within the detection cycle, detects in forwarding-table item to be detected and is not detected
The first quantity first detection forwarding-table item and the second quantity second detection forwarding-table item.
Described first quantity is the positive integer more than or equal to 1, and described second quantity is more than or equal to 0
Positive integer.
This first quantity and the second quantity sum can be equal to the forwarding-table item detection numbers in each detection cycle
Amount.
Wherein, this forwarding-table item failure detector can also export when fault forwarding-table item being detected
Fault cues information, or take corresponding measure to recover fault forwarding-table item etc..
Additionally, this forwarding-table item failure detector can also add up fault forwarding-table item quantity etc..
In the present embodiment, when carrying out forwarding-table item fault detect by this forwarding-table item failure detector,
First determine that the first detection forwarding-table item and non-first that fault is easily sent out detects the second detection of forwarding-table item
Forwarding-table item, within each detection cycle, the first detection forward table of the first quantity that detection is not detected
Item and the second detection forwarding-table item of the second quantity, so that be susceptible to the first inspection of fault
Survey forwarding-table item to be preferentially detected, such that it is able to shorten the time detecting fault forwarding-table item, Ke Yiti
High fault detection efficiency.
A kind of forwarding-table item another embodiment of failure detector that Fig. 9 provides for the embodiment of the present invention
Structural representation, this device may include that
List item determines unit 901, for determining that the first detection that in forwarding-table item to be detected, fault is easily sent out forwards
List item, and the second detection forwarding-table item.
This second detection forwarding-table item is not include this first detection forwarding-table item in forwarding-table item to be detected
Forwarding-table item.
Wherein, as a kind of possible implementation, this list item determines that unit 901 may include that
Computing unit, in calculate Preset Time each forwarding-table item to be detected be used for instruct message to turn
The lookup number of times sent out.
List item determines subelement, for searching number of times more than or equal to the forward table to be detected searching threshold value
Item is as the first detection forwarding-table item, and the forwarding-table item to be detected of non-first detection forwarding-table item is the second inspection
Survey forwarding-table item.
As alternatively possible implementation, this list item determines that unit 901 can be treated specifically for determining
The conduct first connecting forwarding-table item for setting up communication protocol in detection forwarding-table item detects forwarding-table item,
The forwarding-table item of non-first detection forwarding-table item is as the second detection forwarding-table item.
As the implementation that another is possible, this list item determines that unit 901 can be treated specifically for determining
The the first detection forwarding-table item preset in detection forwarding-table item, and the second of non-first detection forwarding-table item
Detection forwarding-table item.
List item detector unit 902, within the detection cycle, detects in forwarding-table item to be detected and is not detected
The first quantity first detection forwarding-table item and the second quantity second detection forwarding-table item.
Described first quantity is the positive integer more than or equal to 1, and described second quantity is more than or equal to 0
Positive integer.
This first quantity can be identical with this second quantity, it is also possible to different, this second quantity can be zero,
Can also be not zero, to ensure that fault detect balances.
This first quantity and the second quantity sum can be equal to the forwarding-table item detection numbers in each detection cycle
Amount.
When carrying out forwarding-table item fault detect, the fault forwarding-table item quantity can haveing with statistic mixed-state.With
Fault forwarding-table item according to varying number, takes corresponding failure measure.
Fault cues unit 903, is more than or equal to the first threshold for the fault forwarding-table item quantity detected
Value, exports fault cues information.
In forwarding-table item process fault detection, if detecting, fault forwarding-table item quantity is more than or equal to the
During one threshold value, fault cues information can be exported, to point out user's forwarding-table item fault to occur.
In the present embodiment, when carrying out forwarding-table item fault detect by this forwarding-table item failure detector,
First determine that the first detection forwarding-table item and non-first that fault is easily sent out detects the second detection of forwarding-table item
Forwarding-table item, within each detection cycle, the first detection forward table of the first quantity that detection is not detected
Item and the second detection forwarding-table item of the second quantity, so that be susceptible to the first inspection of fault
Survey forwarding-table item to be preferentially detected, such that it is able to shorten the time detecting fault forwarding-table item, Ke Yiti
High fault detection efficiency.Barrier forwarding-table item or the fault forward table detected can also detected simultaneously
Item quantity, more than or equal to first threshold, exports fault cues information, with notice user malfunction generation in time.
A kind of forwarding-table item another embodiment of failure detector that Figure 10 provides for the embodiment of the present invention
Structural representation, this device may include that
Forwarding-table item determines unit 1001, for determining the first inspection that in forwarding-table item to be detected, fault is easily sent out
Survey forwarding-table item, and the second detection forwarding-table item of non-first detection forwarding-table item.
Wherein, as a kind of possible implementation, this list item determines that unit 1001 may include that
Computing unit, in calculate Preset Time each forwarding-table item to be detected be used for instruct message to turn
The lookup number of times sent out.
Wherein, this computing unit specifically in each measurement period, each in calculating Preset Time is treated
The lookup number of times being used for instructing message to forward of detection forwarding-table item.
Forwarding-table item determines subelement, for searching number of times more than or equal to search threshold value to be detected turn
Forwarding list item is as the first detection forwarding-table item, and the forwarding-table item to be detected of non-first detection forwarding-table item is the
Two detection forwarding-table items.
As alternatively possible implementation, this list item determines that unit 1001 can be treated specifically for determining
For setting up the first detection forwarding-table item that communication protocol connects in detection forwarding-table item, and non-first inspection
Survey the second detection forwarding-table item in forwarding-table item.
As the implementation that another is possible, this list item determines that unit 1001 can be treated specifically for determining
The the first detection forwarding-table item preset in detection forwarding-table item, and the second of non-first detection forwarding-table item
Detection forwarding-table item.
List item detector unit 1002, within the detection cycle, detects in forwarding-table item to be detected the most tested
First detection forwarding-table item of the first quantity surveyed and the second detection forwarding-table item of the second quantity.
Described first quantity is the positive integer more than or equal to 1, and described second quantity is more than or equal to 0
Positive integer.
Fisrt fault recovery unit 1003, for being more than or equal to when the fault forwarding-table item quantity detected
Second Threshold, re-issues, to forwarding engine, the source forwarding-table item that fault forwarding-table item is corresponding.
In forwarding-table item process fault detection, if fault forwarding-table item being detected, or this statistic unit
When the fault forwarding-table item quantity of statistics is more than or equal to first threshold, fault forwarding-table item can be updated,
Specifically can re-issue the source forwarding-table item that this fault forwarding-table item is corresponding, that replaces that this breaks down turns
Forwarding list item.
Certainly this device can also include:
Fault cues unit, the quantity of the fault forwarding-table item for detecting is more than or equal to first threshold,
Output fault cues information.
In the present embodiment, when carrying out forwarding-table item fault detect by this forwarding-table item failure detector,
First the first detection forwarding-table item that fault is easily sent out, and the second inspection of non-first detection forwarding-table item are determined
Survey forwarding-table item, thus within each detection cycle, the first detection of the first quantity that detection is not detected
Forwarding-table item and the second detection forwarding-table item of the second quantity, so that be susceptible to the first of fault
Detection forwarding-table item is preferentially detected, and shortens the time detecting fault forwarding-table item, can improve event
Barrier detection efficiency.Simultaneously when fault forwarding-table item being detected, it is also possible to re-issue this fault forward table
The source forwarding-table item that item is corresponding, to replace fault forwarding-table item so that fault forwarding-table item recovers, it is ensured that
Router correctly runs.
A kind of forwarding-table item another embodiment of failure detector that Figure 11 provides for the embodiment of the present invention
Structural representation, this device may include that
List item determines unit 1101, for determining that the first detection that in forwarding-table item to be detected, fault is easily sent out turns
Forwarding list item, and the second detection forwarding-table item of non-first detection forwarding-table item.
Wherein, as a kind of possible implementation, this list item determines that unit 1101 may include that
Computing unit, in calculate Preset Time each forwarding-table item to be detected be used for instruct message to turn
The lookup number of times sent out.
Wherein, this computing unit specifically in each measurement period, each in calculating Preset Time is treated
The lookup number of times being used for instructing message to forward of detection forwarding-table item.
List item determines subelement, for searching number of times more than or equal to the forward table to be detected searching threshold value
Item is as the first detection forwarding-table item, and the forwarding-table item to be detected of non-first detection forwarding-table item is the second inspection
Survey forwarding-table item.
As alternatively possible implementation, this forwarding-table item determines that unit 1101 can be specifically for really
Fixed forwarding-table item to be detected is used for set up communication protocol and connects forwarding-table item as the first detection forward table
, the forwarding-table item of non-first detection forwarding-table item is the second detection forwarding-table item.
As the implementation that another is possible, this forwarding-table item determines that unit 1101 can be specifically for really
The the first detection forwarding-table item preset in fixed forwarding-table item to be detected, and non-first detection forwarding-table item
Second detection forwarding-table item.
List item detector unit 1102, within each detection cycle, detects in forwarding-table item to be detected not
First detection forwarding-table item of the first detected quantity and the second detection forwarding-table item of the second quantity.
Described first quantity is the positive integer more than or equal to 1, and described second quantity is more than or equal to 0
Positive integer.
Second fault recovery unit 1103, for being more than or equal to when the fault forwarding-table item quantity detected
3rd threshold value, determines untapped default memory area in described memorizer, by described fault forwarding-table item
Corresponding source forwarding-table item is stored in described default memory area, and updates the described fault forwarding-table item of index
The index information of storage area address is the index information of described default storage area address.
Memorizer arranges extra default memory area, during original state, is not used in storage routing forwarding
List item.Such that it is able to source forwarding-table item corresponding for fault forwarding-table item is stored in this default memory area,
The index information simultaneously updating index fault forwarding-table item storage address is described default storage area address
Index information.Thus during carrying out Message processing, the index information according to updating can find correspondence
Forwarding-table item, this forwarding-table item is the forwarding-table item that there is not fault, thus ensure that router
Correct operation.
Certainly this device can also include:
Fault cues unit, the quantity of the fault forwarding-table item for detecting is more than or equal to first threshold,
Output fault cues information.
In the present embodiment, when carrying out forwarding-table item fault detect by this forwarding-table item failure detector,
First the first detection forwarding-table item that fault is easily sent out, and the second inspection of non-first detection forwarding-table item are determined
Survey forwarding-table item, thus within each detection cycle, the first detection of the first quantity that detection is not detected
Forwarding-table item and the second detection forwarding-table item of the second quantity, so that be susceptible to the first of fault
Detection forwarding-table item is preferentially detected, and shortens the time detecting fault forwarding-table item, can improve event
Barrier detection efficiency.Simultaneously when fault forwarding-table item being detected, it is also possible to this fault forwarding-table item is corresponding
Source forwarding-table item be stored in default memory area, update the index information of this fault forwarding-table item simultaneously,
Enable to fault forwarding-table item recover, it is ensured that router correctly runs.
A kind of forwarding-table item another embodiment of failure detector that Figure 12 provides for the embodiment of the present invention
Structural representation, this device may include that
List item determines unit 1201, for determining that the first detection that in forwarding-table item to be detected, fault is easily sent out turns
Forwarding list item, and the second detection forwarding-table item of non-first detection forwarding-table item.
Wherein, as a kind of possible implementation, this list item determines that unit 1201 may include that
Computing unit, in calculate Preset Time each forwarding-table item to be detected be used for instruct message to turn
The lookup number of times sent out.
List item determines subelement, for searching number of times more than or equal to the forward table to be detected searching threshold value
Item is as the first detection forwarding-table item, and the forwarding-table item to be detected of non-first detection forwarding-table item is the second inspection
Survey forwarding-table item.
As alternatively possible implementation, this list item determines that unit 1201 can be treated specifically for determining
Detection forwarding-table item is used for set up communication protocol connection forwarding-table item and detects forwarding-table item as first, non-
Forwarding-table item in first detection forwarding-table item is the second detection forwarding-table item.
As the implementation that another is possible, this list item determines that unit 1201 can be treated specifically for determining
The the first detection forwarding-table item preset in detection forwarding-table item, and the second of non-first detection forwarding-table item
Detection forwarding-table item.
List item detector unit 1202, within each detection cycle, detects in forwarding-table item to be detected not
First detection forwarding-table item of the first detected quantity and the second detection forwarding-table item of the second quantity.
Described first quantity is the positive integer more than or equal to 1, and described second quantity is more than or equal to 0
Positive integer.
Fisrt fault recovery unit 1203, for being more than or equal to when the fault forwarding-table item quantity detected
Second Threshold, to forwarding engine to re-issue the source forwarding-table item that fault forwarding-table item is corresponding, updates described
Fault forwarding-table item;
Fault recovery judging unit 1204, is used for judging that described Fisrt fault recovery unit updates described fault
Forwarding-table item is the most successful, if it does not, trigger the second fault recovery unit 1205;
Second fault recovery unit 1205, for being more than or equal to when the fault forwarding-table item quantity detected
3rd threshold value, determines untapped default memory area in memorizer, and described fault forwarding-table item is corresponding
Source forwarding-table item be stored in described default memory area, and update index described fault forwarding-table item storage
The index information of regional address is the index information of described default storage area address.
In the present embodiment, use two kinds of fault recovery mode classifications to carry out fault recovery, can be effectively ensured
The recovery of fault forwarding-table item, further ensures the correct operation of router.
First source forwarding-table item corresponding for this fault forwarding-table item can certainly be stored in presetting of memorizer
In memory area, when the memory space inadequate of default memory area, e.g., less than preset value, then to turning
Carry out the coffin upon burial to hold up and re-issue the source forwarding-table item that fault forwarding-table item is corresponding, to update this fault forwarding-table item.
Wherein, this device can also include:
Fault cues unit, for the quantity when the fault forwarding-table item detected more than or equal to the first threshold
Value, exports fault cues information.
In the present embodiment, this forwarding-table item failure detector when carrying out forwarding-table item fault detect,
First the first detection forwarding-table item that fault is easily sent out, and the second inspection of non-first detection forwarding-table item are determined
Survey forwarding-table item, thus within each detection cycle, the first detection of the first quantity that detection is not detected
Forwarding-table item and the second detection forwarding-table item of the second quantity, so that be susceptible to the first of fault
Detection forwarding-table item is preferentially detected, and shortens the time detecting fault forwarding-table item, can improve event
Barrier detection efficiency.Simultaneously when fault forwarding-table item being detected, it is also possible to re-issue fault forwarding-table item
Corresponding source forwarding-table item, updates this fault forwarding-table item, if updating unsuccessfully, then by this fault forward table
The source forwarding-table item that item is corresponding is stored in default memory area, updates the rope of this fault forwarding-table item simultaneously
Fuse ceases, it is possible to fault forwarding-table item is recovered, it is ensured that router correctly runs.
Forwarding-table item failure detector described in the invention described above embodiment the most specifically should
In router, can be effective by disposing the router of the present embodiment forwarding-table item failure detector
Improve forwarding-table item fault detection efficiency.
By above description, those skilled in the art is it can be understood that can be by the present invention
Software adds the mode of required general hardware platform and realizes.Seeing Figure 13, the embodiment of the present invention also provides for
A kind of router.This router 1300 at least includes processor 1301 and with processor 1301 by total
The memorizer 1302 that line connects.
This memorizer 1302 stores batch processing instruction, and this memorizer can be high-speed RAM memorizer,
It is also likely to be nonvolatile memory (non-volatile memory), for example, at least one disk memory
Deng.
This processor 1301, for calling the programmed instruction of this memorizer 1302 storage, performs to operate as follows:
Determine that the first detection forwarding-table item and the second detection that in forwarding-table item to be detected, fault is easily sent out forward
List item, wherein, described second detection forwarding-table item is not include described the in described forwarding-table item to be detected
The forwarding-table item of one detection forwarding-table item;
Within the detection cycle, detect the described of the first quantity not detected in described forwarding-table item to be detected
First detection forwarding-table item and the described second detection forwarding-table item of the second quantity.
Alternatively, this router 1300 may be used for performing shown in Fig. 1-Fig. 7 that the embodiment of the present invention provides
The method of arbitrary forwarding-table item fault detect.
This processor is probably a central processor CPU, or specific integrated circuit ASIC
(Application Specific Integrated Circuit), or be configured to implement the embodiment of the present invention
One or more integrated circuits.
Certainly this router can also include algorithm search device, forward engine and other such as master control borad
Deng parts, same as the prior art, do not repeat them here.
In this specification, each embodiment uses the mode gone forward one by one to describe, and each embodiment stresses
Being the difference with other embodiments, between each embodiment, identical similar portion sees mutually.
For device disclosed in embodiment, owing to it corresponds to the method disclosed in Example, so describing
Fairly simple, relevant part sees method part and illustrates.
Finally, in addition it is also necessary to explanation, in this article, the relational terms of such as first and second or the like
It is used merely to separate an entity or operation with another entity or operating space, and not necessarily requires
Or imply relation or the order that there is any this reality between these entities or operation.And, art
Language " includes ", " comprising " or its any other variant are intended to comprising of nonexcludability, thus
Make to include that the process of a series of key element, method, article or equipment not only include those key elements, and
Also include other key elements being not expressly set out, or also include for this process, method, article or
The key element that person's equipment is intrinsic.In the case of there is no more restriction, by statement " including ... "
The key element limited, it is not excluded that also deposit in including the process of described key element, method, article or equipment
In other identical element.
For convenience of description, it is divided into various unit to be respectively described with function when describing apparatus above.Certainly,
The function of each unit can be realized in same or multiple softwares and/or hardware when implementing the present invention.
As seen through the above description of the embodiments, those skilled in the art is it can be understood that arrive
The present invention can add the mode of required general hardware platform by software and realize.Based on such understanding,
The part that prior art is contributed by technical scheme the most in other words can be with software product
Form embody, this computer software product can be stored in storage medium, as ROM/RAM,
Magnetic disc, CD etc., including some instructions with so that computer equipment (can be personal computer,
Server, or the network equipment etc.) perform each embodiment of the present invention or some part institute of embodiment
The method stated.
Described above to the disclosed embodiments, makes professional and technical personnel in the field be capable of or uses
The present invention.Multiple amendment to these embodiments will be aobvious and easy for those skilled in the art
See, generic principles defined herein can without departing from the spirit or scope of the present invention,
Realize in other embodiments.Therefore, the present invention is not intended to be limited to the embodiments shown herein,
And it is to fit to the widest scope consistent with principles disclosed herein and features of novelty.