3 ms·
> you need a machine that can handle whatever link speeds you need I would have expected the relay server only being used for initial handshake to punch throug
by cl3misch 2y ago
> you need a machine that can handle whatever link speeds you need
I would have expected the relay server only being used for initial handshake to punch through NAT, after which the transfer is P2P. Only in the case of some network restrictions the data really flows through the relay. How could they afford running the free relay otherwise?
- lotharrr 2y agoThere are two servers. The "mailbox server" helps with handshakes and metadata transfers, and is super-low bandwidth, a few hundred bytes per connection. The "transit relay helper" is the one that handles the bulk data transfer iff the two sides were unable to establish a direct connection. I've been meaning to find the time to add NAT-hole-punching for years, but haven't managed it yet. We'd use the mailbox server messages to help the two sides learn about the IP addresses to use. That would increase the percentage of transfers that avoid the relay, but the last I read, something like 20% of peer-pairs would still need the relay, because their NATs are too restrictive. The relay usage hasn't been expensive enough to worry about, but if it gets more popular, that might change.
- bscphil 2y agoThe folks on the wormhole-rs fork (who appear to share your Github organization? [1]) already have NAT punching working 95+% of the time in my testing, so maybe what they're doing could be ported over to the Python implementation. [1] https://github.com/magic-wormhole https://github.com/magic-wormhole
- from-nibly 2y agoYou cant make a p2p connection over a NAT without exposing a port on the public side of the NAT.
- t0mas88 2y agoYou can: https://en.wikipedia.org/wiki/Hole_punching_(networking) https://en.wikipedia.org/wiki/Hole_punching_(networking)
- voxic11 2y agoYou aren't guaranteed to be able to do that but in practice most times you can.
- kccqzy 2y agoGo check out STUN and ICE. The best article I've found about NAT traversal is this article from Tailscale: https://tailscale.com/blog/how-nat-traversal-works https://tailscale.com/blog/how-nat-traversal-works