Disorganized P2P Network
The challenge of designing a P2P network - the software for it, that is - is how to get the peers (computer) to communicate. Take a look at the diagram below, which illustrates a disorganized network. All the peers are connected to the internet, but how do they know which address each peer has, and how does a given peer make sure it is communicating with the correct peer?
|A disorganized P2P network|
In order to get the peers in the P2P network to communicate correctly, you therefore have to solve two problems:
- Peer Identification
- Peer Location
Identifying peers meaning being able to distinguish each peer from each other. Since millions of peers might be connected to the same P2P network, you need to be able to address each peer individually. This is done by assigning each peer a unique GUID (Globally Unique ID). We will get back to how a GUID looks in a later text.
Locating peers means finding the peer with a specific GUID on the network. With potentially millions of peers in the P2P network, a peer cannot keep a fully up-to-date list of all peers in the network. Peers are joining and leaving the network all the time. If all peers have to know each other, imagine how many messages they would have to send to each other, to keep each others list of peers up to date. It would be pretty much impossible.
Instead of keeping a full list of all peers in the network, a peer keeps a routing table with a subset of the peers in the network. I will get back to how this routing table looks and works in a later text too.