Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've two private networks (each of them behind a typical dsl router). The routers are connected to the WWW. The extern interface of each router have one dynamic IP address. I want to stream data via UDP directly between one client in private network A and one client in private network B.

I've already tried a lot of things (see: http://en.wikipedia.org/wiki/UDP_hole_punching, or STUN). But it wasn't possible for me to transfer data between the two clients.

It's possible to use a server (located in the WWW, with static IP) to transfer the extern IPs (and extern ports) from the routers between the clients. So imagine client A knows client B's external IP and client B's external port assigned by his router.

I simply tried sending UDP packet to the receivers external IP/port combination, but without any result. So does anyone know what do to communicate via UDP throw the two NAT routers? It must be possible??? Or does Skype, for example, not directly communicate between the clients when the call eachother (voice over ip).

I am sorry for my bad English! If something is confusing don't mind asking me!!!

Thanks for your help in advance.

::::EDIT::::

I can't get pwnat or chownat working.
I tried it with my own dsl-gateway -> didn't work.

Then I set up a complete virtual environment using VMWare.

C1 (Client 1, WinXP Prof SP3): 172.16.16.100/24, GW 172.16.16.1
C2 (Client 2, WinXP Prof SP3): 10.0.0.100/24, GW 10.0.0.1
C3 (Client 3, WinXP Prof SP3): 3.0.0.2/24, GW 3.0.0.1
S1 (Ubuntu 10.04 x64 Server): eth0: 172.16.16.1/24, eth1: 1.0.0.2/24 GW 1.0.0.1
S2 (Ubuntu 10.04 x64 Server): eth0: 10.0.0.1/24, eth1: 2.0.0.2/24 GW 2.0.0.1
S3 (Ubuntu 10.04 x64 Server): eth0: 1.0.0.1/24, eth1: 2.0.0.1/24, eth2: 3.0.0.1/24

+--+     +--+     +--+     +--+     +--+  
|C1|-----|S1|-----|S3|-----|S2|-----|C2|  
+--+     +--+     +--+     +--+     +--+
                    |  
                  +--+  
                  |C3|  
                  +--+  

Server S1 and S2 provide NAT functionality. (they have routing enabled and provide a firewall, which allows trafic from the internal net and provide the nat functionality) Server S3 has routing enabled. The client firewalls are turned off.

C1 and C2 are able to ping C3, e.g. visit C3's webserver. They are also able to send UDP Packets to C3 (C3 successful receives them)!

C1 and C2 have also webservers running for test reasons.

I run ""chownat -s 80 2.0.0.2"" at C1, and ""chownat -c 8000 1.0.0.2"" at C2. Then I tried to access the Webpage from C1 via webbrower localhost at port 8000. It didn't work.

Can anybody help me? Any suggestions? If you have any questions to my question, please ask!

share|improve this question

migrated from stackoverflow.com Jul 16 '10 at 12:56

This question came from our site for professional and enthusiast programmers.

    
Why didn't STUN work? It's whole purpose is to do what you want to do. –  womble Aug 27 '11 at 4:53

3 Answers 3

For a simple windows based application you can try Logmein Hamachi.

For a more advanced solution for NAT to NAT connection udp/tcp look at pwnat.

share|improve this answer

solved... UDP Hole punching techniques work! It was an implementation error!

share|improve this answer
    
what did you use for the transfer (over UDP)? –  rogerdpack Sep 13 '11 at 18:48

Try any of:

  1. Setup your DSL gateways to forward received UDP packets on a particular port directly to the host in question

  2. Setup IPv6 tunnels on your internal nodes, then you'll be able to communicate directly

share|improve this answer
    
I have no access to configure the dsl gateways. –  youllknow Jul 21 '10 at 17:19
    
Then you cannot do it without some sort of external tunnel broker. –  MikeyB Jul 21 '10 at 19:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.