As the title says, what is the difference between UDP hole punching and STUN?
Or is it the same?
As the title says, what is the difference between UDP hole punching and STUN?
Or is it the same?
I can't delete my answer as its accepted, but my answer is wrong. Please ignore it.
hole punching and STUN are quite different things.
STUN will allow a system to work out what its external IP address is (if, as is common, it is located behind a NATing firewall or equivalent). It is really of use where the IP address of the Internet connection is dynamically assigned.
[UDP] hole punching allows a mapping from a real world IP address to a specific box behind a NATing firewall - This is a security thing, but much more importantly required because of the 1:many relationship NAT introduces - so the NATing router needs to know which client to send the packet too. [ For responses to regular traffic it keeps a lookup table of associations between the From IP, Dest IP and ports used (and related ports if its doing its job well) ]