CN105516342B - A kind of P2P penetrates synchronous method and system - Google Patents

A kind of P2P penetrates synchronous method and system Download PDF

Info

Publication number
CN105516342B
CN105516342B CN201511026045.7A CN201511026045A CN105516342B CN 105516342 B CN105516342 B CN 105516342B CN 201511026045 A CN201511026045 A CN 201511026045A CN 105516342 B CN105516342 B CN 105516342B
Authority
CN
China
Prior art keywords
time
data packet
customer end
client
synchronous
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
CN201511026045.7A
Other languages
Chinese (zh)
Other versions
CN105516342A (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.)
Shenzhen Municipalization Communication Network Technology Co Ltd
Original Assignee
Shenzhen Municipalization Communication Network Technology 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 Shenzhen Municipalization Communication Network Technology Co Ltd filed Critical Shenzhen Municipalization Communication Network Technology Co Ltd
Priority to CN201511026045.7A priority Critical patent/CN105516342B/en
Publication of CN105516342A publication Critical patent/CN105516342A/en
Application granted granted Critical
Publication of CN105516342B publication Critical patent/CN105516342B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0016Arrangements for synchronising receiver with transmitter correction of synchronization errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal

Abstract

The present invention relates to network technique field, when by providing one kind including: that client sends data packet to public network server, the data packet includes the first sending time T1;After public network server receives the data packet, returned data packet is sent to client, the returned data packet includes sending time T1, the second sending time TN;When client receives returned data packet, record receives the receiving time T2 of returned data packet, and according to described sending time T1, TN and receiving time T2, calculates public network server prover time T=TN+ (T2-T1)/2;Client determines that synchronous time of break-through, the synchronous time of break-through are TP=T+N when exchanging the address NAT, and wherein N is client negotiation time;Client until synchronous time of break-through TP, client both sides initiate simultaneously P2P penetrate and etc. P2P penetrate synchronous method.It using this method can make that network can be initiated simultaneously between client to penetrate, so that promoting P2P penetrates the probability of success.

Description

A kind of P2P penetrates synchronous method and system
Technical field
The present invention relates to network technique fields, more particularly to a kind of P2P to penetrate synchronous method and system.
Background technique
It is afterwards or multiple that software client is located at NAT (Network Address Translation, network address translation) After NAT, establishes and be connected to the network with the server for being deployed in public network, to get the address NAT of oneself, handed over other clients Initiate P2P (peer-to-peer, referred to as Peer-To-Peer or P-2-P technology) after changing NAT IP, i.e., it is straight between two points on network Connect letter.This direct communication is that rate limitation, speed are not determined by the network transfer speeds between 2 points, and only according to Rely the computing capability and bandwidth of two points (participant) in network, rather than is all gathered in several less servers relying on On, this technology can mitigate the burden of server significantly.But due to the time of each client can not accomplish Millisecond when Between it is synchronous, therefore client is initiated after the opportunity that P2P is penetrated always has and first have, thus P2P is caused to penetrate probability of failure increasing.
Summary of the invention
The purpose of the present invention is to provide a kind of P2P to penetrate synchronous method, it is intended to solve existing P2P and penetrate probability of failure Larger problem.
In a first aspect, a kind of P2P penetrates synchronous method, method includes the following steps:
When client sends data packet to public network server, the data packet includes sending time T1;
After public network server receives the data packet, returned data packet is sent to client, the returned data packet includes Sending time T1, sending time TN;
When client receives returned data packet, record receives the receiving time T2 of returned data packet, and according to the transmission Time T1, TN and receiving time T2 calculate public network server prover time T=TN+ (T2-T1)/2;
Client determines that synchronous time of break-through, the synchronous time of break-through are TP=T+N when exchanging the address NAT, wherein N For client negotiation time;
Until synchronous time of break-through TP, client both sides initiate P2P simultaneously and penetrate client.
Further, the data packet further include: the local ip address of client and port.
Further, the returned data packet further include: the address NAT of client.
Second aspect, a kind of P2P penetrate synchronization system, the system comprises: client, public network server and exchange clothes Business device;The client is at least 2;
The client is used to send data packet to public network server, and the data packet includes the first sending time T1;
The public network server is described to return for sending returned data packet to the client after receiving the data packet Returning data packet includes the first sending time T1 and the second sending time TN;
When the client is also used to receive returned data packet, record receives the receiving time T2 of returned data packet, and root According to the first sending time T1 and the second sending time TN and receiving time T2, public network server prover time T is calculated =TN+ (T2-T1)/2;
The client is also used to determine that synchronous time of break-through, the synchronous time of break-through are TP=T+N, and wherein N is visitor Family end negotiation time;
The swap server exchanges the address NAT for client;
The client is also used to until synchronous time of break-through TP, and client both sides initiate P2P simultaneously and penetrate.
Further, the data packet further include: the local ip address of client and port.
Further, the returned data packet further include: the address NAT of client.
The utility model has the advantages that the present invention penetrates synchronous method by providing a kind of P2P, the described method comprises the following steps: client Hold to public network server send data packet when, the data packet includes sending time T1;Public network server receives the data packet Afterwards, returned data packet is sent to client, the returned data packet includes sending time T1, sending time TN;Client receives When returned data packet, record receives the receiving time T2 of returned data packet, and according to described sending time T1, TN and receiving time T2 calculates public network server prover time T=TN+ (T2-T1)/2;Client is determined to synchronize and be penetrated when exchanging the address NAT Time, the synchronous time of break-through are TP=T+N, and wherein N is client negotiation time;Client waits until synchronous time of break-through TP When, client both sides initiate P2P simultaneously and penetrate.It using this method can make that network can be initiated simultaneously between client to penetrate, from And it promotes P2P and penetrates the probability of success.
Detailed description of the invention
Fig. 1 is that the P2P that one embodiment of the invention provides penetrates synchronous method flow chart;
Fig. 2 is the structure chart that the P2P that one embodiment of the invention provides penetrates synchronization system.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawing and specific implementation Invention is further described in detail for mode.
The P2P that Fig. 1 shows the offer of this one embodiment of the invention penetrates synchronous method, method includes the following steps:
When S101, client send data packet to public network server, the data packet includes sending time T1.
In this step, start public network server and swap server, start P2P client, i.e. customer end A and client B includes the sending time T1 for sending data packet in data packet, simultaneously when wherein customer end A sends data packet to public network server It also further include local ip address and the port of client in data packet.
After S102, public network server receive the data packet, returned data packet, the returned data packet are sent to client Including sending time T1, sending time TN.
In this step, after customer end A sends data packet to public network server in public network server receiving step S101, to Customer end A sends returned data packet, and returned data packet includes sending time T1, sending time TN, while can also include client The address NAT at end.
When S103, client receive returned data packet, record receives the receiving time T2 of returned data packet, and according to described Sending time T1, TN and receiving time T2 calculate public network server prover time T=TN+ (T2-T1)/2.
In step, customer end A receives the returned data packet of public network server transmission, and record receives returned data packet Receiving time T2 sends the sending time T1 of data packet, public network server to client to public network server further according to customer end A A sends the sending time TN of returned data packet and the receiving time T2 of customer end A reception returned data packet, calculates public network service Device prover time T=TN+ (T2-T1)/2.
S104, client determine that synchronous time of break-through, the synchronous time of break-through are TP=T+N when exchanging the address NAT, Wherein N is client negotiation time.
In this step, client negotiates to determine that synchronous time of break-through, synchronous time of break-through are TP=T+N, and wherein N is visitor Family end negotiation time, for example, N are after 10 seconds, and the address NAT of synchronous time of break-through TP and oneself are sent to friendship by customer end A Server is changed, the address NAT of synchronous time of break-through TP and customer end A are sent to customer end B by swap server;Customer end B The address NAT of oneself is sent to swap server, the address NAT of customer end B is returned to customer end A again by swap server.
Until synchronous time of break-through TP, client both sides initiate P2P simultaneously and penetrate for S105, client.
In this step, customer end A, B are timed to synchronous time of break-through TP, and the time is to i.e. to the address other side client NAT P2P is initiated to penetrate.By calculating synchronous time of break-through, can make, which can initiate simultaneously network between client, is penetrated, to be promoted P2P penetrates the probability of success.
On the other hand, the present invention also provides a kind of P2P to penetrate synchronization system, which includes: client 21, public network clothes Business device 22 and swap server 23;Client 21 is at least 2;
Client 21 is used to send data packet to public network server, which includes the first sending time T1;
Public network server 22 is described to return for sending returned data packet to the client 21 after receiving the data packet Returning data packet includes the first sending time T1 and the second sending time TN;
When client 21 is also used to receive returned data packet, the receiving time T2 of record reception returned data packet, and according to The first sending time T1 and the second sending time TN and receiving time T2, calculates public network server prover time T= TN+(T2-T1)/2;
Client 21 is also used to determine that synchronous time of break-through, the synchronous time of break-through are TP=T+N, and wherein N is client Hold negotiation time;
Swap server 23 exchanges the address NAT for client;
Client 21 is also used to until synchronous time of break-through TP, and client both sides initiate P2P simultaneously and penetrate.
In system and previous embodiment in the present embodiment P2P penetrate synchronous method be based on the same inventive concept under two A aspect is in front described in detail method implementation process, so those skilled in the art can retouch according to aforementioned The structure and implementation process of the system being well understood in this implementation are stated, in order to illustrate the succinct of book, details are not described herein again.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.

Claims (6)

1. a kind of P2P penetrates synchronous method, which is characterized in that the described method comprises the following steps:
Customer end A sends data packet to public network server, and the data packet includes the first sending time T1;
After public network server receives the data packet, returned data packet is sent to customer end A, the returned data packet includes described First sending time T1 and the second sending time TN;
When customer end A receives returned data packet, record receives the receiving time T2 of returned data packet, and sends according to described first Time T1 and the second sending time TN and receiving time T2, calculates public network server prover time T=TN+ (T2-T1)/2;
Customer end A determines that synchronous time of break-through, the synchronous time of break-through are TP=T+ when exchanging the address NAT with customer end B N, wherein N is the negotiation time of customer end A and customer end B;
Customer end A with customer end B until synchronous time of break-through TP, initiate P2P with customer end B both sides simultaneously and penetrate by customer end A.
2. P2P according to claim 1 penetrates synchronous method, which is characterized in that the data packet further include: client Local ip address and port.
3. P2P according to claim 1 or 2 penetrates synchronous method, which is characterized in that the returned data packet further include: The address NAT of client.
4. a kind of P2P penetrates synchronization system, which is characterized in that the system comprises: client, public network server and exchange clothes Business device;The client is at least 2;The client includes at least customer end A and customer end B;
The customer end A is used to send data packet to public network server, and the data packet includes the first sending time T1;
The public network server is for sending returned data packet, the return number to the customer end A after receiving the data packet It include the first sending time T1 and the second sending time TN according to packet;
When the customer end A is also used to receive returned data packet, record receives the receiving time T2 of returned data packet, and according to institute The first sending time T1 and the second sending time TN and receiving time T2 is stated, public network server prover time T=TN+ is calculated (T2-T1)/2;
The customer end A is also used to determine that synchronous time of break-through, the synchronous time of break-through are TP=T+N with customer end B, wherein N is the negotiation time of customer end A and customer end B;
The swap server exchanges the address NAT with customer end B for customer end A;
The customer end A is also used to customer end B until synchronous time of break-through TP, and customer end A is sent out simultaneously with customer end B both sides P2P is played to penetrate.
5. P2P according to claim 4 penetrates synchronization system, which is characterized in that the data packet further include: client Local ip address and port.
6. P2P according to claim 4 or 5 penetrates synchronization system, which is characterized in that the returned data packet further include: The address NAT of client.
CN201511026045.7A 2015-12-30 2015-12-30 A kind of P2P penetrates synchronous method and system Active CN105516342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511026045.7A CN105516342B (en) 2015-12-30 2015-12-30 A kind of P2P penetrates synchronous method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511026045.7A CN105516342B (en) 2015-12-30 2015-12-30 A kind of P2P penetrates synchronous method and system

Publications (2)

Publication Number Publication Date
CN105516342A CN105516342A (en) 2016-04-20
CN105516342B true CN105516342B (en) 2019-02-22

Family

ID=55723972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511026045.7A Active CN105516342B (en) 2015-12-30 2015-12-30 A kind of P2P penetrates synchronous method and system

Country Status (1)

Country Link
CN (1) CN105516342B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547620B (en) * 2017-06-22 2021-06-22 新华三信息安全技术有限公司 Response time obtaining method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101374141A (en) * 2007-08-23 2009-02-25 浙江省电信有限公司 TCP NAT crossing method base on PCP protocol
CN101442492A (en) * 2008-12-26 2009-05-27 中国科学院计算技术研究所 Method and system for implementing NAT penetration in P2P network
CN102104476A (en) * 2011-02-21 2011-06-22 中兴通讯股份有限公司 Clock synchronization device and method
CN102404104A (en) * 2011-11-24 2012-04-04 中兴通讯股份有限公司 Self-adaptive synchronizing method and system based on different time delay mechanisms
CN102984289A (en) * 2007-07-27 2013-03-20 索尼电脑娱乐公司 NAT traversal for mobile network equipment
CN103138865A (en) * 2013-01-25 2013-06-05 杭州华三通信技术有限公司 Time synchronization method and time synchronization device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5298592B2 (en) * 2008-03-26 2013-09-25 日本電気株式会社 Time stamp packet communication system, time stamp packet transmitter, time stamp packet receiver

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984289A (en) * 2007-07-27 2013-03-20 索尼电脑娱乐公司 NAT traversal for mobile network equipment
CN101374141A (en) * 2007-08-23 2009-02-25 浙江省电信有限公司 TCP NAT crossing method base on PCP protocol
CN101442492A (en) * 2008-12-26 2009-05-27 中国科学院计算技术研究所 Method and system for implementing NAT penetration in P2P network
CN102104476A (en) * 2011-02-21 2011-06-22 中兴通讯股份有限公司 Clock synchronization device and method
CN102404104A (en) * 2011-11-24 2012-04-04 中兴通讯股份有限公司 Self-adaptive synchronizing method and system based on different time delay mechanisms
CN103138865A (en) * 2013-01-25 2013-06-05 杭州华三通信技术有限公司 Time synchronization method and time synchronization device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
IEEE1588v2时间同步原理及应用浅析;陈苏 等;《高速铁路技术》;20150630;第6卷(第3期);全文
基于NAT穿透P2P即时通讯系统的设计与实现;张静颐 等;《电子设计工程》;20110430;第19卷(第7期);全文

Also Published As

Publication number Publication date
CN105516342A (en) 2016-04-20

Similar Documents

Publication Publication Date Title
KR101354793B1 (en) Synchronizing media streams across multiple devices
EP2458782A1 (en) Method for multiplexing hot backup ports and network system thereof
CN102594672B (en) Method and system applicable to high-quality internet communication in low-reliability network environment
ATE302511T1 (en) SYNCHRONIZED TRANSPORT THROUGH NON-SYNCHRONOUS NETWORKS
WO2011071190A3 (en) Method and apparatus for establishing virtual private networks
CN105634714A (en) Cross-domain clock synchronization method, device thereof and cross-domain clock synchronization system
WO2010014912A3 (en) Methods, systems, and computer readable media for providing sedation service in a telecommunications network
CN102025594A (en) Dynamic route adjusting method and system under NAT environment
CN102035692A (en) Method and device for detecting quality of link
CN101834783A (en) Method and device for forwarding messages and network equipment
CN101291241A (en) Real-time audio and video meeting implementing method by browser combined with P2P transmission mode
CN103703453A (en) System for supplying push service for message load balancing and method thereof
CN102571575A (en) Session information creation method, device and system
EP2790441A3 (en) Methods and devices for improving session continuity
WO2009086199A3 (en) Method and system for managing the reception of messages in a communication network
CN103780483A (en) Method, system and device for obtaining resource information of terminal device of Internet of Thingss
CN105516342B (en) A kind of P2P penetrates synchronous method and system
CN102427452B (en) Synchronize (SYN) message transmitting method and device and network equipment
US20190296845A1 (en) Simplified synchronized ethernet implementation
CN102364935B (en) Audio and video transmission method of network conference and system thereof
CN104348731A (en) Community virtual network connection establishing method and network communication system
CN106534393B (en) Realize the method and system that NAT device passes through
Chirichella et al. Passive bufferbloat measurement exploiting transport layer information
CN105847458B (en) P2P caching guidance system and method based on DNS
CN100558053C (en) The method that the performance of communication for coordination system is measured

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant