Trying to Understand P2P Networks
by - Thursday, January 1, 1970 at 12:00 AM
Hi everyone,

I am fairly new to networking and I'm trying to understand how to program p2p networks, but am struggling with understanding how different hosts can directly communicate with each other.

From my understanding, it seems like some p2p networks make use of centralized servers to distribute a hash map of current nodes' ip:port pairs (and other info that I'm not really aware of) to new connecting nodes so that each node in the network has a map of the other nodes to interact with.

From there, I'm not really sure how residential nodes are able to communicate with each other while behind a gateway. 

I assume each of these nodes are listening for inbound packets on the public ip address that their router assigned them and some port, and sending out packets to other nodes, but what does the sender have to do to successfully send data to nodes that are sitting behind a gateway? I'm guessing it's not as simple as doing something like "Dial("tcp", Node_IP+Node_port)" in Go.
Reply
Look into Libp2p Some cool stuff there.
Alot of the time you need some sort of upnp/nat traversal.
https://en.wikipedia.org/wiki/NAT_traversal
https://libp2p.io/
Note I have not built anything with libp2p but may do so at some point.
Reply
awesome
Reply
(September 6, 2022, 12:39 AM)goy Wrote: Look into Libp2p Some cool stuff there.
Alot of the time you need some sort of upnp/nat traversal.
https://en.wikipedia.org/wiki/NAT_traversal
https://libp2p.io/
Note I have not built anything with libp2p but may do so at some point.


Thank you!
Reply
I think TCP/UDP hole-punching could also be of interest for you
Reply


 Users viewing this thread: Trying to Understand P2P Networks: No users currently viewing.