Explain the client‑server and peer‑to‑peer (P2P) models of networked computers, including their architecture, typical applications, advantages and disadvantages.
Key Concepts
Client‑Server Model – A centralized architecture where dedicated servers provide resources or services to multiple client devices.
Peer‑to‑Peer Model – A decentralized architecture where each node (peer) can act as both client and server, sharing resources directly with other peers.
Server – A computer or process that waits for requests and responds with data, services, or resources.
Client – A computer or process that initiates requests to a server.
Peer – A node in a P2P network that both requests and provides resources.
Client‑Server Model
In the client‑server model a network is organized around one or more powerful servers that host resources such as files, databases, web pages, or applications. Clients connect to these servers over a network (LAN, WAN, or the Internet) to request services.
Typical Architecture
Clients run user‑oriented applications (e.g., web browsers, email clients).
Servers run service‑oriented software (e.g., HTTP server, database server).
Communication follows a request‑response pattern: client → request → server → response → client.
Common Protocols
HTTP/HTTPS – Web pages.
SMTP/IMAP/POP3 – Email.
FTP – File transfer.
SQL over TCP/IP – Database queries.
Advantages
Centralised management – security, backups, and updates are applied in one place.
Scalability – servers can be upgraded without affecting clients.
Reliability – dedicated hardware can be redundant (e.g., fail‑over clusters).
Disadvantages
Single point of failure – if the server crashes, all clients lose access.
Higher cost for powerful server hardware and maintenance.
Potential bottleneck – all traffic passes through the server.
Peer‑to‑Peer (P2P) Model
In a P2P network each node can act simultaneously as a client and a server. Resources are distributed across many peers, and each peer can request and provide data directly to others.
Typical Architecture
Every peer runs software that can both request and serve resources.
Peers discover each other using a discovery mechanism (e.g., tracker, distributed hash table).
Data is often split into chunks; multiple peers can supply different chunks simultaneously.
Common Applications
File‑sharing (e.g., BitTorrent).
Voice‑over‑IP (e.g., Skype’s early architecture).
Distributed computing (e.g., SETI@home, BOINC).
Blockchain networks.
Advantages
No single point of failure – the network can survive loss of many peers.
Resource utilisation – idle bandwidth and storage of many peers are harnessed.
Scalability – as more peers join, total capacity increases.
Disadvantages
Security challenges – peers may be untrusted, leading to malware or data tampering.
Variable performance – depends on the availability and speed of participating peers.
Management complexity – harder to enforce policies centrally.
Comparison of Client‑Server and Peer‑to‑Peer
Aspect
Client‑Server
Peer‑to‑Peer
Control
Centralised (servers control resources)
Decentralised (each peer controls its own resources)
Typical Use‑Case
Web services, email, corporate databases
File sharing, distributed computing, blockchain
Scalability
Vertical (upgrade server) or horizontal (add servers)
Horizontal – each new peer adds capacity
Reliability
Depends on server redundancy
High – network survives loss of many peers
Security Management
Centralised policies, easier to enforce
Distributed; requires trust models, encryption
Performance Bottleneck
Server bandwidth/CPU
Network latency & peer availability
Network Throughput Example
Assume a client‑server file download of size \$S\$ bytes from a server with bandwidth \$Bs\$ (bits/s) to a client with bandwidth \$Bc\$. The theoretical minimum transfer time \$T\$ is:
\$T = \frac{8S}{\min(Bs, Bc)}\$
In a P2P scenario where \$n\$ peers each contribute bandwidth \$Bp\$, the effective bandwidth can approach \$nBp\$, reducing transfer time to:
\$T{P2P} = \frac{8S}{\min(Bs, nB_p)}\$
Suggested Diagrams
Suggested diagram: Client‑Server architecture showing multiple clients connecting to a central server.
Suggested diagram: Peer‑to‑Peer network with nodes connected in a mesh, illustrating resource sharing.
Summary
The client‑server model relies on centralised servers to provide services, offering easier management but creating potential bottlenecks.
The P2P model distributes responsibilities across all peers, improving resilience and scalability at the cost of security and management complexity.
Understanding both models is essential for designing, analysing, and troubleshooting modern networked applications.
Self‑Check Questions
Identify three real‑world services that use the client‑server model and explain why this model is appropriate for each.
Explain how BitTorrent reduces download time compared with a traditional client‑server file transfer.
Discuss one security risk unique to P2P networks and a mitigation strategy.