Please give a a detailed technical explanation of how hotspots connect to the P2P network

Talking on Slack with various folks, and looking briefly thru the Erlang p2p code, the hotspot code tries pretty hard to traverse NAT in various ways.

My goal in asking for this is to have a detailed document describing the P2P network activity of hotspots, how they deal with various kinds of firewalls and NAT so that an technical user can make informed tradeoffs to how they want to setup their network access for the Hotspot. This isn’t going to be needed for 99% of hotspot owners, but for the few of us that are network nerds, knowing the side effects of not letting any incoming, vs letting the hotspot do NAT-PMP with renewing PMP leases vs allowing allowing a port forward would be really really useful. Small details matter, like how the hotspot picks incoming ports in various situations, how other hotspots know how a given hotspot, how it reacts to changing ports, etc.

1 Like

Giving some more background:
I’ve got a fairly complex network setup at home and I currently have two hotspots there. I’m going to be either using directional antennas to focus coverage or move one of the hotspots entirely. In the meantime, it’s really helpful to run both on my home network at the same time at least while I get new hotspots synced and proven.

Right now, it is really difficult to understand and debug the side effects (to syncing as well as the normal operation of the hotspot) of these choices (there may be others, this is off the top of my head):

  • allow no incoming connections
  • Let hotspot do uPnP or NAT-PMP, if so, what ranges do I allow it to have access to? How does it deal with NAT-PMP leases expiring and changing?
  • port forward 44158 for one hotspot and a different port for the other hotspot
  • Effect of the NAT being symmetric, aka NAT’ing port as well vs not.
  • Effect of two hotspots behind the same IP, even on different ports external ports.

I realize I’m asking for a lot here and it’ll be useful for maybe only a hotspot owners, but those owners may make great evangelists.