ShadowJonathan / eduP2P

An authenticated peer-to-peer network overlay
MIT License
3 stars 1 forks source link

[S] (Endpoint Manager) UPnP, NAT-PMP, and PCP #50

Open ShadowJonathan opened 2 months ago

ShadowJonathan commented 2 months ago

Tasks

Description

(Largely inspired by this blog post section)

UPnP, NAT-PMP, and PCP, are all different "ask the router nicely to open a port for us" (yes, its a XKCD 927 moment), of which any one may be implemented in the router at any time.

Probing and requesting an open external port would a.) make the endpoint manager's job substantially easier, and b.) allow for more assured connection oppertunities.

This would be a best-case effort; If the router/firewall allows requesting ports, and it succeeds, we just append it to the known endpoints.

We may want to test it (with hairpinning(?)) that the actual port does map, but in the worst case, the other client(s) will just be sending an extra packet.