CN103067394A - Transmission control protocol (TCP) connecting establishment method and establishment device based on one-way data package - Google Patents
Transmission control protocol (TCP) connecting establishment method and establishment device based on one-way data package Download PDFInfo
- Publication number
- CN103067394A CN103067394A CN2012105875513A CN201210587551A CN103067394A CN 103067394 A CN103067394 A CN 103067394A CN 2012105875513 A CN2012105875513 A CN 2012105875513A CN 201210587551 A CN201210587551 A CN 201210587551A CN 103067394 A CN103067394 A CN 103067394A
- Authority
- CN
- China
- Prior art keywords
- way data
- tcp
- data bag
- way
- packet
- 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.)
- Granted
Links
Images
Abstract
The invention relates to a transmission control protocol (TCP) connecting establishment method and an establishment device based on a one-way data package. The method comprises the following steps: obtaining data packages through a network, filtering a data package in one direction, obtaining a first one-way data package, filtering data containing a three-time handshake sign of the one-way data package according to the three-time handshake sign of the one-way data package, obtaining a second one-way data package, and establishing a one-way TCP connection corresponding to the one-way data package according to application layer logic so that the second one-way data package is handed over to the application layer to be processed through the one-way connection. According to establishment of the TCP connection based on the one-way data package, under environment of network data package dropout and large quantity of flow, effectiveness of application layer data processing is improved. The one-way TCP connection is few in dependent conditions, simple in processing logic, low in maintenance cost, less in occupied resources and greater in flexibility.
Description
Technical field
The present invention relates to Internet technology, relate in particular to a kind of TCP based on the one-way data bag and connect method for building up and device.
Background technology
Along with the develop rapidly of the Internet, the analysis of network application layer business datum and the demand of processing are grown with each passing day.Especially, aspect the performance bottleneck of the validity that improves business datum and solution business datum, be faced with acid test and challenge.
There is some defective in the technology of existing processing network application layer business datum.Under some network design environment, owing to there is the serious phenomenon of data packet loss, make the data receiver of network application layer imperfect, cause business datum can't process or process mistake.In the larger environment of the network traffics such as operator and large-scale colleges and universities scene, how accurately and at length processing application layer service data is a stubborn problem, is to be forced to helpless selection and purely deal with problems from hardware point of view.Only providing under the ad hoc network deployment scenario of one-way data flow, need to finish on this basis the processing to application layer service data.
Existing internet, applications layer service data processing model is to be based upon on the basis of partial data connection, and depends on the network communication protocol carrying.For the state of safeguarding connection with guarantee the effectively correct of data, need more condition, control logic more complicated, management cost are also relatively high.Just because of this, as long as any one annelet is made mistakes, it is imperfect all can to cause data to connect in the business data processing process of application layer, and then reduces the validity of business datum.
It is from application layer that prior art is tackled this class solution of problem thinking mostly, increases service logic, revises professional algorithm.Such solution can cause the increase of complexity and maintenance cost inevitably, and very not obvious quantitative change technique effect is only arranged, and does not produce qualitative change.
The shortcomings such as in sum, the treatment technology of visible existing application layer data is based on complete tcp data and connects, and it is large that it has limitation, and processing logic is complicated, and maintenance cost is high, and consumes resources is many.
Summary of the invention
The purpose of this invention is to provide a kind of TCP based on the one-way data bag that can overcome one of defects at least and connect method for building up and device.
In a first aspect of the present invention, provide a kind of TCP based on the one-way data bag to connect method for building up, comprising: by the Network Capture packet; Filter out a packet on the direction, obtain the first one-way data bag; According to the three-way handshake sign in the described one-way data bag data filtering that will contain the three-way handshake sign in the described one-way data bag is fallen, obtain the second one-way data bag; And the unidirectional TCP connection corresponding with described one-way data bag according to the application-level logic establishment, in order to by described unidirectional connection described the second one-way data bag is transferred to application layer process.
In a second aspect of the present invention, provide a kind of TCP based on the one-way data bag to connect apparatus for establishing, comprising: the packet acquisition module is used for by the Network Capture packet; The first filtering module is used for filtering out a packet on the direction, obtains the first one-way data bag; The second filtering module is used for according to the three-way handshake sign of described one-way data bag the data filtering that will contain the three-way handshake sign in the described one-way data bag being fallen, and obtains the second one-way data bag; And TCP connects and to set up module, is used for creating the unidirectional TCP connection corresponding with described one-way data bag according to application-level logic, in order to by described unidirectional connection described the second one-way data bag is transferred to application layer process.
In the third aspect, the invention provides a kind of server, comprising: the packet acquisition module is used for by the Network Capture packet; The first filtering module is used for filtering out a packet on the direction, obtains the first one-way data bag; The second filtering module is used for according to the three-way handshake sign of described one-way data bag the data filtering that will contain the three-way handshake sign in the described one-way data bag being fallen, and obtains the second one-way data bag; And TCP connects and to set up module, is used for creating the unidirectional TCP connection corresponding with described one-way data bag according to application-level logic, in order to by described unidirectional connection described the second one-way data bag is transferred to application layer process.
The present invention connects by the TCP that sets up based on the one-way data bag, under the environment of network data packet loss and a large amount of streams, improved the validity that application layer service data is processed, unidirectional TCP join dependency condition of the present invention is few, processing logic is simple, maintenance cost is low, it is few to take resource, and greater flexibility is arranged.
Description of drawings
Fig. 1 is the flow chart of the processing network application layer business datum of prior art;
Fig. 2 is the schematic diagram that the TCP of prior art connects;
Fig. 3 is the flow chart according to the processing network application layer business datum of the embodiment of the invention;
Fig. 4 is the flow chart according to the TCP connection of the embodiment of the invention;
Fig. 5 is the schematic diagram according to the TCP connection of the embodiment of the invention; And
Fig. 6 connects the schematic diagram of apparatus for establishing according to the embodiment of the invention based on the TCP of one-way data bag.
Embodiment
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
In order more clearly to understand difference with the prior art of the present invention, below by Fig. 1 and Fig. 2 are described the flow process of processing the network application layer business datum in the prior art.
Fig. 1 is the flow chart of the processing network application layer business datum of prior art.
In step 101, obtain packet by network from data link layer, data link layer is such as being device driver, network interface card of corresponding client etc.
In step 102, the packet that receives is carried out the IP fragmentation restructuring.Data link layer has the characteristic of MTU (Maximum Transmission Unit, MTU), and MTU has limited the maximum length of Frame, and variety of network types has different MTU restrictions.Therefore, packet need to be divided into multi-disc in network layer, make the length of its every a slice all be less than or equal to MTU.Correspondingly, after receiving packet, also need according to procotol the data fragmentation in the packet to be carried out IP fragmentation and reassembly in network layer.
In step 103, the packet behind the IP fragmentation and reassembly is carried out the restructuring of TCP stream.
In step 104, stream restructuring offers application layer with data and processes according to TCP.
Fig. 2 is the schematic diagram that the TCP of prior art connects.
As shown in Figure 2, whole TCP connects to be divided into and connects establishment stage (three-way handshake), data transfer phase and Connection Release stage (four times wave).
Client sends synchronizing sequence numbering (Synchronize Sequence Numbers, SYN) to service end, waits for the service end affirmation; Service end is received SYN, and backward client sends SYN and the confirmation signal ACK of oneself; After client is received the SYN+ACK of service end transmission, send confirmation signal ACK to service end; So finish three-way handshake, connect.
Connect after the foundation, begin mutual data transmission between client and the service end.
After client is finished its data transfer task, send the FIN signal to stop client to the transfer of data of service end to service end; Service end receives FIN, returns a confirmation signal ACK to client; Client receives that the affirmation signal that service end sends can not send data to service end afterwards again, and service end sends FIN to stop service end to the transfer of data of client to client after its data transfer task is finished; Client arrives after the FIN signal of service end transmission, sends ack signal to confirm that service end can not be again to the client transmissions data after receiving confirmation signal to service end; So finish 4-Way Handshake, the connection between client and the service end is terminated.
Fig. 3 is the flow chart according to the processing network application layer business datum of the embodiment of the invention.
In step 301, obtain packet by network from data link layer, be operated in data link layer such as device driver, network interface card etc.
In step 302, the packet that receives is filtered, filter out a packet on the direction.Can set up in advance simple rule in receiving terminal/service end, judge the direction of packet by the IP address information in the packet.Such as, the IP address of the originating end that comprises in certain packet does not belong to the IP address of service end, then this packet is considered as up direction, and for example the direction of this packet is from the client to the service end.As seen, according to the characteristic of some application layer business, can filter out upstream data or downlink data, the packet after the filtration is the one-way data bag.
In step 303, according to the three-way handshake sign in the one-way data bag one-way data bag is filtered, filter out the data that wherein contain the three-way handshake sign, connect the condition of setting up to relax TCP.
In step 304, the packet after filtering is carried out the IP fragmentation restructuring.The IP fragmentation restructuring is technology well-known to those skilled in the art, and sets forth to some extent in to the description of prior art, therefore repeats no more in order to avoid fuzzy the present invention.
In step 305, set up TCP according to the session maintenance condition of application layer and connect.Owing in step 303, removed the data that contain the three-way handshake sign, therefore in TCP establishment of connection process, need not carry out again the three-way handshake inspection, the session maintenance condition that only needs to rely on application layer creates connection.
In step 306, based on the TCP connection packet behind the IP fragmentation and reassembly is carried out the restructuring of TCP stream, carry out subsequent treatment in order to transfer to application layer.
In step 307, disconnect TCP and connect, owing in step 303, having removed the data that contain the three-way handshake sign, therefore set up in the connection of TCP stream and need not carry out again in the process waving for four times checking, only need carry out the unidirectional inspection of waving and get final product.
Fig. 4 is the flow chart according to the TCP connection of the embodiment of the invention.
Fig. 5 is the schematic diagram according to the TCP connection of the embodiment of the invention.
Below, in conjunction with Fig. 4 and Fig. 5 the detailed process of recombinating according to the TCP stream of the embodiment of the invention is described.
In step 401, introduce application-level logic and create unidirectional connection.Owing in Packet Filtering, removed the data that contain the three-way handshake sign, can't rely on again the three-way handshake sign to come the service data state, do not create connection so do not re-use three-way handshake at this.Alternatively, create unidirectional connection according to application-level logic, namely create unidirectional connection in this session maintenance condition that depends on application layer.Further, if the packet behind the IP fragmentation and reassembly is the upstream data bag, then create the unidirectional connection from the client to the service end; Vice versa.As shown in Figure 5, after connecting foundation, just can carry out the one-way data transmission from the client to the service end.
In step 402, unidirectional connection is divided into more fine-grained session.Particularly, if there are a plurality of sessions in this connection, then this connection is subdivided into a plurality of sessions, each session can comprise a plurality of packets.Should be pointed out that it is a preferred step that unidirectional connection is divided into more fine-grained session, is not to realize that technical scheme of the present invention is necessary.
In step 403, the packet of selecting to belong to certain class session carries out the restructuring of TCP stream.TCP stream restructuring is with according to waiting mechanism, and the packet restructuring of unordered arrival is reduced to a complete TCP flow data.The restructuring of TCP stream is well-known to those skilled in the art, therefore repeats no more in order to avoid fuzzy the present invention.
Although be optional with link division for more fine-grained session, then by dividing and selecting restructuring, can adapt to better the business demand of application layer.Such as, in the situation of internet behavior management, if the application layer business only is concerned about user's internet behavior, then can carry out above-mentioned segmentation and can process the packet relevant with internet behavior; And if the application layer business also is concerned about user's internet content, then can carry out first above-mentioned division, again processing and internet behavior and internet content packet in the relevant session all.
In step 404, adopt the unidirectional unidirectional connection of end of waving to check.Because the TCP that sets up connects to be unidirectional connection and to have filtered out before data on the direction before, so adopt unidirectional waving to indicate that FIN finishes this connection.Can find out also that from Fig. 5 as long as service end receives the end signal FIN that client sends, service end will no longer receive the data that client sends, thereby finish the Connection Release stage.
Fig. 6 connects the schematic diagram of apparatus for establishing according to the embodiment of the invention based on the TCP of one-way data bag.
The packet acquisition module obtains packet by network from data link layer, is operated in data link layer such as device driver, network interface card etc.
The first filtering module filters the packet that receives, and filters out a packet on the direction.Can set up in advance simple rule in receiving terminal/service end, judge the direction of packet by the IP address information in the packet.Such as, the IP address of the originating end that comprises in certain packet does not belong to the IP address of service end, then this packet is considered as up direction, and for example the direction of this packet is from the client to the service end.As seen, according to the characteristic of some application layer business, can filter out upstream data or downlink data, the packet after the filtration is the one-way data bag.
The second filtering module filters the one-way data bag according to the three-way handshake sign in the one-way data bag, filters out the data that wherein contain the three-way handshake sign, connects the condition of setting up to relax TCP.
The IP fragmentation recombination module carries out the IP fragmentation restructuring to the packet after filtering.The IP fragmentation restructuring is technology well-known to those skilled in the art, and sets forth to some extent in to the description of prior art, therefore repeats no more in order to avoid fuzzy the present invention.
The TCP connection is set up module and is set up the TCP connection according to the session maintenance condition of application layer.Owing in the second filtering module, removed the data that contain the three-way handshake sign, therefore in TCP establishment of connection process, need not carry out again the three-way handshake inspection, the session maintenance condition that only needs to rely on application layer creates connection.Further, if the packet behind the IP fragmentation and reassembly is the upstream data bag, then create the unidirectional connection from the client to the service end; Vice versa.After connecting foundation, just can carry out the one-way data transmission from the client to the service end.
TCP stream recombination module carries out the restructuring of TCP stream based on the TCP connection to the packet behind the IP fragmentation and reassembly, carries out subsequent treatment in order to transfer to application layer.Should be pointed out that before the restructuring of TCP stream and unidirectional connection can also be divided into more fine-grained session.Particularly, if there are a plurality of sessions in this connection, then this connection is subdivided into a plurality of sessions, each session can comprise a plurality of packets.Should be pointed out that it is a preferred step that unidirectional connection is divided into more fine-grained session, is not to realize that technical scheme of the present invention is necessary.
Although be optional with link division for more fine-grained session, then by dividing and selecting restructuring, can adapt to better the business demand of application layer.Such as, in the situation of internet behavior management, if the application layer business only is concerned about user's internet behavior, then can carry out above-mentioned segmentation to process the packet in the session relevant with internet behavior; And if the application layer business also is concerned about user's internet content, then can not carry out above-mentioned division, i.e. processing and internet behavior and internet content be the packet in the relevant session all.
TCP connects disconnection module disconnection TCP and connects, and owing to removed the data that contain the three-way handshake sign in step 303, the connection of therefore flowing at TCP is set up and need not be carried out waving for four times inspection in the process again, only need carry out the unidirectional inspection of waving and get final product.Particularly, adopt unidirectional waving to indicate that FIN finishes unidirectional connection.In other words, as long as service end receives the end signal FIN that client sends, service end will no longer receive the data that client sends, thereby finish the Connection Release stage.
The professional should further recognize, unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein, can realize with electronic hardware, computer software or the combination of the two, for the interchangeability of hardware and software clearly is described, composition and the step of each example described in general manner according to function in the above description.These functions are carried out with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.The professional and technical personnel can specifically should be used for realizing described function with distinct methods to each, but this realization should not thought and exceeds scope of the present invention.
The method of describing in conjunction with embodiment disclosed herein or the step of algorithm can use the software module of hardware, processor execution, and perhaps the combination of the two is implemented.Software module can place the storage medium of any other form known in random asccess memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or the technical field.
Above-described embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is the specific embodiment of the present invention; the protection range that is not intended to limit the present invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (10)
1. the TCP based on the one-way data bag connects method for building up, comprising:
By the Network Capture packet;
Filter out a packet on the direction, obtain the first one-way data bag;
According to the three-way handshake sign in the described one-way data bag data filtering that will contain the three-way handshake sign in the described one-way data bag is fallen, obtain the second one-way data bag; And
Create the unidirectional TCP corresponding with described one-way data bag according to application-level logic and connect, in order to by described unidirectional connection described the second one-way data bag is transferred to application layer process.
2. method according to claim 1 also comprises:
Finish described unidirectional connection with the unidirectional inspection of waving.
3. method according to claim 1 also comprises:
Described the second one-way data bag is carried out the IP fragmentation restructuring.
4. method according to claim 1 also comprises:
After described unidirectional TCP connects foundation, described the second one-way data bag is carried out the restructuring of TCP stream.
5. method according to claim 1 also comprises:
Be a plurality of sessions with described unidirectional TCP link division, comprise one or more packets in each session;
Carry out the restructuring of TCP stream according to the packet in the one or more sessions of predefine rules selection.
6. method according to claim 2 wherein, describedly unidirectionally waves to check to be to check whether to receive a TCP FIN sign on the direction, if receive described TCP FIN sign, then finish described unidirectional connection.
7. method according to claim 1, wherein, a described direction is data uplink direction or data downstream direction.
8. method according to claim 1, wherein, described application-level logic is that condition is safeguarded in the session of application layer.
9. the TCP based on the one-way data bag connects apparatus for establishing, comprising:
The packet acquisition module is used for by the Network Capture packet;
The first filtering module is used for filtering out a packet on the direction, obtains the first one-way data bag;
The second filtering module is used for according to the three-way handshake sign of described one-way data bag the data filtering that will contain the three-way handshake sign in the described one-way data bag being fallen, and obtains the second one-way data bag; And
Module is set up in the TCP connection, is used for creating the unidirectional TCP corresponding with described one-way data bag according to application-level logic and connects, in order to by described unidirectional connection described the second one-way data bag is transferred to application layer process.
10. a server comprises that the TCP based on the one-way data bag as claimed in claim 9 connects apparatus for establishing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210587551.3A CN103067394B (en) | 2013-02-07 | 2013-02-07 | A kind of TCP connection establishment method and device based on one-way data bag |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210587551.3A CN103067394B (en) | 2013-02-07 | 2013-02-07 | A kind of TCP connection establishment method and device based on one-way data bag |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103067394A true CN103067394A (en) | 2013-04-24 |
CN103067394B CN103067394B (en) | 2016-11-09 |
Family
ID=48109856
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210587551.3A Active CN103067394B (en) | 2013-02-07 | 2013-02-07 | A kind of TCP connection establishment method and device based on one-way data bag |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103067394B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106911707A (en) * | 2017-03-15 | 2017-06-30 | 中国科学技术大学 | The transfer control method and system of a kind of two-way decoupling |
CN108259475A (en) * | 2016-12-29 | 2018-07-06 | 西普霍特公司 | The system and method for handling the grouping in transmission control protocol session |
CN110830325A (en) * | 2019-11-05 | 2020-02-21 | 北京云杉世纪网络科技有限公司 | Adaptive network bypass path network flow direction speculation method and system |
-
2013
- 2013-02-07 CN CN201210587551.3A patent/CN103067394B/en active Active
Non-Patent Citations (2)
Title |
---|
INFORMATION SCIENCES INSTITUTE: "RFC:793 TRANSMISSION CONTROL PROTOCOL", 《IEEE》 * |
J.POSTEL: "User Datagram Protocol", 《IEEE》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108259475A (en) * | 2016-12-29 | 2018-07-06 | 西普霍特公司 | The system and method for handling the grouping in transmission control protocol session |
CN108259475B (en) * | 2016-12-29 | 2021-04-06 | 西普霍特公司 | System and method for processing packets in a transmission control protocol session |
CN106911707A (en) * | 2017-03-15 | 2017-06-30 | 中国科学技术大学 | The transfer control method and system of a kind of two-way decoupling |
CN106911707B (en) * | 2017-03-15 | 2020-01-03 | 中国科学技术大学 | Bidirectional decoupling transmission control method and system |
CN110830325A (en) * | 2019-11-05 | 2020-02-21 | 北京云杉世纪网络科技有限公司 | Adaptive network bypass path network flow direction speculation method and system |
CN110830325B (en) * | 2019-11-05 | 2021-05-14 | 北京云杉世纪网络科技有限公司 | Adaptive network bypass path network flow direction speculation method and system |
Also Published As
Publication number | Publication date |
---|---|
CN103067394B (en) | 2016-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110121059A (en) | Monitor video processing method, device and storage medium | |
CN101997916B (en) | Method and device for file transmission based on network | |
CN103931162B (en) | The method and the network equipment of processing business | |
CN104066110A (en) | Wireless router stability testing system and method | |
CN108616334A (en) | Message transmitting method and device, system, storage medium, electronic device | |
CN107919947A (en) | A kind of coding method of CAN bus long message transmission | |
CN106656838A (en) | Data flow analyzing method and system | |
CN108243343B (en) | A kind of point distribution statistical method and its server based on view networking | |
CN108989837A (en) | A kind of method and apparatus of picture interception | |
CN108924609A (en) | Method, electronic equipment, device and the storage medium of transmission of flow media data | |
CN108664316A (en) | A kind of method and apparatus for the interface message obtaining API | |
CN104270344A (en) | Quintillion gatekeeper | |
CN109302642A (en) | Collecting method and device | |
CN110049341A (en) | Method for processing video frequency and device | |
CN103067394A (en) | Transmission control protocol (TCP) connecting establishment method and establishment device based on one-way data package | |
CN110120854A (en) | The method and apparatus for transmitting data | |
CN110062295A (en) | A kind of file resource acquisition methods and system | |
CN110191304A (en) | Data processing method, device and storage medium | |
CN109995664A (en) | A kind of method, apparatus and system sending data flow | |
CN109639592B (en) | Rapid data analysis method and device based on ten-gigabit traffic | |
CN107566218A (en) | A kind of flux auditing method suitable for cloud environment | |
CN107451092A (en) | A kind of data transmission system based on IB networks | |
CN104283741B (en) | The method and device of the accurate big stream aging of detection | |
CN102315981B (en) | Equipment and method for testing evolved packet core network equipment | |
CN105245464A (en) | Network acceleration method based on Android system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |