P2P 101


published 2023-11-01 17:54

updated 2023-11-08 10:54


Peer-to-Peer networks are an alternative to the "standard" Client-Server architecture. Instead of a specific server that holds all the data you're after, the network is compromised of many peers that act as both client & server.

P2P networks can be unstructured (which is to say there is no reliable method to perform routing or searching), but I'm not particularly interested in these.

Generally, P2P networks come with an overlay network, that structures them. This network gets used for Peer Discovery and Routing.

Peer Discovery & Routing

Peer Discovery is the process of announcing and finding services available on the network. Generally it is solved through either broadcast messages, or a bootstrap node. Peer Routing is the process of finding a specific peer's location in a network. Generally performed through a routing table or similar structure that keeps track of network topology. Largely, a DHT is used as the routing table.

Wire Protocols

A Wire Protocol is the spec for how to exchange messages between peers on the network. It does not handle discovery or routing, but instead handles application data (and may also be called an Application Protocol).