Background technology
In the communication network device application process, there is a kind of like this scene: communicate by letter between network equipment A and the network equipment B, have multiple communication links between the two.And every link is all very important, when breaking down, needs in time to detect to identify.For this reason, a kind of testing mechanism need on all communication links, be added, with the fault on the timely detection communication link.
In order to address the above problem, prior art adopts a kind of scheme of maintenance agreement message status usually.This scheme is concrete to be realized as follows:
With reference to Fig. 1, with No. 1 link, it is example that network equipment A initiates to detect.Network equipment A at first sends a detection messages P, and transmission gets started timing after accomplishing.In a preset time T, A waits for the back message using PA of detection messages P.In time T,, think that then this detects successfully if A receives back message using PA.The next detection messages of the subsequent transmission of network equipment A, and carry out timing again.In time T,, think that this detects failure, reporting links communication failure if A can not receive back message using PA.
Yet, adopt such scheme, after the network equipment sends message, need record to send the information of message, and wait for the back message using of this message.In addition, the testing process on every link is done things in his own way, and n bar link need play n and detect instance, and overhead is very big, can cause the performance of whole network system to reduce.
Summary of the invention
In view of this, the present invention provides the method and apparatus that a kind of multilink fault detects.Through the present invention, make that overhead of the present invention is little, and implement very simple.
For realizing the object of the invention, implementation of the present invention is specific as follows:
The method that a kind of multilink fault detects, said method is applied to exist between transmitting apparatus and opposite end receiving equipment the situation of multiple communication links, and wherein said method comprises the steps:
Step 1, transmitting apparatus be according to preset period 1 timed sending detection messages, and said detection messages copied on all links of communicating by letter with the opposite end receiving equipment send simultaneously;
Step 2, opposite end receiving equipment be according to the detection messages quantity that receives on preset every link of statistics second round, and when finish said second round, the detection messages quantity of receiving on every communication link is gathered;
Whether judge detection messages quantity on every link of statistics in the sense cycle on step 3, the opposite end receiving equipment greater than preset threshold Ccmp, if, judge that then this Link State is normal, otherwise, then judge this communication link fails.
Further, be the integral multiple x of period 1 said second round.
Further, before carry out step 3, said opposite end receiving equipment need judge also whether the detection in second round is effective.
Further, the opposite end receiving equipment is found out detection messages maximum count Cmax from the detection messages quantity of all links of receiving, and judges that whether the detection messages maximum count Cmax that receives is: Cmin ≤Cmax ≤x; If then this sense cycle is effective, get into step 3; Otherwise; Abandon this sense cycle, return step 2, wherein said minimum detection packet counting Cmin preestablishes as required.
Further, ≤Cmin < dynamically adjust in advance in the x scope, and said threshold value Ccmp is set at said minimum detection packet counting Cmin: Ccmp < Cmin at 1/>2x.
The device that the present invention provides a kind of multilink fault to detect simultaneously; Wherein said device is applied to exist between transmitting apparatus and opposite end receiving equipment the situation of multiple communication links; Said device is specially said transmitting apparatus or opposite end receiving equipment, and said device comprises like lower module:
Configuration module; Be used for when said device during as transmitting apparatus; The period 1 t of detection messages is sent in configuration, and when said device during as the opposite end receiving equipment, and configuration receives the T and judge the whether threshold value Ccmp of fault of communication link second round of detection messages;
Transceiver module; Be used for when said device during as transmitting apparatus; According to preset period 1 timed sending detection messages; And said detection messages copied on all links of communicating by letter with the opposite end receiving equipment and send simultaneously, when said device during, be used to receive the detection messages that transmitting apparatus sends as the opposite end receiving equipment;
Statistical module; Be used for when said device during as the opposite end receiving equipment; According to the detection messages quantity of adding up preset second round on each communication link that transceiver module receives; And when finish said second round, each communication link detection messages quantity result of statistics is gathered and sends to judge module;
Judge module; Whether the detection messages quantity result who receives on the every communication link that is used for sending according to statistical module judges greater than preset threshold Ccmp whether communication link exists fault, if judge that then this Link State is normal; Otherwise, then judge this communication link fails.
Further, said judge module before judging whether communication link exists fault in second round, also need judge detect in should second round whether effective.
Further, whether effectively said configuration module also will further dispose and be used to judge said sense cycle minimum detection message amount Cmin.
Further, there is said second round the integral multiple relation between T and said period 1 t, i.e. T=xt, wherein x is a positive integer; Cmin 1/2x=Cmin set as required in the x scope, and threshold value Ccmp < Cmin is to guarantee accurately to judge communication link fails.
Further; Whether the detection messages maximum count Cmax that judges statistical module counts when judge module is: Cmin=Cmax=x judges that then this sense cycle is effective, otherwise; Abandon this sense cycle, the notice statistical module carries out the detection messages quantity statistics again.
Compare with existing technical scheme, the present invention provides a kind of simple testing mechanism when LA Management Room exists under the situation of multiple communication links, realizes the fault detect on all links simultaneously.Therefore, overhead of the present invention is little, helps the performance boost of whole network system.
Embodiment
In order to realize the object of the invention; The core concept that the present invention adopts is: between transmitting apparatus and opposite end receiving equipment, exist under the situation of multiple communication links; Transmitting apparatus is according to preset period 1 timed sending detection messages, and said detection messages copied on all links of communicating by letter with the opposite end receiving equipment sends simultaneously; The opposite end receiving equipment is according to the detection messages quantity that receives on preset every link of statistics second round, and when finish said second round, the detection messages quantity of receiving on every communication link gathered; Whether the opposite end receiving equipment judges detection messages quantity on every link of statistics in the sense cycle greater than preset threshold Ccmp, if, judge that then this Link State is normal, otherwise, then judge this communication link fails.Through the present invention, the multilink fault testing mechanism of LA Management Room is simple, and overhead is little.
For making technical scheme of the present invention clear more and clear, specify below in conjunction with the specific embodiment of the invention.As shown in Figure 2, be the method flow diagram of a kind of multilink fault detection provided by the invention.Wherein said method is applied to exist between transmitting apparatus and opposite end receiving equipment the situation of multiple communication links, with reference to Fig. 1, is example with network equipment A to the communication direction of network equipment B, and the present invention mainly comprises the steps:
Step 1, transmitting apparatus be according to preset period 1 timed sending detection messages, and said detection messages copied on all links of communicating by letter with the opposite end receiving equipment send simultaneously.
In application scenarios shown in Figure 1, network equipment A presses cycle t timed sending detection messages, and said detection messages is copied to transmission simultaneously on all communication links between network equipment A and network equipment B.Wherein detection messages can adopt prior art heartbeat message commonly used or hello packet etc., does not give unnecessary details at this.
What detection messages was sent on all communication links between network equipment A and network equipment B simultaneously specifically is embodied as:
If every link all has a sending module, then earlier be copied into many parts to detection messages through software or specialized hardware, transfer to each communication link sending module then and send separately.
If the shared sending module of multiple communication links, then sending module adopts the mode of circulation on every communication link, to send.
Step 2, opposite end receiving equipment be according to the detection messages quantity that receives on preset every link of statistics second round, and when finish said second round, the detection messages quantity of receiving on every communication link is gathered.
Preferably, in embodiments of the present invention, be the integral multiple x of period 1 said second round.Particularly, under the application scenarios as shown in Figure 1, network equipment B is by the detection messages quantity that receives on every link of cycle T (T=xt, promptly T is the integral multiple of t) statistics.Counting is designated as C1, C2, C3 respectively ... Cn.
Whether judge detection messages quantity on every link of statistics in the sense cycle on step 3, the opposite end receiving equipment greater than preset threshold Ccmp, if, judge that then this link is that state is normal, otherwise, then judge this communication link fails.
Particularly, under application scenarios as shown in Figure 1,, need further on network equipment B, to set a threshold value Ccmp in order to judge effectively whether certain communication link exists fault; Wherein said threshold value should preferably, in embodiments of the present invention, be set Ccmp < 1/>2x less than x; In sense cycle, if the counting of certain communication link, judges then that this communication link state is normal greater than Ccmp; Otherwise, judge that then there is fault in this link, and give the webmaster personnel corresponding fault alarm reporting.
In order to realize the object of the invention, further, before carrying out this step judgement communication link fails, said opposite end receiving equipment need judge also whether the detection in said second round is effective.Concrete implementation procedure is: the opposite end receiving equipment is found out detection messages maximum count Cmax from the detection messages quantity of all links of receiving, and judges that whether the detection messages maximum count Cmax that receives is: Cmin=Cmax=x, if; Then this sense cycle is effective; Get into step 4, otherwise, this sense cycle abandoned; Return step 2, wherein said Cmin preestablishes as required.
Under application scenarios as shown in Figure 1, when cycle T finished, network equipment B found out a maximum count Cmax from C1-Cn, and ≤Cmax < during=x, thinks that then this sense cycle is effective as Cmin.Otherwise, abandon this sense cycle, return step 2 and directly begin next sense cycle.Wherein Cmin can be as required dynamic adjustments in advance, preferably, in embodiments of the present invention, minimum detection packet counting Cmin is set at 1/>2x ≤Cmin < x.
Further, said threshold value Ccmp should be set at: Ccmp < Cmin.
Please refer to the device that Fig. 3 the present invention provides a kind of multilink fault to detect simultaneously; Wherein said device is applied to exist between transmitting apparatus and opposite end receiving equipment the situation of multiple communication links; Particularly; In the present invention, said device can be transmitting apparatus or opposite end receiving equipment, and said device comprises like lower module:
Configuration module; Be used for when said device during as transmitting apparatus; The period 1 t of detection messages is sent in configuration; And when said device during as the opposite end receiving equipment, configuration receive detection messages second round T with judge whether effective minimum detection message amount Cmin and judge the whether threshold value Ccmp of fault of communication link of said sense cycle.
Preferably, in embodiments of the present invention, there is said second round the integral multiple relation between T and said period 1 t, i.e. T=xt, wherein x is a positive integer.In addition, though Cmin dynamic adjustments as required in embodiments of the present invention, preferably, should set Cmin and be: < < x, further, < Cmin is to guarantee judging exactly whether communication link exists fault to set compare threshold Ccmp for=Cmin for 1/>2x.
Transceiver module is used for when said device during as transmitting apparatus, according to preset period 1 timed sending detection messages, and said detection messages copied on all links of communicating by letter with the opposite end receiving equipment sends simultaneously; When said device during, be used to receive the detection messages that transmitting apparatus sends as the opposite end receiving equipment.
Statistical module; When said device during as the opposite end receiving equipment; According to the detection messages quantity of adding up preset second round on each communication link that transceiver module receives; And when finish said second round, each communication link detection messages quantity result of statistics is gathered and sends to judge module.
Further, said statistical module also will be found out the maximum detection messages quantity that communication link is received from the detection messages quantity that every communication link of said statistics is received after finishing second round.
Judge module; Whether the detection messages quantity result who receives on the every communication link according to the statistical module transmission judges greater than preset threshold Ccmp whether communication link exists fault; If, judge that then this Link State is normal, otherwise; Judge that then there is fault in this communication link, and give the webmaster personnel corresponding fault alarm reporting.
Further; Said judge module need judge also whether the detection in second round is effective before whether communication link exists fault in judging this sense cycle, judges that when judge module the detection messages maximum count Cmax of statistical module counts is: Cmin ≤Cmax ≤x; Judge that then this sense cycle is effective; Otherwise, abandoning this sense cycle, the notice statistical module carries out the detection messages quantity statistics again.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.