Computer Networks Basics·Lesson 6 of 10

Peer-to-Peer (P2P) Model

01

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.

In P2P, peers connect directly to one another — no central server.
02

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
03

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.

04

Client-Server vs Peer-to-Peer

Client-ServerPeer-to-Peer
ControlCentralizedDecentralized
RolesFixed (client or server)Every peer does both
Single point of failureYes (the server)No
CostServer hardware neededUses peers' own resources
ScalingAdd server capacityMore peers = more capacity
Best forManaged, secure servicesSharing, resilience, no central cost
05

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
06

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."

P2P is just a network architecture, completely neutral. It's used by legitimate software updates, blockchains, video calls, and content delivery. The technology isn't illegal; only certain uses of any technology can be.

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