4 ms·
This has got me reading about TURN and it just seems like a huge ugly hack. Two computers want to send UDP to each other. They are electrically connected by set
by markisus 2y ago
This has got me reading about TURN and it just seems like a huge ugly hack. Two computers want to send UDP to each other. They are electrically connected by sets of physical cables. They could even be down the street from each other. But they don’t know how to get their routers to set the right bits in their translation tables. Instead it’s just easier to send all their traffic through a third computer in another city thousands of miles away or maybe into outer space and back. Have I got it right?
- XorNot 2y agoYep. But this is what IPv6 was supposed to solve.
- markisus 2y agoI don’t know much about IPv6 but it seems like even if we are stuck with IPv4 we could still make some sort of protocol where my computer could manipulate the NAT table entries allocated to it. Maybe something like DHCP but it deals with ports.
- mindcrime 2y agoIsn't something like that what UPnP / zeroconf is supposed to do[1][2]? [1]: https://en.wikipedia.org/wiki/Universal_Plug_and_Play https://en.wikipedia.org/wiki/Universal_Plug_and_Play [2]: https://en.wikipedia.org/wiki/Zero-configuration_networking https://en.wikipedia.org/wiki/Zero-configuration_networking
- markisus 2y agoVery interesting. I even found some protocols that exactly implement the functionality I was thinking of! https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protoc... https://en.wikipedia.org/wiki/Port_Control_Protocol https://en.wikipedia.org/wiki/Port_Control_Protocol
- alwayslikethis 2y agoNAT may go away, but stateful firewalls won't. There will still be many environments where you can't easily get a point to point connection even though the IP is addressable and there is a route.
- markisus 2y agoWon’t the firewall know to let return traffic through if my computer explicitly sends a request first?
- cookie_monsta 2y agoFrom what I understand the real ugly hack is NAT tables thanks to the shortsightedness of IPv4.Everything else flows from there. Mostly, though, what you are describing is the internet
- Sean-Der 2y agoFor me something only qualifies as a 'huge ugly hack' if a better way exists. I think TURN does the best it can in the constraints that exist! * TURN handles protocol bridging (TCP <-> UDP) * TURN is useful for privacy preservation. * TURN handles NAT Traversal (unfortunate when it comes to this) * TURN is used for security in some cases. It sits at the edge and clients create allocations
- markisus 2y agoOh I thought TURN was mainly about the NAT traversal. Can you elaborate on the other points? Especially security and privacy?
- dartos 2y agoEven if it is mainly about NAT, how else would you do NAT traversal?
- 1oooqooq 2y agoby not having nat? ...only if ipv6 wasn't written by the very people profiting from NAT.
- zamalek 2y agoHole punching: https://en.wikipedia.org/wiki/Hole_punching_(networking) https://en.wikipedia.org/wiki/Hole_punching_(networking)
- dartos 2y agoOh I guess that’s STUN that does the hole punching. I’m so used to seeing both STUN and TURN together.
- markisus 2y agoYou aren’t completely wrong apparently. > TURN is considered an extension to the STUN. So, a typical TURN server would include a STUN server implementation by default. https://www.100ms.live/blog/webrtc-turn-server https://www.100ms.live/blog/webrtc-turn-server
- spease 2y agoBasically. I guess part of the issue is that NAT is also used as a security measure, so there are competing interests in making the ports chosen by outgoing UDP packets deterministic to make STUN easy, versus randomizing and restricting return traffic to the original recipient to make attacking harder and STUN impossible.
- thebruce87m 2y ago> They are electrically connected by sets of physical cables. Pedantic: Fibre and wireless do not fit this criteria, but I still agree with the spirit.
- mystified5016 2y agoExtra pedantic: Ethernet cables are galvanically isolated at both ends. There is no electrical connection at all.