by hhthrowaway1230 on 1/5/25, 10:15 AM with 89 comments
by dennis-tra on 1/5/25, 1:15 PM
The tribal knowledge seems to be that you shouldn't do TCP-based hole punching because it's harder than UDP. The author acknowledges this:
> You can do NAT traversal with TCP, but it adds another layer of complexity to an already quite complex problem, and may even require kernel customizations depending on how deep you want to go.
However, I only see marginally added complexity (given the already complex UDP flows). IMO this complexity doesn't justify discarding TCP hole punching altogether. In the article you could replace raw UDP packets to initiate a connection with TCP SYN packets plus support for "simultaneous open" [0].
This is especially true if networks block UDP traffic which is also acknowledged:
> For example, we’ve observed that the UC Berkeley guest Wi-Fi blocks all outbound UDP except for DNS traffic.
My point is that many articles gloss over TCP hole punching with the excuse of being harder than UDP while I would argue that it's almost equally feasible with marginal added complexity.
[0] https://ttcplinux.sourceforge.net/documents/one/tcpstate/tcp...
by ocdnix on 1/5/25, 11:06 AM
by randunel on 1/5/25, 11:49 AM
GRE tunnels exist and I actually use them extensively, but UDP hole punching is not handled so hub-and-spoke architecture is needed for them, no peer to peer meshes with GRE (ip fou).
Are there equivalent libraries out there which do UDP hole punching and unencrypted GRE tunnels following an encrypted handshake to confirm identity?
by zerox7felf on 1/5/25, 12:33 PM
This is where I wish SIP lived up to its name (Session Initiation Protocol, i.e. any session, such as a VPN one...) and wasn't such a complicated mess making it not worth the hassle. I mean it was made to be the communication side-channel used for establishing p2p rtp streams.
by dfawcus on 1/5/25, 10:46 AM
Previous discussion:
(2022) https://news.ycombinator.com/item?id=30707711
(2020) https://news.ycombinator.com/item?id=24241105
by apitman on 1/5/25, 5:32 PM
This may be the only way we ever have to build p2p apps. IPv6 doesn't have enough steam since NAT and SNI routing solve most problems for most people.
And ISPs are very much not incentivized for that to change.
by Uptrenda on 1/5/25, 8:36 PM
It's a very good theoretical article. I wonder to what extent a software engineer could use this though. Because although it does describe many things I'm not sure there's enough detail to write algorithms for it. Like, could an engineer wrote an algorithm to test for different types of NATs on the basis of this article? Could they adapt their own hole punching code? I've personally read papers where simple tables were more useful than entire articles like this (as extensive as it is.) Maybe still a good starting point though.
Also, the last section in the article is extremely relevant. It has the potential to bypass symmetric NATs which are used in the mobile system. The latest research on NAT traversal uses similar techniques and claims near 100% success rates.
by vinay_ys on 1/5/25, 4:43 PM
by snthpy on 1/7/25, 6:37 AM
A read a bit about this space a few weeks ago after not knowing anything about it beforehand. My impression is that ip6 dices all of this and NAT traversal isn't necessary anymore. So why isn't ip6 more popular and how do I get started with it for my home network and tailscale VPN?
by yyyfb on 1/6/25, 2:10 PM
by binary132 on 1/5/25, 3:29 PM
by michidk on 1/5/25, 11:52 AM
by boredatoms on 1/5/25, 10:24 PM
by api on 1/5/25, 3:30 PM