P2P - Project XIII

January 10, 2015
Peer to Peer (P2P)
For the purposes of Peer to Peer chat and E-VOIP calls Project XIII randomly grabs an internal and an
external tcp/ip port for UDP hole punching. A basic description of UDP hole punching can be found here:
http://en.wikipedia.org/wiki/UDP_hole_punching
Friend initiates P2P session by sending a
request to a friend.
Friend can accept or decline a P2P request
Friend
You
1.) Data Flow Hub (DFH)
Page 1
January 10, 2015
Peer to Peer (P2P)
2). UDP hole punching is used to create the connection
UDP Hole Punch
Once the P2P session has been agreed, each device chats
with the STUN server to figure out where the other IP address
is.
Firewall
Public Network
3.) STUN Server
Firewall opens a port
between the private network
and the public network
Public network
Firewall
Firewall opens a port
between the private network
and the public network
P2P
Firewall
P2P data
Firewall
P2P
You
Friend
4.) The STUN server tells each party where the other is. When your
device opens the communication with the STUN server a port on the
firewall is opened up. The STUN server passes this port address to the
other party. This is considered a ‘hole punch’. The other side can now
sends data directly to you (P2P). The devices have each asked for the
hole in the firewall to be opened. The packets between the devices
are always UDP packets. Some routers/firewalls do not support this
behavior.
Page 2
January 10, 2015
Peer to Peer (P2P)
Once communication has been established via the UDP hole
punch, data is now flowing between the devices
Encrypted Data
Project XIII:
Chat or
EVOIP
Encrypted Data
Project XIII:
Chat or
EVOIP
Internet
Local Socket
Server
Local Socket
Server
Firewall
UDP hole punch has opened
the needed ports on the
firewall
Firewall
UDP hole punch has opened
the needed ports on the
firewall
Page 3
January 10, 2015
Peer to Peer (P2P)
Here is a configuration with a VPN tunnel on one side. Certain ISPs are not providing
access to UDP hole punching. So we use a VPN tunnel to take care of that.
Project XIII:
Chat or
EVOIP
Project XIII:
Chat or
EVOIP
Encrypted Data
Encrypted Data
Internet
Local Socket
Server
Local Socket
Server
VPN Tunnel
Firewall
UDP hole punch has opened
the needed ports on the
firewall
Firewall
UDP hole punch has opened
the needed ports on the
firewall
Page 4