Movatterモバイル変換


[0]ホーム

URL:


CN103607311B - System and method for reestablishing TCP connection seamlessly - Google Patents

System and method for reestablishing TCP connection seamlessly
Download PDF

Info

Publication number
CN103607311B
CN103607311BCN201310629375.XACN201310629375ACN103607311BCN 103607311 BCN103607311 BCN 103607311BCN 201310629375 ACN201310629375 ACN 201310629375ACN 103607311 BCN103607311 BCN 103607311B
Authority
CN
China
Prior art keywords
tcp
original
connects
connection
newly
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
CN201310629375.XA
Other languages
Chinese (zh)
Other versions
CN103607311A (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.)
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information Co 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 Xiamen Meiya Pico Information Co LtdfiledCriticalXiamen Meiya Pico Information Co Ltd
Priority to CN201310629375.XApriorityCriticalpatent/CN103607311B/en
Publication of CN103607311ApublicationCriticalpatent/CN103607311A/en
Application grantedgrantedCritical
Publication of CN103607311BpublicationCriticalpatent/CN103607311B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The invention discloses a method for reestablishing TCP connection seamlessly. The method comprises the following steps: S1, a TCP client side determines original TCP connection which needs to be reestablished, and a connection reestablishment option is added into a TCP SYN message; S2, a TCP server side finds out the original TCP connection according to the connection reestablishment option, and reestablishes new TCP connection according to connection attributes of the original TCP connection; S3, when establishment of the new TCP connection is completed, the TCP client side and the TCP server side copy data in a transmitting cache and data in a receiving cache of the original TCP connection to a transmitting cache and a receiving cache of the new TCP connection correspondingly. The invention further discloses a system for reestablishing the TCP connection seamlessly.

Description

The system and method that a kind of seamless reconstruction tcp connects
Technical field
The present invention relates to the communications field, the system and method that more particularly, to a kind of seamless reconstruction tcp connects.
Background technology
Tcp (transmission control protocol) is transport layer protocol, and in tcp/ip network, tcp is shouldThere is provided reliable transmission channel with the application program of layer.
When situations below, application program needs to rebuild tcp connection: when 1, original tcp connects abnormal disconnection, applies journeySequence needs to create new tcp connection;2nd, when unstable networks lead to tcp to send data failure, tcp adopts exponential backoff mechanism weightNew send (when sending unsuccessfully, with exponential increase, e.g., interval time is followed successively by the time interval resending: 1 second, 2 seconds, 4Second, 8 seconds, 16 seconds, 32 seconds), when exponential backoff mechanism leads to network recovery, tcp connect data is activation can not recover in time (withAs a example the back off time of aforementioned hypothesis, if network recovered when the 16th second, due to exponential backoff mechanism, tcp data is activation needsWill by the 31st second when just can recover).
In prior art, mainly tcp is actively rebuild by application program and connect, make data transmit-receive faster recover normal.LogicalNormal processing mode is: during tcp disconnecting, return back to initial interface based on application program thereon, in being forced using processDisconnected, lead to the part operation having executed and process loss.This application program actively rebuilds tcp connection, and there are the following problems: shouldWhen rebuilding tcp connection with program, not sending successful data in original tcp Connection Cache can be dropped.Therefore, application programNeed to consider and solve the data loss problem leading to due to tcp connection reconstruction.
Content of the invention
When rebuilding tcp connection for solving application program in prior art, do not send successfully in original tcp Connection CacheData can be dropped, and lead to the part operation having executed and process the technological deficiency lost, and the present invention provides a kind of seamless heavyBuild the system and method for tcp connection.
One aspect of the present invention is:
There is provided a kind of method that seamless reconstruction tcp connects, including step: s1, tcp client determines what needs were rebuildOriginal tcp connects, and adds connection reconstruction option in tcp syn message, and described connection reconstruction option includes original tcp and connectsSource ip address and source port number and purpose ip address and destination slogan;S2, tcp service end finds according to the Reconstruction OptionOriginal tcp connects, and re-creates newly-built tcp connection according to the connection attribute that original tcp connects;S3, when newly-built tcp connect woundBuild when completing, tcp client each will be corresponding with the data in order caching for original tcp linkup transmit caching with tcp service endCopy in the transmission caching and order caching that newly-built tcp connects.
Another technical solution used in the present invention is:
There is provided the system that a kind of seamless reconstruction tcp connects, including tcp client and tcp service end, described tcp clientEnd includes the first connection reconstruction module, described tcp service end includes the second connection reconstruction module;Described first connection reconstruction moduleNeed the original tcp being rebuild to connect for determining, and add connection reconstruction option in tcp syn message, and be used forWhen newly-built tcp connection establishment completes, the data in original tcp linkup transmit caching and order caching is accordingly copied to newlyBuild in the transmission caching and order caching of tcp connection, wherein said connection reconstruction option includes the source ip address that original tcp connectsWith source port number and purpose ip address and destination slogan;Described second connection reconstruction module is used for being looked for according to the Reconstruction OptionConnect to original tcp, and newly-built tcp is re-created according to the connection attribute that original tcp connects and connect, and for when newly-builtWhen tcp connection establishment completes, the data in original tcp linkup transmit caching and order caching is accordingly copied to newly-built tcpIn the transmission caching and order caching that connect.
The invention has the beneficial effects as follows: when being different from the application program of prior art and rebuilding tcp and connect, original tcp connectsDo not send successful data in caching can be dropped, lead to the part operation having executed and process the technological deficiency lost,The present invention provides the system and method that a kind of seamless reconstruction tcp connects, when application program needs to rebuild tcp connection, by original tcpThere is no the data processing in linkup transmit and order caching, copy in newly-built tcp linkup transmit and order caching, tcp is evenAfter connecing reconstruction, application program can continue transceiving data in newly-built tcp connection, and original tcp does not have the number processing in connectingAccording to losing, make application program without the concern for and solve to rebuild the tcp data loss problem that leads to of connection.
Brief description
Fig. 1 is the execution flow chart of a kind of method that seamless reconstruction tcp connects in an embodiment of the present invention;
Fig. 2 is the schematic diagram increasing the Reconstruction Option under tcp syn message options option list;
Fig. 3 is that tcp client is realized rebuilding the interaction diagrams that tcp is connected with tcp service end.
Specific embodiment
By the technology contents of the detailed description present invention, structural feature, realized purpose and effect, below in conjunction with embodimentAnd coordinate accompanying drawing to be explained in detail.
Refer to Fig. 1, be the execution flow chart of a kind of method that seamless reconstruction tcp connects in an embodiment of the present invention.This is seamless to rebuild the method that tcp connects and includes step:
Step s1, tcp client determines needs the original tcp being rebuild to connect, and adds even in tcp syn messageConnect the Reconstruction Option, described connection reconstruction option includes source ip address and source port number and the purpose ip address that original tcp connectsAnd destination slogan.
Refer to Fig. 2, be the schematic diagram increasing the Reconstruction Option under tcp syn message options option list.tcpSyn message is first handshake packet of three-way handshake bag, and in tcp/ip agreement, tcp agreement provides reliable Connection Service, adoptsSet up a connection with three-way handshake:
Shake hands for the first time: when setting up connection, client sends syn bag (syn=j) and arrives server, and enters syn_sentState, waiting for server confirms, syn is synchronizing sequence numbering (synchronize sequence numbers).Hold for the second timeHand: server receives syn bag it is necessary to confirm the syn (ack=j+1) of client, oneself also sends a syn bag (syn=simultaneouslyK), i.e. syn+ack bag, now server enter syn_recv state.Third time is shaken hands: client receives the syn+ of serverAck bag, sends to server and confirms bag ack (ack=k+1), and this bag is sent, and client and server entersEstablished state.After completing above-mentioned three-way handshake, client and server start to transmit data.
Step s2, tcp service end finds original tcp according to the Reconstruction Option and connects, and the connection being connected according to original tcp belongs toProperty re-create newly-built tcp and connect.
Step s3, when newly-built tcp connects establishment and completes, original tcp is each connected by tcp client and tcp service endSend the data in caching and order caching accordingly to copy in the transmission caching and order caching that newly-built tcp connects.
In the present embodiment, described step s1 specifically includes:
Step s11, determination need the original tcp being rebuild to connect;
The connection attribute that step s12, the original tcp of reading connect, described connection attribute includes tcp source ip address, tcp purposeIp address, tcp source port number, tcp destination slogan, original sequence number and original confirmation number;
The sequence number that step s13, the newly-built tcp of initialization connect and confirmation number are respectively a First ray number and the first confirmationNumber, then initiate newly-built tcp connection request to tcp service end.
In the present embodiment, described step s2 specifically includes:
Step s21, when receiving newly-built tcp connection request, tcp service end judge tcp syn message whether there is weightBuild option;
Step s22, when judge tcp syn message there is the Reconstruction Option when, found former according to the field in the Reconstruction OptionThere is tcp to connect, obtain the connection attribute that this original tcp connects, connected according to the newly-built tcp of connection attribute setting that original tcp connectsConnect attribute, wherein, sequence number=original sequence number -1 that newly-built tcp connects, confirmation number=original confirmation that newly-built tcp connectsNumber -1.
It is described in detail with reference to the method that a specific implementation step connects to above-mentioned seamless reconstruction tcp.Please joinRead Fig. 3, be that tcp client is realized rebuilding the interaction diagrams that tcp is connected with tcp service end.Tcp client and tcp service endThe interaction realizing rebuilding tcp connection comprises the steps:
(1) tcp client determines needs the tcp rebuilding to connect;
(2) tcp client reads the connection attribute that original tcp connects;
(3) connection attribute of the newly-built connection of tcp client initialization;
(4) tcp client initiates the request of the tcp syn with the Reconstruction Option;
(5) tcp service end carries out port snoop;
(6) tcp service end receives the request of the tcp syn with the Reconstruction Option;
(7) find original tcp according to the Reconstruction Option to connect;
(8) tcp service end reads the connection attribute that original tcp connects;
(9) tcp service end initializes the connection attribute of newly-built connection;
(10) tcp service end sends tcp syn+ack response message;
(11) tcp client receives tcp syn+ack response message;
(12) tcp client sends tcp ack response message, then respectively enters step (13) and step (15);
(13) original tcp connection data duplication is connected by tcp client to newly-built tcp;
(14) the normal transceiving data of tcp client.
(15) tcp service end receives tcp ack response message;
(16) original tcp connection data duplication is connected by tcp service end to newly-built tcp;
(17) the normal transceiving data of tcp service end.
Another aspect of the present invention provides the system that a kind of seamless reconstruction tcp connects, the side that above-mentioned seamless reconstruction tcp connectsMethod is applied in this system.The system of reconstruction tcp connection that this is seamless includes tcp client and tcp service end.Described tcp visitorFamily end includes the first connection reconstruction module, described tcp service end includes the second connection reconstruction module.
Described first connection reconstruction module is used for determining needs the original tcp being rebuild to connect, and in tcp syn messageMiddle interpolation connection reconstruction option, when newly-built tcp connection establishment completes, by original tcp linkup transmit caching and order cachingData accordingly copy in the transmission caching and order caching that newly-built tcp connects, wherein, described connection reconstruction option includesSource ip address and source port number and purpose ip address and destination slogan that original tcp connects.
Described second connection reconstruction module is used for finding original tcp connection according to the Reconstruction Option, and is connected according to original tcpConnection attribute re-create newly-built tcp and connect, and for when newly-built tcp connects establishment and completes, original tcp being connected and sending outThe data in caching and order caching is sent accordingly to copy in the transmission caching and order caching that newly-built tcp connects.
In the present embodiment, described first connection reconstruction module specifically includes determining module, read module, asks modulusBlock, the first replication module.
Determining module is used for determining needs the original tcp being rebuild to connect.Read module is used for reading original tcp connectionConnection attribute, described connection attribute includes tcp source ip address, the ip address of tcp mesh, tcp source port number, tcp destination interfaceNumber, original sequence number and original confirmation number.Request module is used for initializing the sequence number of newly-built tcp connection and confirmation number is respectivelyFirst ray number and confirmation No. the first, then initiate newly-built tcp connection request to tcp service end.
In the present embodiment, described second connection reconstruction module specifically includes judge module, setup module, the second duplicationModule.Judge module is used for, when tcp service end receives newly-built tcp connection request, judging that tcp syn message whether there is weightBuild option.Setup module is used for when described judge module judges that tcp syn message has the Reconstruction Option, according in the Reconstruction OptionField find original tcp and connect, obtain the connection attribute that this original tcp connects, the connection attribute connecting according to original tcpNewly-built tcp connection attribute is set, wherein, sequence number=original sequence number -1 that newly-built tcp connects, the confirmation that newly-built tcp connectsNumber=original confirmation number -1.
Described first replication module and the second replication module are respectively used to when newly-built tcp connection establishment completes, by tcp visitorData in family end and tcp service end original tcp linkup transmit caching and order caching accordingly copies to what newly-built tcp connectedSend in caching and order caching.
The invention has the beneficial effects as follows: when being different from the application program of prior art and rebuilding tcp and connect, original tcp connectsDo not send successful data in caching can be dropped, lead to the part operation having executed and process the technological deficiency lost,The present invention provides the system and method that a kind of seamless reconstruction tcp connects, when application program needs to rebuild tcp connection, by original tcpThere is no the data processing in linkup transmit and order caching, copy in newly-built tcp linkup transmit and order caching, tcp is evenAfter connecing reconstruction, application program can continue transceiving data in newly-built tcp connection, and original tcp does not have the number processing in connectingAccording to losing, make application program without the concern for and solve to rebuild the tcp data loss problem that leads to of connection.
The foregoing is only embodiments of the invention, not thereby limit the present invention the scope of the claims, every using thisEquivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skillsArt field, is included within the scope of the present invention.

Claims (4)

S1, tcp client determines needs the original tcp being rebuild to connect;Read the connection attribute that original tcp connects, describedConnection attribute include tcp source ip address, the ip address of tcp mesh, tcp source port number, tcp destination slogan, original sequence number andOriginal confirmation number;Initialize sequence number and confirmation number respectively original sequence number -1 and the original confirmation number -1 that newly-built tcp connects,Then initiate the request of the tcp with the Reconstruction Option to tcp service end, and add connection reconstruction option in tcp syn message, describedConnection reconstruction option includes original tcp source ip address of tcp connection and the ip address of tcp source port number and tcp mesh and tcpDestination slogan;
First replication module, for when newly-built tcp connect establishment complete when, by original for tcp client tcp linkup transmit caching andData in order caching accordingly copies in the transmission caching and order caching that newly-built tcp connects;Described second connects weightModeling block is used for finding original tcp connection according to the field in the Reconstruction Option, obtains the connection attribute that this original tcp connects,Newly-built tcp connection attribute is arranged according to the connection attribute that original tcp connects, wherein, sequence number=original sequence that newly-built tcp connectsRow number -1, the confirmation number that newly-built tcp connects=original confirmation number -1;And it is used for when newly-built tcp connection establishment completes, will be formerThe data in tcp linkup transmit caching and order caching is had accordingly to copy to the transmission caching of newly-built tcp connection and receive slowIn depositing.
CN201310629375.XA2013-11-292013-11-29System and method for reestablishing TCP connection seamlesslyActiveCN103607311B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201310629375.XACN103607311B (en)2013-11-292013-11-29System and method for reestablishing TCP connection seamlessly

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201310629375.XACN103607311B (en)2013-11-292013-11-29System and method for reestablishing TCP connection seamlessly

Publications (2)

Publication NumberPublication Date
CN103607311A CN103607311A (en)2014-02-26
CN103607311Btrue CN103607311B (en)2017-01-18

Family

ID=50125512

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201310629375.XAActiveCN103607311B (en)2013-11-292013-11-29System and method for reestablishing TCP connection seamlessly

Country Status (1)

CountryLink
CN (1)CN103607311B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107026783B (en)*2016-01-312019-12-13格尔软件股份有限公司Quick reconnection method suitable for virtual private network
CN107172572B (en)*2017-04-252018-07-31西安梦贝智能科技有限公司Virtual connections method based on low-power consumption bluetooth and the wireless charging agreement using this method
CN108306828A (en)*2018-01-242018-07-20广东睿江云计算股份有限公司A kind of method and device optimizing TCP connection using congestion control data list
CN109729104B (en)*2019-03-192021-08-17北京百度网讯科技有限公司 Client source address acquisition method, apparatus, server, and computer-readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1588910A (en)*2004-08-102005-03-02毛德操Method for directly routing of out bound moving node flow in internet
CN1965532A (en)*2004-04-302007-05-16国际商业机器公司Method and apparatus for group communication with end-to-end reliability
CN101369973A (en)*2008-10-202009-02-18成都市华为赛门铁克科技有限公司Method and device for conversation aging
CN101827111A (en)*2010-05-122010-09-08中兴通讯股份有限公司TCP (Transfer Control Protocol) linking method, network system, client end and server
CN102014005A (en)*2010-12-172011-04-13天津曙光计算机产业有限公司Method for implementing TCP connection management by using multistage memory searching mode
CN102868754A (en)*2012-09-262013-01-09北京联创信安科技有限公司High-availability method, node device and system for achieving cluster storage

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1965532A (en)*2004-04-302007-05-16国际商业机器公司Method and apparatus for group communication with end-to-end reliability
CN1588910A (en)*2004-08-102005-03-02毛德操Method for directly routing of out bound moving node flow in internet
CN101369973A (en)*2008-10-202009-02-18成都市华为赛门铁克科技有限公司Method and device for conversation aging
CN101827111A (en)*2010-05-122010-09-08中兴通讯股份有限公司TCP (Transfer Control Protocol) linking method, network system, client end and server
CN102014005A (en)*2010-12-172011-04-13天津曙光计算机产业有限公司Method for implementing TCP connection management by using multistage memory searching mode
CN102868754A (en)*2012-09-262013-01-09北京联创信安科技有限公司High-availability method, node device and system for achieving cluster storage

Also Published As

Publication numberPublication date
CN103607311A (en)2014-02-26

Similar Documents

PublicationPublication DateTitle
US20080294784A1 (en)Method for Synchronizing Connection State in Data Communication, and Communication Node Using the Same
CN112039884B (en)Application method of quick interconnection protocol QUIC in distributed database system
US20080159325A1 (en)System and method for tcp high availability
CN101651706A (en)Method, system and device for sending and receiving data
CN101536417A (en)Method for eliminating redundant connections
CN103338118B (en)A kind of communication network method of attachment and device
CN103607311B (en)System and method for reestablishing TCP connection seamlessly
CN103354560B (en)Method and system for data decomposition and synchronization
CN101425977A (en)Air-ground data communication control system
WO2021147793A1 (en)Data processing method, apparatus and system, electronic device and computer storage medium
WO2023046088A1 (en)End-to-end system solution method applied to audio and video data transmission
CN105391536A (en)Communication method and device between client end and service end
CN103973414A (en)Data transmission method and device
CN105808374A (en)Snapshot processing method and associated equipment
CN105978796A (en)Message communication method and system based on unstable mobile network
CN110753035B (en) An ultra-low latency communication transmission method for FPGA based on TCP protocol
CN103685398A (en)Communication connection establishment method and communication system
WO2016106780A1 (en)User data transmission method and apparatus and terminal
US9992309B2 (en)Communication device and communication method
CN107277163B (en) Device remote mapping method and device
CN105227276A (en) A method of peer-to-peer network data transmission based on UDT
CN103780683A (en)Method for virtual machine online migration between XIA islands
JP7128288B2 (en) Point-to-point database synchronization over transport protocol
CN105721395B (en)Data synchronous configuration method, equipment and system
CN101510901B (en)Communication method, communication apparatus and system between distributed equipment

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp