0% found this document useful (0 votes)
81 views

Lecture 8 (Peer-to-Peer Applications)

This document discusses peer-to-peer (P2P) applications and architectures. It describes two types of P2P applications: file distribution and distributed databases. For file distribution, it explains BitTorrent, where files are distributed from one source to many peers, with each peer assisting in redistribution. For distributed databases, it discusses Distributed Hash Tables (DHTs) which store and retrieve data across peers without a central coordinator. It then analyzes the scalability of P2P architectures compared to client-server, showing how P2P designs improve distribution time as more peers participate.

Uploaded by

Abdullah Anwaar
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Lecture 8 (Peer-to-Peer Applications)

This document discusses peer-to-peer (P2P) applications and architectures. It describes two types of P2P applications: file distribution and distributed databases. For file distribution, it explains BitTorrent, where files are distributed from one source to many peers, with each peer assisting in redistribution. For distributed databases, it discusses Distributed Hash Tables (DHTs) which store and retrieve data across peers without a central coordinator. It then analyzes the scalability of P2P architectures compared to client-server, showing how P2P designs improve distribution time as more peers participate.

Uploaded by

Abdullah Anwaar
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Computer

Communications and
Networks
Peer-to-Peer Applications
(week 6)
By
Hafiz Aamir Hafeez
Peer-to-Peer Applications
A P2P architecture, there is minimal (or no) reliance on always-on
infrastructure servers. Instead, pairs of intermittently connected hosts, called
peers, communicate directly with each other. The peers are not owned by a
service provider, but are instead desktops and laptops controlled by users.
Two different applications that are particularly well-suited for P2P designs.
File Distribution: where the application distributes a file from a single
source to a large number of peers.
e.g: BitTorrent system.
Database distributed over A large community of peers:
e.g: Distributed Hash Table (DHT).
P2P File Distribution

Distributing a large file from a single server to a large number of hosts (called peers).
The file might be a new version of the Linux operating system, a software patch for
an existing operating system or application, an MP3 music file, or an MPEG video file.
In client-server file distribution, the server must send a copy of the file to each of the
peers—placing an enormous burden on the server and consuming a large amount of
server bandwidth.
In P2P file distribution, each peer can redistribute any portion of the file it has
received to any other peers, thereby assisting the server in the distribution process.
Most popular P2P file distribution protocol is BitTorrent. Originally developed by
Bram Cohen, there are now many different independent BitTorrent clients
conforming to the BitTorrent protocol, just as there are a number of Web browser
clients that conform to the HTTP protocol.
Scalability of P2P Architectures
To compare client-server architectures with peer-to-peer architectures, and illustrate
the inherent self-scalability of P2P, we now consider a simple quantitative model for
distributing a file to a fixed set of peers for both architecture types.
As shown in Figure, the server and the peers are connected to the Internet with access
links.
Upload rate of the server’s access link by us,
Upload rate of the ith peer’s access link by ui
Download rate of the ith peer’s access link by di
Size of the file to be distributed (in bits) by F
Number of peers that want to obtain a copy of the file by N
The distribution time is the time it takes to get a copy of the file to all N peers.
Scalability
of P2P
Architectur
es
Scalability of P2P Architectures

In our analysis of the distribution time below, for both client-server and
P2P architectures, we make assumption that the Internet core has
abundant bandwidth, implying that all of the bottlenecks are in access
networks. We also suppose that the server and clients are not participating
in any other network applications, so that all of their upload and download
access bandwidth can be fully devoted to distributing this file.
Let’s first determine the distribution time for the client-server architecture,
which we denote by Dcs.
In the client-server architecture, none of the peers aids in distributing the
file. We make the following observations:
Scalability of P2P Architectures
•  The server must transmit one copy of the file to each of the N peers.
Thus the server must transmit NF bits. Since the server’s upload rate
is us, the time to distribute the file must be at least NF/us.
• Let dmin denote the download rate of the peer with the lowest
download rate, that is, dmin = min{d1,dp,...,dN}.
The peer with the lowest download rate cannot obtain all F bits of the
file in less than F/dmin seconds. Thus the minimum distribution time is
at least F/dmin.
Putting these two observations together, we obtain
BitTorrent
BitTorrent is a popular P2P protocol for file distribution. In BitTorrent lingo, the
collection of all peers participating in the distribution of a particular file is called a
torrent. Peers in a torrent download equal-size chunks of the file from one
another, with a typical chunk size of 256 KBytes. When a peer first joins a torrent,
it has no chunks. Over time it accumulates more and more chunks. While it
downloads chunks it also uploads chunks to other peers.
Let’s now take a closer look at how BitTorrent operates.
Each torrent has an infrastructure node called a tracker. When a peer joins a
torrent, it registers itself with the tracker and periodically informs the tracker that
it is still in the torrent. In this manner, the tracker keeps track of the peers that are
participating in the torrent. A given torrent may have fewer than ten or more than
a thousand peers participating at any instant of time.
BitTorrent

Functionality of BitTorrent is all theoretical portion is for your reading.


Important this is definition of unhooked.
Functionality of BitTorrent is part of assignment. But should be written
in your own words.
Distributed Hash Tables (DHTs)
Distributed Hash Tables are a form of a distributed database that can
store and retrieve information associated with a key in a network of
peer nodes that can join and leave the network at any time. The nodes
coordinate among themselves to balance and store data in the network
without any central coordinating party. Distributed Hash Tables are
both fault tolerant and resilient when key/value pairs are replicated.
The ability to distribute data among the peers is in strong contrast to
the Blockchain model in which every node has a copy of the entire
ledger. This is a critical distinction and could allow for the ability to
move health records out of the silos of the EHR systems.

You might also like