NAT Traversal

From Adam Colton
Revision as of 16:37, 2 March 2016 by Adamcolton (talk | contribs) (→Theory)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Go Code https://golanglibs.com/dig_in/upnp

Theory

The techniques break down into two groups. Most solutions give the user a public facing IP and Port. Hole-punching (potentially) does not. It can assign a different port for each connection.

So we need these pieces of information:

  • Node ID
  • IP:Port
  • Direct Connect
  • STUN server
  • Router Type

STUN server and Router type are only important if Direct Connect is false. If both our router and their router is symmetric and we both don't have Direct Connect, no connection is possible.