Peer-to-Peer (P2P) Network Paradigm
Peer-to-Peer (P2P) Network Paradigm
Introduction
The Peer-to-Peer (P2P) paradigm is a communication model in which every computer (peer) can act as both a client and a server. Unlike the client-server model, there is no dedicated central server that permanently provides services. Instead, peers share their resources, such as files, storage, processing power, or network bandwidth, directly with one another.
The P2P paradigm became popular through file-sharing applications such as Napster, Gnutella, BitTorrent, Kazaa, WinMX, and GNUnet.
Features of P2P Networks
- Every node (peer) can both provide and request services.
- Resources are distributed among peers.
- No dedicated server is required.
- Easy to scale as more peers join the network.
- Cost-effective because expensive servers are unnecessary.
- Suitable for file sharing, multimedia streaming, VoIP, and distributed computing.
Working of a P2P Network
- A peer joins the P2P network.
- The peer shares one or more files/resources.
- Another peer searches for the required resource.
- The requested file is downloaded directly from the peer that owns it.
- After downloading, the new peer can also share the same file with others.
Peer A ←→ Peer B ↕ ↕ Peer C ←→ Peer D ↕ ↕ Peer E ←→ Peer F
Each peer acts as both a client (downloads files) and a server (uploads files).
Types of P2P Networks
P2P networks are classified into two main types:
- Centralized (Hybrid) P2P Network
- Decentralized P2P Network
1. Centralized (Hybrid) P2P Network
A centralized P2P network uses a central directory server to maintain information about peers and the files they share. However, the actual file transfer takes place directly between peers.
The directory service follows the client-server model, while file sharing follows the peer-to-peer model. Therefore, it is also called a Hybrid P2P Network.
Working
- A peer registers with the central server.
- It sends its IP address and list of shared files.
- The central server stores this information.
- Another peer searching for a file sends a query to the server.
- The server returns the IP addresses of peers containing the file.
- The requesting peer downloads the file directly from one of those peers.
Central Directory Server │ ---------------------------- │ │ │ Peer A Peer B Peer C │ │ └──── File Transfer ───────┘
Advantages
- Simple directory management
- Fast searching
- Easy file location
Disadvantages
- Central server becomes a bottleneck.
- Heavy traffic on the directory server.
- Single point of failure.
- Vulnerable to attacks.
- Copyright issues due to centralized control.
Example
Napster (original version)
2. Decentralized P2P Network
In a decentralized P2P network, there is no central directory server. Instead, peers organize themselves into an overlay network, and the responsibility for locating files is shared among all peers.
Decentralized networks are divided into:
- Unstructured P2P
- Structured P2P
A. Unstructured P2P Network
In an unstructured P2P network, peers are connected randomly. There is no predefined organization.
Searching is performed by query flooding.
Working
- A peer searches for a file.
- It sends a query to its neighboring peers.
- If a neighbor has the file, it responds.
- Otherwise, the query is forwarded (flooded) to other neighboring peers.
- Eventually, the peer containing the file responds.
Peer A / | \ B C D / \ | E F G Query is flooded until the file is found.
Advantages
- Simple to implement
- No central server
- Highly fault tolerant
Disadvantages
- Large network traffic due to flooding
- Slow search
- Poor scalability
Gnutella Network
Gnutella is an example of a decentralized, unstructured P2P network.
Its features include:
- Random distribution of directory information.
- Uses query flooding to locate files.
- New peers obtain neighbor information during bootstrap.
- Uses Ping and Pong messages to check whether neighbors are active.
- Improved versions introduced Ultra Nodes, Query Routing Protocol (QRP), and Dynamic Querying (DQ) to reduce traffic and improve scalability.
B. Structured P2P Network
A structured P2P network organizes peers according to predefined rules, making file searching much more efficient.
Most structured P2P systems use a Distributed Hash Table (DHT).
Working
- Each peer is assigned an identifier.
- Each file is assigned a key using a hash function.
- The DHT maps file keys to the responsible peer.
- Queries are routed directly to the correct peer instead of flooding the network.
Distributed Hash Table (DHT) File Key → Responsible Peer Hash(File) → Peer ID → File Location
Advantages
- Fast searching
- Efficient routing
- Highly scalable
- Reduced network traffic
Disadvantages
- More complex to implement
- Higher maintenance overhead
Example
BitTorrent (uses DHT for peer discovery)
Comparison of P2P Network Types
| Feature | Centralized P2P | Unstructured P2P | Structured P2P |
|---|---|---|---|
| Central Server | Yes (Directory only) | No | No |
| File Transfer | Peer-to-Peer | Peer-to-Peer | Peer-to-Peer |
| Search Method | Central directory | Flooding | Distributed Hash Table (DHT) |
| Scalability | Medium | Low | High |
| Search Speed | Fast | Slow | Very Fast |
| Traffic | Moderate | High | Low |
| Fault Tolerance | Low | High | High |
| Example | Napster | Gnutella | BitTorrent |
Advantages of P2P Networks
- No dedicated server required.
- Cost-effective.
- Easy to expand by adding more peers.
- Better resource utilization.
- High availability.
- Load is distributed among peers.
- Suitable for large-scale file sharing.
Disadvantages of P2P Networks
- Difficult to manage.
- Security challenges.
- File authenticity cannot always be guaranteed.
- Data redundancy.
- Copyright issues due to unauthorized file sharing.
- Some unstructured networks generate excessive traffic.
Applications of P2P Networks
- File sharing (BitTorrent)
- Video sharing
- Audio sharing
- Internet telephony (VoIP)
- IPTV
- Distributed storage
- Blockchain and cryptocurrencies
- Distributed computing
Summary
The Peer-to-Peer (P2P) paradigm is a decentralized communication model in which each peer functions as both a client and a server. Peers directly share resources without relying on a dedicated server. P2P networks are classified as Centralized (Hybrid) and Decentralized. Decentralized networks are further divided into Unstructured P2P (e.g., Gnutella, which uses query flooding) and Structured P2P (e.g., BitTorrent, which uses Distributed Hash Tables). Compared to the client-server model, P2P offers better scalability and resource sharing but introduces challenges in security, management, and efficient searching

Comments
Post a Comment