Jump to content
  • Advertisement
Sign in to follow this  
peter_b

Questions about NAT punchtrough & p2p

This topic is 3960 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, i have some questions about NAT punchtrough & p2p. 1. (this is really about p2p) Does it work like this? Two peer's connect to a central server, which tell's both peer's about the other one's address. They both start sending "punchtrough" packets to the other one until one of the has been reached by the other one, hoping that the NAT machine will start remembering to forward the packets to the correct lan address. 2. What if the p2p server is hosted on a computer that has both a private lan behind it, and is also connected to the internet. Is it possible that its socket listens on two nic's at once? (is this possible?). In that case, what if one client is from the private lan, and one is from the internet, then the one on the internet would be sent a private lan address to it from the server (the address the server see's), it wont be able to connect to it. 3. Is NAT-punchtrough guaranteed to work if done properly? I have a hard time thinking it is with all the firewall rules and private lans that exist on the internet. Is a p2p solution even viable? I mean would you often find yourself in a seat where a client can connect to the server, but the punchtrough fails between some of the clients, so they will have to be disconnected. 4. (edit) On a sidenote! =] TCP-punchtrough.. is it possible? =] does NAT-gateways analyze the internal content of tcp-packets and make their forwarding decision based upon if the handshake is done properly, or would it be enough to have booth peer's call connect() in intervals to make the punch-trough, instead of like with udp, sending dummy packets? =] Thanks for any input. =] [Edited by - peter_b on February 7, 2008 1:21:07 AM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by peter_b
3. Is NAT-punchtrough guaranteed to work if done properly?


I always read the forum FAQ before asking questions, you should too. :) Not because I don't want to answer your question, but because it's faster for you and you'll get a more detailed answer.

The FAQ links to this excellent article by Hplus.

In a nutshell: No, not all routers implement it correctly and you'll find various degrees of brokeness on some routers.

Share this post


Link to post
Share on other sites
Quote:
1. (this is really about p2p) Does it work like this? Two peer's connect to a central server, which tell's both peer's about the other one's address. They both start sending "punchtrough" packets to the other one until one of the has been reached by the other one, hoping that the NAT machine will start remembering to forward the packets to the correct lan address.


I believe it works with 2 set of ports. A port thats meant to be and another a port thats observed by the central server. If they are the same, there are usually no problems. Yes Both send punch through packets at each other on both of those ports hoping it'll connect. Once a packet gets through to either of those peers, they are more or less connected.

ref: http://www.bford.info/pub/net/p2pnat/

Share this post


Link to post
Share on other sites
1) yes.
2) yes.
3) no, but it's likely.
4) it's possible using "simultaneous open," but not as well supported as udp.

And, of course, you get faster and better answers by reading the Forum FAQ.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!