Confusion about a stunning server

What I need, I will open a server UDPthat listens on a port X(local computer), or machine(public IP)can send me a packet UDP. My car doesn’t public IP. In principle, I need stun.

I am testing a stuntmanserver / client project . I am running stuntman-server on a server (public ip). Run the client on my system (local ip). I asked for the associated ip / port for the port 9999.

./stunclient --mode full --protocol udp --localport 9999 stun.server.ip

The stun server returns the IP address and port. Then I opened the server UDP(using java) on my local system and started listening on the port 9999and sent a message UDPfrom other machine (which has public IP)to mapped IP/portreturned by the stun server. But I can not get any data. You can assume that my server / client code (written in java) works fine on the local network.

Flow:

My machine ->>>>>stun request for 9999 port and my ip ------> stun server
My machine <<<<<<<<<<<<<<<<<<mapped ip/port <<<<<<<<<<<<<<<  stun server
My machine : Run JAVA udp server socket in 9999 port

My machine  <<<<<<<<<<<<<<<<<<<UDP message to mapped ip/port<<<<<< other public machine 
            xxxxxxxxxxxxxxxxxxxNot workingxxxxxxxxxxxxxxxxxxxxxxxx
+4
source share
1 answer

You did not publish the results of your run stunclient, but I think it looked something like this:

$ stunclient --mode full --localport 9999 stun.stunprotocol.org
Binding test: success
Local address: 192.168.1.8:9999
Mapped address: 1.2.3.4:9999
Behavior test: success
Nat behavior: Endpoint Independent Mapping
Filtering test: success
Nat filtering: Address and Port Dependent Filtering

, "Endpoint Independent", Filtering "Address and Port Dependent", , . ( "NAT " ).

, STUN. IP- 1.2.3.4. , , (9999) .

NAT , ​​:

------------------------------------------------------------------------------------
||     LOCAL IP    | LOCAL PORT ||  EXT PORT    ||   REMOTE IP      | REMOTE PORT ||
||================================================================================||
||   192.168.1.8   | 9999       ||  9999        ||  107.23.150.92   | 3478        ||
------------------------------------------------------------------------------------

9999 (107.23.150.92), NAT . NAT/ , . IP- STUN, NAT NAT "remote" .

" ", , . , IP- 2.4.6.8, 8888. NAT , 2.4.6.8:8888 NAT. , NAT , , NAT , . NAT-, "Cone NAT", , .

. STUN (9999) ( ), . , NAT

------------------------------------------------------------------------------------
||     LOCAL IP    | LOCAL PORT ||  EXT PORT    ||   REMOTE IP      | REMOTE PORT ||
||================================================================================||
||   192.168.1.8   | 9999       ||  9999        ||  107.23.150.92   | 3478        ||
||   192.168.1.8   | 9999       ||  9999        ||  2.4.6.8         | 8888        ||
------------------------------------------------------------------------------------

1- 2.4.6.8:8888 NAT NAT.

, :

My machine:9999 ---->[STUN BINDING REQUEST]--->stun server:3478

My machine:9999 <----[STUN BINDING RESPONSE mapped IP:port]<--- stun server:3478

My machine:9999 [Open socket on port 9999]

My machine:9999 ---->[1 byte datagram] -------> 'other:8888'

My machine:9999 <---- [UDP to public IP:port obtained in step 2]<----'other:8888'

, P2P STUN, . IP- . , , , .

, STUN. ( NAT) IP- , " ". , , . . RTSP , .

NAT- .

STUNTMAN. , . , . , STUN NAT.

+7

Source: https://habr.com/ru/post/1533905/


All Articles