[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] How NAT Works



Hi
I've read through most of this and I'm stuck on how STUN works. I think I
must be missing something but this is where I'm having problems.

A NAT device handles connections by quads of source IP and port, and
destination IP and port. So the client on the inside of my network
(client1) makes a call out to the STUN server, that records the external IP
and port the connection is coming from and is then able to pass it on to
the other side of the connection (client2).

But, if client2 tries to connect to client1 using that IP and port the NAT
box will see a different source IP, one that doesn't match any that it
knows, so it would just drop the traffic.

I know the idea is that once client1 has punched out of the NAT, the hole
is open so the other side is able to send packets back, but I can only see
that working when the other side is using the same IP as client1 started
talking to. If client2 tries to talk to the external IP and port client1
used to talk to the STUN server it shouldn't work.

Is this the failing that TURN is used to handle? If so, then isn't STUN
dead in most situations? I'd imagine a lot of clients, especially VOIP, are
behind at least one layer of NAT.

To have written such a big article on STUN, it feels like I've missed
something important that means it will work in a lot more situations, but I
can't see what it is. Can anyone explain?

Robin

On Sun, 5 Jan 2025 at 11:56, Richard Ibbotson <richard@xxxxxxxxxxxxxx>
wrote:

> Hi
>
> https://tailscale.com/blog/how-nat-traversal-works
>
>
> Might interest someone out there. How NAT works.
>
> --
> Richard
>
>
> _______________________________________________
> Sheffield Linux User's Group
> http://sheflug.org.uk/mailman/listinfo/sheflug_sheflug.org.uk
> FAQ at: http://www.sheflug.org.uk/mailfaq.html
>
> GNU - The Choice of a Complete Generation
>
_______________________________________________
Sheffield Linux User's Group
http://sheflug.org.uk/mailman/listinfo/sheflug_sheflug.org.uk
FAQ at: http://www.sheflug.org.uk/mailfaq.html

GNU - The Choice of a Complete Generation