Re: UDP hole punching P2p
Its Done .............problem was due to NAT mapping .
Re: UDP hole punching P2p
hi lok.vikram
i am also trying to implement the UDP Hole punching behind the NAT but it's not happening.I think i am also facing same problem.Will you please share with us what was the problem in NAT and how u overcome it
Re: UDP hole punching P2p
I don know how you are implementing it.Do you have rendvous server or not.it is mandatory for NAt punching.
client 1
1. create a listener thread which will listen to a port say 40000.
2. use same port to connect with the other peer.
client 2
1. create a listener thread which will listen to a port say 30000.
2. use same port to connect with the other peer.
step 2 in both client should happen simultaneously
rdv server
which will exchange the IP address to two peer trying to connect.
I wanted to know how you are implementing it.
Best of luck
Re: UDP hole punching P2p
hi lok.vikram
Thanks for u r reply.
I am doing same what u told here.
Please Clear me the following point.
1. Client 1 And Client 2 both has Public IP and Public Port. Will the public port and private port may differ when they communicating with server ??? For say Client 1 public port 4000 and private port 3000 . if yes then client 1 , which port will use to listen and which port for use for connect ???
2. Rendezvous server will only exchange the client 1 and client 2 's public and private IP and port and while try to connect p2p we use the same port which already used for communicate to Rendezvous server. Am i missing anything about Rendezvous server ???
I have a request, if u give me the mail id i can send u the code ...
My mail id [email protected].
Please help me.....
Re: UDP hole punching P2p
Hi lok.vikram
"Its Done .............problem was due to NAT mapping"
Please share with us what was the problem was due to NAT mapping ???
Re: UDP hole punching P2p
1. Client 1 And Client 2 both has Public IP and Public Port. Will the public port and private port may differ when they communicating with server ??? For say Client 1 public port 4000 and private port 3000 . if yes then client 1 , which port will use to listen and which port for use for connect ???
Note:while connecting P2P donot use private address for time being later you can add private address for p2p.my suggestion is based based on public address for time being.
ans:Yes public and private port may differ since NAT is involved. here 3000(local port) is mapped to 4000(public port) by NAT.you need to listen to local port only .
client Create udp sockey say m_Sock not need to bind local address if you are using public address.use this socket to connect with server.
create a listener thread where use m_Sock in select() (in C++ ) to listen for incoming mesage from server or p2p client.
then connect the other P2P client(use public address and port) using same m_Sock.same need to repeated in other client as well.
2. Rendezvous server will only exchange the client 1 and client 2 's public and private IP and port and while try to connect p2p we use the same port which already used for communicate to Rendezvous server. Am i missing anything about Rendezvous server ???
Ans:Correct you need to use same port for P2P.
I have a request, if u give me the mail id i can send u the code ...
My mail id [email protected].
Please help me.....[/QUOTE]
Re: UDP hole punching P2p
I have a really stupid question.
How would i go about creating a rendevouz server or is there an open source one out there like for linux i can use for my middle man? I think this is what im needing to accomplish my goal of creating my own teamviewer/logmein
Re: UDP hole punching P2p
The "hole punching" technique is described in the excellent paper "Peer-to-Peer Communication Across Network Address Translators" by Bryan Ford, Pyda Srisuresh, Dan Kegel at http://www.brynosaurus.com/pub/net/p2pnat/ . Bryan Ford's site (at http://midcom-p2p.sourceforge.net/ ) includes a link to source code for "hole punching".
Mike