Peer-to-Peer
P2P
- In Turkish
- eşler arası
- Pronunciation
- PEER tuh PEER
In short
Peer-to-peer (P2P) is a network design in which peers connect and share resources directly, each acting as both client and server, with no central server.
What is peer-to-peer (P2P)?
In a P2P network every peer can request data and provide it. When you download a file with BitTorrent, released in 2001, you receive pieces from many other peers at once and upload pieces you already have to others. The more people share a file, the more capacity the network has, which is the opposite of a central server that gets slower as demand grows.
Peers still need to find each other. Some systems use a central tracker or directory just for discovery, as Napster did in 1999 before the transfer itself happened directly between users. Fully decentralized ones use distributed hash tables (DHTs), where peers share responsibility for looking up who has what. Because most devices sit behind NAT routers, P2P software also needs techniques for punching through to reach each other, with relay servers as a fallback.
Beyond file sharing, P2P ideas power blockchains such as Bitcoin, where every node keeps and verifies the ledger, WebRTC video calls that connect browsers directly, local multiplayer games, software update distribution and content-addressed storage such as IPFS.
A common misconception is that peer-to-peer means illegal file sharing. It is a neutral architecture with real strengths, no single point of failure, lower server costs and resistance to censorship, and real costs: harder security, since peers can be malicious, slower and less predictable discovery, and the difficulty of keeping shared data consistent.
Key takeaways
- In P2P, peers share resources directly, acting as client and server.
- Capacity grows as more peers join, unlike a single central server.
- Discovery uses trackers or distributed hash tables; NAT needs special handling.
- BitTorrent, blockchains and WebRTC calls all use P2P ideas.
- It avoids single points of failure but makes security and consistency harder.
Readers ask
What is the difference between P2P and client-server?
Client-server relies on dedicated servers that serve many clients. P2P has no central server for the main work: each peer both consumes and provides resources, connecting directly to others.
Is a blockchain peer-to-peer?
Yes. Public blockchains such as Bitcoin and Ethereum are P2P networks where nodes exchange transactions and blocks directly and each keeps a copy of the ledger.
Is WebRTC peer-to-peer?
WebRTC lets browsers send audio, video and data directly to each other. A server is still needed to introduce the peers, and relay servers are used when a direct connection isn't possible.
See also
- Client-Server ArchitectureSoftware Architecture, p. 6Client-server architecture splits a system into clients, which request data or actions, and servers, which provide them, as when a browser requests a page.
- Distributed SystemSoftware Architecture, p. 14A distributed system is a set of computers that work together over a network and appear to their users as a single system.
- NATNetworking, p. 17NAT is a technique in which a router rewrites the IP addresses in passing packets, letting many devices on a private network share one public IP address.
- Consistent HashingSoftware Architecture, p. 9Consistent hashing spreads keys across a changing set of servers so that adding or removing a server moves only a small share of the keys.
- Consensus AlgorithmSoftware Architecture, p. 8A consensus algorithm lets a group of machines agree on a single value or an ordered log of decisions, even when some of them crash or messages are lost.
- WebSocketWeb Development, p. 61WebSocket is a protocol that keeps a single connection open between a browser and a server so both sides can send each other messages instantly at any time.
Spotted a mistake or something missing on this page?Suggest an edit