CN101594268B - Link detection method - Google Patents

Link detection method Download PDF

Info

Publication number
CN101594268B
CN101594268B CN2009101506005A CN200910150600A CN101594268B CN 101594268 B CN101594268 B CN 101594268B CN 2009101506005 A CN2009101506005 A CN 2009101506005A CN 200910150600 A CN200910150600 A CN 200910150600A CN 101594268 B CN101594268 B CN 101594268B
Authority
CN
China
Prior art keywords
recipient
link
message
heartbeat
predetermined period
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2009101506005A
Other languages
Chinese (zh)
Other versions
CN101594268A (en
Inventor
李聪
王国兵
张耀丹
陈飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN2009101506005A priority Critical patent/CN101594268B/en
Publication of CN101594268A publication Critical patent/CN101594268A/en
Application granted granted Critical
Publication of CN101594268B publication Critical patent/CN101594268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a link detection method, which comprises that: firstly, a sender sends heartbeat messages to a receiver through a link in a first preset period, the heartbeat messages carry parameters, and the parameters represent the number of the heartbeat messages and the number of general messages sent by the sender, the number of the heartbeat messages and the number of the general messages sent by the receiver, which are carried by a heartbeat message sent by the receiver and received by the sender last time, and the number of the heartbeat messages and the number of the general messages received when the sender receives the heartbeat message last time; secondly, the receiver judges whether the heartbeat messages are normally received and whether the parameters in the heartbeat messages are normal; and finally, the state of the link is determined according to a judgment result. The link detection method achieves the technical effect of improving link detection sensitivity.

Description

Chain circuit detecting method
Technical field
The present invention relates to the communications field, relate in particular to a kind of chain circuit detecting method.
Background technology
At present, utilize heartbeat message to realize the detection of link usually.The method of utilizing heartbeat detection is to send heartbeat message at transmitting terminal, then by judging at receiving terminal whether heartbeat message loses the state that detects link, if judging in the data that receive, receiving terminal comprises heartbeat message in the cycle of setting, think that then link is normal, if do not comprise heartbeat message, then think the link chain rupture, to finish detection to Link State.Under the situation that link interrupts fully, the method for heartbeat detection can detect link soon fault has taken place.
The detection method of the link in the correlation technique exists under the situation of error code at link, the packet that might occur in the link has taken place to lose, and heartbeat message is not lost, make that the link detecting result is normal situation, cause link detecting result and actual result not to be inconsistent, link detecting is sensitive inadequately.
Summary of the invention
The object of the present invention is to provide a kind of chain circuit detecting method, can solve in the correlation technique when link and exist under the situation of error code, the packet that might occur in the link has taken place to lose, and heartbeat message is not lost, cause link detecting result and actual result not to be inconsistent, the technical problem that link detecting is sensitive inadequately.
According to an aspect of the present invention, a kind of chain circuit detecting method is provided, comprise: transmit leg sends heartbeat message with first predetermined period by chain road direction recipient, heartbeat message carries parameter, and number, transmit leg the last time that the parametric representation transmit leg sends the number of heartbeat message and sends total message receives heartbeat message number and the total message number that heartbeat message number that the expression recipient that carries in the heartbeat message that the recipient sends sends and total message number and transmit leg receive when receiving the last heartbeat message; The recipient judges whether normally to receive that heartbeat message and recipient judge whether the parameter in the heartbeat message is normal; Determine the state of link according to judged result; The recipient is forbidden link or is continued to use link according to the state of link; Wherein, the recipient judges whether normally to receive heartbeat message and recipient judge whether the parameter in the heartbeat message normally specifically comprises: if continuous first pre-determined number of recipient does not receive heartbeat message in first predetermined period, judge that then link is in the third state; If the recipient receives heartbeat message in first predetermined period, then calculate d 0=N 1-N 2, wherein, N 1Be the heartbeat message number that recipient that the recipient obtains according to the calculation of parameter in former and later two heartbeat messages of receiving recently sends in one first predetermined period, N 2The heartbeat message number that the transmit leg that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving recently for the recipient receives in one first predetermined period; If d 0=0, then total message number of receiving in one first predetermined period of the total message number that sends in one first predetermined period of the recipient that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving recently of recipient and transmit leg judges that link is in first state or second state; Otherwise d 0>0, judge that then the heartbeat message that the recipient sends loses, if existing, loses continuous first pre-determined number heartbeat message that the recipient sends in first predetermined period, then the recipient judges that link is in the third state.
Preferably, total message number of receiving in one first predetermined period of the total message number that sends in one first predetermined period of the recipient that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving recently of recipient and transmit leg judges that link is in first state or second state specifically comprises: the recipient calculates d 1=N 3-N 4, wherein, N 3Total message number that the recipient who obtains by calculation of parameter in former and later two heartbeat messages of receiving recently for the recipient sends in one first predetermined period, N 4Total message number that the transmit leg that obtains by the calculation of parameter in former and later two heartbeat messages of receiving recently for the recipient receives in one first predetermined period; If d 1=0, judge that then link is in first state; If d 1>0, judge that link is in second state.
Preferably, the state of link is in first state or second state, and the recipient carries out following processing according to the state of link to link: if link is in first state, it is w that the weighted value of link in i first predetermined period then is set i=-β; If link is in second state, then calculate the weighted value of link in i first predetermined period
Figure DEST_PATH_GSB00000549352100021
As W=∑ w iDuring<α, the recipient judges that link is in upstate, continue to send data by link, and at W=∑ w i, W=0 is set at≤0 o'clock; As W=∑ w iDuring 〉=α, the recipient is forbidden link, wherein, and N 3iTotal message number that the recipient sends in i first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, N 4iTotal message number that transmit leg receives in i first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, α and β are set point.
Chart SEQ chart * ARABIC 1
Preferably, the state of link is in the third state, and the recipient carries out following processing according to the state of link to link: the recipient is forbidden link, and weighted value W=α is set, and α is a set point.
Preferably, when the recipient is forbidden link, also comprise: step 1, the recipient sends test packet with second predetermined period to link, and sends heartbeat message with first predetermined period to link; Step 2 judges that the recipient does not have losing of heartbeat message at receive direction, and if calculate each d according to heartbeat message 0All satisfy d 0=N 1-N 2=0, then calculate d 1i=N 3i-N 4iIf, d 1i=0, w then is set i=-β; Otherwise d 1i>0, calculate
Figure DEST_PATH_GSB00000549352100031
Step 3 is as W=∑ w i≤ 0 o'clock, recover link, and W=0 is set; Otherwise, repeating step one, step 2, and step 3, and at W=∑ w iDuring 〉=α, W=α is set, wherein, N 3iTotal message number that the recipient sends in i first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, N 4iTotal message number that transmit leg receives in i first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, β is a set point.
Chart SEQ chart * ARABIC 2
Preferably, link is the multilink based on D passage uplink access regulation.
Preferably, heartbeat message is the link-quality message.
Preferably, the SAPI field is used in the link-quality message packet header is based on untapped numerical value in the D passage uplink access regulation protocol stack.
By means of technique scheme of the present invention, be illustrated in transmit leg and make about the number of heartbeat message and total packet sending and receiving whether the recipient can normally come to determine the state of link according to whether normally receiving the parameter in heartbeat message and the heartbeat message by in heartbeat message, carrying, thereby realized the technique effect of raising link detecting sensitivity.
Description of drawings
Accompanying drawing is used to provide further understanding of the present invention, and constitutes the part of specification, is used from explanation the present invention with embodiments of the invention one, is not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is compatible inquiry of the present invention and response message structural representation;
Fig. 2 is the pack arrangement schematic diagram of LQR message of the present invention;
Fig. 3 is the structural representation of LQR message message body of the present invention;
Fig. 4 is a test packet message structure schematic diagram of the present invention;
Fig. 5 shows the flow chart according to the chain circuit detecting method of first embodiment of the invention;
Fig. 6 shows the flow chart according to the chain circuit detecting method of second embodiment of the invention;
Fig. 7 shows the flow chart according to the chain circuit detecting method of third embodiment of the invention;
Fig. 8 shows the flow chart according to the compatible query steps of the embodiment of the invention.
Embodiment
Functional overview
Be used for the various data message forms of the present invention shown in Fig. 1,2,3,4, all messages all use LAPD (Link Access Procedure of D-Channel, D passage uplink access regulation) message format, the LAPD head-coating structure is similar to the head-coating structure of LAPD information frame, what but the SAPI field was used in the packet header is untapped numerical value in the LAPD protocol stack, and N (S) and N (R) field are complete 0, do not use this two fields in the present invention.
As shown in Figure 1, being described as follows of the interior main field of message:
FRAME_TYPE: the value of compatible inquiry and this field of response message is set to specific numerical value, to be different from other type of message, such as 0xc1;
REQUEST_OR_ACK: compatible query message and compatible inquiry response message, this field is set to different values, with mutual difference.Value such as compatible this field of query message can be set to 0xf0; And compatible inquiry response message, the value of this field can be made as 0x0f.
As shown in Figure 2, being described in detail as follows of the main field of LQR message:
This field of FRAME_TYPE:LQR message is set to specific numerical value, to be different from other type of message, such as 0xc2;
LENGTH: field is used to identify the length of the LQR content of closelying follow later, is 24 generally speaking.
As shown in Figure 3, being described in detail as follows of each field of LQR message body:
Every physical link the present invention for the LAPD link can safeguard 5 statistical variables:
DwCurLocalOutLQRs: the LQR number of current transmission, LQR message of every transmission, this value will add one;
DwCurLocalOutPkts: total message number of current transmission, this value of message of every transmission (comprising LAPD bag, LQR message and test packet) all can add one;
DwCurLocalInLQRs: the current LQR bag number that receives;
DwLastLocalInLQRs: when last time first predetermined period regularly arrives, the duplicating of dwCurLocalInLQRs value;
DwCurLocalInPkts: the current total message number that receives.
The explanation of each field in the LQR message body:
LastPeerOutLQRs: duplicate the CurOutLQRs (opposite end sends LQR message number) in the opposite end LQR message that the last time receives;
LastPeerOutPackets: duplicated the CurOutPackets (total message number that the opposite end sends) in the last opposite end LQR message that receives;
LastInLQRs: the last time, local terminal received LQR message number when receiving opposite end LQR message; Equal the value of the dwCurLocalInLQRs of the last time when receiving opposite end LQR message;
LastInPackets: the last time is when receiving opposite end LQR message, the total message number that receives; Equal the value of the dwCurLocalInPkts of the last time when receiving opposite end LQR message;
CurOutLQRs: the LQR message number that current local terminal sends equals current dwCurOutLQRs;
CurOutPackets: total message number of transmission equals current dwCurLocalOutPkts.
As shown in Figure 4, the detailed description of the main field of test packet:
FRAME_TYPE: this field of test packet is set to specific numerical value, to be different from other type of message, such as 0xc3;
LENGTH: field is used for identifying the length of message test data;
TEST DATA: the message body of test data, message body length need and the value of LENGTH equates that the content of each byte of message body can arbitrarily be provided with.
Below in conjunction with accompanying drawing the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein only is used for description and interpretation the present invention, and be not used in qualification the present invention.
In the following description, for the purpose of explaining, a plurality of specific details have been described, to provide to thorough of the present invention.Yet, obviously, do not having under the situation of these specific detail, also can realize the present invention, in addition, under the situation of not conflicting, promptly under the situation that does not deviate from the spirit and scope that claims illustrate, among following embodiment and the embodiment each details can be carried out various combinations.
In in the whole text, total message refers to various types of messages, comprises heartbeat message; Predetermined period all can come timing by timer.
First embodiment
Fig. 5 shows the flow chart according to the chain circuit detecting method of first embodiment of the invention.As shown in Figure 5, the chain circuit detecting method according to first embodiment of the invention comprises:
Step S502, transmit leg sends heartbeat message with first predetermined period by chain road direction recipient, heartbeat message carries parameter, and number, transmit leg the last time that the parametric representation transmit leg sends the number of heartbeat message and sends total message receives heartbeat message number and the total message number that heartbeat message number that the expression recipient that carries in the heartbeat message that the recipient sends sends and total message number and transmit leg receive when receiving the last heartbeat message; For example, this first predetermined period can be 500ms;
Step S504, recipient judge whether normally to receive that heartbeat message and recipient judge whether the parameter in the heartbeat message is normal;
Step S506 determines the state of link according to judged result.
In step S502, because the parameter of carrying in the heartbeat message that transmit leg sends can be represented the last time and receive heartbeat message number and total message number of the expression recipient transmission of carrying in the heartbeat message of recipient's transmission that can derive: the recipient also sends the heartbeat message that comprises above-mentioned parameter with first predetermined period to transmit leg.
Be illustrated in transmit leg and make about the number of heartbeat message and total packet sending and receiving whether the recipient can normally come to determine the state of link according to whether normally receiving the parameter in heartbeat message and the heartbeat message by in heartbeat message, carrying according to the chain circuit detecting method of the embodiment of the invention, thereby realized the technique effect of raising link detecting sensitivity.
Preferably, the recipient judges whether normally to receive heartbeat message and recipient judge whether the parameter in the heartbeat message normally specifically comprises: if continuous first pre-determined number of recipient does not receive heartbeat message in first predetermined period, judge that then link is in the third state; If the recipient receives heartbeat message in first predetermined period, then calculate d 0=N 1-N 2, wherein, N 1Be the heartbeat message number that recipient that the recipient obtains according to the calculation of parameter in former and later two heartbeat messages of receiving recently sends in one first predetermined period, N 2The heartbeat message number that the transmit leg that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving recently for the recipient receives in one first predetermined period; If d 0=0, then the recipient judges that according to the total message number in former and later two heartbeat messages of receiving recently link is in first state or second state; Otherwise d 0>0, judge that then the heartbeat message that the recipient sends loses, if existing, loses continuous first pre-determined number heartbeat message that the recipient sends in first predetermined period, then the recipient judges that link is in the third state.For example, do not receive heartbeat message, judge directly that then link is in the third state if the recipient is connected in two first predetermined periods; If the recipient receives heartbeat message, according to aforementioned analysis, then the possibility Link State is good, and also possible Link State is bad, and need judge the state of link this moment by the parameter in the further analysis heartbeat message.Thereby can exist under the situation of error code at link, also Link State be made judgement, thereby reach the technique effect that improves link detecting sensitivity.
Preferably, the recipient judges that according to the total message number in former and later two heartbeat messages of receiving recently link is in first state or second state specifically comprises: the recipient calculates d 1=N 3-N 4, wherein, N 3Total message number that the recipient who obtains by calculation of parameter in former and later two heartbeat messages of receiving recently for the recipient sends in one first predetermined period, N 4Total message number that the transmit leg that obtains by the calculation of parameter in former and later two heartbeat messages of receiving recently for the recipient receives in one first predetermined period; If d 1=0, judge that then link is in first state; If d 1>0, judge that link is in second state.Work as d 1=0 o'clock, illustrate that the number of total message that the recipient sends equals the number that transmit leg receives in previous first predetermined period, so this link there is not packet loss, otherwise, show that then there is packet loss in this link.Thereby can exist under the situation of error code at link, also Link State be made judgement, thereby reach the technique effect that improves link detecting sensitivity.
Preferably, chain circuit detecting method also comprises: the recipient handles link according to the state of link.After the state of link detected, also need further to handle according to this state.
Preferably, the state of link is in first state or second state, and the recipient handles specifically link according to the state of link and comprises: if link is in first state, it is w that the weighted value of link in i first predetermined period then is set i=-β; If link is in second state, then calculate the weighted value of link in i first predetermined period w i = N 3 i - N 4 i N 3 i ; As W=∑ w iDuring<α, the recipient judges that link is in upstate, continue to send data by link, and at W=∑ w i, W=0 is set at≤0 o'clock; As W=∑ w iDuring 〉=α, the recipient is forbidden link, wherein, and N 3iTotal message number that the recipient sends in i first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, N 4iTotal message number that transmit leg receives in i first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, α and β are set point.When link is in first state in i cycle, its weighted value is set is-β, show that the link current state is good, when Link State second state, show that there is the packet loss phenomenon in this link, when the packet loss of this link reaches a certain amount of, forbid this link.This α and β value are set point, can set this value according to the concrete needs of system, and when link-quality was had relatively high expectations, this α and β value can be set lessly, when link-quality is required to hang down, can set this α and β value bigger.Usually this α is set at 0.5, β is set to 0.1.
Preferably, the state of link is in the third state, and the recipient handles specifically link according to the state of link and comprises: the recipient is forbidden link, and W=α is set.When Link State was very bad, the recipient was forbidden this link, when using the multilink transmission in order to avoid influence the message transmission rate of whole logical links.
Preferably, when the recipient is forbidden link, also comprise: step 1, the recipient sends test packet with second predetermined period to link, and sends heartbeat message with first predetermined period to link; Step 2 judges that the recipient does not have losing of heartbeat message at receive direction, and if calculate each d according to heartbeat message 0All satisfy d 0=N 1-N 2=0, then calculate d 1i=N 3i-N 4iIf, d 1i=0, w then is set i=-β; Otherwise d 1i>0, calculate w i = N 3 i - N 4 i N 3 i ; Step 3 is as W=∑ w i≤ 0 o'clock, recover link, and W=0 is set; Otherwise, repeating step one, step 2, and step 3, and at W=∑ w iDuring 〉=α, W=α is set, wherein, N 1Be the heartbeat message number that recipient that the recipient obtains by calculation of parameter in former and later two heartbeat messages of receiving recently sends in one first predetermined period, N 2The heartbeat message number that the transmit leg that obtains by the calculation of parameter in former and later two heartbeat messages of receiving recently for the recipient receives in one first predetermined period; N 3iTotal message number that the recipient sends in i first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, N 4iTotal message number that transmit leg receives in i first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, α and β are set point.For example, this second predetermined period can be 100ms, usually this α is set at 0.5, and β is set to 0.1.When certain bar link was disabled, the recipient sent test packet and heartbeat message and returns to the link condition at this link and set when satisfying condition, and recovers this link.
Preferably, the length of test packet is longer, for example, can be 150 bytes.Thereby can avoid erroneous judgement as far as possible.Because, after link is disabled, have only heartbeat message transmitting on this link, and the heartbeat message bag is long shorter, under the situation that the error rate is fixed, the probability of heartbeat message generation error code is less, and it is undesired therefore link may to occur, and the situation that the transmitting-receiving of heartbeat message is not all lost will cause the erroneous judgement to link like this.Therefore need on disabled link, send the long long test data of bag, to avoid erroneous judgement.
Preferably, link is the multilink based on LAPD.Article one, many physical links of LAPD chain route carry jointly, when wherein having some link to have packet loss, and the heartbeat detecting method in the correlation technique can't detect the problem that these links exist, to cause the LAPD packet loss and retransmit, thereby the speed of influence transmission can't embody the superiority bandwidth based on the LAPD multilink.And by adopting chain circuit detecting method of the present invention just can reach the technique effect of avoiding this situation.
Preferably, heartbeat message is the LQR message.The structure of LQR message is shown in Fig. 2,3.
Preferably, the SAPI field is used in the link-quality message packet header is based on untapped numerical value in the D passage uplink access regulation protocol stack.Thereby make the standard message form that is different from LAPD according to message format of the present invention (shown in Fig. 1,2,3,4), so that the recipient can support detection method of the present invention according to this numerical value judgement transmit leg.
In the above-described embodiments, can realize the timing of first predetermined period and second predetermined period by for example timer.
Make that about the number of heartbeat message and total packet sending and receiving the recipient can be according to whether receiving normally whether parameter in heartbeat message and the heartbeat message correctly comes to determine the state of link by in heartbeat message, carrying the expression transmit leg according to the chain circuit detecting method of the embodiment of the invention, and come link is handled accordingly, thereby realized improving the technique effect of link detecting sensitivity according to the state of link.
Second embodiment
Fig. 6 shows the flow chart according to the chain circuit detecting method of second embodiment of the invention.Fig. 6 has described equipment X under the link upstate, and to the flow process that Link State detects, its step is as follows, and the timer of supposing first predetermined period is T2:
Step 601: after receiving a LQR who sends from opposite equip. Y from this link, preserve all statistical contents in this message, and compare with statistical value among the previous LQR that receives: at first calculate the LastInLQRs among current this LQR that receives and the previous LQR that receives in the difference of LastInLQRs, if difference is 0, devices illustrated Y does not receive the LQR bag that equipment X sends in a T2 timing cycle, then other statistical parameters do not have reference value, do not do analysis, and variable bPeerNotRcvLQR is set is TRUE, sign opposite equip. Y did not receive the LQR bag at a T2 in the cycle, and execution in step 602; If the difference of the LastInLQRs in former and later two LQR bag, illustrate opposite end Y greater than 0 and received in the cycle that at a T2 LQR that equipment X sends wraps, and global variable bPeerNotRcvLQR is set is FALSE, and execution in step 603;
Step 602: equipment X adds one with a variable bySendLQRLost who is used to identify local terminal sending direction LQR packet loss number of times, and whether the value of judging bySendLQRLost loses situation more than 2 times more than or equal to 2 (also can be other number of times) to judge whether to exist sending direction LQR bag continuously; If bySendLQRLost less than 2 and bPeerNotRcvLQR be TRUE, then continue execution in step 601; If bySendLQRLost less than 2 and bPeerNotRcvLQR be FALSE, then execution in step 604; If bySendLQRLost more than or equal to 2, then is provided with bySendLQRLost=0, and W=100 is set, execution in step 607;
Step 603: the difference of the LastInLQRs of former and later two LQR the bags whether difference of the LastPeerOutLQRs in former and later two LQR bags that equipment X calculating receives equals to receive, if equate, devices illustrated X is on sending direction, the LQR message is not lost, bySendLQRLost=0 then is set, execution in step 604; If the difference of the LastPeerOutLQRs among former and later two LQR that receive is greater than the difference of LastInLQRs, may there be the situation of losing in devices illustrated X LQR message on sending direction, and then execution in step 602;
Step 604: if receive the difference of the LastPeerOutPackets difference of former and later two LQR bags that slave unit Y sends greater than LastInPackets from this link, there is packet loss in devices illustrated X sending direction, calculating during this period, local terminal sends the number M (M equals the LastPeerOutPackets difference in former and later two LQR bags) of wrapping, and the number N of calculating packet loss (equaling the difference that M deducts LastInPackets in former and later two LQR bags), if N=0, judged result is that equipment X sending direction does not have packet loss, w=-β (β>0) then is set, and wherein β can set according to actual conditions; Otherwise calculate N>0: w=γ N/M, wherein γ can set according to actual conditions.And execution in step 605;
Step 605: calculate weighted value according to formula W=W+w, if W 〉=100 then W=100 is set, and execution in step 607; If 0<W<100, then execution in step 601; If W≤0 then is provided with W=0,, continue execution in step 601 because this link is exactly initiate mode originally; Wherein, 100 is set point, also can be set at other values according to actual conditions;
Step 606: each T2 regularly arrives, calculate dwCurLocalInLQRs and dwLastLocalInLQRs difference, if difference is 0, explanation is in a T2 timing cycle, do not receive the LQR packet that equipment Y sends over, the variable byNotRcvLQRs of receive direction LQR packet loss number of times is added one, and judge that byNotRcvLQRs (promptly judges whether to exist receive direction LQR message to lose situation more than 2 times continuously) whether more than or equal to 2, if more than or equal to 2, then byNotRcvLQRs is set to 0, dwCurLocalInLQRs is copied to dwLastLocalInLQRs, and weighted value W=100 is set, carry out 607; If byNotRcvLQRs less than 2, copies to dwLastLocalInLQRs with dwCurLocalInLQRs, continue execution in step 606; Bag is not lost if dwCurLocalInLQRs and dwLastLocalInLQRs difference, illustrate receive direction LQR greater than 0, and dwCurLocalInLQRs is copied to dwLastLocalInLQRs, and byNotRcvLQRs is set to 0, continuation execution in step 606; Wherein, T2 is set to 500ms usually, also can be set to other values according to actual conditions;
Step 607: forbid this physical link, but still to this link timed sending LQR message, and start cycle timer T3, regularly send the long test packet of length to this link, message structure as shown in Figure 4, usually T3 is set to 100ms, also can be set to other values according to actual conditions.
Make that by the parameter of in heartbeat message, carrying the number that is illustrated in total message that transmit leg sends in first predetermined period recipient can be according to whether receiving normally that parameter in heartbeat message and the heartbeat message determines the state of link according to the chain circuit detecting method of the embodiment of the invention, and when the packet loss phenomenon appears in link, forbid link or continue the use link according to user's setting, thereby realized improving the technique effect of link detecting sensitivity.
The 3rd embodiment
Fig. 7 shows the flow chart according to the chain circuit detecting method of third embodiment of the invention.Fig. 7 has described equipment X under link is in disabled status, and to the flow process that Link State detects, its step is as follows, supposes that the second predetermined period timer is T3:
Step 701: receive behind a LQR of opposite equip. Y transmission from this link, preserve all statistical contents in this message, and compare with statistical value among the previous LQR that receives, at first calculate LastInLQRs among current this LQR and the difference of the LastInLQRs among the previous LQR, if difference is 0, devices illustrated Y may not receive the LQR bag that equipment X sends in a T2 timing cycle, and then other statistical parameters do not have reference value, do not do analysis, carry out 701; If the difference of the LastInLQRs in former and later two LQR bags is greater than 0, whether the difference of LastPeerOutLQRs is greater than the difference of the LastInLQRs in former and later two bags among former and later two LQR that then relatively receive, if greater than, illustrate that may there be packet loss in sending direction LQR, then execution in step 701; If difference equates that devices illustrated X LQR message on sending direction is not lost, then execution in step 702;
Step 702: if receive the difference of the LastPeerOutPackets difference of former and later two LQR bags that slave unit Y sends greater than LastInPackets from this link, illustrate that there is packet loss in local terminal equipment X sending direction, calculating local terminal during inferior sends the number M (M equals the LastPeerOutPackets in former and later two LQR bags) of bag, and the number N of calculating packet loss (equaling the difference that M deducts LastInPackets in former and later two LQR bags), if N=0, judged result is that equipment X sending direction does not have packet loss, w=-β (β>0) then is set, and wherein β can set according to actual conditions; Otherwise calculate N>0: w = γ M - N M , Wherein γ can set according to actual conditions.And execution in step 703;
Step 703: calculate weighted value according to formula W=W+w,,, continue execution in step 701 because this link is exactly disabled status originally if W 〉=100 are provided with W=100; If 0<W<100 continue to carry out 701; If W≤0 then is provided with W=0, continue execution in step 704; Wherein, 100 is set point, also can be set at other values according to actual conditions;
Step 704: enable this link, stop the T3 timer, T3 is set to 100ms usually, also can be set to other values according to actual conditions.
Make that about the parameter of heartbeat message and total message number the recipient can be according to whether receiving normally that parameter in heartbeat message and the heartbeat message determines the state of link by in heartbeat message, carrying the expression transmit leg according to the chain circuit detecting method of the embodiment of the invention, and can be behind the forbidding link, actual conditions according to link, when link condition reaches requirement, recover link, thereby realized improving the technique effect of link detecting sensitivity.
In addition, before the chain circuit detecting method of realizing according to the embodiment of the invention, can also carry out compatibility and inquire about, following compatible querying method is based on the LAPD agreement.
Carry out compatible step of inquiring about as shown in Figure 8:
Step 801: when equipment X starts, start timer T1;
Step 802:T1 regularly arrives, and sends compatible query message shown in Figure 1, and judges that whether T1 timing expired times are more than or equal to 5 times (also can be set to other number of times according to actual conditions); If expired times surpass 5 times, devices illustrated X does not receive the compatibility inquiry or the response message of opposite end in five T1 timing cycles, and then execution in step 805, otherwise, then restart timer T1; Wherein, T1 can be set to 1s, also can be set to other values according to actual conditions;
Step 803: if opposite equip. Y supports the link detecting mode that the present invention describes, after the compatible query message that the equipment X of receiving sends, respond compatible inquiry response message, if this moment, equipment Y was not activated timer T2, then start timer T2, beginning timed sending LQR packet; If equipment X before the 5th T1 timer arrives, receives the compatible inquiry response message of opposite equip. Y, then devices illustrated Y supports link detecting mode of the present invention, stops the T1 timer, execution in step 806; Perhaps during this period, just in time equipment Y also is in starting state, and it supports link detecting mode of the present invention, then equipment X can receive the compatible query message of opposite equip. Y, need to respond the compatible inquiry response message in opposite end this moment, stop the T1 timer, and execution in step 806;
Step 804: if equipment X is after the 5th T1 timer, the LAPD agreement has entered the normal operation phase, receive the compatible query message of opposite equip. Y this moment, illustrate that opposite equip. Y supports link detecting mode of the present invention, then respond compatible inquiry response message, if be not activated the T2 timer, then execution in step 806;
Step 805:, then still continue to use original link detecting mode if opposite equip. Y does not support link detecting mode of the present invention;
Step 806: start cycle timer T2, each T2 regularly arrives, and every the physical link that uses to the LAPD link sends the LQR message.
As mentioned above, by means of technique scheme of the present invention, make about the number of heartbeat message and total packet sending and receiving whether the recipient can normally come to determine the state of link according to whether normally receiving the parameter in heartbeat message and the heartbeat message by in heartbeat message, carrying transmit leg, thereby realized the technique effect of raising link detecting sensitivity.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1. a chain circuit detecting method is characterized in that, comprising:
Transmit leg sends heartbeat message with first predetermined period by described chain road direction recipient, described heartbeat message carries parameter, and number, transmit leg the last time that described parametric representation transmit leg sends the number of heartbeat message and sends total message receives heartbeat message number and the total message number that heartbeat message number that the expression recipient that carries in the heartbeat message that described recipient sends sends and total message number and described transmit leg receive when receiving the last heartbeat message;
Described recipient judges whether normally to receive that described heartbeat message and described recipient judge whether the parameter in the described heartbeat message is normal;
Determine the state of described link according to judged result;
Described recipient is forbidden described link or is continued to use described link according to the state of described link;
Wherein, described recipient judges whether normally to receive described heartbeat message and described recipient judge whether the parameter in the described heartbeat message normally specifically comprises:
If continuous first pre-determined number of described recipient does not receive described heartbeat message in described first predetermined period, judge that then described link is in the third state;
If described recipient receives described heartbeat message in described first predetermined period, then calculate d 0=N 1-N 2, wherein, N 1Be the heartbeat message number that recipient that described recipient obtains according to the calculation of parameter in former and later two heartbeat messages of receiving recently sends in one first predetermined period, N 2The heartbeat message number that the transmit leg that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving recently for described recipient receives in one first predetermined period;
If d 0=0, total message number that total message number that the recipient that then described recipient obtains according to the calculation of parameter in former and later two described heartbeat messages of receiving recently sends in one first predetermined period and transmit leg receive in one first predetermined period judges that described link is in first state or second state;
Otherwise d 0>0, judge that then the heartbeat message that the recipient sends loses, if existing, loses continuous first pre-determined number heartbeat message that the recipient sends in first predetermined period, then described recipient judges that described link is in the third state.
2. chain circuit detecting method according to claim 1, it is characterized in that total message number that total message number that the recipient that described recipient obtains according to the calculation of parameter in former and later two described heartbeat messages of receiving recently sends and transmit leg receive judges that described link is in first state or second state specifically comprises in one first predetermined period in one first predetermined period:
Described recipient calculates d 1=N 3-N 4,
Wherein, N 3Total message number that the recipient who obtains by calculation of parameter in former and later two heartbeat messages of receiving recently for described recipient sends in one first predetermined period, N 4Total message number that the transmit leg that obtains by the calculation of parameter in former and later two heartbeat messages of receiving recently for described recipient receives in one first predetermined period;
If d 1=0, judge that then described link is in described first state;
If d 1>0, judge that described link is in described second state.
3. chain circuit detecting method according to claim 1 is characterized in that, the state of described link is in described first state or described second state, and described recipient carries out following processing according to the state of described link to described link:
If link is in described first state, it is w that the weighted value of described link in i first predetermined period then is set i=-β;
If link is in described second state, then calculate the weighted value of described link in i described first predetermined period
Figure FSB00000549352000021
As W=∑ w iDuring<α, the recipient judges that link is in upstate, continue to send data by described link, and at W=∑ w i, W=0 is set at≤0 o'clock;
As W=∑ w iDuring 〉=α, described recipient is forbidden described link,
Wherein, N 3iTotal message number that described recipient sends in i described first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, N 4iTotal message number that transmit leg receives in i described first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, α and β are set point.
4. chain circuit detecting method according to claim 1 is characterized in that the state of described link is in the described third state, and described recipient carries out following processing according to the state of described link to described link:
Described recipient is forbidden described link, and weighted value W=α is set, and α is a set point.
5. chain circuit detecting method according to claim 3 is characterized in that, when described recipient is forbidden described link, also comprises:
Step 1, described recipient sends test packet with second predetermined period to described link, and sends described heartbeat message with described first predetermined period to described link;
Step 2 judges that the recipient does not have losing of heartbeat message at receive direction, and if calculate each d according to described heartbeat message 0All satisfy d 0=N 1-N 2=0, then calculate d 1i=N 3i-N 4iIf, d 1i=0, w then is set i=-β; Otherwise d 1i>0, calculate
Figure FSB00000549352000031
Step 3 is as W=∑ w i≤ 0 o'clock, recover described link, and W=0 is set; Otherwise, repeating step one, step 2, and step 3, and at W=∑ w iDuring 〉=α, W=α is set.
6. chain circuit detecting method according to claim 4 is characterized in that, when described recipient is forbidden described link, also comprises:
Step 1, described recipient sends test packet with second predetermined period to described link, and sends described heartbeat message with described first predetermined period to described link;
Step 2 judges that the recipient does not have losing of heartbeat message at receive direction, and if calculate each d according to described heartbeat message 0All satisfy d 0=N 1-N 2=0, then calculate d 1i=N 3i-N 4iIf, d 1i=0, w then is set i=-β; Otherwise d 1i>0, calculate
Figure FSB00000549352000041
Step 3 is as W=∑ w i≤ 0 o'clock, recover described link, and W=0 is set; Otherwise, repeating step one, step 2, and step 3, and at W=∑ w iDuring 〉=α, W=α is set,
Wherein, N 3iTotal message number that described recipient sends in i described first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, N 4iTotal message number that transmit leg receives in i described first predetermined period that obtains according to the calculation of parameter in former and later two heartbeat messages of receiving for the recipient, β is a set point.
7. according to each described chain circuit detecting method among the claim 1-4, it is characterized in that described link is the multilink based on D passage uplink access regulation.
8. chain circuit detecting method according to claim 7 is characterized in that, described heartbeat message is the link-quality message.
9. chain circuit detecting method according to claim 8 is characterized in that, the SAPI field is used in the described link-quality message packet header is based on untapped numerical value in the D passage uplink access regulation protocol stack.
CN2009101506005A 2009-06-23 2009-06-23 Link detection method Active CN101594268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101506005A CN101594268B (en) 2009-06-23 2009-06-23 Link detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101506005A CN101594268B (en) 2009-06-23 2009-06-23 Link detection method

Publications (2)

Publication Number Publication Date
CN101594268A CN101594268A (en) 2009-12-02
CN101594268B true CN101594268B (en) 2011-11-23

Family

ID=41408726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101506005A Active CN101594268B (en) 2009-06-23 2009-06-23 Link detection method

Country Status (1)

Country Link
CN (1) CN101594268B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404170B (en) * 2011-11-18 2014-01-22 福建星网锐捷网络有限公司 Detection method, device and system of message loss
CN103139008A (en) * 2011-11-23 2013-06-05 中兴通讯股份有限公司 Self-adaption method and device capable of detecting message heartbeat period
CN103490943A (en) * 2013-07-04 2014-01-01 文杰 Industrial Ethernet packet loss detection method based on heartbeat signals
CN105530141A (en) * 2014-10-27 2016-04-27 中兴通讯股份有限公司 Link state detection method and device
WO2016065552A1 (en) * 2014-10-29 2016-05-06 华为技术有限公司 Heartbeat cycle setting method and terminal
CN104320311A (en) * 2014-11-20 2015-01-28 国电南京自动化股份有限公司 Heartbeat detection method of SCADA distribution type platform
CN105721232A (en) * 2014-12-02 2016-06-29 中兴通讯股份有限公司 Method and device for implementing link detection
CN107872357B (en) * 2016-09-27 2020-05-08 华为技术有限公司 Method, equipment and system for measuring available bandwidth of link
CN107231302B (en) * 2017-05-10 2020-04-21 北京奇艺世纪科技有限公司 Transmission path selection method and device
CN107086943A (en) * 2017-05-24 2017-08-22 深圳市乃斯网络科技有限公司 The computational methods and system of packet loss in network linking
CN109217978A (en) * 2017-06-30 2019-01-15 华为技术有限公司 The methods, devices and systems of data transmission
WO2020237530A1 (en) * 2019-05-29 2020-12-03 华为技术有限公司 Link detection method and apparatus and related device
CN114244893A (en) * 2021-12-14 2022-03-25 京东方科技集团股份有限公司 Instruction processing method, device and communication system

Also Published As

Publication number Publication date
CN101594268A (en) 2009-12-02

Similar Documents

Publication Publication Date Title
CN101594268B (en) Link detection method
CA1220830A (en) Transmitting sequence numbers of information in a packet data transmission system
CN101764730B (en) CAN bus data transmission method
EP0465533A4 (en) Error correction for infrared data communication
JP2006526967A5 (en)
CN103684678A (en) Baud rate adaptive method for UART, device and UART
EP1521385A3 (en) Safety protocol for industrial controller
CN101652949A (en) Packet communication method and receiving side device
CN110297800B (en) Method and system for realizing stable communication between main control chip and security chip
CN105187332B (en) Multi-source data transmission method based on Zigbee network
EP2684323A1 (en) Microcontroller with can bus module and auto speed detect
CN109495215A (en) A kind of communication means of half-duplex bus, system and device and readable storage medium storing program for executing
CN104113442A (en) Ethernet loop detection system and method
CN106685760A (en) Link state detecting method and apparatus
JP3968097B2 (en) Status report missing detection in communication systems
CN106452894B (en) Failure connecting detection method and apparatus
CN103534973B (en) A kind of methods, devices and systems reducing transmission control layer confirmation message
CN100502277C (en) Correctness checking system and method of data transmission
KR20060061347A (en) Radio network communication system and protocol using an automatic repeater
CN103068061B (en) The method and apparatus of detecting transmission collision, and the method and apparatus for slowing down transmission collision
CN109068328A (en) Secure network communication method, terminal and system
CN101626320A (en) Method and device for detecting loopback of channel
CN109245816A (en) A kind of chain circuit detecting method and device
CN107040431B (en) Method and system for detecting LAN port loop of AP
JP3966081B2 (en) Communication control system and communication system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant