Application Layer: Computer Networking: A Top Down Approach
Application Layer: Computer Networking: A Top Down Approach
Application Layer
Computer
Networking: A
Top Down
Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012
Example:
Web application
Peer-to-peer file sharing system
Characteristics:
Clients do not directly communicate with each other
Disadvantage:
Infrastructure Intensive
service providers must pay recurring
interconnection and bandwidth costs for sending
data and receiving data to and from Internet.
Challenges:
ISP Friendly
Security
Incentives
IP address
port number
Application Layer 2-13
Transport Services Available to
Applications
Services that a transport-layer protocol can offer
to applications invoking it can be classified into 4
dimensions :
1. Reliable data transfer
2. Throughput
3. Timing
4. Security
UDP Services
Web browser
Web server
Application Layer 2-19
Overview of HTTP
HTTP: hypertext transfer protocol
Web’s application layer protocol
HT
TP
r equ
PC running e
st
HT
Firefox browser TP
res
pon
se
t
u es
req server
T P n se
HT s po running
r e Apache Web
T TP
H server
iphone running
Safari browser
time
6. Steps 1-5 repeated for each of 10
jpeg objects
initiate TCP
connection
RTT
request
file
time to
RTT transmit
file
file
received
time time
HTTP with Persistent Connections
~
~ entity body ~
~ body
The Web cache has its own disk storage and keeps
copies of recently requested objects in this storage.
HT proxy
TP u e st
req server req
HT ues P se
client TP t H TT p on
res res origin
pon T P
se HT server
u est
req e
TT P o ns
p
H r es
T TP
H
client origin
server
Application Layer
More about Web caching
A cache is both a Why Web caching?
server and a client at reduce response time for
the same time. client request.
Web cache is reduce traffic on an
purchased and institution’s access link.
installed by an
ISP(university,
company, residential
ISP)
Mailbox
Message queue
above lets you send email without using email client (reader)
From: [email protected]
To: [email protected]
Subject: Searching for the meaning of life.
3. Load distribution
gaia.cs.umass.edu
gaia.cs.umass.edu
(dns1.networkutopia.com, 212.212.212.1, A)
Application Layer 2-100
Peer-to-Peer Applications
Self scalable
time to distribute F
to N clients using
Dc-s > max{NF/us,,F/dmin}
client-server approach
increases linearly in N
Application Layer 2-106
File distribution time: P2P
server transmission: must
upload at least one copy F
us
time to send one copy: F/us
di
client: each client must network
download file copy ui
min client download time: F/dmin
clients: as aggregate must download NF bits
max upload rate (limting max download rate) is us + Sui
time to distribute F
DP2P
to N clients using > max{F/us,,F/dmin,,NF/(us + Sui)}
P2P approach
increases linearly in N …
… but so does this, as each peer brings service capacity
Application Layer 2-107
BitTorrent
BitTorrent is a popular P2P protocol for file
distribution.
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.
While it downloads chunks it also uploads chunks
to other peers.
Once a peer has acquired the entire file, it may
leave the torrent, or remain in the torrent and
continue to upload chunks to other peers.
Application Layer 2-108
How BitTorrent works?
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.
Alice arrives …
… obtains list
of peers from tracker
… and begins exchanging
file chunks with peers in torrent
Un-scalable approach
1
This circular arrangement of the peers is a special case of an overlay network.
3
15
4
12
5
10
8
Resolving a query
1 Who is responsible
for key 14 ?
value 3
15
4
12
5
10
8
Advantage:
The circular DHT provides a very elegant solution for
reducing the amount of overlay information each peer
must manage.
In particular, each peer needs only to be aware of two
peers, its immediate successor and its immediate
predecessor.
Disadvantage:
But this solution introduces yet a new problem.
Although each peer is only aware of two neighboring
peers, to find the node responsible for a key (in the worst
case), all N nodes in the DHT will have to forward a
message around the circle; N/2 messages are sent on
average.
Circular DHT with shortcuts
1 Who is responsible
value
for key 14 ?
3
15
4
12
5
10
8
• Each peer keeps track of IP addresses of predecessor,
successor, short cuts.
• Reduced from 6 to 3 messages.
• Shortcuts can significantly reduce the number of messages
used to process a query.
Peer churn Peers may come and go (churn)
1
Handling peer churn:
15 3 Each peer knows address of its
two successors
4 Each peer periodically pings its
two successors to check aliveness
12 If immediate successor leaves,
5
choose next successor as new
10 immediate successor
8
example: peer 5 abruptly leaves
Peer churn handling peer churn:
1
peers may come and go (churn)
each peer knows address of its
15 3 two successors
each peer periodically pings its
4 two successors to check aliveness
if immediate successor leaves,
12
choose next successor as new
immediate successor
10
8
example: peer 5 abruptly leaves
peer 4 detects peer 5’s departure; makes 8 its immediate
successor
4 asks 8 who its immediate successor is; makes 8’s
immediate successor its second successor.
When a peer wants to join the DHT:
Let’s say a peer with identifier 13 wants to join the DHT, and at
the time of joining, it only knows about peer 1’s existence in the
DHT.