Direct TCP / IP Connections in P2P Applications

From Joel post on Copilot :

Direct connection! We always did everything we can to make sure that the Fog Creek Copilot can connect in any network situation, regardless of whether it is firewalls or NAT. to do this, both sides are outgoing connections to our server, which transmits traffic on their behalf. Well, in many cases this is not necessary. So version 2.0 does something pretty smart: it sets up the initial connection through our servers, so you get the right to connect with 100% reliability. But then as soon as you all connect, it is quiet, in the background, looking for a way to make a direct connection. If this fails, there is no big deal: you just continue relaying through our server. If you can make a direct peer-to-peer connection, it silently moves your data to a direct connection. You will not notice anything except probablymuch faster than communication.

How do they change the server’s connection to the P2P connection?

+3
source share
3 answers

It is quite complicated and interesting. I'm sure I have some details, but the overview is as follows:

Programs can already talk to each other through the Joel server so that they can exchange information with each other and with the Joel server. In addition, Joel has its own external IP addresses, and they provide information about their internal IP addresses.

They decide to try this hole punch technique. Computer A initiates a TCP connection with computer B using an external IP address B. It will not pass, but what it does tells the router that it needs to allow incoming packets from B on this port.

B , A, /ip, , B ( - , - , ).

B , B A IP, A B .

, , , , TCP-, NAT TCP . , .

-Adam

+9

, "" ", NAT" Cone" (Cone - ). 100% - , UDP 80% .

Hole Punching: STUN ( wikipedia)

+1

, , P2P.

- :

  • Machine1 .
  • Machine1 .
  • Machine1 .
  • Machine2 , .
  • Machine2 , Machine1.
  • Machine1 Machine2.

:

  • Disconnected connection to the servers of the copy machines.
  • Data is transferred instead of a direct (P2P) connection between two machines.
+1
source

All Articles