CN101848223B - Network processor-based method and device for realizing quick bidirectional forwarding detection of messages - Google Patents
Network processor-based method and device for realizing quick bidirectional forwarding detection of messages Download PDFInfo
- Publication number
- CN101848223B CN101848223B CN201010186773.5A CN201010186773A CN101848223B CN 101848223 B CN101848223 B CN 101848223B CN 201010186773 A CN201010186773 A CN 201010186773A CN 101848223 B CN101848223 B CN 101848223B
- Authority
- CN
- China
- Prior art keywords
- loopback
- message
- template message
- processing unit
- sending
- 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.)
- Expired - Fee Related
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 92
- 238000000034 method Methods 0.000 title claims abstract description 31
- 230000002457 bidirectional effect Effects 0.000 title abstract description 3
- 238000012545 processing Methods 0.000 claims abstract description 88
- 230000005540 biological transmission Effects 0.000 claims abstract description 70
- 230000006870 function Effects 0.000 claims abstract description 26
- 230000000737 periodic effect Effects 0.000 claims abstract description 17
- 238000007493 shaping process Methods 0.000 claims description 9
- JEIPFZHSYJVQDO-UHFFFAOYSA-N ferric oxide Chemical compound O=[Fe]O[Fe]=O JEIPFZHSYJVQDO-UHFFFAOYSA-N 0.000 claims description 4
- 238000004891 communication Methods 0.000 abstract description 2
- 230000008569 process Effects 0.000 description 9
- 238000005538 encapsulation Methods 0.000 description 4
- MHABMANUFPZXEB-UHFFFAOYSA-N O-demethyl-aloesaponarin I Natural products O=C1C2=CC=CC(O)=C2C(=O)C2=C1C=C(O)C(C(O)=O)=C2C MHABMANUFPZXEB-UHFFFAOYSA-N 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000003550 marker Substances 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 101150082208 DIABLO gene Proteins 0.000 description 1
- 102100033189 Diablo IAP-binding mitochondrial protein Human genes 0.000 description 1
- 238000003556 assay Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a network processor-based method and device for realizing the quick bidirectional forwarding detection of messages, belonging to the data transmission and communication field. The method comprises the following steps: a loopback timer is arranged in a network processor; the network processor receives an enable mark, a sending template message, a table of sending detection information and a statistical learning table which are sent by a central processing unit; message sending function is started according to the enable mark, the loopback timer is started according to the sending template message, the table of sending detection information and the statistical learning table are looked up according to the sending template message to obtain loopback count value; the loopback count value is compared with the periodic value of the table of sending detection information to judge whether the two values are equal, if so, the sending period of the loopback timer is completed, one copy of the sending template message is made, the loopback of one sending template message is performed, a detection message is generated according to the other sending template message and the table of sending detection information, and the detection message is outputted. The technical scheme of the invention can improve the performance of the system.
Description
Technical field
The present invention relates to transfer of data communication field, particularly a kind of processor Network Based is realized the method and apparatus that rapid message two-way converting detects.
Background technology
Greeting (Hello) agreement is a kind of network layer protocol, and it makes the network equipment can identify mutually the identity of oneself, and shows that oneself is still in running order.The network equipment returns to Hello and replys after receiving Hello request.The network equipment sends Hello packet according to the time interval of appointment, still in running order to show oneself.
It is a set of international standard protocol that is used for realizing fast detecting that two-way converting detects (Bidirectional Forwarding Detection, BFD), and a kind of light load, short detection of duration are provided.Compare with other " Hello " testing mechanisms in the past, there are many original advantages.
BFD agreement is simple " Hello " agreement, and aspect a lot, the neighbours test section of the Routing Protocol that it is famous to those is similar.On the passage of the session that a pair of system is set up between them, periodically send detection messages, if certain system is not received the detection messages of opposite end within the sufficiently long time, think that fault has occurred certain part in this duplex channel to adjacent system.Sending and receiving speed between system needs to consult.
In the implementation procedure of BFD agreement, need corresponding state machine to store the state of local session, yet in the system of current router and switch realizes, the operation relevant to state is by upper layer software (applications), platform is realized.The benefit of this way is: the state that can realize at an easy rate BFD switches, and realizes simple BFD function.But there is a fatal defect to be exactly: because BFD is fast detecting message, may will send a data message every 10ms, and platform is processed with general CPU, restriction due to cpu resource, on every equipment, can only support at most the session (Session) of 5 BFD, otherwise too high CPU usage can cause other function process cannot obtain in time enough cpu resources simultaneously.
Summary of the invention
Technical problem to be solved by this invention is to provide the method for the rapid message two-way converting monitoring that a kind of processor Network Based realizes, and simplifies the workload of platform, and technical scheme is as follows:
Processor Network Based is realized the method that rapid message two-way converting detects, and comprising:
At network processing unit, loopback timer is set;
Described network processing unit receives that central processing unit sends enables sign, send template message, send and detect information table and statistical learning table;
Described in described network processing unit basis, enable to identify start detection message sending function, according to sending template message, start described loopback timer, according to sending, template message is inquired about described transmission detection information table and statistical learning table obtains loopback count value;
Whether the periodic quantity that more described loopback count value and described transmission detect information table equates, if equated, arrive the transmission cycle of loopback timer, and described transmission template message is copied to portion, a copy of it is sent to template message and carry out loopback, according to another part, send template message and described transmission detection information table generation detection messages, and output.
Further, unequal if loopback count value and described transmission detect the cycle of information table, will after a numerical value of described loopback count value variation, again write statistical learning table.
Further, describedly at network processing unit, loopback timer is set, comprises: on the loopback mouth of network processing unit, enable the shaping feature of traffic management, by shaping parameter is set, make the message rate of going out from loopback mouth controlled, to realize loopback timer.
Further, according to transmission detection information table and statistical learning table described in the search index of transmission template message, obtain loopback count value, comprising:
Described network processing unit sends detection information table according to the index search sending in message, obtains the relevant information that sends message, and according to detecting from sending the keyword search statistical learning table that information table is found, obtains loopback count value.
Wherein, described template message comprises: the umber of loopback template message, timer loopback identify, in order to what distinguish this loopback timer of use, are the traffic identifier that sends template message or regularly detect the inner classes offset of template message, the index of session queue and loopback message; Or
Described transmission detects information table and comprises: search successfully or unsuccessfully the sense cycle value of the timed sending that identifies, sets, send the relevant information of message and in order to the keyword of index statistical learning table; Or
Described statistical learning table comprises: corresponding to the loopback number of times of current sessions with corresponding to the packet receiving count value of current sessions.
Processor Network Based is realized the method that rapid message two-way converting detects, and comprising:
At network processing unit, loopback timer is set;
Described network processing unit receives that central processing unit sends enables sign, regularly detect template message, send and detect information table and statistical learning table;
Described network processing unit according to described in enable sign and start regularly detection messages function, according to regularly detecting template message starts described loopback timer, according to sending template message, inquire about that described transmission detects information table and statistical learning table obtains loopback count value;
Whether the periodic quantity that more described loopback count value and described transmission detect information table equates;
If equated, reach the sense cycle of loopback timer, according to the packet receiving count results of statistical learning table, judge, if packet receiving count results is preset value, described timing is detected to template message and copy portion, a copy of it is for detecting failure information to described central processing unit report, and wherein another part is carried out loopback.
Further, if packet receiving count value is not described preset value, the packet receiving count value in described statistical learning table is returned to described preset value, and enter next sense cycle.
A network processing unit, comprising:
Module is set, for loopback timer is set at network processing unit;
Receiver module, enables sign, sends template message, sends and detect information table and statistical learning table for what receive that central processing unit sends;
Start and acquisition module, for enabling to identify start detection message sending function described in basis, according to sending template message, start described loopback timer, according to sending, template message is inquired about described transmission detection information table and statistical learning table obtains loopback count value;
Comparison and output module, whether the periodic quantity for more described loopback count value and described transmission detection information table equates, if equated, arrive the transmission cycle of loopback timer, and described transmission template message is copied to portion, a copy of it is sent to template message and carry out loopback, according to another part, send template message and described transmission detection information table generation detection messages, and output.
Further, described comparison and output module, if also unequal for the cycle of loopback count value and described transmission detection information table, will write statistical learning table after a numerical value of described loopback count value variation again; Or
The described module that arranges, specifically for enabling the shaping feature of traffic management on the loopback mouth at network processing unit, by shaping parameter is set, makes the message rate of going out from loopback mouth controlled, to realize loopback timer; Or
Described startup and acquisition module, for sending and detect information table according to the index search that sends message, obtain the relevant information that sends message, and according to detecting from sending the keyword search statistical learning table that information table is found, obtain loopback count value.
A network processing unit, comprising:
Module is set, for loopback timer is set;
Receiver module, enables sign, regularly detects template message, sends and detect information table and statistical learning table for what receive that central processing unit sends;
Start and acquisition module, for enabling sign described in basis, start regularly detection messages function, according to regularly detecting template message starts described loopback timer, according to sending, template message is inquired about described transmission detection information table and statistical learning table obtains loopback count value;
Whether comparison and output module be equal for the periodic quantity of more described loopback count value and described transmission detection information table; If equated, reach the sense cycle of loopback timer, according to the packet receiving count results of statistical learning table, judge, if packet receiving count results is preset value, described timing is detected to template message and copy portion, a copy of it is for detecting failure information to described central processing unit report, and wherein another part is carried out loopback.
Further, described comparison and output module, if be not also described preset value for packet receiving count value, return to described preset value by the packet receiving count value in described statistical learning table, and enter next sense cycle.
The present invention is by transferring to network processing unit to realize the transmission of BFD and measuring ability, thereby greatly alleviated the burden of platform, is conducive to support more BFD session, greatly improved the performance of system.
Accompanying drawing explanation
Fig. 1 is a kind of message transmission flow figure that realizes the method for rapid message two-way converting detection in network processing unit that the embodiment of the present invention provides;
The another kind that Fig. 2 embodiment of the present invention provides is realized the packet check flow chart of the method for rapid message two-way converting detection in network processing unit;
Fig. 3 is that the embodiment of the present invention realizes the detail flowchart that BFD fast detecting message sends and detects.
Fig. 4 is the structural representation of a kind of network processing unit of providing of the embodiment of the present invention.
Fig. 5 is the graph of a relation of the present invention in whole switch system and between modules.
Embodiment
Below in conjunction with accompanying drawing, the embodiment of the present invention is described in detail.
First embodiment of the invention provides a kind of processor Network Based to realize the method that rapid message two-way converting detects, and as shown in Figure 1, comprising:
101, at network processing unit, loopback timer is set;
102, network processing unit receives that central processing unit sends enables sign, send template message, send and detect information table and statistical learning table;
103, network processing unit enables to identify start detection message sending function according to this, according to sending template message, starts this loopback timer, and according to sending, template message is inquired about this transmission detection information table and statistical learning table obtains loopback count value;
104, relatively whether this loopback count value and this periodic quantity that sends detection information table equate, if equated, judgement arrives the transmission cycle of loopback timer, and this transmission template message is copied to portion, a copy of it is sent to template message and carry out loopback, according to another part, send template message and generate detection messages with this transmission detection information table, and output.
Further, if loopback count value and this cycle that sends detection information table are unequal, will after a numerical value of this loopback count value variation, again write statistical learning table.
Further, should loopback timer be set at network processing unit, comprise: on the loopback mouth of network processing unit, enable shaping (shaper) function of traffic management, by shaper parameter is set, make the message rate of going out from loopback mouth controlled, to realize loopback timer.
Further, according to this transmission detection information table of search index and the statistical learning table that send template message, obtain loopback count value, comprising:
This network processing unit sends detection information table according to the index search sending in message, obtains the relevant information that sends message, and according to detecting from sending the keyword search statistical learning table that information table is found, obtains loopback count value.
Further, this template message comprises: the umber of loopback template message, loopback timer ID, what in order to difference, use this loopback timer is the traffic identifier that sends template message or regularly detect the inner classes offset of template message and the index of session queue and loopback message.
Further, this transmission detection information table comprises:
Search successfully or unsuccessfully the sense cycle value of the timed sending that identifies, sets, send the relevant information of message and in order to the keyword of index statistical learning table.
Further, this statistical learning table comprises:
Corresponding to the loopback number of times of current sessions with corresponding to the packet receiving count value of current sessions.
Second embodiment of the invention also provides a kind of processor Network Based to realize the method that rapid message two-way converting detects, and as shown in Figure 2, comprising:
201, at network processing unit, loopback timer is set;
Wherein, how loopback timer being set can be referring to the corresponding contents of the first embodiment.
202, this network processing unit receives that central processing unit sends enables sign, regularly detect template message, send and detect information table and statistical learning table;
Wherein, regularly detect template message, send and detect the content of information table and statistical learning table referring to the related content of the first embodiment.
203, this network processing unit enables to identify according to this and starts regularly detection messages function, and according to regularly detecting template message starts this loopback timer, according to sending, template message is inquired about this transmission detection information table and statistical learning table obtains loopback count value;
204, relatively whether this loopback count value and this periodic quantity that sends detection information table equate; If equated, judgement reaches the sense cycle of loopback timer, according to the packet receiving count results of statistical learning table, judge, if packet receiving count results is preset value, this is regularly detected to template message and copy portion, a copy of it is for detecting failure information to this central processing unit report, and wherein another part is carried out loopback.
Further, the method also comprises: if packet receiving count value is not this preset value, the packet receiving count value in this statistical learning table is returned to this preset value, and enter next sense cycle.
Wherein, network processing unit goes for switch, router or other network forwarding equipment.
The main flow network processor chip of Present Domestic device fabrication manufacturer of take is below example, and the specific embodiments of the embodiment of the present invention is as follows:
In order to realize the function of loopback timer in network processing unit, need to do corresponding configuration to network processing unit, concrete configuration can be as follows:
The shaper function of enabling traffic management (Traffic Manager, TM) on the loopback (loopback) of network processing unit mouthful, by shaper parameter is set, makes the message rate of going out from loopback mouth controlled.
CPU sends template message to network processing unit, and the microcode in network processing unit mails to template message in the loopback mouth of setting, and after this template message is constantly in network processing unit internal loopback.Because loopback mouth has opened shaper function, message will be periodically in network processing unit internal loopback.Shaper function can only be configured in L0, L1, and L2, on 4 levels such as L3.The loopback mouth of physics has 3, and being equivalent to can have 3 loopback mouths in corresponding L2 rank.Other shaper parameter of L3 level can configure 256 features (profile).Shaper parameter is just configured on L3 layer, during every one deck configuration shaper parameter, need to configure a reference speed rate (base rate).Reference speed rate is that all shaper parameters of this rank of LX share, and is other global parameter of level.The base rate=5150 configuring in the present embodiment.By parameter configuration above, can be obtained: the loopback of each message is spaced apart 10/1536ms, and the queue that has so just realized whole 1536 the BFD sessions of chronomere (10ms) of each timer is all scanned once.It should be noted that, in this example, network processing unit can be supported 1536 sessions, but in actual applications, and the ability that the session number that network processing unit can be supported can processor Network Based self and determining can, more than 1536, also can be less than 1536.
In order to realize timed sending BFD detection messages in network processing unit, need pre-designed template message, send and detect information table and statistical learning table.
Generally, network processing unit is just processed for the data message receiving, and then according to the corresponding list item finding, does forward process.In order to realize timed sending BFD detection messages, just needing a content is the packet receiving process that blank template message is carried out analog network processor, then according to the related content that checks in transmission detection information table, data being inserted to template message sends, simultaneously, template message is copied to a loopback that continues, to maintain the function of timer.Wherein, the structure of template message is as follows:
1) umber of loopback template message, in this example can be with 2 byte representations, and its numerical value can be 1.
2) timer head sign, being used for identifying this message is the template message after loopback, rather than the message of receiving from network.
3) inner types value (Packet_Type), mainly to be to send template message or regularly detect template message for what distinguish this loopback timer of use, for example, when inner classes offset is 1, what represent this loopback timer of use is to send template message; When inner classes offset is 0, what represent this loopback timer of use is regularly to detect template message.
4) index of session queue (Index), is used for directly searching the information of session.
5) traffic identifier (FLOW ID) that need to use during loopback, this data flow that this sign is determined is transmitted with the speed of agreement according to prior configuration information in loop-back process, and then realizes regularly.
6) content of message.For timed sending BFD detection messages more effectively, in main, have: for the Higig head of switching network processor, (DMAC is controlled in object media interviews, Destination Media Access Control) and source media interviews control (Source Media AccessControl, SMAC) two layers and the content of three layers of message such as, what need support is, four layer protocols of message are User Datagram Protocol (User Datagram Protocol, UDP), and udp protocol is the Control the content of BFD message below, this part content need to realize in strict accordance with BFD agreement.
For timed sending detection messages in BFD agreement and timing, detect the function that receives message, mainly need 2 list items, one is to send to detect information table, and what this table was stored is the information that sends message; Another is statistical learning table, the storage of this table be the information of loopback number of times, when each loopback scan queue, if loopback count value equate with transmission or sense cycle; enter transmission or testing process, loopback count value clear 0; If etc., just loopback count value is not added to 1.It should be noted that, loopback count value is just in order to need for example, in practical application, the initial value of loopback count value can not be also 0, but other numerical value, the variation of loopback count value can be not limited only to add 1, also can be to add 2, add 3, and being not limited to is addition, can be other algorithms such as subtraction, as long as finally can realize the traversal for whole queue.
For sending, detect information table, its search key is exactly the index that leaves the session queue in template message in, searches the corresponding informance of session with this index.This table content mainly comprises following part:
Key assignments: timing loop postbacks and send/detect the Current BFD entry Index in masterplate message.
Title | Byte offset | Biased moving | Explanation |
Current?BFD entry?Index | 0:1 | 0 | The index of BFD template message |
Title | Byte offset | Biased moving | Explanation |
valid | 0 | 0 | Significance bit |
match | 0 | 1 | Match bit |
?Ready | 0 | 2 | Send/detection of 0---does not enable send/detection of 1----and enables |
?SndOrChk | 0 | 3 | 0---gained list item result is for sending list item 1---gained list item result for detecting list item |
?MPLS?flag | 0 | 4 | 0----IP encapsulation, 1----MPLS encapsulation |
?LabelCnt | 0 | 5:6 | The label number of plies that MPLS will encapsulate |
?IPQINQ | 0 | 7 | 0---one deck vlan, bis-layers of vlan of 1--- |
?MultiHop | 1 | 0 | 0---BFD is single-hop, and 1---BFD is multi-hop |
?Rx?flag | 1 | 1 | 0---sends BFD message 1---from Tx and sends BFD message from Rx |
?IPOption | 1 | 2 | The non-option bag of 0---, 1----option bag |
?Trunk?flag | 1 | 3 | The non-trunk of 0---, 1-----trunk table |
?Rsvd | 1 | 2:7 | Retain |
?Trigger?PeriodCnt | 2:3 | 0:7 | The count counting of detection/sense cycle, user's configuration |
?Trunk?ID | 4 | Looking into trunk table uses | |
?DetMulti | 5 | Send and detect multiple | |
?Type | 6 | While searching BFD count table, use | |
?Rsvd | 7 | Retain | |
?My?Discreaminator | 8:11 | The local identifier of BFD session connection | |
?Your?Discreaminator | 12:15 | BFD session connection distal marker symbol | |
?Inner?vlan | 16:17 | The internal layer vlan of BFD message | |
?Out?Vlan | 18:19 | 0 | The outer vlan of BFD message |
?UDP?SrcPort | 20:21 | 0 | The source port number of UDP, is issued by platform |
?UDP?DstPort | 22:23 | 0 | The destination slogan of UDP, is issued by platform |
DPort | 24 | 0:7 | No. Port of outbound port |
DMod | 25 | 0:7 | No. Mod of outbound port |
Rsvd | 26:27 | 0 | Retain |
SIP | 28:31 | 0 | The SIP of the BFD message sending, platform issues |
DIP | 32:35 | 0 | The DIP of the BFD message sending, is issued by platform |
Inner?Label | 36:39 | 0 | Vpn label while sending the BFD message of MPLS encapsulation |
Outer?Label | 40:43 | 0 | Outer layer label while sending the BFD message of MPLS encapsulation |
Desired?Min?Tx Interval | 44:47 | 0 | The local minimum BFD message of supporting sends interval |
Required?Min RX?Interval | 48:51 | 0 | The local minimum BFD supporting receives interval |
IpOption | 52:55 | 0 | The content of IP option |
DMAC | 56:61 | The DMAC of the BFD message sending, needs to consult | |
Rsvd | 62:63 | 0 | Retain |
1) search successfully or unsuccessfully identify, if sign set obtains effective result after representing to search, otherwise, represent not find relevant information.
2) timed sending detection messages and regularly detection receive the distinctive mark of message, can represent that lookup result is that result or the timing that timed sending detection messages will be used detects the result that reception message will be used, and specifically can set according to actual conditions by 0 and 1 of this sign.
3) periodic quantity, represents transmission and assay intervals for certain fixing session subscriber configuration or setting, the number of times of the loopback needing counting.For example: the periodic quantity of transmission is 3, need to send again after message loopback 3 circles.
4) send the relevant information of message.If this part information spinner is used when sending message, the Higig relevant information that comprises message, as mod, port (port) etc., two or three layers of relevant information, medium access control (Media Access Control, MAC) and IP etc., and the information of relevant UDP and BFD data division, under these information are transmitted after setting up session with platform.
5) the necessary keyword of further searching, in some cases, also needs to use the keyword of list item once to look into statistical learning table, and the content of this keyword also will exist this transmission to detect in information table.
For statistical learning table, this table is current and passed through several time points in order to record each session, by comparing with the periodic quantity sending in detection information table, draw and whether need to send or detect operation, its search key is mainly that two of session signs and one are used for distinguishing and are timed sending or detect field regularly.It mainly comprises following content:
Key assignments: the Your Discreaminator that BFD session is corresponding and My Discreaminator and type (type)
Title | Byte offset | Biased moving | Explanation |
?Type | 9 | 0 | 0-represents to search transmission list item 1-and represents to search detection list item |
?Rsvd | 8 | Retain, in order to share table number, expanded key length | |
?My?Discreaminator | 0:3 | 0 | The local identifier of BFD session connection |
?Your?Discreaminator | 4:7 | BFD session connection distal marker symbol |
Title | Byte offset | Biased moving | Explanation |
?Valid | 0 | 0 | Effectively |
?Match | 0 | 1 | Coupling |
?Receive?Ready | 0 | 2 | The quick packet receiving of the local BFD of 0---does not enable |
The quick packet receiving of the local BFD of 1---enables | |||
SndOrChkFlg | 0 | 3 | 0---gained list item result is for sending list item 1---gained list item result for detecting list item |
Rsvd | 0 | 4:7 | Retain |
Rsvd | 1 | ||
CurLoopCnt | 2:3 | 0 | Record current loopback number of times |
ReceivePacketCnt | 4:7 | 0 | Receive BFD packet counting statistics |
Rsvd | 8:31 | 0 | Retain |
1) corresponding to the loopback number of times of current sessions, i.e. the record of current elapsed-time standards;
2), corresponding to the packet receiving count value of current sessions, record this session and receive altogether how many detection packets.
After completing above setting, below will on network processing unit, realize the transmission of BFD message, receive and detect, as shown in Figure 4, concrete implementation procedure has as follows:
CPU issues the sign that enables of BFD function, the list item of template message and relevant BFD session.Wherein, the sign that enables of BFD represents enabling of BFD measuring ability, issues template message and starts to scan whole queue for starting timer simultaneously, if do not descend forwarding list item, queue is empty so, how to check and can not send message.Instantly after forwarding list item, can realize message according to the content of list item and send the functions such as detection.
Whether processor detects is that BFD transmission template message/timing detects template message (301), if whether, enter other flow processs (302), because of unrelated to the invention, do not repeat them here.Then judge that BFD sign enables (303), if not, abandon template message (304), if so, use the index search in template message to send detection information table (305), and whether effectively judgement send detection information table (306), if effectively,, according to sending the keyword search statistical learning table (307) that detects information table, if invalid, template message is carried out to loopback (318).Particularly, conventionally when network processing unit is received template message, be generally 2 template message, one for timed sending detection messages, another is for regularly receiving detection messages, wherein, these 2 template message can share a loopback timer passage, can also use different loopback timer passages.When network processing unit receives transmission template message, can send and detect information table according to the index search in message, obtain the relevant information of transmission message.Meanwhile, according to the keyword search statistical learning table of finding; If find to send, do not detect information table, represent not this BFD session, directly loopback template message.If find to send and detect information table, want the loopback count value in first comparative statistics study table whether to equate (308) with the periodic quantity sending in detection information table, if equated, represent to arrive send or sense cycle, loopback count value is clear 0 (310), otherwise, represent also not arrive and send or sense cycle, now, again write after loopback count value is added to 1 (309) and in statistical learning table, go to (317), then loopback template message can (318).
Network processing unit needs whether judge templet message is regularly to detect template message (311), if not,, for the transmission template message that arrives the transmission cycle, first template message is copied to portion, so just there have been two parts of template message.Is a copy of it (accurate according to the object information of looking into transmission detection information table gained?) be packaged into different BFD messages and send (312 and 316), another part of template message enters loopback queue.It should be noted that, the message of all loopbacks all need to add 1 at the index of template message, and the index of the template message that network processing unit receives again is like this from last different, and the list item result checking in is also just different, has represented different BFD sessions.Because system is supported at most 1536 sessions, just automatically clear 0 when the value of index reaches 1536, so just formed round-robin queue, known according to arranging of loopback timer, in each 10ms, network processing unit all, to 1536 of whole queue run-downs, has been realized timing mechanism.
For the timing that arrives sense cycle, detect template message, to be whether 0 to judge (313) according to the packet receiving count value of statistical learning table, if packet receiving count value is 0, be illustrated in and in the regular hour, do not receive detection messages, need the report to CPU, now, need to copy a template message, a in order to carry out loopback, another part detects failed message (314) in order to report.If packet receiving count results is not 0, represent to detect successfully, just the packet receiving in statistical learning table is counted clear 0 (315), then upgrade and add up learning table (317), soon the loopback in statistical learning table is counted clearly 0, continues next sense cycle.
Due in BFD agreement, the foundation of BFD session is that the negotiations process by three-way handshake completes, and in the negotiations process of session, some message is given the processing that CPU carries out session status on needing.In addition,, after the session establishment of BFD, also having some messages that change about parameter also needs to send processing.The handling process that receives like this BFD message is mainly just divided into: the common BFD message for setting up session, abandons after counting; For not being that the message of up send on directly for setting up session or session status; And the message changing for some parameters after session establishment send on after counting.
Inventive concept based on identical with method, the embodiment of the present invention provides a kind of network processing unit, and this network processing unit goes for switch, router or other network forwarding equipment, and as shown in Figure 5, this network processing unit comprises:
Module is set, for loopback timer is set at network processing unit;
Receiver module, enables sign, sends template message, sends and detect information table and statistical learning table for what receive that central processing unit sends;
Start and acquisition module, for enable to identify start detection message sending function according to this, according to sending template message, start this loopback timer, according to sending, template message is inquired about this transmission detection information table and statistical learning table obtains loopback count value;
Comparison and output module, for relatively whether this loopback count value and this periodic quantity that sends detection information table equate, if equated, arrive the transmission cycle of loopback timer, and this transmission template message is copied to portion, a copy of it is sent to template message and carry out loopback, according to another part, send template message and generate detection messages with this transmission detection information table, and output.
Further, this comparison and output module, if also unequal for loopback count value and this cycle that sends detection information table, will write statistical learning table after a numerical value of this loopback count value variation again.
Further, this arranges module, specifically for enabling the shaper function of traffic management on the loopback mouth at network processing unit, by shaper parameter is set, makes the message rate of going out from loopback mouth controlled, to realize loopback timer.
Further, start and acquisition module, for obtaining loopback count value according to this transmission detection information table of search index and the statistical learning table that send template message, comprising:
This starts and acquisition module sends detection information table according to the index search sending in message, obtains the relevant information that sends message, and according to detecting from sending the keyword search statistical learning table that information table is found, obtains loopback count value.
Inventive concept based on identical with method, the embodiment of the present invention also provides another kind of network processing unit, and this network processing unit goes for switch, router or other network forwarding equipment, and as shown in Figure 4, this network processing unit comprises:
Module is set, for loopback timer is set;
Receiver module, enables sign, regularly detects template message, sends and detect information table and statistical learning table for what receive that central processing unit sends;
Start and acquisition module, for enabling according to this to identify, start regularly detection messages function, according to regularly detecting template message starts this loopback timer, according to sending, template message is inquired about this transmission detection information table and statistical learning table obtains loopback count value;
Comparison and output module, for relatively whether this loopback count value and this periodic quantity that sends detection information table equate; If equated, reach the sense cycle of loopback timer, according to the packet receiving count results of statistical learning table, judge, if packet receiving count results is preset value, this is regularly detected to template message and copy portion, a copy of it is for detecting failure information to this central processing unit report, and wherein another part is carried out loopback.
Further, this comparison and output module, if be not also this preset value for packet receiving count value, return to this preset value by the packet receiving count value in this statistical learning table, and enter next sense cycle.
As shown in Figure 5, different being between the present invention and prior art, prior art just realizes BFD function between upper strata key-course and exchange chip, and the present invention transfers to network processing unit to realize the transmission of BFD and measuring ability, thereby greatly alleviated the burden of platform, be conducive to support more BFD session, greatly improved the performance of system.
Claims (8)
1. processor Network Based is realized the method that rapid message two-way converting detects, and it is characterized in that, comprising:
At network processing unit, loopback timer is set;
Described network processing unit receives that central processing unit sends enables sign, send template message, send and detect information table and statistical learning table;
Described in described network processing unit basis, enable to identify start detection message sending function, according to sending template message, start described loopback timer, according to sending, template message is inquired about described transmission detection information table and statistical learning table obtains loopback count value;
Whether the periodic quantity that more described loopback count value and described transmission detect information table equates, if equated, arrive the transmission cycle of loopback timer, and described transmission template message is copied to portion, a copy of it is sent to template message and carry out loopback, according to another part, send template message and described transmission detection information table generation detection messages, and output; If it is unequal that loopback count value and described transmission detect the cycle of information table, will after a numerical value of described loopback count value variation, again write statistical learning table.
2. the method for claim 1, it is characterized in that, describedly at network processing unit, loopback timer is set, comprise: the shaping feature of enabling traffic management on the loopback mouth of network processing unit, by shaping parameter is set, make the message rate of going out from loopback mouth controlled, to realize loopback timer.
3. the method for claim 1, is characterized in that, according to transmission detection information table and statistical learning table described in the search index of transmission template message, obtains loopback count value, comprising:
Described network processing unit sends detection information table according to the index search sending in template message, obtains the relevant information that sends template message, and according to detecting from sending the keyword search statistical learning table that information table is found, obtains loopback count value.
4. the method as described in claim 1-3 any one, is characterized in that,
Described transmission template message comprises: the umber of loopback template message, timer loopback identify, in order to what distinguish this loopback timer of use, are the traffic identifier that sends template message or regularly detect the inner classes offset of template message, the index of session queue and loopback message; Or
Described transmission detects information table and comprises: search successfully or unsuccessfully the sense cycle value of the timed sending that identifies, sets, send the relevant information of template message and in order to the keyword of index statistical learning table; Or
Described statistical learning table comprises: corresponding to the loopback number of times of current sessions with corresponding to the packet receiving count value of current sessions.
5. processor Network Based is realized the method that rapid message two-way converting detects, and it is characterized in that, comprising:
At network processing unit, loopback timer is set;
Described network processing unit receives that central processing unit sends enables sign, regularly detect template message, send and detect information table and statistical learning table;
Described network processing unit according to described in enable sign and start regularly detection messages function, according to regularly detecting template message starts described loopback timer, according to sending template message, inquire about that described transmission detects information table and statistical learning table obtains loopback count value;
Whether the periodic quantity that more described loopback count value and described transmission detect information table equates;
If equated, reach the sense cycle of loopback timer, according to the packet receiving count results of statistical learning table, judge, if packet receiving count results is preset value, described timing is detected to template message and copy portion, a copy of it is for detecting failure information to described central processing unit report, and wherein another part is carried out loopback; If packet receiving count value is not described preset value, the packet receiving count value in described statistical learning table is returned to described preset value, and enter next sense cycle.
6. a network processing unit, is characterized in that, comprising:
Module is set, for loopback timer is set at network processing unit;
Receiver module, enables sign, sends template message, sends and detect information table and statistical learning table for what receive that central processing unit sends;
Start and acquisition module, for enabling to identify start detection message sending function described in basis, according to sending template message, start described loopback timer, according to sending, template message is inquired about described transmission detection information table and statistical learning table obtains loopback count value;
Comparison and output module, whether the periodic quantity for more described loopback count value and described transmission detection information table equates, if equated, arrive the transmission cycle of loopback timer, and described transmission template message is copied to portion, a copy of it is sent to template message and carry out loopback, according to another part, send template message and described transmission detection information table generation detection messages, and output; If also unequal for the cycle of loopback count value and described transmission detection information table, will after a numerical value of described loopback count value variation, again write statistical learning table.
7. network processing unit as claimed in claim 6, is characterized in that, comprising:
The described module that arranges, specifically for enabling the shaping feature of traffic management on the loopback mouth at network processing unit, by shaping parameter is set, makes the message rate of going out from loopback mouth controlled, to realize loopback timer; Or
Described startup and acquisition module, specifically for sending detection information table according to the index search sending in message, obtain the relevant information that sends message, and according to detecting from sending the keyword search statistical learning table that information table is found, obtain loopback count value.
8. a network processing unit, is characterized in that, comprising:
Module is set, for loopback timer is set;
Receiver module, enables sign, regularly detects template message, sends and detect information table and statistical learning table for what receive that central processing unit sends;
Start and acquisition module, for enabling sign described in basis, start regularly detection messages function, according to regularly detecting template message starts described loopback timer, according to sending, template message is inquired about described transmission detection information table and statistical learning table obtains loopback count value;
Whether comparison and output module be equal for the periodic quantity of more described loopback count value and described transmission detection information table; If equated, reach the sense cycle of loopback timer, according to the packet receiving count results of statistical learning table, judge, if packet receiving count results is preset value, described timing is detected to template message and copy portion, a copy of it is for detecting failure information to described central processing unit report, and wherein another part is carried out loopback; If packet receiving count value is not described preset value, the packet receiving count value in described statistical learning table is returned to described preset value, and enter next sense cycle.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010186773.5A CN101848223B (en) | 2010-05-25 | 2010-05-25 | Network processor-based method and device for realizing quick bidirectional forwarding detection of messages |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010186773.5A CN101848223B (en) | 2010-05-25 | 2010-05-25 | Network processor-based method and device for realizing quick bidirectional forwarding detection of messages |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101848223A CN101848223A (en) | 2010-09-29 |
CN101848223B true CN101848223B (en) | 2014-08-13 |
Family
ID=42772683
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010186773.5A Expired - Fee Related CN101848223B (en) | 2010-05-25 | 2010-05-25 | Network processor-based method and device for realizing quick bidirectional forwarding detection of messages |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101848223B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102594582B (en) * | 2011-01-14 | 2017-12-15 | 中兴通讯股份有限公司 | A kind of message loop back method and system |
CN102904772A (en) * | 2012-09-26 | 2013-01-30 | 中兴通讯股份有限公司 | Method and device for realizing throughput test of network equipment |
CN104980293B (en) * | 2014-04-02 | 2019-05-31 | 深圳市中兴微电子技术有限公司 | A kind of OAM message is quickly sent and the method and device of detection processing |
CN106301835B (en) * | 2015-05-25 | 2020-03-13 | 中兴通讯股份有限公司 | BFD link establishing method and device and router |
CN105812224B (en) * | 2016-04-20 | 2021-07-20 | 广东电网有限责任公司电力科学研究院 | Method and system for network scanning based on trunk protocol |
CN107846292B (en) | 2016-09-19 | 2020-12-04 | 新华三技术有限公司 | Method and device for preventing fault processing delay |
CN108376128B (en) * | 2018-01-19 | 2019-06-07 | 凯美瑞德(苏州)信息科技股份有限公司 | A kind of processing method and system of communication message |
CN114268561B (en) * | 2020-09-15 | 2023-06-09 | 烽火通信科技股份有限公司 | BFD message sending device and method |
CN115082236A (en) * | 2022-06-30 | 2022-09-20 | 中国工商银行股份有限公司 | Message processing method, device, electronic device and medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101247270A (en) * | 2008-03-19 | 2008-08-20 | 中兴通讯股份有限公司 | System and method for implementing bidirectional forwarding detection |
CN101378338A (en) * | 2008-09-24 | 2009-03-04 | 中兴通讯股份有限公司 | Method and apparatus for implementing bidirectional transmit-receive detection |
CN101478421A (en) * | 2008-12-05 | 2009-07-08 | 中兴通讯股份有限公司 | OAM packet timing processing system and method |
-
2010
- 2010-05-25 CN CN201010186773.5A patent/CN101848223B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101247270A (en) * | 2008-03-19 | 2008-08-20 | 中兴通讯股份有限公司 | System and method for implementing bidirectional forwarding detection |
CN101378338A (en) * | 2008-09-24 | 2009-03-04 | 中兴通讯股份有限公司 | Method and apparatus for implementing bidirectional transmit-receive detection |
CN101478421A (en) * | 2008-12-05 | 2009-07-08 | 中兴通讯股份有限公司 | OAM packet timing processing system and method |
Also Published As
Publication number | Publication date |
---|---|
CN101848223A (en) | 2010-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101848223B (en) | Network processor-based method and device for realizing quick bidirectional forwarding detection of messages | |
CN103929461B (en) | Mac address information synchronous method and device in pile system | |
CN101521603B (en) | Method and system for quickly detecting connectivity of link | |
WO2016082588A1 (en) | Link connectivity checking method and apparatus | |
CN101924659B (en) | Network equipment and method for detecting links of physical ports of same | |
US20120106339A1 (en) | Probing Specific Customer Flow in Layer-2 Multipath Networks | |
CN101573913A (en) | Method and apparatus for improved multicast routing | |
KR101494566B1 (en) | Discovery of conventional devices and bridges in hybrid communication networks | |
CN101286990B (en) | Forwarding method and apparatus of double-layer multicast | |
CN108631873B (en) | Method and device for transmitting and receiving network management information, transmitting equipment and receiving equipment | |
US20070223494A1 (en) | Method for the resolution of addresses in a communication system | |
CN101478421B (en) | OAM packet timing processing system and method | |
CN102957616A (en) | Method and system for transferring TRILL (transparent interconnection of lots of links) network messages in an ASIC(application specific integrated circuit ) | |
CN101547063A (en) | Method and system for testing forward delay | |
Batalla et al. | ID-based service-oriented communications for unified access to IoT | |
CN107947994A (en) | Network topology self-discovery method, apparatus, the network equipment and computer-readable storage medium | |
ATE415033T1 (en) | APPARATUS AND METHOD FOR A PROTOCOL FOR DETECTING PRINTER | |
CN101019380B (en) | Systems and methods for accelerated learning in ring networks | |
CN102801622B (en) | A kind of retransmission method of data message and retransmission unit | |
CN101247351A (en) | Load sharing method and device | |
CN101145940A (en) | A method for searching network element device and establishing topology connection in network management system | |
CN104506339A (en) | Industrial Ethernet network topology management implementation method based on PROFINET | |
CN102369682A (en) | Broadcasting method and communication device | |
CN102263679B (en) | Source role information processing method and forwarding chip | |
CN103346962A (en) | Unknown single broadcast message forwarding method and routing bridge |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140813 Termination date: 20200525 |