September 5, 2022 at 10:10 PM
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.
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.
