Summary of the invention
The embodiment of the present invention provides a kind of packet transmission and processing method and device, in order to the problem solving CAPWAP burst and the link efficiency that causes of recombinating is low.
The embodiment of the present invention provides a kind of packet transmission and processing method, comprising:
Link device receives needs from the first equipment the handshake message sending to the second equipment;
If the maximum point of leaf length of carrying in described handshake message is greater than the capacity threshold of setting, described link device changes described maximum point of leaf length, and maximum point of leaf length after wherein said change is not more than described threshold value;
Handshake message is sent to described second equipment by described link device.
A kind of packet transmission and processing method that the above embodiment of the present invention provides, the first equipment received by link device prepares the handshake message issued in the second equipment, and judging whether needs the maximum point of leaf length in handshake message to modify; If maximum point of leaf length in handshake message is greater than the capacity threshold of setting, then the maximum point of leaf length revised in handshake message is not more than capacity threshold; Then amended handshake message is sent to the second equipment by link device; If maximum point of leaf length in handshake message is not more than described capacity threshold, then handshake message is sent to the second equipment by link device.Link device can revise maximum point of leaf length in handshake message, thus has ensured that data flow is when CAPWAP tunnel, can not exceed CAPWAP tunnel maximum load capability, avoids CAPWAP burst and restructuring, optimizes antenna efficiency efficiency, improves AP device throughput.
Further, the capacity threshold of described setting is the maximum message size that described link device self allows.
In the above embodiment of the present invention, described preset capacity threshold value is the maximum fragment message length of described link device, utilize maximum message size that link self is supported as capacity threshold, link device ability to work is improved, avoid unnecessary message fragment, improve the efficiency of transmission of whole link.
Further, described link device judges whether to receive handshake message according to following manner.
Described link device is after receiving message, if described message is SYN (SYNchronous, synchronously) data message or SYN/ACK (SYNchronous/ACKnowledge, confirmation of synchronization) data message, then determine that the message received is handshake message; Otherwise, then determine that the message received is not handshake message.。
In the above embodiment of the present invention, the MSS value of the first equipment or the second equipment is had in the Option Field of handshake message SYN or SYN/ACK, therefore, after only having link device acquisition handshake message, could determine whether the MSS value of the first equipment or the second equipment is greater than the capacity threshold of link device setting, also can determine whether the MSS value needing change first equipment or the second equipment.
Further, described maximum point of leaf length is the maximum fragment message length of TCP layer or maximum point of leaf length of IP layer.
In the above embodiment of the present invention, maximum point of leaf length is maximum point of leaf length of TCP layer or maximum point of leaf length of IP layer, because the message transmitted in TCP layer and IP layer has the mechanism of link negotiation, so in the above embodiment of the present invention, link device can utilize link negotiation mechanism to change the message being greater than capacity threshold, make full use of the characteristic of two kinds of messages self, reach the effect of negotiation.
Further, described link device receive from the first equipment need to send to the handshake message of the second equipment after, also comprise:
If the maximum point of leaf length of carrying in described handshake message is not more than the capacity threshold of described link device setting, handshake message is sent to described second equipment by described link device.
In the above embodiment of the present invention, ensure that the complete of data-message transmission, if be not more than the capacity threshold of setting by the data message of link device, then described data message does not need to change, and directly sends to the second equipment by link device.
The embodiment of the present invention also provides a kind of message transmissions processing unit, comprising:
Message receiving element, for receiving the handshake message needing to send to the second equipment from the first equipment;
Capacity adjustment unit, for being greater than the capacity threshold of setting when the maximum point of leaf length of carrying in described handshake message, described capacity adjustment unit changes described maximum point of leaf length, and maximum point of leaf length after wherein said change is not more than described threshold value;
Packet sending unit, for sending to described second equipment by handshake message.
Further, the capacity threshold of described setting is the maximum message size that link device self allows.
Further, described message receiving element also for, judge whether to receive handshake message according to following manner:
After receiving message, if described message is SYN data message or SYN/ACK data message, then determine that the message received is handshake message; Otherwise, determine that the message received is not handshake message.。
Further, described maximum fragment message length is maximum point of leaf length of TCP layer or maximum point of leaf length of IP layer.
Further, described packet sending unit also for:
If the maximum point of leaf length of carrying in described handshake message is not more than the capacity threshold of setting, handshake message is sent to described second equipment.
A kind of message transmissions processing unit that the above embodiment of the present invention provides, the first equipment received by link device prepares the handshake message issued in the second equipment, and judging whether needs the maximum point of leaf length in handshake message to modify; If maximum point of leaf length in handshake message is greater than the capacity threshold of setting, then the maximum point of leaf length revised in handshake message is not more than capacity threshold; Then amended handshake message is sent to the second equipment by link device; If maximum point of leaf length in handshake message is not more than described capacity threshold, then handshake message is sent to the second equipment by link device.Link device can revise maximum point of leaf length in handshake message, thus has ensured that data flow is when CAPWAP tunnel, can not exceed CAPWAP tunnel maximum load capability, avoids CAPWAP burst and restructuring, optimizes antenna efficiency efficiency, improves AP device throughput.
Embodiment
In order to make the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the present invention is described in further detail, and obviously, described embodiment is only a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention 1 provides a kind of packet transmission and processing method, and as shown in Figure 1, described method comprises:
Step S101, link device receives needs from the first equipment the handshake message sending to the second equipment;
Step S102, if the maximum point of leaf length of carrying in described handshake message is greater than the capacity threshold of setting, described link device changes described maximum point of leaf length, and maximum point of leaf length after wherein said change is not more than described threshold value;
Step S103, handshake message is sent to described second equipment by described link device.
It should be noted that, the first equipment described in the embodiment of the present invention and the second equipment are the terminal device needing to carry out communicating, and can be the electronic equipments such as computer, the webserver.
Wherein, in step S101, described first equipment needs to send to the handshake message of the second equipment to refer to the first equipment and the second equipment to set up handshake message in TCP/IP (TransmissionControlProtocol/InternetProtocol, TCP/IP) connection procedure.
Set up in TCP/IP connection procedure at the first equipment and the second equipment, can first carry out " three-way handshake " between first equipment and the second equipment, so-called " three-way handshake " is namely followed the tracks of each data message sent, data message is sent and receives synchronous, and send to according to received data message confirmation message, connected by " three-way handshake " process.
The three-way handshake flow process that TCP/IP connects is synchronous SYN (SYNchronous), confirmation of synchronization SYN/ACK (SYNchronous/ACKnowledge) and confirms ACK (ACKnowledge).The MSS value of self all can write in the Option Field of SYN or SYN/ACK type TCP/IP message by the both sides sent in the process connected.Connect period at three-way handshake, the message length of SYN, SYN/ACK, ACK is very short, is necessarily less than preset capacity threshold value, also just means that SYN message or SYN/ACK are complete message information when being transferred to link device.
When link device receives the message that the first equipment sends to the second equipment, first need whether the message judging to receive is handshake message.
Concrete judgment mode is:
Judge whether the described message received is SYN data message or SYN/ACK data message, if SYN data message or SYN/ACK data message, then determines that the message received is handshake message; Otherwise, determine that the message received is not handshake message.
In step S102, described maximum point of leaf length is maximum point of leaf length MSS of TCP layer or maximum point of leaf length MTU of IP layer.
MSS is a concept inside TCP, it is the maximum data segmentation that tcp data bag can transmit at every turn, do not comprise header part, it and IPMTU meet following relation: IPMTU=MSS+20bytes (IP packet header)+20bytes (TCP packet header)
Such as virtual dial-up agreement PPPoE, be exactly carry ppp protocol (PointtoPointProtocol over ethernet, point-to-point connection protocol), it comprises the PPPoE head of 6bytes and No. ID, the ppp protocol of 2bytes, now, the MTU value due to Ethernet is 1500, so upper strata PPP load data can not more than 1492 bytes, the MTU be namely equivalent under PPPOE environment is 1492 bytes, and MSS is 1452 bytes.
In TCP layer, transmission control protocol (TransmissionControlProtocol, TCP) adopts MSS to limit the maximum length of data field in TCP message, and MSS represents the maximum data segmentation that tcp data bag can transmit at every turn.In order to reach best transmission usefulness, Transmission Control Protocol will consult the MSS value of both sides usually when connecting, and the minimum value in the MSS value that communication two party can provide according to both sides is defined as the current maximum MSS value connected.
TCP message is transferred to IP layer, and be packaged into IP message at IP layer, when the length of IP message is greater than MTU, link device such as the router etc. of IP layer needs IP message to carry out burst process, IP message is divided into some, and the length of each burst is all not more than MTU value.
The maximum message size that the permission that described capacity threshold in the embodiment of the present invention refers to link device setting is passed through.
In an embodiment, described capacity threshold can set as required; Also can be that the maximum message size allowed according to equipment self is arranged.
The difference of capacity threshold size, can impact link transmission.If capacity threshold setting is too small, then needs the message amount changed to increase, strengthen the workload of link device, cause network transfer speeds slow.
Such as, the MSS value of link device self is 1200 bytes, the capacity threshold of setting is 600 bytes, the MSS value of the first equipment is 1000 bytes, the MSS value of the second equipment is 700 bytes, if the first equipment and the second equipment start message transmission, link device will change the MSS value of the first equipment, and changes the MSS value of the second equipment.
If change the capacity threshold of setting into 1200 bytes, then at the first equipment and the second equipment in the process in message transmissions, link device does not need the MSS value of change first equipment and the second equipment.
Based on this, a kind of optional mode is as capacity threshold using the maximum message size of link device self support.Utilize maximum message size that link self is supported as capacity threshold, link device ability to work is improved, avoids unnecessary message fragment, improve the efficiency of transmission of whole link.
In IP layer message transmission procedure, described capacity threshold is the MTU value that link device self is supported, this value is the minimum value of MTU value that the MTU value supported of link device input and link device output are supported.The MTU value of such as link device input support is 1400 bytes, and the MTU value of link device output support is 1000 bytes, then get 1000 bytes as capacity threshold.
In TCP layer message transmission procedure, described capacity threshold is according to link device self MTU value, this MTU value is the minimum value of MTU value that the MTU value supported of described link device input and output are supported, then converts link maximum point of leaf length MSS that CAPWAP tunnel is supported to.
Also comprise in step s 103, if the maximum point of leaf length of carrying in described handshake message is not more than the capacity threshold of setting, handshake message is sent to described second equipment by described link device.
For the ease of the understanding of those skilled in the art, the embodiment of the present invention 2 is illustrated at this, as shown in Figure 2, in wireless communication process, by the first equipment, link device and the second equipment form a communication link, the MSS value of the first equipment is 1000 bytes, the MSS value that link device self is supported is 600 bytes, the MSS value of the second equipment is 800 bytes, first equipment sends the message data of 1000 bytes to the second equipment, flow through link device, because the MSS value of link device is less than 1000 bytes, so first for described message burst will be sent to the second equipment by link device again.
In order to avoid message fragment, the method that the present embodiment adopts is, link device is when first equipment that receives sends to the handshake message SYN of the second equipment, the MSS value that MSS value in described handshake message SYN and link device self are supported is compared, find that the MSS value in described handshake message SYN is greater than the MSS value of described link device, then the MSS value in described first equipment SYN message is just changed to 600 (or being less than the value of 600) byte by described link device, then the handshake message after change is sent to described second equipment, described second equipment receives the SYN message from described first equipment, the MSS value that wherein said message carries is 600 bytes, then described second equipment can send SYN/ACK message to described first equipment, the MSS value of carrying is 800 bytes, described SYN/ACK message is when flowing through described link device, described link device can the MSS value self supported of the MSS value of more described SYN/ACK message and described link device, find that the MSS value in described SYN/ACK message is greater than the MSS value of described link device, the MSS value then changed in described SYN/ACK message is 600 (or being less than the value of 600) byte, SYN/ACK message after change is sent to described first equipment by described link device, MSS value in the SYN/ACK message that described first equipment receives is 600 bytes.
The MSS value of the SYN message that such first equipment sends is 1000 bytes, the MSS value of the second equipment SYN/ACK message received is 600 bytes, then described first equipment will adjust the MSS value sending message is 600 bytes, same, what described second equipment received is 600 bytes from the MSS value in the SYN message of described first equipment, MSS value in the SYN/ACK message sent is 800 bytes, then can adjust self MSS value is 600 bytes, like this, described first equipment sends message to described second equipment, then can not occur the situation of burst again.Same, if the second equipment is as transmitting terminal, the first equipment is as receiving terminal, and the negotiations process of link device is still set up.
Above-described embodiment MSS value described when link device is all less than the MSS value of the first equipment and the second equipment, in the method for a kind of message transmissions introduced in embodiment 1, comprises above-described embodiment, but is not limited only to above-described embodiment.
Introduce another kind of embodiment 3 to be below convenient to make those skilled in the art understand the method for a kind of message transmissions described in embodiment 1.
As shown in Figure 2, in wireless communication process, by the first equipment, link device, second equipment forms a communication link, the MSS value of the first equipment is 1000 bytes, the MSS value that link device self is supported is 800 bytes, the MSS value of the second equipment is 600 bytes, described first equipment sends handshake message SYN message to described second equipment, flow through described link device, MSS value due to described SYN is greater than the MSS value of described link device, so the MSS value that described link device changes described SYN is 800 (or being less than 800) byte, then the SYN message after change is sent to described second equipment, after the SYN message of described second equipment after receiving described change, send SYN/ACK message to described first equipment,
The described SYN/ACK message of described second equipment is when flowing through described link device, MSS value due to described SYN/ACK message is less than the MSS value of described link device, described link device is not modified to the MSS value of described SYN/ACK message, and described SYN/ACK message is sent to the first equipment.
Like this, the MSS value in the SYN message that the first equipment sends is 1000 bytes, and the MSS value of the SYN/ACK message received is 600 bytes, then the MSS value of the first apparatus modifications self is that 600 bytes carry out message transmissions;
Same, the MSS value of the SYN message that the second equipment receives is 800 bytes, and the MSS value of the SYN/ACK message of transmission is 600 bytes, then the MSS value of the second apparatus modifications self is that 600 bytes carry out message transmissions.Same, if the second equipment is as transmitting terminal, the first equipment is as receiving terminal, and the negotiations process of link device is still set up.
By above-described embodiment 2,3, can avoid in Wi-Fi transmitting procedure, the data message that first equipment or the second equipment send exceedes CAPWAP tunnel maximum load capability, cause the problem of data message burst, optimize the operating efficiency of Wi-Fi link transmission, improve AP device throughput.
The embodiment of the present invention 4 also provides a kind of processing method of TCP layer message transmissions, and as shown in Figure 3, the method comprises:
Step S301, link device receives the message needing to send to the second equipment from the first equipment, and type of message is not limit, and can be TCP/IP message, also can be the message of other host-host protocol;
Step S302, whether first equipment that checks needs to send to the message of the second equipment to be TCP message; If TCP message, then perform step S303; If not TCP message, then perform step S307;
Step S303, checks that whether described TCP message is SYN or the SYN/ACK message of three-way handshake during TCP connects, i.e. handshake message;
If SYN or SYN/ACK message, be then handshake message, perform step S304; If not SYN or SYN/ACK message, then not handshake message, perform step S307;
Step S304, obtain the MSS value in current TCP message in Options field, the MSS value of described first equipment and described second equipment self, in the process connected, writes in the option Options field of SYN or SYN/ACK type TCP message by the first equipment and the second equipment;
Step S305, judge whether the MSS value in TCP message is greater than the capacity threshold of link device, the capacity threshold of the MSS value in SYN or the SYN/ACK message detected and link device is compared, if MSS value is greater than capacity threshold, then performs step S306; If MSS value is not more than capacity threshold, then perform step S307;
Step S306, link device changes described MSS value, and the MSS value after wherein said change is not more than described threshold value, after change, then performs step S307;
Step S307, first equipment needs to send to the message of the second equipment to send to described second equipment by described link device, if perform step S306, what then described second equipment received is the handshake message carrying the MSS value changed, if do not perform step S306, then what the second equipment received is the message that the first equipment sends to the second equipment.
Link device can revise maximum point of leaf length in handshake message, thus has ensured that data flow is when CAPWAP tunnel, can not exceed CAPWAP tunnel maximum load capability, avoids CAPWAP burst and restructuring, optimizes antenna efficiency efficiency, improves AP device throughput.
Based on same inventive concept, according to the processing method of a kind of message transmissions that the above embodiment of the present invention provides, correspondingly, another embodiment of the present invention additionally provides a kind of processing unit of message transmissions, and its structural representation as shown in Figure 4, specifically comprises:
Message receiving element 401, for receiving the handshake message needing to send to the second equipment from the first equipment;
Capacity adjustment unit 402, during for being greater than the capacity threshold of setting as the maximum point of leaf length MSS carried in described handshake message, described capacity adjustment unit changes described maximum point of leaf length, and maximum point of leaf length after wherein said change is not more than described capacity threshold;
Packet sending unit 403, for sending to described second equipment by handshake message.
Wherein, described first equipment needs to send to the handshake message of the second equipment to refer to the first equipment and the second equipment to set up handshake message in TCP/IP connection procedure.
Set up in TCP/IP connection procedure at the first equipment and the second equipment, can first carry out " three-way handshake " between first equipment and the second equipment, so-called " three-way handshake " is namely followed the tracks of each data message sent, data message is sent and receives synchronous, and send to according to received data message confirmation message, connected by " three-way handshake " process.
The three-way handshake flow process that TCP/IP connects is synchronous SYN, confirmation of synchronization SYN/ACK and confirms ACK.The MSS value of self all can write in the Option Field of SYN or SYN/ACK type TCP/IP message by the equipment both sides sending message in the process connected.Connect period at three-way handshake, the message length of SYN, SYN/ACK and ACK is very short, is necessarily less than preset capacity threshold value, also just means that SYN message or SYN/ACK message are complete message information when being transferred to link device.
When message receiving element 401 receives the message that the first equipment sends to the second equipment, first need whether the message judging to receive is handshake message.
Concrete judgment mode is:
Judge whether the described message received is SYN data message or SYN/ACK data message, if SYN data message or SYN/ACK data message, then determines that the message received is handshake message; Otherwise, determine that the message received is not handshake message.
Wherein, in capacity adjustment unit 402, described maximum point of leaf length is maximum point of leaf length MSS or IP layer maximum point of leaf length MTU of TCP layer.
In TCP layer, Transmission Control Protocol adopts MSS to limit the maximum length of data field in TCP message, and MSS represents the maximum data segmentation that tcp data bag can transmit at every turn.Usually will consult the MSS value of both sides when connecting in order to reach best transmission usefulness Transmission Control Protocol, the minimum value in the MSS value that communication two party can provide according to both sides is defined as the current maximum MSS value connected.TCP message is transferred to IP layer, and be packaged into IP message at IP layer, when the length of IP message is greater than MTU, link device such as the router etc. of IP layer needs IP message to carry out burst process, IP message is divided into some, and the length of each burst is all not more than MTU value.
The maximum message size that the permission that described capacity threshold in the embodiment of the present invention refers to link device setting themselves is passed through.
In an embodiment, described capacity threshold can set as required; Also can be that the maximum message size allowed according to described link device self is arranged.
The difference of capacity threshold size, can impact link transmission.If capacity threshold setting is too small, then needs the message amount changed to increase, strengthen the workload of described link device, cause network transfer speeds slow.
Based on this, a kind of optional mode is as capacity threshold using the maximum message size of described link device self support.Utilize maximum message size that described link device self is supported as capacity threshold, described link device ability to work is improved, avoids unnecessary message fragment, improve the efficiency of transmission of whole link.
Wherein, described packet sending unit 403 also for:
If the maximum point of leaf length of carrying in described handshake message is not more than the capacity threshold of setting, handshake message is sent to described second equipment.
A kind of message transmissions processing unit that the above embodiment of the present invention provides, the first equipment received by link device prepares the handshake message issued in the second equipment, and judging whether needs the maximum point of leaf length in handshake message to modify; If maximum point of leaf length in handshake message is greater than the capacity threshold of setting, then the maximum point of leaf length revised in handshake message is not more than capacity threshold; Then amended handshake message is sent to the second equipment by link device; If maximum point of leaf length in handshake message is not more than described capacity threshold, then handshake message is sent to the second equipment by link device.Link device can revise maximum point of leaf length in handshake message, thus when having ensured data flow via CAPWAP tunnel, CAPWAP tunnel maximum load capability can not be exceeded, avoid CAPWAP burst and restructuring, optimize antenna efficiency efficiency, improve AP device throughput.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.