Module 1
Module 1
Text Book
James F Kurose and Keith W Ross,
Computer Networking, A Top Down
approach, Sixth Edition, Pearson, 2017
2: Application Layer 1
15CS52- Computer Networks
Module 1- Application layer
Module 2- Transport layer
Module 3- Network layer
Module 4- Mobile and Multimedia Networks
Module 5- Multimedia networking
Applications
2: Application Layer 2
Some network apps
e-mail voice over IP
web real-time video
instant messaging conferencing- skype
remote login Movies on demand-
P2P file sharing Netflix
facebook
multi-user network
twitter
games
streaming stored video
clips
2: Application Layer 3
Chapter 2: Application layer
2.1 Principles of 2.6 P2P applications
network applications
2.2 Web and HTTP
2.3 FTP
2.4 Electronic Mail
SMTP, POP3, IMAP
2.5 DNS
2: Application Layer 4
Chapter 2: Application Layer
Our goals: learn about protocols
conceptual, by examining popular
implementation application-level
aspects of network protocols
application protocols HTTP
transport-layer FTP
service models SMTP / POP3 / IMAP
client-server
DNS
paradigm
peer-to-peer
paradigm
2: Application Layer 5
Principles of Network Applications
Creating a network app
application
transport
network
data link
2: Application Layer 7
Client-server architecture
server:
always-on host
Services requests
permanent IP address
Eg: web,ftp,
telnet,email
Data center
client/server housing a large no of host
Powerful virtual server
Google, Bing, Amazon, e-
Bay, Gmail, Yahoo,
facebook, twitter
2: Application Layer 8
Data center
facility composed of networked computers and
storage.
servers, storage subsystems, networking
switches, routers and firewalls, as well as the
cabling and physical racks used to organize and
interconnect the IT equipment.
Google has 30 to 50 data center
Can have hundreds of thousands of servers,
which must be powered and maintained.
2: Application Layer 9
Client-server architecture
clients:
communicate with server
may be intermittently
connected
may have dynamic IP
addresses
do not communicate
directly with each other
client/server
2: Application Layer 10
P2P architecture
no always-on server
arbitrary end systems
directly communicate
peer-peer
peers are intermittently
connected and change IP
addresses
Peers not owned by the
service provider, controlled
by users.
Peers reside at Homes,
universities, office.
Highly scalable but difficult to
manage
2: Application Layer 11
P2P architecture
Traffic intensive applications
File sharing- BitTorrent
Internet Telephony (skype)
IPTV- Kankan and PPStream
2: Application Layer 12
P2P architecture
Three Major Challenges
ISP Friendly –asymmetrical BW
usage
Security
Incentives- users volunteering for
sharing their BW, storage, and
computational resources.
2: Application Layer 13
Hybrid of client-server and P2P
Skype
voice-over-IP P2P application
centralized server: finding address of remote
party:
client-client connection: direct (not through
server)
Instant messaging
chatting between two users is P2P
centralized service: client presence
detection/location
• user registers its IP address with central
server when it comes online
• user contacts central server to find IP
addresses of buddies
2: Application Layer 14
Class-2
Processes Communicating
2: Application Layer 15
Processes communicating
Process: program running within a host.
within same host, two processes communicate
using inter-process communication (defined by
OS).
processes in different hosts communicate by
exchanging messages.
A sending process creates and sends messages
into the network;
a receiving process receives these messages and
possibly responds by sending messages back
2: Application Layer 16
Processes communicating
A network application consists of pairs of processes that send
messages.
A browser -client process ,a Web server - server process.
P2P- the peer that is downloading the file is labeled as the
client, and the peer that is uploading the file is labeled as the
server.
Client process: process that initiates communication
Server process: process that waits to be contacted
2: Application Layer 17
In the context of a communication session
between a pair of processes, the process
that initiates the communication is labeled
as the client.
The process that waits to be contacted to
begin the session is the server.
2: Application Layer 18
Interface Between process and
Computer networks-Sockets
host or host or
process sends/receives server
server
messages to/from its
socket. controlled by
app developer
socket analogous to door process process
2: Application Layer 19
Socket
The interface between the application layer
and the transport layer within a host.
referred to as the Application Programming
Interface (API) between the application and
the network.
The only control that the application developer
has on the transport-layer side is
(1) choice of transport protocol; (2) ability to
fix a few parameters maximum buffer and
maximum segment sizes
2: Application Layer 20
Addressing processes
to receive messages, process must have
identifier
host device has unique 32-bit IP address
Q: does IP address of host suffice for
identifying the process?
2: Application Layer 21
Addressing processes
2: Application Layer 22
Addressing processes
identifier includes both IP address and port numbers
associated with process on host.
Popular applications have been assigned specific port
numbers.
Example port numbers:
HTTP Web server: 80
SMTP Mail server: 25
to send HTTP message to gaia.cs.umass.edu web
server:
IP address: 128.119.245.12
Port number: 80
well-known port numbers for all Internet standard
protocols
2: Application Layer 23
Transport services Available to
Applications
sending side pushes messages through the socket.
At the other side of the socket, the transport-
layer protocol has the responsibility of getting the
messages to the socket of the receiving process.
Broadly classify the possible services along four
dimensions:
reliable data transfer
Throughput
timing
security.
2: Application Layer 24
Reliable data transfer
If a protocol provides a guaranteed data delivery
service, it is said to provide reliable data
transfer.
For many applications—such as electronic mail,
file transfer, remote host access, Web document
transfers, and financial applications can not
tolerate data loss
loss-tolerant applications
multimedia applications such as conversational
audio/video that can tolerate some amount of data loss.
2: Application Layer 25
Throughput
The rate at which the sending process can deliver bits
to the receiving process.
transport-layer protocol could provide, guaranteed
available throughput at some specified rate.
The application could request a guaranteed throughput
of r bits/sec, and the transport protocol would then
ensure that the available throughput is always at
least r bits/sec.
Example of internet telephone application ,
app encodes voice at 32kps then if transfer layer is
unable to provide that speed then app need to
encode at slower rate but not less than half of
required.
2: Application Layer 26
bandwidth-sensitive applications
Applications that have throughput
requirements.
Eg :Many current multimedia applications
Elastic applications
can make use of as much, or as little,
throughput as happens to be available.
Electronic mail, file transfer, and Web
transfers are all elastic applications.
2: Application Layer 27
Transport services Available to
Applications
Timing
A transport-layer protocol can also provide timing guarantees
Interactive real-time applications, such as Internet telephony,
virtual environments, teleconferencing, and multiplayer games
require low delay to be “effective”.
For non-real-time applications, lower delay is always preferable
to higher delay, but no tight constraint is placed on the end-
to-end delays.
Security
A transport protocol can provide an application
with one or more security services.
Encryption, data integrity, …
2: Application Layer 28
Class 3
Transport services provided by
the Internet
Application layer protocols
2: Application Layer 29
Transport services provided by the Internet
2: Application Layer 30
TCP services
connection-oriented service
a reliable data transfer service.
connection-oriented: setup required between
client and server processes.
2: Application Layer 32
Internet transport protocols services
UDP service:
2: Application Layer 33
Services Not Provided by
Internet Transport Protocols
Transport protocol services along four dimensions:
reliable data transfer, throughput, timing, and
security.
Which of these services are provided by TCP and UDP?
TCP- reliable, Security
TCP can be easily enhanced at the application layer with
SSLto provide security services
Today’s Internet can often provide satisfactory service
to time-sensitive applications, but it cannot provide any
timing or throughput guarantees.
2: Application Layer 34
Popular Internet applications, their application-
layer protocols, and their underlying transport
protocols
Application Underlying
Application layer protocol transport protocol
2: Application Layer 35
Secure TCP
Neither TCP nor UDP provide any encryption
An enhancement for TCP, called Secure
Sockets Layer (SSL)
TCP-enhanced-with-SSL
provides critical process-to-process security
services, including encryption, data integrity,
and end-point authentication.
Enhancements being implemented in the
application layer
2: Application Layer 36
Application layer protocols
network processes communicate with each
other by sending messages into sockets.
But how are these messages structured?
What are the meanings of the various
fields in the messages?
When do the processes send the
messages?
2: Application Layer 37
An application-layer protocol defines:
The types of messages exchanged, for
example, request messages and response
messages.
The syntax of the various message types,
such as the fields in the message and how the
fields are delineated.
The semantics of the fields, that is, the
meaning of the information in the fields.
Rules for determining when and how a
process sends messages and responds to
messages.
2: Application Layer 38
Web’s application-layer protocol, HTTP is
available as an RFC 1845 and RFC2610 .-
public domain
If a browser developer follows the rules
of the HTTP RFC, the browser will be able
to retrieve Web pages from any Web
server that has also followed the rules of
the HTTP RFC.
Skype uses proprietary application-layer
protocols
2: Application Layer 39
2.2Web and HTTP
Web page consists of objects.
Object can be HTML file, JPEG image, Java
applet, audio file,…
Web page consists of base HTML-file which
includes several referenced objects
Each object is addressable by a URL
Example URL:
www.someschool.edu/someDept/pic.gif
2: Application Layer 40
HTTP overview
HTTP: hypertext
transfer protocol HT
TP
r
equ
Web’s application layer PC running HT est
TP
protocol Explorer res
pon
se
client/server model
client: browser that
e st
u
requests, receives, P r eq se Server
T o n
“displays” Web objects HT r es
p running
T P Apache Web
server: Web server HT
server
sends objects in
response to requests
Mac running
Navigator
2: Application Layer 41
HTTP overview (continued)
Uses TCP: HTTP is “stateless”
client initiates TCP server maintains no
connection (creates socket) information about
to server, port 80 past client requests
server accepts TCP
connection from client aside
Protocols that maintain
HTTP messages (application- “state” are complex!
layer protocol messages) past history (state) must
exchanged between browser be maintained
(HTTP client) and Web if server/client crashes,
server (HTTP server)
their views of “state” may
TCP connection closed
be inconsistent, must be
reconciled
2: Application Layer 42
HTTP connections
Nonpersistent HTTP Persistent HTTP
At most one object is Multiple objects can
sent over a TCP be sent over single
connection. TCP connection
each request/response between client and
pair be sent over a server.
separateTCPconnectio all of the requests and
n their corresponding
responses be sent over
the same
TCPconnection
2: Application Layer 43
Nonpersistent HTTP
(contains text,
Suppose user enters URL www.someSchool.edu/someDepartment/home.index
references to 10
jpeg images)
time
2: Application Layer 44
Nonpersistent HTTP (cont.)
2: Application Layer 45
Non-Persistent HTTP: Response time
Definition of RTT: time for a
small packet to travel from
client to server and back.
Response time: initiate TCP
connection
one RTT to initiate TCP
RTT
connection
request
one RTT for HTTP request file
time to
and first few bytes of RTT
transmit
HTTP response to return file
file
file transmission time received
total = 2RTT+transmit time
time time
2: Application Layer 46
Persistent HTTP
2: Application Layer 47
HTTP request message
two types of HTTP messages: request, response
HTTP request message:
ASCII (human-readable format)
request line
(GET, POST, GET /somedir/page.html HTTP/1.1
HEAD commands) Host: www.someschool.edu
User-agent: Mozilla/4.0
header Connection: close
lines Accept-language:fr
Carriage return,
line feed (extra carriage return, line feed)
indicates end
of message
The GET method is used when the browser
requests an object, with the requested object
identified in the URL field.
The browser is requesting the object
/somedir/page.html.
The browser implements version HTTP/1.1.
The header line Host: www.someschool.edu
specifies the host on which the object resides.
the Connection: close header line, the browser
is telling the server that it doesn’t want to
bother with persistent connections;
it wants the server to close the connection
after sending the requested object.
2: Application Layer 49
The User-agent: header line specifies the
user agent, that is, the browser type.
The user agent is Mozilla/5.0, a Firefox
browser.
Acceptlanguage: header indicates that the
user prefers to receive a French version of
the object, if such an object exists on the
server;
2: Application Layer 50
HTTP request message: general format
2: Application Layer 51
GET - Requests data from a specified
resource
POST - Submits data to be processed to a
specified resource
2: Application Layer 52
The entity body is empty with the GET
method, but is used with the POST
method.
An HTTP client often uses the POST
method when the user fills out a form—for
example, when a user provides search
words to a search engine.
If the value of the method field is POST,
then the entity body contains what the
user entered into the form fields.
2: Application Layer 53
For example, if a form uses the GET method,
has two fields, and the inputs to the two fields
are monkeys and bananas, then the URL will
have the structure
www.somesite.com/animalsearch?
monkeys&bananas.
The HEAD method is similar to the GET
method.
When a server receives a request with the
HEAD method, it responds with an HTTP
message
2: Application Layer 54
Application developers often use the HEAD
method for debugging.
The PUT method is often used in
conjunction with Web publishing tools.
PUT allows a user to upload an object to a
specific path (directory) on a specific Web
server.
The DELETE method allows a user, or an
application, to delete an object on a Web
server
2: Application Layer 55
Uploading form input
Post method:
Web page often
includes form input URL method:
Input is uploaded to Uses GET method
server in entity body Input is uploaded in
URL field of request
line:
www.somesite.com/animalsearch?monkeys&banana
2: Application Layer 56
Method types
HTTP/1.0 HTTP/1.1
GET GET, POST, HEAD
POST PUT
HEAD uploads file in entity
body to path specified
asks server to leave
in URL field
requested object out of
response DELETE
deletes file specified in
the URL field
2: Application Layer 57
HTTP response message
status line
(protocol
status code HTTP/1.1 200 OK
status phrase) Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT
header Server: Apache/1.3.0 (Unix)
lines Last-Modified: Mon, 22 Jun 1998 …...
Content-Length: 6821
Content-Type: text/html
2: Application Layer 59
The server uses the Connection: close header line to
tell the client that it is going to close the
TCPconnection after sending the message.
The Date: header line indicates the time and date
when the HTTP response was created and sent by
the server.
The Server:header line indicates that the message
was generated by an Apache Web server.
It is analogous to the User-agent:
The Last-Modified: header line indicates the time
and date when the object was created or last
modified.
2: Application Layer 60
The Content-Length: header line indicates
the number of bytes in the object being
sent.
The Content-Type: header line indicates
that the object in the entity body is
HTMLtext.
2: Application Layer 61
HTTP response status codes
The status code and associated phrase indicate the
result of the request.
In first line in server->client response message.
A few sample codes:
200 OK
request succeeded, requested object later in this message
301 Moved Permanently
requested object moved, new location specified later in
this message (Location:)
400 Bad Request
request message not understood by server
404 Not Found
requested document not found on this server
505 HTTP Version Not Supported 2: Application Layer 62
2: Application Layer 63
User-server state: cookies
It is often desirable for a Web site to
identify users, either because the server
wishes to restrict user access or because it
wants to serve content as a function of the
user identity. For these purposes, HTTP uses
cookies.
Cookies, defined in [RFC 6265], allow sites to
keep track of users
2: Application Layer 64
User-server state: cookies
Example:
Many major Web sites
Susan always access
use cookies
Internet always from PC
Four components:
visits specific e-
1) cookie header line of
HTTP response message commerce site for first
2) cookie header line in time
HTTP request message when initial HTTP
3) cookie file kept on
user’s host, managed by requests arrives at site,
user’s browser site creates:
4) back-end database at unique ID
Web site
entry in backend
database for ID
2: Application Layer 65
Cookies: keeping “state” (cont.)
client server
ebay 8734
usual http request msg
Amazon server
cookie file usual http response creates ID
Set-cookie: 1678 1678 for user create
ebay 8734 entry
amazon 1678
usual http request msg
cookie: 1678 cookie- access
specific
one week later: usual http response msg action backend
database
access
ebay 8734 usual http request msg
amazon 1678 cookie: 1678 cookie-
spectific
usual http response msg action
2: Application Layer 66
Cookies (continued)
aside
What cookies can bring: Cookies and privacy:
authorization cookies permit sites to
shopping carts learn a lot about you
you may supply name
recommendations
and e-mail to sites
user session state
(Web e-mail)
How to keep “state”:
protocol endpoints: maintain state
at sender/receiver over multiple
transactions
cookies: http messages carry state
2: Application Layer 67
Web caching
a proxy server—is a network entity that
satisfies HTTP requests on the behalf of an
origin Web server.
own disk storage and keeps copies of
recently requested objects in this storage.
A user’s browser can be configured so that
all of the user’s HTTPrequests are first
directed to the Web cache.
2: Application Layer 68
Web caches (proxy server)
Goal: satisfy client request without involving origin server
client
origin
server
More about Web caching
cache acts as both Why Web caching?
client and server reduce response time
typically cache is for client request
installed by ISP reduce traffic on an
(university, company, institution’s access
residential ISP) link.
Reduce web traffic in
the Internet as a
whole, thereby
improving the
performance of all
applications.
2: Application Layer 70
Caching example
origin
Assumptions servers
average object size = 1000000
public
bits= 1Mb=1 Mega bits Internet
avg. request rate from
institution’s browsers to origin
servers = 15/sec
delay from router on the 15 Mbps
access link
Internet side of access link to
any origin server and back to institutional
network
router = 2 sec 100 Mbps LAN
Consequences
total delay = Internet delay +
access delay + LAN delay institutional
= 2 sec + 1 sec+ milliseconds cache
Caching example (cont)
origin
possible solution servers
increase bandwidth of access
public
link to, say, 100 Mbps Internet
consequence
Total delay = Internet delay +
access delay + LAN delay 100 Mbps
= 2 sec + msecs + msecs access link
often a costly upgrade
institutional
network
100 Mbps LAN
institutional
cache
2: Application Layer 72
Caching example (cont)
possible solution: install origin
cache servers
suppose hit rate is 0.4
public
consequence Internet
40% requests will be
satisfied almost immediately
( 10ms)
60% requests satisfied by 15 Mbps
origin server access link
utilization of access link
institutional
reduced to 60%, resulting in network
negligible delays (say 1.0 to 100 Mbps LAN
0.6 sec)
total avg delay =0.4*(0.01)
secs + .6*(2.0)s = 1.2 secs
institutional
cache
Content Distribution Networks(CDNs)
A CDN Company installs many geographically
distributed caches throughout the Internet.
Shared CDN- Akamai, Limelight
Dedicated CDN- google and Microsoft
2: Application Layer 74
Conditional GET
object housed in the Web server may have
been modified since the copy was cached at
the client.
A mechanism that allows a cache to verify
that its objects are up to date- conditional
GET.
(1) the request message uses the GET
method
(2) the request message includes an If-
ModifiedSince: header line.
2: Application Layer 75
On the behalf of a requesting browser, a proxy
cache sends a request message to a Web server:
GET /fruit/kiwi.gif HTTP/1.1
Host: www.exotiquecuisine.com
the Web server sends a response message with
the requested object to the cache:
HTTP/1.1 200 OK
Date: Sat, 8 Oct 2011 15:39:29
Server: Apache/1.3.0 (Unix)
Last-Modified: Wed, 7 Sep 2011 09:23:24 Content-
Type: image/gif
(data data data data data ...)
2: Application Layer 76
one week later, another browser requests the same
object via the cache, and the object is still in the
cache.
The cache performs an up-to-date check by issuing
a conditional GET.
Specifically, the cache sends:
GET /fruit/kiwi.gif HTTP/1.1
Host: www.exotiquecuisine.com
If-modified-since: Wed, 7 Sep 2011 09:23:24
This conditional GET is telling the server to send
the object only if the object has been modified
since the specified date.
2: Application Layer 77
The Web server sends a response
message to the cache:
HTTP/1.1 304 Not Modified
Date: Sat, 15 Oct 2011 15:39:29
Server: Apache/1.3.0 (Unix)
(empty entity body)
2: Application Layer 78
Conditional GET
2: Application Layer 80
FTP: the file transfer protocol
2: Application Layer 81
FTP HTTP
Run on top of TCP Run on top of TCP
Two parallel TCP Sends request and
connection to response into Same
transfer file- control TCP connection.
connection, data Send its control
connection information in-band
Send its control
information out of
band
2: Application Layer 82
FTP: separate control, data connections
TCP control connection
FTP client contacts FTP server port 21
at port 21, TCP is transport
protocol TCP data connection
client authorized over control FTP port 20 FTP
connection client server
client browses remote server opens another TCP
directory by sending commands
data connection to transfer
over control connection.
another file.
when server receives file control connection: “out of
transfer command, server
band”
opens 2nd TCP connection (for
FTP server maintains “state”:
file) to client
current directory, earlier
after transferring one file,
authentication
server closes data connection.
2: Application Layer 83
FTP commands, responses
2: Application Layer 84
Electronic Mail outgoing
message queue
user mailbox
user
Three major components: agent
user agents mail
user
mail servers server
agent
simple mail transfer protocol:
SMTP mail
SMTP
server user
“mail reader”
SMTP
composing, editing, reading mail user
agent
mail messages server
e.g. Outlook, Mozilla
user
Thunderbird
agent
outgoing, incoming messages user
stored on server agent
2: Application Layer 85
Electronic Mail: mail servers
user
Mail Servers agent
mailbox contains incoming
mail
user
messages for user server
agent
message queue of outgoing
SMTP
(to be sent) mail messages mail
server user
SMTP protocol between mail
servers to send email
SMTP agent
messages SMTP
client: sending mail mail user
agent
server server
“server”: receiving mail
user
server agent
user
agent
2: Application Layer 86
Electronic Mail: SMTP
uses TCP to reliably transfer email message from client
to server, port 25
direct transfer: sending server to receiving server
three phases of transfer
handshaking (greeting)
transfer of messages
closure
command/response interaction
commands: ASCII text
response: status code and phrase
2: Application Layer 87
SMTP
Transfers messages from senders’ mail servers
to the recipients’ mail servers.
much older than HTTP.
Restricts the body of all mail messages to simple
7-bit ASCII
7-bit ASCII restriction is a bit of a pain—it
requires binary multimedia data to be encoded to
ASCII before being sent over SMTP;
it requires the corresponding ASCII message to
be decoded back to binary after SMTP
transport.
2: Application Layer 88
Scenario: Alice sends message to Bob
1) Alice uses UA to compose 4) SMTP client sends Alice’s
message and “to” message over the TCP
[email protected] connection
2) Alice’s UA sends message 5) Bob’s mail server places the
to her mail server; message message in Bob’s mailbox
placed in message queue 6) Bob invokes his user agent
3) Client side of SMTP opens to read message
TCP connection with Bob’s
mail server
1 mail
mail
server user
user server
2 agent
agent 3 6
4 5
2: Application Layer 89
Does not use intermediate mail servers for
sending mail.
The TCP connection is a direct connection.
The message does not get placed in some
intermediate mail server.
2: Application Layer 90
how SMTP transfers a message from a
sending mail server to a receiving mail server.
2: Application Layer 91
Sample SMTP interaction
S: 220 hamburger.edu
C: HELO crepes.fr
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <[email protected]>
S: 250 [email protected]... Sender ok
C: RCPT TO: <[email protected]>
S: 250 [email protected] ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: Do you like ketchup?
C: How about pickles?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 hamburger.edu closing connection
2: Application Layer 92
SMTP: final words
SMTP uses persistent connections
SMTP requires message (header & body) to be in
7-bit ASCII
SMTP server uses CRLF.CRLF to determine end
of message
2: Application Layer 93
Comparison with HTTP
HTTP SMTP
Transfers files from a web Transfers files from one mail
server to a web client server to another mail server.
Persistent Persistent
Pull protocol Push protocol
Someone loads The Sending mail server
94
Mail message format
2: Application Layer 95
Mail access protocols
SMTP SMTP access user
user
agent protocol agent
2: Application Layer 96
POP3
POP3 begins when the user agent opens a
TCP connection to the mail server on port
110.
Three phases:
Authorization –UA sends usr, pwd
Transaction- UA retrieves msg, delete
Update- occurs after the client has issued the
quit command
2: Application Layer 97
POP3 protocol C:telnet mailServer 110
S: +OK POP3 server ready
C: user bob
authorization phase S: +OK
C: pass hungry
client commands:
S: +OK user successfully logged on
user: declare username
C: list
pass: password
S: 1 498
server responses S: 2 912
+OK S: .
-ERR C: retr 1
S: <message 1 contents>
transaction phase, client: S: .
list: list message numbers C: dele 1
retr: retrieve message by C: retr 2
S: <message 1 contents>
number
S: .
dele: delete
C: dele 2
quit C: quit
S: +OK POP3 server signing off
2: Application Layer 98
A user agent using POP3 can often be configured
to “download and delete” or to “download and
keep.”
In the download-and-delete mode, the user agent
will issue the list, retr, and dele commands.
list the size of each of the stored messages.
The user agent then retrieves and deletes each
message from the server.
After processing the quit command, the POP3
server enters the update phase and removes
messages 1 and 2 from the mailbox.
2: Application Layer 99
POP3
More about POP3
Previous example uses “download and delete” mode.
Bob cannot re-read e-mail if he changes client
“Download-and-keep”: copies of messages on local
machine
POP3 is stateless across sessions
Does not provide any means for a user to create
remote folders and assign msgs to folder
The DNS protocol runs over UDP and uses port 53.
a Verisign, Dulles, VA
c Cogent, Herndon, VA (also LA)
d U Maryland College Park, MD k RIPE London (also 16 other locations)
g US DoD Vienna, VA
h ARL Aberdeen, MD i Autonomica, Stockholm (plus
j Verisign, ( 21 locations) 28 other locations)
e NASA Mt View, CA m WIDE Tokyo (also Seoul,
f Internet Software C. Palo Alto, Paris, SF)
CA (and 36 other locations)
13 root name
servers worldwide
b USC-ISI Marina del Rey, CA
l ICANN Los Angeles, CA
resolution example
2
Host at cis.poly.edu 3
TLD DNS server
wants IP address for 4
gaia.cs.umass.edu 5
gaia.cs.umass.edu
recursive query: 2 3
puts burden of name
7 6
resolution on
TLD DNS server
contacted name
server
heavy load? local DNS server
dns.poly.edu 5 4
1 8
gaia.cs.umass.edu
Type=A
Type=CNAME
name is hostname
name is alias name for some
value is IP address
“canonical” (the real) name
(Relay1.bar.foo.com,145.
www.ibm.com is really
37.93.126, A)
Type=NS servereast.backup2.ibm.com
name is domain (e.g. foo.com)
value is canonical name
value is hostname of
Type=MX
authoritative name server for value is canonical name of a
this domain
mailserver
(Foo.com, dns.foo.com, NS)
(foo.com,
mail.bar.foo.com,MX)
2: Application Layer
117
DNS Messages
query and reply messages, both with same message
format
msg header
identification: 16 bit #
for query, reply to query
uses same #
flags:
query or reply
recursion desired
recursion available
reply is authoritative
RRs in response
to query
records for
authoritative servers
additional “helpful”
info that may be used
topics:
File distribution –BitTorrent
Database distributed over a
large community of peers-
Distributed Hash Table
Time to distribute F
= dcs = max { NF/us, F/dmin }
to N clients using
client/server approach
increases linearly in N
(for large N)
File distribution time: P2P
Server
server must send one
F u1 d1 u2
copy: F/us time us d2
3.5
P2P
Minimum Distribution Time
3
Client-Server
2.5
1.5
0.5
0
0 5 10 15 20 25 30 35
N
2: Application Layer 127
File distribution: BitTorrent
P2P file distribution
obtain list
of peers
trading
chunks
peer
3
15
4
12
5
10
8
Each peeronly aware of immediate successor
and predecessor.
Circle DHT (2)
1110
4
1110
12
1110
1110 5
Define closest 1110
as closest 10
successor 8
Circular DHT with Shortcuts
1 Who’s resp
for key 11?
3
15
4
12
5
10
8
Each peer keeps track of IP addresses of predecessor,
successor, short cuts.
Reduced from 6 to 2 messages.
Possible to design shortcuts so O(log N) neighbors, O(log
N) messages in query
Peer Churn
1
•To handle peer churn, require
print modifiedMessage
clientSocket.close()
controlled by
controlled by process application
application process
developer
developer socket socket
controlled by TCP with TCP with controlled by
buffers, operating
operating buffers, internet system
system variables variables
host or host or
server server