I’ve continued working on the P2P graph simulator and I have added directed connections and a random message delay. I’ve also finished implementing the most basic protocol possible where each peer just connects to as many peers as it can find. The algorithm is very simple. When a new peer connects to the network, it sends a connection request to the node it knows. The receiving node anwers with the list of peers it is connected to. The connecting node in turn sends connection requests to every new peer it received.
Failures are handled by periodically checking each existing connection. If a connection stops working for some reason, a node sends all its peers to its peers and they themselves check if there is a peer to be added back.
(A. Shaker and D. S. Reeves, “Self-stabilizing structured ring topology P2P systems,” Fifth IEEE International Conference on Peer-to-Peer Computing (P2P’05), 2005) ↩