A peer-to-peer (P2P) network is a distributed system where nodes, or peers, communicate directly to provide a shared service without a central coordinator. Each peer can request information or services and provide them to others, unlike a client/server system with dedicated servers. section 11.1 section 11.5
P2P networks can support:
- Permissionless access, fault tolerance, and censorship resistance, supported by data and state replicated across nodes. section 11.1
- Sharing computing resources such as storage, bandwidth, and processing power. section 11.0
Peers need to initiate connections to other nodes and accept incoming connections. Because peers may use different protocols, a network can support transports such as TCP and UDP, as well as higher-level protocols including HTTP and QUIC. section 11.1.1
A Rust libp2p node
A small node can generate a unique peer ID, represent its address with a multiaddress, exchange ping messages, and discover nearby peers using mDNS. The libp2p Swarm manages network behavior and events. section 11.5
Compare the dedicated server in a client/server system with the direct communication between peers in a P2P system. section 11.1

