BlitzMax UDP/TCP Hole Punching

BlitzMax Forums/BlitzMax Programming/BlitzMax UDP/TCP Hole Punching

jtfrench(Posted 2008) [#1]
Hi there,

Has anyone successfully implemented a NAT traversal solution that uses hole punching? I've been researching for a while now ways to allow two instances of a game to send files to each other directly (P2P file transfer). This, of course, has been made difficult due to NATs which map private IP addresses to global IPs that are shared with the world.

I read up on how to achieve this using UDP (and TCP) hole punching (article here) and it seems to make a lot of sense, though before I spend too much time trying to implement it, I wanted to see if anyone else had any success with it.

Finding a solution to this very common P2P problem would be a great asset for the BlitzMax community! Please let me know if you know of any tried-and-true solutions, or if you'd like to collaborate with me on writing/testing one from scratch.

-Jason

(P.S. I'm particularly interested in a TCP implementation of hole punching as I need to ensure that every packet of my file transmission arrives)


Retimer(Posted 2008) [#2]
Seems like all you're looking for is reliable UDP.

Some customization to enet source, or better yet, the use of RakNet (which is amazing, by the way) would give you what you're looking for.

I was always led to believe that tcp + nat punchthrough was nearly pointless as to how much more complicated it can be compared to udp + nat punchthrough. So why not use reliable udp and you have your nat punchthrough and tcp reliability.

Aside from what you're looking for, with r-udp it's also always nice to have a dynamic 'realiable' or 'not' switch to all your packets, and as far as i've seen, there is no downside to r-udp...it's no slower than tcp.