Why so many servers?
joe at begriffs.com
Mon May 4 22:58:45 UTC 2020
> > As an interesting experiment, I'm wondering if anyone wants to try
> > ICE/STUN with me and see if we can open a direct TCP connection
> > between our computers?
Forest Johnson wrote:
> I would do this! I was meaning to start developing and prototyping a
> simple p2p VPN soon.
Given this is something you're planning to work on, do you want to take
the lead in this investigation? Just tell me what to do on my end and
I'll help you debug.
> > In an ideal world I wouldn't need any server, but could use a native
> > chat application and "call" another person directly with their IP
> > address.
> I don't think that's possible unless one person has a public IP (no
> NAT). There has to be some sort of session establishment mechanism,
> otherwise the router being connected to wont know which LAN address to
> forward the connect packet to.
My understanding is that you designate a certain port, and tell the
router to forward packets hitting that port to a particular computer in
the LAN. So the public IP that an outsider connects to would be the
address of the router.
> > Anybody have suggestions for more cool p2p software?
> I don't think you can talk about p2p in 2020 without talking about IPFS.
> I really like the ideas behind IPFS and I want to build software using it.
Decentralized content-addressable storage certainly goes back earlier
than $CURRENT_YEAR. I remember Freenet from twenty years ago doing a
similar thing. IPFS is probably more efficient though.
> To make it even better, the IPFS project made the decision to split
> a large part of their code base into a separate project called libp2p.
Nice tip. Libp2p has a good description of NAT traversal too.
They do kind of use their own system though. Rather than STUN they use
the "identity protocol," and rather than TURN they use the "circuit
relay protocol." They also rely on the SO_REUSEPORT option to
setsockopt() which isn't in POSIX.
It is available in Linux and BSD though:
The LWN article is interesting because they motivate why the option was
created, and there's some pushback in the comments.
More information about the Friends