In a peer-to-peer network every participant is both client and server: nodes find each other, store and send data among themselves, and no single machine is in charge. This removes central bottlenecks and single points of failure, and in exchange makes discovery, trust and consistency much harder.
Key concepts
- Overlay network: peers form a logical network on top of the internet and route messages through it.
- Distributed hash tables: structured overlays such as Chord and Kademlia map keys to nodes in a logarithmic number of hops.
- Unstructured networks: flooding and random walks, simple but costly for rare items.
- Content addressing and chunking: files are named by their hash and split into pieces fetched from many peers.
- Incentives and churn: peers join and leave constantly, and some will take without giving.
Vocabulary
- Peer: a participating node.
- Bootstrap node: a known address a newcomer contacts to find the rest.
- NAT traversal: techniques, such as hole punching and relays, that let peers behind routers connect.
- Swarm: the group of peers sharing one piece of content.
- Sybil attack: one party posing as many peers to gain influence.
What to study, in order
- Sockets and concurrency: a program that listens and connects at once.
- Build a two-node chat, then a gossip protocol that spreads a message to many.
- Implement a small Kademlia-style table and measure lookup hops as nodes grow.
- Study how a swarm distributes a file: pieces, hashes and which piece to ask for next.
- Read about NAT traversal and about defences against Sybil and eclipse attacks.
Related tags
#distributed-systems #mesh-networks #protocols #cryptography