Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention provides the transmission method of tcp data bag.The embodiment of the invention also provides corresponding device thereof and system.Below be elaborated respectively.
Embodiment one,
The transmission method of a kind of tcp data bag that the embodiment of the invention provides, be provided with for example TCP agency of a tcp data packet transfer device at network side, the TCP agency is after receiving the ACK bag of receiving terminal transmission, increase the receive window of this ACK bag and send to transmitting terminal, the packet that sends according to this ACK bag that has increased receive window of receiving end/sending end then, and send described packet to receiving terminal with window more than or equal to the receive window of former ACK bag.
Wherein, receiving terminal is specifically as follows portable terminal or server; Corresponding sending terminal is server or portable terminal.
As shown in Figure 1, its idiographic flow can be as follows:
101, the TCP agency receives the ACK bag from receiving terminal;
102, the TCP agency increases the receive window of described ACK bag;
103, TCP agency will increase the ACK bag behind the receive window and send to transmitting terminal;
104, TCP acts on behalf of the packet that receiving end/sending end sends, and to be transmitting terminal increased the ACK bag behind the receive window and send according to described this packet;
That is to say, such as, the receive window of supposing former ACK bag is first window, receive window after the increase is second window, because transmitting terminal is to wrap the receive window of knowing receiving terminal according to the ACK that receives, so, when transmitting terminal receives after this has increased ACK bag behind the receive window, will think that the receive window of receiving terminal is second window, then be that window transmission packet is acted on behalf of to TCP with second window, because second window is greater than first window, therefore, in the same time, the data volume that the TCP agency gets access to from transmitting terminal naturally also can be some more.
105, TCP agency sends described packet to receiving terminal with the window more than or equal to the receive window of former ACK bag.
As from the foregoing, after present embodiment adopts the TCP agency to receive the ACK bag of receiving terminal transmission, increase the receive window of this ACK bag, and send to transmitting terminal, the TCP agency can obtain the packet that transmitting terminal is come in advance like this, TCP agency sends packet to receiving terminal more than or equal to the window of the receive window of former ACK bag more then, thereby improved transmission rate, and provide the data of comparison abundance for eating dishes without rice or wine, make interface-free resources be fully used, promote the TCP transmission performance, improved the throughput performance of network, strengthened user's business experience.
Embodiment two,
Method according to embodiment one describes below will be described in further detail for example.
Described tcp data packet transfer device, for example TCP acts on behalf of, during specific implementation, can on the layer of the PDCP (PDCP:Packet Data Convergence Protocol) in radio network controller (the RNC:Radio Network Controller) entity, increase a TCP performance and strengthen module, be that tcp performance strengthens agency (TCP Performance Enhancer, below all be called for short TPE), the protocol stack of universal terrestrial access network (UTRAN) can be referring to Fig. 2 behind the increase TPE.
Perhaps the TPE module can be an independent module, and perhaps the TPE module can be arranged on that Serving GPRS Support Node (SGSN:Serving GPRS Support Node) is gone up or the TPE module can be arranged on the Gateway GPRS Support Node (GGSN:Gateway GPRS Support Node).
TPE has the function of parsing TCP (TCP/IP:Transmit ControlProtocol/Internet Protocol) bag, first handshake packet that can connect by the data separation TCP in TCP packet header, the handshake packet for the third time that TCP connects, ACK wraps and packet, and they are made corresponding processing.
1, handshake packet
In order to set up the connection between receiving terminal and the transmitting terminal, receiving terminal can be initiated handshake packet to transmitting terminal.
TPE receives the handshake packet that receiving terminal sends, be after the handshake packet for the third time that connects of first handshake packet that connects of TCP or TCP, write down the size of the receive window of this handshake packet, and the expansion factor in the TCP packet header option of this handshake packet increased, and then this has been increased the handshake packet after the expansion factor sent to transmitting terminal.
2, ACK bag
After receiving terminal and transmitting terminal connected, receiving terminal can send the ACK bag to transmitting terminal after receiving from the packet of transmitting terminal, to carry out transfer of data.
TPE is after receiving the ACK bag of receiving terminal transmission, write down the receive window of this ACK bag, promptly write down the size of receive window of the script of this ACK bag, then this receive window is increased, for example this receive window can be increased and be 64kbytes, and this has been increased the ACK bag behind the receive window send to transmitting terminal.
3, packet
After receiving terminal and transmitting terminal connected, transmitting terminal sent packet to receiving terminal, if in setting up the process that TCP connects, TPE is not provided with expansion factor (Window Scaling), and window size is the window after TPE increases; If expansion factor is set, window size is that the window after TPE increases multiply by 2 expansion factor power.
TPE receives the packet that transmitting terminal sends, the propelling movement PUSH mark in its TCP packet header is changed to 1, and this mark is submitted to application layer from the TCP layer after being used to indicate receiving terminal to receive this packet immediately, so that reduce taking of TCP spatial cache, K with the receive window of the ACK of described record bag doubly is a window then, send packet to receiving terminal, wherein, K is a preset value, it can be integer, also can be mark, can be provided with according to the strategy of operator, and K be more than or equal to 1.
As shown in Figure 3, its idiographic flow can be as follows:
201, in order to set up being connected between receiving terminal and the transmitting terminal, receiving terminal sends handshake packet to TPE;
202, after TPE receives handshake packet, write down the size of the receive window of this handshake packet;
203, TPE can be with the expansion factor in the TCP packet header option of this handshake packet, and promptly WindowScaling is provided with, and certainly, if be provided with expansion factor before, then can enlarge introduction to this and does further to increase;
204, TPE will increase the handshake packet after the expansion factor and send to transmitting terminal, to connect;
205, connect after the success, receiving terminal sends ACK and wraps to TPE after receiving from the packet of transmitting terminal;
206, TPE writes down the receive window in this ACK bag after receiving the ACK bag of receiving terminal transmission;
207, TPE increases the receive window in this ACK bag;
208, the TPE ACK bag that will increase behind the receive window sends to transmitting terminal;
209, transmitting terminal receives after this has increased ACK bag behind the receive window, increased the ACK bag behind the receive window according to this and sent packet to TPE, if set up before in the process of TCP connection, TPE is provided with expansion factor, then multiply by 2 expansion factor power with the receive window after increasing is window, sends packet to TPE; That described expansion factor refers to the setting that receives or increase after expansion factor.
210, after TPE receives the packet that transmitting terminal sends, the propelling movement PUSH mark in its TCP packet header is changed to 1, this mark is submitted to application layer from the TCP layer after being used to indicate receiving terminal to receive these packets immediately, so that reduce taking of TCP spatial cache;
211, these packets of TPE buffer memory send to receiving terminal with higher speed with packet, and for example the K with the receive window of the ACK of described record bag doubly is a window, send packet to receiving terminal, wherein, K is a preset value, can be provided with according to the strategy of operator, and K is more than or equal to 1;
212, receiving terminal receives packet.
As from the foregoing, because TPE has increased the receive window of ACK bag and the expansion factor of handshake packet, and the packet that transmitting terminal sends to be receive window with the ACK bag multiply by 2 expansion factor power is window, so, in this way, TPE just can get access to some data of transmitting terminal in advance, after this, TPE sends to receiving terminal with higher speed with packet again, such as the K with the receive window of the ACK of described record bag doubly is window, send packet to receiving terminal, thereby make the transmission pipeline of transmitting terminal and receiving terminal that sufficient data volume be arranged, avoid Radio Link control buffer memory to take (RLC BO:Radio LinkControl Buffer Occupy) emptying to a certain extent and caused eating dishes without rice or wine not having the generation of the phenomenon that data can send, promoted the TCP transmission performance, throughput performance to network has gain, has strengthened user's business experience.
Embodiment three,
On the basis of embodiment two described methods, overflow for fear of the receiving terminal data, can also send packet at TPE and do a judgement before to receiving terminal, promptly judge record the ACK bag receive window whether doubly less than the M of the receive window of the handshake packet of described record, described M is a preset value, is adjustable numerical value, and M is smaller or equal to 1, if show then and may cause the receiving terminal data to overflow that TPE stops to send described packet to receiving terminal; If not, show then and can not cause the receiving terminal data to overflow that then TPE doubly is a window with the K of the receive window of the ACK bag of described record, sends packet to receiving terminal, wherein, K is a preset value, can be configured according to the strategy of operator, and K is more than or equal to 1.
Certainly, packet loss when transmitting terminal sends packet to TPE, can also allow TPE safeguard a table, the sequence number and the bag that are writing down its received packet in this table are long, TPE can determine whether packet loss of packet that transmitting terminal sends according to the sequence number of this record and bag are long then, for example, can judge whether the sequence number in this table is continuous; If determine packet loss, then the receive window with the ACK bag of described record is a window, sends packet to receiving terminal; If determine there is not packet loss, then the K with the receive window of the ACK bag of described record doubly is a window, sends packet to receiving terminal.
Wherein, receiving terminal can be portable terminal or server, and corresponding sending terminal is server or portable terminal, to with the receiving terminal portable terminal below, transmitting terminal is that server is that example is described in further detail scheme provided by the present invention, and as shown in Figure 4, flow process can be as follows:
301, portable terminal sends handshake packet to TPE;
302, after TPE receives this handshake packet, write down the receive window of this handshake packet;
303, TPE can be provided with the expansion factor in the TCP packet header option of this handshake packet, certainly, if set before, then can increase this expansion factor;
304, the TPE handshake packet that will be provided with or increase expansion factor sends to server, to set up being connected between portable terminal and the server;
305, connect after the success, begin to carry out transfer of data between portable terminal and the server, portable terminal sends ACK and wraps to TPE after receiving the packet that server sends;
306, TPE writes down the receive window of this ACK bag after receiving the ACK bag of portable terminal transmission;
307, TPE increases the receive window of this ACK bag;
308, the TPE ACK bag that will increase behind the receive window sends to server;
309, server receives after this has increased ACK bag behind the receive window, sends packet to TPE according to this receive window that has increased the ACK bag behind the receive window; If before set up in the process that TCP connects, TPE is provided with expansion factor, then multiply by 2 expansion factor power with the receive window after increasing is window, sends packet to TPE; That described expansion factor refers to the setting that receives or increase after expansion factor;
310, after TPE receives the packet of server transmission, these packets of buffer memory, the sequence number and the bag that write down these packets are long;
311, TPE is changed to 1 with the PUSH mark in the TCP packet header of these packets, and this mark is used for being submitted to application layer from the TCP layer immediately after indicating mobile terminal is received this packet, so that reduce taking of TCP spatial cache;
312, TPE determine the ACK bag write down receive window whether doubly less than the M of the receive window of the handshake packet that is write down, promptly judge whether to cause the receiving terminal data to overflow, described M is a preset value, be adjustable numerical value, and M is smaller or equal to 1;
If 313, then TPE stops to send packet to portable terminal;
314, if not, then TPE according to the sequence number of step 312 recorded data bag and the long packet loss that determines whether of bag;
315, if determine packet loss, then TPE is a window with the receive window of the ACK bag of described record, sends packet to portable terminal;
316, if determine there is not packet loss, then TPE doubly is a window with the K of the receive window of the ACK bag of described record, sends packet to portable terminal, and wherein, K is a preset value, can be provided with according to the strategy of operator, and K 1;
317, portable terminal receives packet.
As from the foregoing, because TPE has increased the receive window of ACK bag, therefore can get access to some data of transmitting terminal in advance, TPE is after receiving these data, the sequence number and the bag that can write down this packet are long, so that whether detect packet loss, TPE can also be by determining record the receive window of ACK bag whether doubly control whether send packet to receiving terminal less than the M of the receive window of the handshake packet of described record, overflow to prevent the receiving terminal data, when determining not cause data to overflow, then the K with the receive window of the ACK of described record bag doubly is a window, send packet to receiving terminal, thereby realized that TPE can surpass receiving ability that receiving terminal is stated and give out a contract for a project, promptly packet is sent to receiving terminal with higher speed, make the transmission pipeline of transmitting terminal and receiving terminal that sufficient data volume be arranged, avoid RLC BO emptying to a certain extent and caused eating dishes without rice or wine not having the generation of the phenomenon that data can send, promoted the TCP transmission performance, throughput performance to network has gain, has strengthened user's business experience.
Embodiment four,
In order to implement above method better, embodiments of the invention also correspondingly provide a kind of transmitting device of tcp data bag, as shown in Figure 5, mainly comprise:
First receiving element 401 is mainly used in and receives the ACK bag that receiving terminal sends;
First is provided with unit 403, is mainly used in the receive window that increases in the ACK bag that first receiving element 401 receives;
First transmitting element 404 is mainly used in and with first the ACK bag that unit 403 increased behind the receive window is set and sends to transmitting terminal;
The 3rd receiving element 601 is mainly used in the packet that receiving end/sending end sends, and described packet is that transmitting terminal sends according to the ACK bag that first transmitting element 404 sends;
The 3rd transmitting element 606 is mainly used in the window with the receive window that wraps more than or equal to former ACK, and the packet that the 3rd receiving element 601 is received sends to receiving terminal.
Certainly, as shown in Figure 6, the transmitting device of this tcp data bag can also comprise first record cell 402, is used for writing down the receive window of the ACK bag that first receiving element 401 receives;
Described the 3rd transmitting element 606, the K that also is used for the receive window of the ACK bag of first record cell 402 record doubly is a window, sends packet to receiving terminal, wherein, K is a preset value, can be provided with according to the strategy of operator, and K is more than or equal to 1.
Further, because receiving terminal also needed to connect with transmitting terminal before sending the ACK bag, therefore, as shown in Figure 6, the transmitting device of this tcp data bag can also comprise:
Second receiving element 501 is mainly used in and receives the handshake packet that receiving terminal sends;
Second record cell 502 is mainly used in the receive window of the handshake packet that record second receiving element 501 receives;
Second is provided with unit 503, is mainly used in the expansion factor in the handshake packet TCP packet header that increases 501 receptions of second receiving element;
Second transmitting element 504 is mainly used in and with second unit 503 is set and has increased the handshake packet after the expansion factor and send to transmitting terminal.
Further, overflow for fear of the receiving terminal data, as shown in Figure 6, the transmitting device of this tcp data bag can also comprise:
First judging unit 604, whether the receive window that is mainly used in the request package of determining first record cell, 402 records is less than the M of the receive window of the handshake packet of second recording unit records 502 doubly, promptly judge whether to cause the receiving terminal data to overflow, wherein, M is a preset value, can be provided with according to the strategy of operator, and M is smaller or equal to 1;
The 3rd transmitting element 606, also be used for when first judging unit 604 determines that the receive window of the ACK bag of first recording unit records is not less than M times of receive window of handshake packet of second recording unit records, the K of the receive window that the ACK that writes down with first record cell 402 wraps doubly is a window, send packet to receiving terminal, wherein, K is a preset value, can be provided with according to the strategy of operator, and K is more than or equal to 1.
Further, packet loss when transmitting terminal sends packet to TPE, as shown in Figure 6, the transmitting device of this tcp data bag can also comprise:
The 3rd record cell 602, the sequence number and the bag that are mainly used in the packet that receives of record the 3rd receiving element 601 are long;
Second judging unit 605 is mainly used in according to the packet of the sequence number of the 3rd record cell 602 record and the long definite transmitting terminal transmission of bag packet loss whether;
The 3rd transmitting element 606 also is used for when described second judging unit 605 is determined packet loss, and the receive window that the ACK that writes down with described first record cell 402 wraps is that window sends packet to receiving terminal.
Further, in order to reduce taking of TCP spatial cache, as shown in Figure 6, the transmitting device of this tcp data bag further can also comprise:
The 3rd is provided with unit 603, and the propelling movement PUSH mark that is mainly used in the packet TCP packet header that the 3rd receiving element 601 is received is changed to 1, and this mark is submitted to application layer from the TCP layer after being used to indicate receiving terminal to receive these packets immediately
The 3rd transmitting element 606 also is used for the 3rd packet that is provided with after unit 603 is provided with is sent to receiving terminal.
It should be noted that give another device among Fig. 5 and Fig. 6, promptly transmitting terminal 7, just in order to describe the transmitting device of this tcp data bag clearer.
The transmitting device of this tcp data bag is specifically as follows TPE, and receiving terminal can be portable terminal or server, and corresponding transmitting terminal can be server or portable terminal.
Below, will be that TPE is that example describes with the transmitting device of this tcp data bag, concrete steps can be as follows:
Second receiving element 501 of step 1, TPE receives the handshake packet that receiving terminal sends;
The receive window of the handshake packet that step 2, second record cell, 502 records, second receiving element 501 receive;
Step 3, second is provided with the expansion factor in the TCP packet header option of the handshake packet that unit 503 receives second receiving element 501, be that Window Scaling is provided with, perhaps if before be provided with expansion factor, then can increase this expansion factor that sets;
Step 4, second transmitting element 504 are provided with unit 503 with second and are provided with or have increased the handshake packet after the expansion factor and send to transmitting terminal, to set up being connected between receiving terminal and the transmitting terminal;
After step 5, the success that connects, first receiving element 401 receives the ACK bag that the receiving terminal end sends;
The receive window of the ACK bag that step 6, first record cell, 402 records, first receiving element 401 receive;
Step 7, first is provided with unit 403 and increases receive window in the ACK bag that first receiving element 401 receives;
Step 8, first transmitting element 404 send first and unit 403 is set has increased the ACK behind the receive window and wrap to transmitting terminal, to carry out follow-up transfer of data;
The packet that step 9, the 3rd receiving element 601 receiving end/sending ends send, this packet ACK bag that to be transmitting terminal send according to first transmitting element 404 sends, and the receive window of the ACK bag that is about to receive multiply by 2 expansion factor power and sends packet to TPE as window;
The sequence number and the bag of the packet that step 10, the 3rd record cell 602 records the 3rd receiving element 601 receive are long;
The PUSH mark that step 11, the 3rd is provided with the TCP packet header of the packet that unit 603 receives the 3rd receiving element 601 is changed to 1, after receiving this packet, this mark indication receiving terminal is submitted to application layer from the TCP layer immediately, so that reduce taking of TCP spatial cache;
Step 12, first judging unit 604 determine first record cells, 402 records the ACK bag receive window whether doubly less than the M of the receive window of the handshake packet of second record cell, 502 records, described M is a preset value, be adjustable numerical value, and M is smaller or equal to 1;
If step 13 then stops to send packet to receiving terminal;
Step 14, if not, then the 3rd transmitting element 606 is according to the sequence number and the long packet loss that determines whether of bag of the 3rd record cell 602 recorded data bags;
Step 15, if determine packet loss, then the receive window with the handshake packet of second record cell, 502 records is a window, sends packets to receiving terminal by the 3rd transmitting element 606;
Step 10 six, if determine there is not packet loss, then the K with the receive window of the ACK bag of first record cell, 402 records doubly is a window, sends packet by the 3rd transmitting element 606 to receiving terminal, wherein, K is a preset value, can be provided with according to the strategy of operator, and K is more than or equal to 1;
As from the foregoing, because the transmitting device of this tcp data bag has increased the receive window of ACK bag, therefore can get access to some data of transmitting terminal in advance, the transmitting device of this tcp data bag is after the packet that receives the transmitting terminal transmission, the sequence number and the bag that can write down this packet are long, so that whether detect packet loss, whether the receive window of request package that can also be by determining record doubly controls whether send packet to receiving terminal less than the M of the receive window of the handshake packet of described record, overflow to prevent the receiving terminal data, when determining not cause data to overflow, then the K with the receive window of the ACK of described record bag doubly is that window sends packet to receiving terminal, realization sends to receiving terminal with higher speed with packet, make the transmission pipeline of transmitting terminal and receiving terminal that sufficient data volume be arranged, avoid RLC BO emptying to a certain extent and caused eating dishes without rice or wine not having the generation of the phenomenon that data can send, promoted the TCP transmission performance, the throughput performance of network has been had gain.
In addition, the embodiment of the invention also correspondingly provides a kind of communication system, i.e. communication equipment comprises the transmitting device of above-mentioned tcp data bag provided by the invention.
In a word, embodiments of the invention have following beneficial effect:
The embodiment of the invention is by increasing a module TPE on the PDCP layer in the RNC entity, TPE can increase the receive window of its received ACK bag and the expansion factor size of handshake packet, therefore can get access to some data of transmitting terminal in advance; And, TPE is after the packet that receives the transmitting terminal transmission, the sequence number and the bag that can write down this packet are long, so that whether detect packet loss, the transmitting device of this tcp data bag can also be by determining record the receive window of ACK bag whether doubly control whether send packet to receiving terminal less than the M of the receive window of the handshake packet of described record, overflow to prevent the receiving terminal data, when determining not cause data to overflow, then the K with the receive window of the ACK of described record bag doubly is a window, send packet to receiving terminal, thereby realize packet being sent to receiving terminal with higher speed, make the transmission pipeline of transmitting terminal and receiving terminal that sufficient data volume be arranged, avoid RLC BO emptying to a certain extent and caused eating dishes without rice or wine not having the generation of the phenomenon that data can send, promoted the TCP transmission performance, improve the throughput performance of network, strengthened user's business experience to a certain extent.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to finish by program, this program can be stored in the computer-readable recording medium, and storage medium can comprise: ROM, RAM, disk or CD etc.
More than transmission method, the Apparatus and system of the tcp data bag that the embodiment of the invention provided is described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.