Computer Networks Basics·Lesson 6 of 10
Peer-to-Peer (P2P) Model
What Is Peer-to-Peer?
In a peer-to-peer (P2P) network there's no dedicated server. Every device — called a — acts as both client and server at the same time, requesting resources from others and sharing its own. Control and data are spread across all the participants instead of sitting in one central place. It's the opposite philosophy to the client-server model.
A study group
There's no teacher handing out every answer. Instead, everyone shares the notes they have and borrows what they're missing directly from classmates. If one person leaves, the group carries on — knowledge lives across everyone, not in a single source.
How It Works
Fetching a file in a P2P network
- A peer announces what it has and looks for what it needs
- It discovers other peers holding the desired data
- It downloads pieces directly from several peers at once
- As it receives pieces, it starts sharing them with others too
- The more peers join, the more sources exist — often getting faster, not slower
Types of P2P
Pure P2P
Every peer is fully equal and there's no central coordination at all. Peers find each other and exchange data entirely on their own. It's maximally resilient but harder to search and organize.
Hybrid P2P
A lightweight central server helps peers discover each other, but the actual data still flows peer-to-peer. This blends easy lookup with decentralized transfer — many real systems, including early file-sharing networks, work this way.
Client-Server vs Peer-to-Peer
| Client-Server | Peer-to-Peer | |
|---|---|---|
| Control | Centralized | Decentralized |
| Roles | Fixed (client or server) | Every peer does both |
| Single point of failure | Yes (the server) | No |
| Cost | Server hardware needed | Uses peers' own resources |
| Scaling | Add server capacity | More peers = more capacity |
| Best for | Managed, secure services | Sharing, resilience, no central cost |
Strengths and Weaknesses
Advantages
- No central server to buy, run, or maintain
- No single point of failure — very resilient
- Scales naturally: each new peer adds capacity
- Often gets faster as more peers share the load
Disadvantages
- Harder to secure and control — no central authority
- Data consistency and search are more complex
- Performance depends on unpredictable peers
- Peers may leave at any time, taking their data with them
Where You See It
P2P powers BitTorrent file sharing, blockchain and cryptocurrency networks, some voice/video calling systems, and local features like sharing files directly between two phones. Anywhere avoiding a central server is valuable — for cost, resilience, or independence — P2P is a natural fit.
“"Peer-to-peer means piracy — it's basically illegal."”
Q:How does P2P avoid a single point of failure?
A: Because no single machine is essential. Every peer holds and serves data, so if one drops off, others still have copies and the network keeps working. There's no central server whose failure would take everything down.
Quick Revision Cheat Sheet
Model: Decentralized — every peer is client and server
Peer: An equal node that both shares and requests
Pure vs Hybrid: No coordination vs a server just for discovery
Big strength: No single point of failure; scales with peers
Big weakness: Harder to secure, search, and keep consistent