Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does peer2peer work through a router?

How does one PC connect to another over the internet to another PC?

An example would be a program listening for connections on PC 1. PC 1 sits behind Router 1. PC 2 has a client program trying to connect to PC 1.

What is the correct technology/technique to use as the listening program in this situation?

like image 627
BeerHugger Avatar asked Feb 22 '09 18:02

BeerHugger


2 Answers

This article by Brian Ford explains how peer to peer communication across NATs work.

Most routers also expose a Universal Plug and Play interface (uPnP) which can be used for port forwarding and NAT traversal.

You should also check out the STUNT library which is an easy to use NAT traversal library.

like image 177
Brian R. Bondy Avatar answered Sep 22 '22 07:09

Brian R. Bondy


You may want to read up on NAT Traversal. NAT traversal is a general term for techniques that establish and maintain TCP/IP network connections traversing network address translation (NAT) gateways.

like image 25
David Segonds Avatar answered Sep 21 '22 07:09

David Segonds