A kind of processing method of double layer channel protocol message and device thereof
Technical field
The present invention relates to the processing of double layer channel protocol (L2TP) message, relate in particular to the control message of L2TP message in the virtual private network system and the processing of data message.
Background technology
L2TP is a kind of constructing virtual private network (VPN that is used for, Virtual Private Network) two-layer protocol, the L2TP message is to carry out message encapsulation, the data that further encapsulate by point-to-point protocol (PPPOE) on PPP(Point-to-Point Protocol) or the Ethernet again by User Datagram Protocol (UDP).The L2TP message is divided into data message and control message, and different control messages can be set up different passages, and data message is after the control message is set up passage, could transmit in the passage corresponding with channel number.
The L2TP message contains type field (T) and channel number, can distinguish data message or control message by the type field (T), and channel number is represented the passage at this message place.
Control message and data message all are to transmit by UDP, and because UDP is the agreement of a unreliable transmission, so control message in the L2TP message and data message all may be lost in transport process.But the consequence that they are lost is different, data message lose the consequence that can not cause especially severe, just the quality to communication has certain influence, but controlling losing of message then can make passage set up, thereby causes the user to dial in.So itself will guarantee to control the reliable transmission of message the L2TP agreement, therefore introduce retransmission mechanism.
As shown in Figure 1, described control message is to be used to set up virtual path 10 4 between LAC (LAC) 102 and the webserver (LNS) 106, and promptly passage 1,2,3...n.Each passage can corresponding a plurality of users, also can corresponding user.If user 1 and 2 successively dials in VPN, and need set up passage ' 1 ' equally and carry out transfer of data, promptly the channel number in two L2TP messages all is ' 1 ', LAC (LAC) 102 is judged the L2TP message of user 1 and 2 respectively so, if two T are ' 1 ', judge that then former and later two messages all are the control messages, successively send to the corresponding webserver (LNS) 106 with two control messages then.The L2TP control message that accessed concentrator 102 sends is that user 1 and user's 2 control message all can be added in the wait acknowledge formation with passage ' 1 ' corresponding channel control block, and this channel control block leaves in the LAC 102 and the webserver 106.
Receiving user 1 control message when the webserver 106 after, according to its type field T judge be control message after.Can handle and produce response to this control message within a certain period of time.Here be to come control response whether overtime by the timer subsystem in the virtual private network system.When LAC 102 is received the response that the webserver 106 beams back in this certain hour after, will set up the pairing path 10 4 of channel number by the channel status loom system in the virtual private network system between the LAC 102 and the webserver 106, it is passage ' 1 ', just pass through the data message of this passage ' 1 ' transmission user 1 later on, and the control message of user 1 in the wait acknowledge formation is deleted from formation; And if LAC 102 is not received the response that the webserver 106 is beamed back in this certain hour, then LAC 102 need be controlled message to this and retransmits, retransmit and surpass the response that certain number of times is not also received the webserver 106, then abandon sending user 1 control message, just can't set up the passage ' 1 ' between user 1 and the LNS.The webserver 106 is the same to the disposition of user 2 control message in regular turn.
Here, a wait acknowledge quene threshold is arranged in the channel control block, i.e. the maximum length of wait acknowledge formation, it disposes by artificial when initial.When if the wait acknowledge queue length of channel control block reaches the wait acknowledge queue length threshold, the user of LAC 102 no longer is sent out its message so, thereby 106 couples of users' that receive later on of the webserver message is also no longer handled.
After the passage of between user 1 is by the LAC 102 and the webserver 106, setting up ' 1 ', if the T that 102 pairs of messages that will send later of LAC are judged wherein is ' 0 ', then this message is a data message, and send this data message according to the channel number in this data message, promptly if at user 1 data message, then channel number wherein is ' 1 ', according to passage ' 1 ' this data message is sent so.Equally, the webserver 106 is judged according to T after receiving this data message, learns it is data message, at last these data is handled.
Generally speaking, the quantity of data message is more much bigger than the quantity of control message.No matter judge control message or data message, as long as the webserver 106 just receives it is handled, when but if user's number of dialling in simultaneously is many, because many data messages can take a large amount of processing time of the webserver 106, so can cause the control message that sends after some can't in time be handled and be responded, thereby make LAC 102 wait timeouts, and cause the user's that dialled in afterwards passage to set up and therefore can't dial in VPN.
Summary of the invention
The objective of the invention is not carry out differentiating and processing for control message that receives and data message in order to solve in the prior art, thereby when network traffics are very big, owing to taking a large amount of processing times, data message make the control message have little time to handle, the problem that causes the user's that dialled in afterwards passage to set up.
The invention provides a kind of processing method of L2TP message, described L2TP message is divided into data message and control message, and the L2TP message comprises channel number and distinguishes data message and the type field of control message, comprise the wait acknowledge queue length threshold of controlling message in the corresponding channel control block of the passage corresponding with this channel number, it is characterized in that described method comprises:
A., the congestion threshold value is set, and the congestion threshold value is greater than zero and is less than or equal to the integer value of the wait acknowledge queue length threshold of described control message;
B. receive the L2TP message, and judge according to described type field, if data message, execution in step c then is if control message, then execution in step e;
C. obtain the channel number at described data message place, and obtain the wait acknowledge queue length of control message in the respective channel according to this channel number;
D. judge whether described wait acknowledge queue length is greater than or equal to the congestion threshold value among the step a, if, then abandon this data message, return step b, if not, then this data message is handled, return step b;
E. described control message is handled and responded, return step b.
Congestion threshold value among the described step a is by artificial configuration or is defaulted as the wait acknowledge queue length threshold of controlling message.
The present invention also provides a kind of processing unit of L2TP message, described L2TP message is divided into data message and control message, and the L2TP message comprises channel number and distinguishes data message and the type field of control message, comprise the wait acknowledge queue length threshold of controlling message in the corresponding channel control block of the passage corresponding with this channel number, described device comprises the judgement types of devices of judging type of message, and the execution processing unit that message is handled, when judging that types of devices judges that the type of message is the control message, then should control message directly delivers to and carries out processing unit and handle, it is characterized in that, also comprise:
Setting device is used to be provided with the congestion threshold value, and this congestion threshold value is greater than zero and is less than or equal to the integer value of the wait acknowledge queue length threshold of described control message;
Deriving means when described judgement types of devices is judged message and is data message, receives this data message, obtains the channel number at this data message place, and obtains the wait acknowledge queue length of control message in respective channel according to this channel number;
Judgment means, receive described data message and described wait acknowledge queue length that deriving means sends, and the congestion threshold value that wait acknowledge queue length and setting device send compared, judge whether the wait acknowledge queue length is greater than or equal to described congestion threshold value, if, then abandon this data message, if not, then this data message is sent to the execution processing unit and handle.
The congestion threshold value of described setting device setting is by artificial configuration or is defaulted as the wait acknowledge queue length threshold of controlling message.
The present invention also provides a kind of network equipment of Virtual Private Network, comprise the channel status loom system that sets up passage, the timer subsystem that control L2TP message is retransmitted, described L2TP message comprises control message and data message, the described network equipment also comprises foregoing L2TP message process device, this processing unit is provided with the congestion threshold value, after channel status loom system sets up passage, if this processing unit is received data message, obtain the channel number at this data message place, and according to the wait acknowledge queue length of controlling message in this channel number acquisition respective channel, then wait acknowledge queue length in this processing unit and described congestion threshold value are compared, judge whether the wait acknowledge queue length is greater than or equal to described congestion threshold value, if, then abandon this data message, if not, then this data message is handled.
When the webserver receives data message among the present invention, judge at first whether the wait acknowledge queue length is greater than or equal to described congestion threshold value, if, then abandon this data message, if not, then this data message is sent to the execution processing unit and handle, can save more data message like this and take a large amount of processing time of the webserver, thereby the user's who dialled in afterwards control message can in time be handled, thereby set up passage and dial in VPN.
Description of drawings
Fig. 1 is the system block diagram of in the prior art L2TP message being handled;
Fig. 2 is the process flow figure of the network equipment of Virtual Private Network in the embodiment of the invention to the L2TP message;
Fig. 3 is the block diagram of the processing unit handled of the L2TP message in the network equipment of Virtual Private Network in the embodiment of the invention.
Embodiment
Below in conjunction with drawings and Examples the present invention is described in detail.
The invention provides the processing method of a kind of network equipment of Virtual Private Network to the L2TP message.Shown in Fig. 2 is the process flow figure of the network equipment of Virtual Private Network in the embodiment of the invention to the L2TP message.Described L2TP message is divided into data message and control message, the L2TP message comprises channel number and distinguishes data message and the type field T of control message, and comprise the wait acknowledge queue length threshold of controlling message in the corresponding channel control block of the passage corresponding with this channel number, for example the channel number in the present embodiment is ' 2 ', with wait acknowledge queue length threshold in passage ' 2 ' the corresponding channel control block be ' 10 '.The processing method of this L2TP message is as follows.
Congestion threshold value (step 201) at first is set, this congestion threshold value is greater than zero and is less than or equal to the integer value of the wait acknowledge queue length threshold of described control message, dispose by artificial in the present embodiment, the congestion threshold value is set to ' 5 ', and deposits in passage ' 2 ' the corresponding channel control block.Can also artificially not dispose in addition, and it is defaulted as the wait acknowledge queue length threshold.
To the L2TP message (step 202) that is received, judge (step 204) according to described type field T, if T is ' 0 ', then expression is a data message, obtain the channel number at this data message place then, and control the wait acknowledge queue length (step 208) of message in the channel control block according to this channel number acquisition respective channel.For example the channel number at this data message place is ' 2 ' in the present embodiment, and the wait acknowledge queue length of the control message in this passage is ' 3 '.
Next judge that whether this wait reply queue length more than or equal to congestion threshold value (step 210), if this wait is replied queue length and is greater than or equal to the congestion threshold value, then abandon this data message (step 214), receive next L2TP message (step 202) then again; If not, for example in the present embodiment, the wait acknowledge queue length is ' 3 ', is to be less than or equal to congestion threshold value ' 5 ', according to prior art this data message is handled (step 212) so, receive next L2TP message (step 202) then again.
If judging type field T is ' 1 ', then expression is the control message, so just as prior art, (step 206) handled and responded to this control message, receives next L2TP message (step 202) then again.
The present invention also provides the processing unit of the L2TP message in a kind of network equipment of Virtual Private Network, the network equipment of described Virtual Private Network also comprises channel status loom system of the prior art and timer subsystem etc., described channel status loom system sets up passage according to the control message, and described timer subsystem then is used to control the repeating transmission of message.
Shown in Fig. 3 is the block diagram of the processing unit in the network equipment of Virtual Private Network of the embodiment of the invention L2TP message handled.Described L2TP message is divided into data message and control message, and the L2TP message comprises channel number and distinguishes data message and the type field T of control message, and comprise the wait acknowledge queue length threshold of controlling message in the corresponding channel control block of the passage corresponding with this channel number, for example the channel number in the present embodiment is ' 2 ', with wait acknowledge queue length threshold in passage ' 2 ' the corresponding channel control block be ' 10 '.
This processing unit comprises the judgement types of devices 304 of judging type of message in the prior art, and the execution processing unit 312 that message is handled, described judgement types of devices 304 is judged according to type field T, if T is ' 1 ', then this message be control message, so directly should control message deliver to the execution processing unit 312 handle.Processing unit of the present invention also comprises setting device 308, deriving means 306, and judgment means 310.
Described setting device 308 is used to be provided with the congestion threshold value, and this congestion threshold value is greater than zero and is less than or equal to the integer value of the wait acknowledge queue length threshold of described control message.By artificial configuration, the congestion threshold value is set to ' 5 ' in the present embodiment, and leave in and passage ' 2 ' corresponding channel control block in.Can also artificially not dispose in addition, and it is defaulted as the wait acknowledge queue length threshold.
Described deriving means 306, when described judgement types of devices 304 is judged according to type field T, and when T is ' 0 ', then this message is a data message, so described deriving means 306 receives this data message, obtain the channel number at this data message place then, and obtain the wait acknowledge queue length of control message in the respective channel according to the channel control block of this channel number.For example the channel number at this data message place is ' 2 ' in the present embodiment, and the wait acknowledge queue length of the control message in this passage is ' 3 '.
Described judgment means 310, receive described data message and described wait acknowledge queue length that deriving means 306 sends, and the congestion threshold value that wait acknowledge queue length and setting device 308 send compared, judge whether the wait acknowledge queue length is greater than or equal to described congestion threshold value, if then abandon this data message; If not, for example in the present embodiment, the wait acknowledge queue length is ' 3 ', is less than congestion threshold value ' 5 ', this data message is sent to carry out processing unit 312 so, according to prior art this data message is handled.
The present invention is by introducing a congestion threshold value in the channel control block of each passage, make when the webserver 106 is received data message, unlike prior art, directly handle, but whether the wait acknowledge queue length of judging earlier control message in the passage at this data message place is greater than or equal to the congestion threshold value, and then the processing of definite this data message whether.And control message the wait acknowledge queue length be greater than or equal under the situation of congestion threshold value, this data message is abandoned, so just can save the processing time of the webserver 106, make the control message received later can in time processed and response.Therefore, VPN can be set up and dial in to the user's who dialled in afterwards passage, can select a balance point like this between the user's number that can dial in VPN and user communication quality.
Though through the present invention is described in conjunction with specific embodiments, for the skilled personage in present technique field, will be conspicuous according to manyly substituting of making of narration above, modifications and variations.Therefore, when such substituting, in the spirit and scope that modifications and variations fall into attached claim the time, should being included among the present invention.