Earlier quoted context omitted.
> If you could just ask your router for a lease on a chunk of IP+NAT addresses The “just” is doing a lot of lifting there. I’m glad the various port mapping protocols didn’t really take off and it looks like IPv6 is going to actually make it instead. Much less complexity in most parts of the stack and network.
[flagged]
A most elegant TCP hole punching algorithm
31–40 of 111 posts
Re: A most elegant TCP hole punching algorithm
#32Earlier quoted context omitted.
Does your friend setting up port forwarding on their pfSense not help in your scenario?
Yes, that solves it completely. But the exercise we were trying to do was to do it without that.
This hs a good diagram to understand the options
https://rajsinghtech.github.io/claude-diagrams/diagrams/netw...
Re: A most elegant TCP hole punching algorithm
#33> Many home routers try to preserve the source port in external mappings. This is a property called “equal delta mapping” – it won’t work on all routers but for our algorithm we’re sacrificing coverage for simplicity. It is precisely this point that has flummoxed me when connecting my p2p wireguard config[1] with a friend that uses a pfsense router, no matter what we tried, pfsense always chooses a random source port…
Re: A most elegant TCP hole punching algorithm
#34Earlier quoted context omitted.
[flagged]
Firewalls aren't nearly as bad as NAT.
If you are tying to work around your firewall because it isn’t yours, that’s not a legitimate use.
Re: A most elegant TCP hole punching algorithm
#35[flagged]
This is an AI slop bot
> my grandmother had a cookie jar collection and I always thought it was weird until I realized she was basically running a primitive NFT gallery except the tokens were actually useful because they contained cookies
Re: A most elegant TCP hole punching algorithm
#36Earlier quoted context omitted.
Firewalls aren't nearly as bad as NAT.
Basically the same thing. If you legitimately need to establish a connection then put a firewall rule in, whether that needs nat or pat is a function of your available addresses. If you are tying to work around your firewall because it isn’t yours, that’s not a legitimate use.
Take mobile data connections, for example: Most people don't want to pay for metered (by the byte) inbound traffic they didn't ask for that also drains their battery, but do want to be able to establish P2P connections for lower latency VoIP etc.
This is a firewall that's definitionally "not theirs", but that still also serves their interests, yet usually doesn't offer any user-accessible management interface.
So may I please traverse this firewall now, or is my use case still illegitimate?
Re: A most elegant TCP hole punching algorithm
#37> Many home routers try to preserve the source port in external mappings. This is a property called “equal delta mapping” – it won’t work on all routers but for our algorithm we’re sacrificing coverage for simplicity. It is precisely this point that has flummoxed me when connecting my p2p wireguard config[1] with a friend that uses a pfsense router, no matter what we tried, pfsense always chooses a random source port…
[flagged]
> Don't post generated comments or AI-edited comments. HN is for conversation between humans.
Re: A most elegant TCP hole punching algorithm
#38Re: A most elegant TCP hole punching algorithm
#39Needing to punch holes in NAT is one of the most idiotic own-goals in the entire field of networking. NAT is effectively your router doing DHCP with a 17-bit suffix (16-bit port + 1 bit for UDP vs TCP) to each of your applications and then not telling you the address it gave you or how long it is good for (which is what a regular DHCP lease does). This is in addition to it, most likely, already doing regular DHCP and…
Why not use plain IPv6 instead?
Re: A most elegant TCP hole punching algorithm
#40This is a great algorithm! In this era where AI is eating away at how deterministic computers are, I really appreciate reading about an elegant solution to a real problem using deterministic logic.
We still live in an age of deterministic computers. It’s the software that’s become fuzzy. (And since we’re on the subject: there’s no AI)
Of course there’s still plenty of deterministic software you can run… for now.