Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAshaman73

Posted 15 May 2013 - 05:27 AM

Take a look at the following scenario:

 

client A at local network 192.168.1.1:8080

client B at same local network 192.168.1.2:8080

behind global NAT 2.2.2.2

and

server at global network 1.1.1.1:9000

 

now A and B send requests to server and getting the following public endpoint:

client A: 2.2.2.2:9000

client B: 2.2.2.2:9001

 

The problem is, if client A tries to contact client B by 2.2.2.2:9001 it would send a message through the router to itself, which will most likely not work. In this case it just needs to use its local (aka private) endpoint (192.168.1.2:8080) to contact it. Therefor you send requests to both, private (if behind the same NAT) and public (if behind other NAT).


#1Ashaman73

Posted 15 May 2013 - 05:23 AM

Take a look at the following scenario:

 

client A at local network 192.168.1.1:8080

client B at same local network 192.168.1.2:8080

server at global network 1.1.1.1:9000

 

now A and B send requests to server and getting the following public endpoint:

client A: 2.2.2.2:9000

client B: 2.2.2.2:9001

 

The problem is, if client A tries to contact client B by 2.2.2.2:9001 it would send a message through the router to itself, which will most likely not work. In this case it just needs to use its local (aka private) endpoint (192.168.1.2:8080) to contact it. Therefor you send requests to both, private (if behind the same NAT) and public (if behind other NAT).


PARTNERS