You are on page 1of 10

Compare and contrast the working of client-server and peer-to-peer

application architectures.

A computer network is made up of software and hardware components that allow


one device to communicate with another.

Hardware provides the set of instructions that utilizes the networking equipment for
data transmission, whereas software specifies the sequence of commands
(communication protocol) that uses the hardware equipment for data transmission.

A basic data transfer is made up of numerous phases that take place at different
layers of the computer network. The most established communication stack is the
OSI 7-layer model.

A communication network can also be categorized into two broad models:

 Peer-to-peer network model


 Client-Server network model

In this article we’ll go through Peer-to-Peer vs Client-Server based network models


to learn how data is transmitted and received at the computer level and compare and
discuss the two network communication categories.
 

In a p2p network, all computers on the network are considered equal, with each
workstation offering access to resources and data.

This means that each node in the p2p network model can both request for services
from the other peers or offer services to the other peers. Each node can be both a
client and a server.

Peer-to-Peer can be huge networks in which computers may interact with each other
and share what is on or linked to their machines with other people.

It is also one of the most straightforward forms of architecture to construct if you


have of course the proper software on each node.

Definition of Client-Server Model

The client-server model structure is a centralized network in which the server hosts,
provides, and maintains the majority of the client’s data and services.

In this network model, a central server is a must and all the clients (computers) are
connected to the central server for retrieving data or using its services.
The diagram above shows a server connected to the network (shown as Internet
above but can be any other type of network) with various clients.

The server acts as a middle point of the network. Servers wait for requests from
clients to show up before responding.

Characteristic Client-Server Model Peer-to-Peer Model (p2p)

peer-to-peer networks are primarily


Client-server networks are primarily
Prime focus focused on communication and
concerned with data exchange.
connectivity.

In a p2p network, all the members


In client-server networks, the server
Data Transmission (peers) of the network act as the service
provides all the services and data
providers and consumers.
while the clients request for services

and data.

A client-server network is expensive to


p2p is cheaper to make than a client-
implement because a central server
server network as no central server is
Cost has to be built and it has to keep
required.
running constantly otherwise the

network will collapse.

The client-server network model


A p2p network is more vulnerable. The
provides better security because the
peers act like the server and the
file access is controlled by the server,
Security consumer at the same time which is why
not the nodes.
file access can’t be handled centrally,

the security is handled by the users.

Performance Client-server systems are more robust As the number of nodes in a peer-to-

and can be extended as needed. peer network grows, performance


decreases.

The full bandwidth is not allocated in


The bandwidth depends on the
advance in a peer-to-peer connection. It
Bandwidth distribution connection of the server to the rest of
uses the bandwidth node according to
the network.
the available bandwidth of each node

(peer) and then releases it when it is no

longer required.

Comparison of Peer-to-Peer vs Client Server

Examples of client-server architecture

Client-server networks are preferable for bigger networks, particularly if they are
expected to increase in scale.

If your network contains sensitive data, you should employ a client-server structure
as well. 

When you use a web browser to go to a particular website, the browser (client)
sends a request to the web server which is handling the website’s content.

Then the server responds to the request and sends data and cookies back to the
browser which will show that data according to the configuration.

The same goes for database servers. The client sends a request/query to the server,
which checks for the legitimacy of that request. If everything checks out, the server
will send data back to the client.

Server peering is used in the Internet mail system, which is a distributed client-server
framework.

Clients send and receive mail via communicating with servers, while servers
communicate with one another.
An outgoing message can be sent directly to the server (MTA), which will transport it
to the recipient’s inbox, or to another MTA, which will pass it on.

By organizing servers in a layer, this system is designed to be extremely scalable.


Another example of distributed client-server is the DNS network which contains root
servers and other second level servers in the hierarchy.

Examples of Peer to Peer (p2p) model

In 1999, when Napster was launched, was a pivotal moment in the history of P2P.
People utilized Napster to exchange and download music via file-sharing programs.

Most of the music exchanged on Napster was copyrighted, making it unlawful to


distribute it. That didn’t stop many from getting it, though.

Peer-to-peer technology had to face a lot of backlash because of its usage in illegal
file-sharing (torrents). But a lot of companies and many day-to-day services we use,
incorporate p2p technology.

Another example is Windows 10 updates. Microsoft’s servers and P2P are both used
to deliver Windows 10 upgrades.

Some online gaming platforms make use of peer-to-peer (P2P) technology to allow
players to download games. Diablo III, StarCraft II, and World of Warcraft are all
distributed through peer-to-peer (P2P) by Blizzard Entertainment.

Pros Cons

It is generally slower because every user is

accessed by other users.


Cheap because it does not need a central server.

The network does not need a unique operating


Backing up data and archiving is tough because the
system to function.
files are handled by every user, not by a central

server.

It is less secure than other network models.


The speed of your internet connection may have no

bearing on the time it takes for your files t download.

The system will not be disrupted if one of the Possibilities of Illegal data sharing.
computers crashes.

Pros & Cons of Peer to Peer Model

Pros & Cons of Client-Server Model

Pros Cons

Authorized users (clients) can access and modify


When multiple client requests are made at the same
data on a server, allowing for improved sharing.
time, servers become significantly saturated,

resulting in traffic congestion.

This network is vulnerable. If the server crashes, the


Access and resources are better regulated on
whole network will collapse.
servers, ensuring that only authorized clients can

acquire or alter data.

Maintaining a central server can be costly and


Any new user can be simply integrated into the
require a lot of manpower and time.
networks because the network is flexible enough.

Backing up and archiving data is easier in this The user policies in the network must be set by an

network. expert network administrator.


How persistent HTTP connection is different than non-persistent HTTP connection.

Illustrate.

The Hypertext Transfer Protocol (HTTP) is an application-level protocol that


uses TCP as an underlying transport and typically runs on port 80. HTTP is
a stateless protocol i.e. server maintains no information about past client
requests.
HTTP Connections
1. Non-Persistent
2. Persistent
Before starting with persistent and non-persistent HTTP connection lets
know what is RTT.
RTT-> Time for a small packet to travel from client to server and back.
RTT= 2*propagation time
1. For a connection Persistent or Non-persistent it is sure that to initiate TCP
connection one RTT is used.
2. One RTT is used for HTTP request and first few bytes to HTTP response
to return.
So in order to know total file transmission time->
total = 2RTT+transmit time
Difference between Persistent & Non-Persistent connection.

Non-Persistent Connection
1. Without parallel connection
2. With parallel connection
Without parallel connection Non-Persistent
Each objection takes two RTT (assuming no window limit) one for TCP
connection and other for HTTP image/text file.
With parallel connection Non-Persistent

Persistent connection
1. Non-Pipelined
2. Pipelined
In Non-pipeline connection we first establish connection which takes two
RTT then we send all the objects images/text files which takes 1 RTT each
(TCP for each object is not required).
In Pipelined connection 2RTT for connection establishment and then
1RTT(assuming no window limit) for all the objects i.e. images/text.

Advantages of persistent connections :


1) Lower CPU and memory usage because there are less number of
connections.
2) Allows HTTP pipelining of requests and responses.
3) Reduced network congestion (fewer TCP connections).
4) Reduced latency in subsequent requests (no handshaking).
5) Errors can be reported without the penalty of closing the TCP connection.

Disadvantages of persistent connections :


Resources may be kept occupied even when not needed and may not be
available to others.
Most of the modern browsers like Chrome, Firefox and Internet Explorer use
persistent connections.

You might also like