CN106230744B - A kind of method and forwarding device of the recombination of data flow random ordering - Google Patents

A kind of method and forwarding device of the recombination of data flow random ordering Download PDF

Info

Publication number
CN106230744B
CN106230744B CN201610597488.XA CN201610597488A CN106230744B CN 106230744 B CN106230744 B CN 106230744B CN 201610597488 A CN201610597488 A CN 201610597488A CN 106230744 B CN106230744 B CN 106230744B
Authority
CN
China
Prior art keywords
tcp segment
serial number
tcp
buffering queue
segment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610597488.XA
Other languages
Chinese (zh)
Other versions
CN106230744A (en
Inventor
王茂斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Comba Network Systems Co Ltd
Original Assignee
Comba Telecom Systems China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Comba Telecom Systems China Ltd filed Critical Comba Telecom Systems China Ltd
Priority to CN201610597488.XA priority Critical patent/CN106230744B/en
Publication of CN106230744A publication Critical patent/CN106230744A/en
Application granted granted Critical
Publication of CN106230744B publication Critical patent/CN106230744B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention discloses the method and forwarding device of a kind of data flow random ordering recombination, this method comprises: receiving the first TCP segment that the first equipment is sent to the second equipment;The serial number of first TCP segment is compared with the serial number of newest received correct second TCP segment of sequence of the second equipment;If the serial number of the first TCP segment be greater than the second TCP segment serial number and the second TCP segment byte length and value, according to the source port number or destination slogan of first TCP segment, determine the corresponding buffering queue of the first TCP segment;Its deviation post in corresponding buffering queue is determined according to the serial number of the first TCP segment;First TCP segment is stored in the deviation post of the corresponding buffering queue, and each message in buffering queue is successively sent to second equipment by the sequence of deviation post, to solve the problem of the larger traffic impacting efficiency of transmission of existing method time loss.

Description

A kind of method and forwarding device of the recombination of data flow random ordering
Technical field
A kind of method and forwarding device recombinated the present invention relates to field of communication technology more particularly to data flow random ordering.
Background technique
As network multi-path routes, multicore processing, popularization of the multichannel loading balancing technique in internet, Internet service Continuous extension and expansion, and requirement to network transmission speed increasingly improves, and the guarantee of network sequence is increasingly shown Its importance.Currently, most of internet data is propagated in the form of TCP data stream, and TCP data stream has strictly timing Control, can cause if timing confusion TCP state machine negotiation window narrow, further influence data flow transmission speed Rate.
TCP (Transmission Control Protocol, transmission control protocol) is a kind of connection-oriented, reliable , transport layer communication protocol based on byte stream, connection is established by " three-way handshake ", will the company of dismounting when data are transmitted It connects.In TCP/IP (Transmission Control Protocol/Internet Protocol) protocol levels model, TCP layer is located on IP layers, the transport layer under application layer.
TCP message is the message of application transport control protocol, as shown in Figure 1, TCP stem and real data are generally included, Wherein TCP stem include source port number (i.e. the port numbers of transmitting terminal), destination slogan (i.e. the port numbers of receiving end), serial number, Confirmation number and verification and wait.In general, application layer is sent to TCP layer for data transmitting between netting, being indicated with octet Stream.Then, TCP layer is divided into the data flow message segment of suitable length, and result packet is transmitted to IP layers, is passed through by IP layers Network sends packet to peer layer (i.e. the TCP layer of receiving end).TCP layer can give each TCP message to guarantee that packet loss does not occur One serial number, while serial number also ensures that the packet for being transmitted to receiving end is received in-order.Then, receiving end is to having had successfully received Byte sends back to a corresponding confirmation (ACK message);If transmitting terminal does not receive confirmation in reasonable round-trip delay (RTT), So corresponding data will be retransmitted.Whether TCP message is wrong come inspection data with a verification and function, is generally sending out Will be calculated when sending and receiving verification and.
It is an important work in sequence arrangement of the link link to TCP data stream to make TCP data not generate random ordering Make, and the method that the sequence of TCP data stream arranges at present be forwarding device using buffer by the data packet received all into Row data buffer storage is until buffer is filled with, and then to the data packet progress arranging order in buffer, but caching itself increases again Time loss of the data flow in network link, traffic impacting efficiency of transmission.
To sum up, the method time loss that there are data flows in network link that the sequence of existing TCP data stream arranges It is larger, the problem of traffic impacting efficiency of transmission.
Summary of the invention
The embodiment of the present invention provides the method and forwarding device of a kind of data flow random ordering recombination, to solve existing TCP The method time loss that there are data flows in network link that the sequence of data flow arranges is larger, traffic impacting transmission effect The problem of rate.
The method of the present invention includes a kind of method of data flow random ordering recombination, is sent to this method comprises: receiving the first equipment First TCP segment of the second equipment;By the serial number of first TCP segment and the newest received sequence of second equipment The serial number of correct second TCP segment is compared;
If the serial number of first TCP segment is greater than the serial number and second TCP message of second TCP segment Section byte length and value, then according to the source port number or destination slogan of first TCP segment, determine described first The corresponding buffering queue of TCP segment;
Determine first TCP segment in corresponding buffering queue according to the serial number of first TCP segment Deviation post;
First TCP segment is stored in the deviation post of the corresponding buffering queue, and by the buffering queue In each message be successively sent to second equipment by the sequence of deviation post.
Based on same inventive concept, the embodiment of the present invention further provides a kind of forwarding device, which includes:
Receiving unit, the first TCP segment for being sent to the second equipment for receiving the first equipment;
Comparing unit, for by the serial number of first TCP segment and second equipment it is newest it is received sequence just The serial number of the second true TCP segment is compared;
Determination unit, if the serial number for first TCP segment is greater than serial number and the institute of second TCP segment State the second TCP segment byte length and value, then according to the source port number or destination port of first TCP segment Number, determine the corresponding buffering queue of first TCP segment;
The determination unit is also used to determine that first TCP segment exists according to the serial number of first TCP segment Deviation post in corresponding buffering queue;
Processing unit, for first TCP segment to be stored in the deviation post of the corresponding buffering queue, and will Each message in the buffering queue is successively sent to second equipment by the sequence of deviation post.
Forwarding device is sent to the first TCP segment of the second equipment in the first forwarding device of reception in the embodiment of the present invention When, by newest received correct second TCP segment of sequence of the serial number of first TCP segment and second equipment Serial number is compared, if the serial number of first TCP segment is greater than the serial number and described second of second TCP segment TCP segment byte length and value determined then according to the source port number or destination slogan of first TCP segment The corresponding buffering queue of first TCP segment determines that the first TCP is reported according to the serial number of first TCP segment First TCP segment is stored in the corresponding buffering queue by deviation post of the literary section in corresponding buffering queue Deviation post, and each message in the buffering queue is successively sent to second equipment by the sequence of deviation post.? That is forwarding device can first report received TCP before TCP segment is stored in buffering queue in the embodiment of the present invention Literary section is screened, and whether continuous with last received message screens this message, if continuously, directly by TCP segment It is sent to the second equipment, is not then stored into buffering queue, if discontinuously, by the offset of this packet storage to buffering queue It in position, is retransmited after message is resequenced by way of buffering queue to the second equipment, this have the effect that slow It rushes in queue and only stores out-of-order TCP segment, the time of caching consumption can be reduced to greatest extent, while also guaranteeing TCP number According to the timing requirements of stream, the transmission rate and handling capacity of TCP data stream are improved.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this For the those of ordinary skill in field, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of TCP segment structural schematic diagram that the prior art provides;
Fig. 2 is a kind of method flow schematic diagram of data flow random ordering recombination provided in an embodiment of the present invention;
Fig. 3 is the process schematic that three-way handshake is established in a kind of transmitting terminal that the prior art provides and receiving end;
Fig. 4 is that a kind of buffering queue provided in an embodiment of the present invention stores out-of-order recombination method schematic diagram one;
Fig. 5 is that a kind of buffering queue provided in an embodiment of the present invention stores out-of-order recombination method schematic diagram two;
Fig. 6 is a kind of forwarding device schematic diagram provided in an embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into It is described in detail to one step, it is clear that the described embodiments are only some of the embodiments of the present invention, rather than whole implementation Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts All other embodiment, shall fall within the protection scope of the present invention.
Shown in Figure 2, the embodiment of the present invention provides a kind of method flow schematic diagram of data flow random ordering recombination, specifically Implementation method includes:
Step S101 receives the first TCP segment that the first equipment is sent to the second equipment;
Step S102 is correct by the newest received sequence of the serial number of first TCP segment and second equipment The serial number of second TCP segment is compared;
Step S103, if the serial number of first TCP segment is greater than the serial number and described the of second TCP segment Two TCP segment byte lengths and value, then according to the source port number or destination slogan of first TCP segment, really Determine the corresponding buffering queue of first TCP segment;
Step S104 determines first TCP segment in corresponding buffering according to the serial number of first TCP segment Deviation post in queue;
First TCP segment is stored in the deviation post of the corresponding buffering queue by step S105, and will be described Each message in buffering queue is successively sent to second equipment by the sequence of deviation post.
It should be noted that execute the above method is forwarding device, forwarding device can be router or interchanger It is that the message for sending transmitting terminal is sent to receiving end by connecting link Deng, forwarding device main function.In order to enable mostly main When machine multiprocess communication, it is unlikely to that mess occurs, it is necessary to be used in combination with the IP address of port numbers and host, referred to as Socket or socket (Socket).So the source port number of TCP segment and destination slogan just constitute a socket, due to The IP address of host is uniquely that such destination host can distinguish the source machine of the data flow received.Socket includes IP address (32) and port numbers (16), totally 48.Such as source port number (124.33.13.55,200) and destination slogan (126.45.21.51,25) is exactly a pair of of socket, and in entire Internet, a pair communicated on the level of the transport layer is socketed Word all must be unique.
Before step S101, forwarding device establishes corresponding buffering queue according to the three-way handshake of host A and host B, Wherein the process of three-way handshake is as shown in Figure 3:
Step 1 is shaken hands for the first time, and client TCP gives server end TCP to send a special TCP data section first. The data segment does not include application layer data, and sets 1 for SYN (Synchronization, synchronization bit) position in stem, So the data segment is referred to as SYN data segment, wherein SYN means that this is a connection request as shown in Figure 1, SYN is set to 1 Or receive message.In addition, client selects an initial sequence number SEQ, if SEQ=x and this number is put into initial TCP SYN data segment sequence-number field in.The data segment is packaged into an IP data packet, and is sent to server.
Step 2, second handshake take once the IP data packet equipped with TCP SYN data segment reaches server host Business device will extract TCP SYN data segment from the IP data packet, distribute the buffer area TCP and variable to the connection, and give client End TCP sends the data segment for allowing to connect.This allows the data segment connected also not include any application layer data.But It is that 3 important informations are loaded in its stem.Firstly, SYN is arranged to 1;The section secondly, TCP data section stem is read really It is arranged to x+1;Finally, server selects the initial sequence number of oneself, SEQ=y, and the value is put into TCP data section stem In sequence-number field.
Step 3 is shaken hands for the third time, receive allow connect data segment after, client also can to connection distributing buffer Area and variable.Client host can also send another data segment to server, provide to the data segment that allows to connect of server Confirmation.
Forwarding device pre-establishes corresponding buffering queue according to the source port number or destination slogan of message segment, if turning Hair equipment screens out host A and there is out-of-order message segment toward the message segment that host B is sent, then this message segment is stored in corresponding master Out-of-order recombination is carried out in the buffering queue of the IP address of machine A, and the second equipment is then forwarded to after recombination.In other words, in step By newest received correct second TCP message of sequence of the serial number of first TCP segment and second equipment in S101 Before the serial number of section is compared, obtains the synchronization bit SYN of the control bit of first TCP segment and terminate bit FIN Value;Determine any one value of both SYN and FIN of first TCP segment not for 1.It only determines and receives The first TCP message when not being handshake message, just carry out the process of subsequent comparison and out-of-order recombination.
Wherein, the maximum value of serial number is 232- 1, when data are excessive, sequence number value is more than this number, then serial number is to 232Carry out modulus Operation.The relationship of confirmation number and serial number in TCP segment is: if the timing of two message segments is continuously, the latter is connect The serial number of the message segment of receipts is equal to the confirmation number of previous received message segment.
For example, host A has sent the message segment that four length are 100 bytes, the first byte of first message segment to host B Serial number 0, i.e. the serial number 0 of the message segment, the serial number 99 of the last byte of the first message segment, the i.e. byte long of the message segment Degree is 100;The serial number 100 of the first byte of second message segment, the i.e. serial number 100 of the message segment, the end of the second message segment The serial number 199 of byte, the i.e. byte length of the message segment are 100, and so on.Host A passes through forwarding device to master in this way Machine B has sent 0~99,100~199,200~299,300~399 four message segments.
Because there is the process for connection of shaking hands between host A and host B, if being the discovery that first message or the last one report Text, it is clear that it does not need to carry out the comparison of Sequence and Acknowledgment Number, is sent directly to the second equipment, it is then corresponding according to handshake message Source port number generates corresponding buffering queue, therefore before step S102, and the SYN of control bit is 1 to shake hands based on the received Perhaps destination slogan generates the source port number or the corresponding buffering team of destination slogan to the source port number of TCP segment Column, wherein serial number and second TCP segment of the serial number of the stem of the buffering queue for second TCP segment Byte length and value.
Example in connecting, i.e. host A pass through 0~99 message segment that sends to host B of router, and router is by this message Be sent directly to the second equipment, and calculating main frame B should received next correct message segment of sequence serial number 100, and Serial number 100 is recorded, while a buffering queue is established according to the source port number of this message, identifies the head of buffering queue Portion's serial number is 100.And then, second message segment that router receiving host A is sent to host B is 200~299, because Serial number is not equal to the serial number 100 recorded, therefore router temporarily stores this message segment to the source port number pair of message segment In the buffering queue answered.
Further, if the serial number of first TCP segment is equal to the serial number and described the of second TCP segment Two TCP segment byte lengths and value or the serial number of first TCP segment be less than second TCP segment Serial number and the second TCP segment byte length and value, then first TCP segment is sent directly to described second Equipment.
That is, router compares reception if second message segment that host A is sent to host B is 100~199 Message segment serial number it is consistent with the serial number of record, then this message segment is directly sent to the second equipment, or, host The message segment that A is sent to host B is to 1000~1099 this message segment, the sequence of the buffering queue stem mark of router Number be 1100, at this time again receive 200~299 this message segment, then illustrate 200~299 this message segment be before host A send The message segment that failure retransmitted again later is sent to host B, therefore router does not store the message segment in buffering queue, but it is straight It connects this message segment by 200~299 and is sent to the second equipment.
Further, forwarding device will be occurred among out-of-order message segment deposit buffering queue according to setting rule, That is, the serial number of forwarding device the first TCP message based on the received, finds corresponding deviation post from buffering queue, Then the first TCP message is stored in the corresponding deviation post.It specifically includes: according to the source of first TCP segment Slogan or destination slogan determine the corresponding buffering queue of first TCP segment using hash algorithm;According to described The serial number of one TCP segment determines bits of offset of first TCP segment in corresponding buffering queue using hash algorithm It sets, the first TCP message is then stored in corresponding deviation post.
If the corresponding source port number of buffering queue 1 be 124.33.13.55,200, when forwarding device receive the first TCP message When, wherein the source port number of the first TCP message be 124.33.13.55,200, forwarding device finds buffering using hash algorithm Queue 1 then utilizes the preset offset rule in hash algorithm in buffering queue further according to the serial number of the first TCP segment Find the deviation post that be inserted into.As an example it is assumed that saying the serial number of received first TCP message of forwarding device 1100, the confirmation number of preceding primary received second TCP message is 900, therefore forwarding device determines the bits of offset of the first TCP message 2 are set to, the first TCP message is stored in buffering queue as shown in Figure 4, and then, forwarding device is again by received serial number 1200 message segment and the message segment of received serial number 1300 are stored in the corresponding deviation post 3 of buffering queue shown in Fig. 4 With deviation post 4.Then, forwarding device receives the message segment of the message segment of serial number 900, serial number 1000 again, and forwarding is set Back-up is not by the position that the two message segments deposit deviation post is 0 and deviation post is 1, and so far, consideration, which reduces to the greatest extent, to be passed Message segment in deviation post 0 to deviation post 4 can be successively sent to by the time loss during defeated, forwarding device in order Second equipment.
Certainly, further, by first TCP segment be stored in the corresponding buffering queue deviation post it Afterwards, further includes: judge whether stem to the setting deviation post of the buffering queue has been written into message;If having been written into report The message of the stem of institute's buffering queue to the deviation post is then sent to described second by the sequence of deviation post and set by text It is standby.
For example, the serial number 1100 of received first TCP message of forwarding device, the newest received sequence of the second equipment The confirmation number of correct second TCP message is 900, and the message segment of corresponding storage is as shown in figure 5, in deviation post in buffering queue 0 has stored 900~999 message segment, has stored 1200~1299 message segment in deviation post 3, therefore by the first TCP Message is stored in deviation post 2, at this time to guarantee data throughout and minimal time delay, needs to send to walk to have completed in first time The data of whole preamble section, therefore buffering queue is sent to the second equipment from deviation post 0 to the message segment of deviation post 3, so Afterwards by the serial number of the message segment finally sent in buffering queue and message segment byte length and value be updated to the buffering queue The serial number of stem.
Certainly, because the length of buffering queue is pre-set, it is possible to exist when forwarding device receives When the first TCP message, buffering queue has been filled with, so being judged before being stored in buffering queue, that is, judges institute State the memory space whether deviation post exceeds the buffering queue;
If without departing from first TCP segment to be stored in the deviation post of the corresponding buffering queue;
If exceeding, all messages in the buffering queue are sent to the server by the sequence of deviation post End;
Determine that the serial number buffering queue of the stem of the buffering queue after being sent completely finally is sent The byte length of the serial number of message segment and the message segment finally sent and value;According to the serial number of the stem and institute The serial number for stating the first TCP segment redefines new bits of offset of first TCP segment in corresponding buffering queue It sets;
First TCP segment is stored in the new deviation post of the corresponding buffering queue.
That is, queue length be not enough to cache the out-of-order data reformed in need, if buffering queue has been filled with, It is successively then sent to the second equipment in sequence through message each in buffering queue, even if there is partial offset position for sky in queue, Such case specifically occurs when extreme out-of-order situation occurs in network, or occurs packet loss occur in the front end data of buffering queue When.If at this time forwarding device continue to cache and wait it is to be reformed, may the equal data less than needs, while can cause the first equipment by It cannot be responded for a long time in transmission data and determine loss of data, retransmit process into data, and cause to generate invalid data And repeated data.
Further, the length of the buffering queue, which can according to need, artificially configures, in addition when forwarding device connects When receiving the message segment that control bit FIN is 1, determines to finish the use of the data queue in network, empty the port numbers at this time The spatial cache that corresponding buffering queue occupies, and discharge the buffering queue.
Based on the same technical idea, the embodiment of the present invention also provides a kind of forwarding device, which can be performed above-mentioned side Method embodiment.Forwarding device provided in an embodiment of the present invention is as shown in Figure 6, comprising: receiving unit 401, comparing unit 402, really Order member 403, processing unit 404, in which:
Receiving unit 401, the first TCP segment for being sent to the second equipment for receiving the first equipment;
Comparing unit 402, for by the serial number of first TCP segment and the newest received sequence of second equipment The serial number of correct second TCP segment is compared;
Determination unit 403, if being greater than the serial number of second TCP segment for the serial number of first TCP segment With the second TCP segment byte length and value, then according to the source port number or destination of first TCP segment Slogan determines the corresponding buffering queue of first TCP segment;
The determination unit 403 is also used to determine first TCP message according to the serial number of first TCP segment Deviation post of the section in corresponding buffering queue;
Processing unit 404, for first TCP segment to be stored in the deviation post of the corresponding buffering queue, And each message in the buffering queue is successively sent to second equipment by the sequence of deviation post.
Further, further includes: generate buffering queue unit 405, the synchronization bit SYN for control bit based on the received For 1 source port number of TCP segment of shaking hands, perhaps to generate the source port number or destination slogan corresponding for destination slogan Buffering queue, wherein the serial number of the stem of the buffering queue be second TCP segment serial number and described second TCP segment byte length and value.
Further, the determination unit 403 is also used to: obtaining the synchronization ratio of the control bit of first TCP segment Special SYN and the value for terminating bit FIN;Determine both SYN and FIN of first TCP segment any one value it is equal It is not 1.
Further, the determination unit 403 is also used to: if the serial number of first TCP segment is equal to described second The serial number of TCP segment and the second TCP segment byte length and value, alternatively, if the sequence of first TCP segment Number be less than second TCP segment serial number and the second TCP segment byte length and value, then by described first TCP segment is sent directly to second equipment.
Further, the determination unit 403 is specifically used for: according to the source port number of first TCP segment or Destination slogan determines the corresponding buffering queue of first TCP segment using hash algorithm;
According to the serial number of first TCP segment, determine first TCP segment corresponding using hash algorithm Deviation post in buffering queue.
After the determination unit determines deviation post, the processing unit 404 is specifically used for: judging the buffering team Whether the stem of column to setting deviation post has been written into message;If having been written into message, extremely by the stem of institute's buffering queue The message of the deviation post is sent to second equipment by the sequence of deviation post.
Further, the processing unit 404 is specifically used for: judging whether the deviation post exceeds the buffering queue Memory space;
If without departing from first TCP segment to be stored in the deviation post of the corresponding buffering queue;
If exceeding, all messages in the buffering queue are sent to the server by the sequence of deviation post End;
Determine that the serial number buffering queue of the stem of the buffering queue after being sent completely finally is sent The byte length of the serial number of message segment and the message segment finally sent and value;
According to the serial number of the serial number of the stem of the buffering queue and first TCP segment, redefine described New deviation post of first TCP segment in corresponding buffering queue;
First TCP segment is stored in the new deviation post of the corresponding buffering queue.
Wherein, the length of the buffering queue, which can according to need, artificially configures, in addition when determination unit 403 receives When the message segment that the FIN to control bit is 1, determines to finish the use of the data queue in network, empty the port numbers at this time The spatial cache that corresponding buffering queue occupies, and discharge the buffering queue.
To sum up, forwarding device is sent to the first TCP of the second equipment receiving the first forwarding device in the embodiment of the present invention When message segment, newest received correct 2nd TCP of sequence of the serial number of first TCP segment and second equipment is reported The serial number of literary section is compared, if the serial number of first TCP segment be greater than second TCP segment serial number with it is described Second TCP segment byte length and value, then according to the source port number or destination slogan of first TCP segment, It determines the corresponding buffering queue of first TCP segment, determines described first according to the serial number of first TCP segment First TCP segment is stored in the corresponding buffering team by deviation post of the TCP segment in corresponding buffering queue The deviation post of column, and each message in the buffering queue is successively sent to described second by the sequence of deviation post and is set It is standby.That is, forwarding device, can be first to received before TCP segment is stored in buffering queue in the embodiment of the present invention TCP segment is screened, and whether continuous with last received message screens this message;If continuous, directly TCP is reported Literary section is sent to the second equipment, is not then stored into buffering queue, if discontinuously, by this packet storage to buffering queue In deviation post, retransmited after message is resequenced by way of buffering queue to the second equipment, this have the effect that Out-of-order TCP segment is only stored in buffering queue, can reduce the time of caching consumption to greatest extent, while also being guaranteed The timing requirements of TCP data stream improve the transmission rate and handling capacity of TCP data stream.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (14)

1. a kind of method of data flow random ordering recombination, which is characterized in that this method comprises:
Receive the first TCP segment that the first equipment is sent to the second equipment;
By newest received correct second TCP segment of sequence of the serial number of first TCP segment and second equipment Serial number be compared;
If serial number of the serial number of first TCP segment equal to second TCP segment and the second TCP segment word Save length and value, alternatively, if the serial number of first TCP segment be less than second TCP segment serial number with it is described Second TCP segment byte length and value, then first TCP segment is sent directly to second equipment;
If serial number of the serial number of first TCP segment greater than second TCP segment and the second TCP segment word Save length and value, then according to the source port number or destination slogan of first TCP segment, determine the first TCP The corresponding buffering queue of message segment;
Offset of first TCP segment in corresponding buffering queue is determined according to the serial number of first TCP segment Position;
First TCP segment is stored in the deviation post of the corresponding buffering queue, and will be in the buffering queue Each message is successively sent to second equipment by the sequence of deviation post.
2. the method for data flow random ordering recombination as described in claim 1, which is characterized in that determination the first TCP report Before the corresponding buffering queue of literary section, further includes:
The source port number or destination slogan for the TCP segment of shaking hands that the synchronization bit SYN of control bit is 1 based on the received, The source port number or the corresponding buffering queue of destination slogan are generated, wherein the serial number of the stem of the buffering queue is The serial number of second TCP segment and the second TCP segment byte length and value.
3. the method for data flow random ordering recombination as claimed in claim 1 or 2, which is characterized in that described to report the first TCP Before the serial number of literary section is compared with the serial number of newest received correct second TCP segment of sequence of second equipment, Further include:
It obtains the synchronization bit SYN of the control bit of first TCP segment and terminates the value of bit FIN;
Determine any one value of both SYN and FIN of first TCP segment not for 1.
4. the method for data flow random ordering recombination as claimed in claim 1 or 2, which is characterized in that described according to the first TCP The source port number or destination slogan of message segment determine the corresponding buffering queue of first TCP segment, comprising:
According to the source port number or destination slogan of first TCP segment, the first TCP is determined using hash algorithm The corresponding buffering queue of message segment;
The serial number according to first TCP segment determines first TCP segment in corresponding buffering queue Deviation post, comprising:
According to the serial number of first TCP segment, determine first TCP segment in corresponding buffering using hash algorithm Deviation post in queue.
5. the method for data flow random ordering recombination as claimed in claim 1 or 2, which is characterized in that described to report the first TCP Literary section is stored in the deviation post of the corresponding buffering queue, and by each message in the buffering queue by the suitable of deviation post Sequence is successively sent to second equipment, comprising:
Judge whether the deviation post exceeds the memory space of the buffering queue;
If without departing from first TCP segment to be stored in the deviation post of the corresponding buffering queue;
If exceeding, all messages in the buffering queue are sent to server end by the sequence of deviation post;
The serial number for determining the stem of the buffering queue after being sent completely is the message that the buffering queue is finally sent Section serial number and the message segment finally sent byte length and value;
According to the serial number of the serial number of the stem of the buffering queue and first TCP segment, described first is redefined New deviation post of the TCP segment in corresponding buffering queue;
First TCP segment is stored in the new deviation post of the corresponding buffering queue.
6. the method for data flow random ordering recombination as claimed in claim 1 or 2, which is characterized in that by first TCP segment It is stored in after the deviation post of the corresponding buffering queue, further includes:
Judge whether stem to the setting deviation post of the buffering queue has been written into message;
Each message by the buffering queue is successively sent to second equipment by the sequence of deviation post, comprising:
If having been written into message, the message of the stem of the buffering queue to the deviation post is pressed to the sequence of deviation post It is sent to second equipment.
7. the method for data flow random ordering recombination as claimed in claim 1 or 2, which is characterized in that the queue of the buffering queue Length is configurable.
8. a kind of forwarding device, which is characterized in that the equipment includes:
Receiving unit, the first TCP segment for being sent to the second equipment for receiving the first equipment;
Comparing unit, for the newest received sequence of the serial number of first TCP segment and second equipment is correct The serial number of second TCP segment is compared;And if the serial number for first TCP segment is equal to the 2nd TCP The serial number of message segment and the second TCP segment byte length and value, alternatively, if the serial number of first TCP segment Less than second TCP segment serial number and the second TCP segment byte length and value, then by the first TCP Message segment is sent directly to second equipment;
Determination unit, if the serial number for first TCP segment is greater than the serial number and described the of second TCP segment Two TCP segment byte lengths and value, then according to the source port number or destination slogan of first TCP segment, really Determine the corresponding buffering queue of first TCP segment;
The determination unit is also used to be determined first TCP segment in correspondence according to the serial number of first TCP segment Buffering queue in deviation post;
Processing unit, for first TCP segment to be stored in the deviation post of the corresponding buffering queue, and will be described Each message in buffering queue is successively sent to second equipment by the sequence of deviation post.
9. forwarding device as claimed in claim 8, which is characterized in that further include:
Buffering queue unit is generated, the source for the TCP segment of shaking hands that the synchronization bit SYN for control bit based on the received is 1 Perhaps destination slogan generates the source port number or the corresponding buffering queue of destination slogan to port numbers, wherein described slow Rush the stem of queue serial number be second TCP segment serial number and the second TCP segment byte length and Value.
10. forwarding device as claimed in claim 8 or 9, which is characterized in that the determination unit is also used to:
It obtains the synchronization bit SYN of the control bit of first TCP segment and terminates the value of bit FIN;
Determine any one value of both SYN and FIN of first TCP segment not for 1.
11. forwarding device as claimed in claim 8 or 9, which is characterized in that the determination unit is specifically used for:
According to the source port number or destination slogan of first TCP segment, the first TCP is determined using hash algorithm The corresponding buffering queue of message segment;
According to the serial number of first TCP segment, determine first TCP segment in corresponding buffering using hash algorithm Deviation post in queue.
12. forwarding device as claimed in claim 8 or 9, which is characterized in that the processing unit is specifically used for: described in judgement Whether deviation post exceeds the memory space of the buffering queue;
If without departing from first TCP segment to be stored in the deviation post of the corresponding buffering queue;
If exceeding, all messages in the buffering queue are sent to server end by the sequence of deviation post;
The serial number for determining the stem of the buffering queue after being sent completely is the message that the buffering queue is finally sent Section serial number and the message segment finally sent byte length and value;
According to the serial number of the serial number of the stem of the buffering queue and first TCP segment, described first is redefined New deviation post of the TCP segment in corresponding buffering queue;
First TCP segment is stored in the new deviation post of the corresponding buffering queue.
13. forwarding device as claimed in claim 8 or 9, which is characterized in that the determination unit determine deviation post it Afterwards, the processing unit is specifically used for: judging whether stem to the setting deviation post of the buffering queue has been written into message; If having been written into message, the message of the stem of the buffering queue to the deviation post is sent by the sequence of deviation post To second equipment.
14. forwarding device as claimed in claim 8 or 9, which is characterized in that the queue length of the buffering queue is configurable 's.
CN201610597488.XA 2016-07-26 2016-07-26 A kind of method and forwarding device of the recombination of data flow random ordering Active CN106230744B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610597488.XA CN106230744B (en) 2016-07-26 2016-07-26 A kind of method and forwarding device of the recombination of data flow random ordering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610597488.XA CN106230744B (en) 2016-07-26 2016-07-26 A kind of method and forwarding device of the recombination of data flow random ordering

Publications (2)

Publication Number Publication Date
CN106230744A CN106230744A (en) 2016-12-14
CN106230744B true CN106230744B (en) 2019-04-16

Family

ID=57534404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610597488.XA Active CN106230744B (en) 2016-07-26 2016-07-26 A kind of method and forwarding device of the recombination of data flow random ordering

Country Status (1)

Country Link
CN (1) CN106230744B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111917656B (en) * 2017-07-27 2023-11-07 超聚变数字技术有限公司 Method and device for transmitting data
CN109547389B (en) * 2017-08-08 2021-12-07 中国移动通信集团宁夏有限公司 Code stream file recombination method and device
CN107835138B (en) * 2017-09-15 2022-01-04 南京安讯科技有限责任公司 Message ordering method in TCP communication connection
US10680966B2 (en) * 2017-12-27 2020-06-09 Juniper Networks, Inc. Intelligent buffering for packet reordering by virtual nodes within a network device
CN110572300B (en) * 2019-08-30 2022-07-05 西南交通大学 Method for estimating transmitted data volume of TCP stream
CN110519002B (en) * 2019-09-27 2021-03-16 苏州浪潮智能科技有限公司 Time synchronization method and related device
CN110855584B (en) * 2019-10-16 2022-02-01 武汉绿色网络信息服务有限责任公司 Method and device for TCP out-of-order recombination
CN111427859B (en) * 2020-03-25 2024-04-05 京东科技控股股份有限公司 Message processing method and device, electronic equipment and storage medium
CN112738119B (en) * 2020-12-30 2022-12-09 北京天融信网络安全技术有限公司 Message processing method and device, electronic equipment and readable storage medium
WO2022147762A1 (en) * 2021-01-08 2022-07-14 华为技术有限公司 Data packet sequencing method and apparatus
CN112969201B (en) * 2021-05-18 2021-07-23 荣耀终端有限公司 Cache depth adjusting method and device
CN114143268B (en) * 2021-10-25 2024-02-06 航天恒星科技有限公司 Message receiving method and device based on TCP, electronic equipment and storage medium
CN114244785B (en) * 2021-12-20 2022-12-06 中电信数智科技有限公司 5G data flow out-of-order processing method and device
CN114024924B (en) * 2022-01-05 2022-04-12 北京安博通科技股份有限公司 TCP stream recombination method and device, electronic equipment and storage medium
CN114978986B (en) * 2022-05-13 2024-05-14 中国联合网络通信集团有限公司 Data transmission method, device and storage medium
CN115442000A (en) * 2022-08-25 2022-12-06 苏州空天信息研究院 Transmission guarantee method suitable for low-bandwidth and easily-consumed ad hoc network
CN117527937B (en) * 2024-01-08 2024-03-15 柏科数据技术(深圳)股份有限公司 Ordering window-based data message ordering method, device and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146031A (en) * 2006-12-05 2008-03-19 中兴通讯股份有限公司 Service-data oriented storage method and processing method in radio communication system
EP2154798A1 (en) * 2007-06-07 2010-02-17 ZTE Corporation Ethernet data reforming apparatus and method
CN101841545A (en) * 2010-05-14 2010-09-22 中国科学院计算技术研究所 TCP stream restructuring and/or packetizing method and device
CN105357148A (en) * 2015-10-15 2016-02-24 盛科网络(苏州)有限公司 Method and system for preventing output message of network exchange chip from being disordered

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2887387B1 (en) * 2005-06-17 2007-08-31 Alcatel Sa ENCAPSULATION OF E1-TYPE FRAME UNDER ETHERNET

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146031A (en) * 2006-12-05 2008-03-19 中兴通讯股份有限公司 Service-data oriented storage method and processing method in radio communication system
EP2154798A1 (en) * 2007-06-07 2010-02-17 ZTE Corporation Ethernet data reforming apparatus and method
CN101841545A (en) * 2010-05-14 2010-09-22 中国科学院计算技术研究所 TCP stream restructuring and/or packetizing method and device
CN105357148A (en) * 2015-10-15 2016-02-24 盛科网络(苏州)有限公司 Method and system for preventing output message of network exchange chip from being disordered

Also Published As

Publication number Publication date
CN106230744A (en) 2016-12-14

Similar Documents

Publication Publication Date Title
CN106230744B (en) A kind of method and forwarding device of the recombination of data flow random ordering
US9648147B2 (en) System and method for TCP high availability
CN104025525B (en) For sending the method and apparatus and exchange apparatus of packet
JP5038425B2 (en) Optimization process of traffic control in packet telecommunications network
Zhang et al. Multipath routing and MPTCP-based data delivery over manets
US20070110046A1 (en) Internet protocol optimizer
US7139268B1 (en) Performance of intermediate nodes with flow splicing
CN101917472A (en) Method, device and equipment for recombining multi-link messages
CN103618678A (en) Method, device and system for self-adaptation multiple-link aggregation
AU2007320794B2 (en) Selective session interception method
CN107770085B (en) Network load balancing method, equipment and system
WO2003053009A1 (en) A method of controlling flow of the ethernet data in a synchronous data hierarchy transmission network
CN105743614B (en) The transmission method and device of data
CN107852371A (en) Data packet network
CN113194504B (en) Method and system for optimizing transmission protocol based on multiplex detection and opposite-end remote measurement
US20070291782A1 (en) Acknowledgement filtering
CN102780621B (en) A kind of upstream data packet transmission method, device and the network equipment
JP2024111082A (en) Optimizing network parameters to enable network coding
CN103475657B (en) The treating method and apparatus of anti-SYN extensive aggression
CN106302213A (en) A kind of method and device of data transmission
CN105763375B (en) A kind of data packet sending method, method of reseptance and microwave station
US20120101987A1 (en) Distributed database synchronization
JP5832335B2 (en) Communication apparatus and communication system
WO2014079334A1 (en) Method and router device for neighbor relationship processing
CN107852372A (en) Data packet network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 510663 No. 10 Shenzhou Road, Science City, Luogang District, Guangzhou City, Guangdong Province

Patentee after: Jingxin Network System Co.,Ltd.

Address before: 510663 No. 10 Shenzhou Road, Science City, Luogang District, Guangzhou City, Guangdong Province

Patentee before: Comba Telecom System (China) Ltd.