Documente Academic
Documente Profesional
Documente Cultură
Application Layer
CE - 402
Network applications:
Process: program running
within a host.
within same host, two
processes communicate
using interprocess
communication (defined
by OS).
processes running in
different hosts
communicate with an
application-layer protocol
CE - 402
CC&N-CE-402
Application Layer
CE - 402
application
transport
network
data link
physical
application
transport
network
data link
physical
application
transport
network
data link
physical
Types of messages
exchanged, eg, request &
response messages
Syntax of message types:
what fields in messages &
how fields are delineated
Semantics of the fields, ie,
meaning of information
in fields
Rules for when and how
processes send & respond
to messages
CE - 402
CC&N-CE-402
Public-domain protocols:
defined in RFCs
allows for
interoperability
eg, HTTP, SMTP
Proprietary protocols:
eg, KaZaA
THREE PARADIGMS
Client server
Peer-to-Peer
Hybrid
Application Layer
Client-server paradigm
Typical network app has two
pieces: client and server
Client:
application
transport
network
data link
physical
Server:
provides requested service to client
request
reply
application
transport
network
data link
physical
Peer-to-Peer paradigm
CE - 402
CC&N-CE-402
Application Layer
Application
layer protocol
Underlying
transport protocol
smtp
telnet
http
ftp
proprietary
(e.g. RealNetworks)
NSF
proprietary
(e.g., Vocaltec)
TCP
TCP
TCP
TCP
TCP or UDP
CE - 402
TCP or UDP
typically UDP
CE - 402
CC&N-CE-402
PC running
Explorer
Server
running
NCSA Web
server
Mac running
Navigator
Application Layer
CE - 402
Architecture of WWW
CE - 402
CC&N-CE-402
10
Application Layer
Client (Browser)
Each browser usually consists of three parts: a controller, client protocol, and
interpreters.
The controller receives input from the keyboard or the mouse and uses the
client programs to access the document.
After the document has been accessed, the controller uses one of the
interpreters to display the document on the screen.
The client protocol can be one of the protocols described previously such as
FTP or HTTP.
The interpreter can be HTML, Java, or JavaScript, depending on the type of
document.
CE - 402
11
URL
CE - 402
CC&N-CE-402
12
Application Layer
Cookies
CE - 402
13
Cookies
3.
4.
CC&N-CE-402
14
Application Layer
WEB DOCUMENTS
CE - 402
15
Static document
When a client accesses the document, a copy of the document is
sent. The user can then use a browsing program to display the
document
CE - 402
CC&N-CE-402
16
Application Layer
CE - 402
17
CC&N-CE-402
18
Application Layer
CE - 402
19
HTTP
CE - 402
CC&N-CE-402
20
10
Application Layer
CE - 402
21
CE - 402
CC&N-CE-402
http is stateless
server
maintains
no
information about past client
requests
so that the communication
consists of independent pairs
of request and response
Protocols that maintain state
are complex!
22
11
Application Layer
http example
Suppose user enters URL
www.SSUET.edu/CEDt/home.index
to 10 jpeg images)
time
CE - 402
23
connection.
time
CE - 402
CC&N-CE-402
of 10 jpeg objects
24
12
Application Layer
HTTP 1.1
CE - 402
25
CE - 402
CC&N-CE-402
26
13
Application Layer
non-persistent
connection: one object
in each TCP
connection
some browsers
create multiple
TCP connections
simultaneously one per object
persistent connection:
multiple objects
transferred within one
TCP connection
CE - 402
27
request line
(GET, POST,
HEAD commands)
CE - 402
CC&N-CE-402
28
14
Application Layer
CE - 402
29
HTTP/1.1 200 OK
Connection: close
Date: Thu, 06 Aug 2011 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 22 Jun 2011 ...
Content-Length: 6821
Content-Type: text/html
data data data data data ...
data, e.g.,
requested
html file
CE - 402
CC&N-CE-402
30
15
Application Layer
200 OK
31
client
server
CE - 402
CC&N-CE-402
time
32
16
Application Layer
client
http response
HTTP/1.0
304 Not Modified
object
not
modified
If-modified-since:
<date>
http response
object
modified
HTTP/1.1 200 OK
<data>
CE - 402
33
CE - 402
CC&N-CE-402
origin
server
client
client
Proxy
server
origin
server
34
17
Application Layer
origin
servers
public
Internet
1.5 Mbps
access link
institutional
network
10 Mbps LAN
institutional
cache
CE - 402
35
user
at host
CE - 402
CC&N-CE-402
FTP
FTP file transfer
user
client
interface
local file
system
FTP
server
remote file
system
36
18
Application Layer
CE - 402
FTP port 20
client
FTP
server
37
CE - 402
CC&N-CE-402
38
19
Application Layer
Electronic Mail
outgoing
message queue
user agents
mail servers
simple mail transfer protocol:
smtp
User Agent
a.k.a. mail reader
composing, editing, reading
mail messages
e.g., Microsoft Outlook,
Pegasus Mail,Gmail, Yahoo
outgoing, incoming messages
stored on server
CE - 402
user mailbox
user
agent
mail
server
SMTP
SMTP
mail
server
user
agent
user
agent
mail
server
SMTP
user
agent
user
agent
user
agent
39
Mail Servers
mail
server
SMTP
SMTP
mail
server
user
agent
CE - 402
CC&N-CE-402
SMTP
user
agent
mail
server
user
agent
user
agent
user
agent
40
20
Application Layer
CE - 402
41
CC&N-CE-402
220 SSUET.edu
HELO yahoo.com
250 Hello yahoo.com, pleased to meet you
MAIL FROM: <amir@yahoo.com >
250 amir@yahoo.com ... Sender ok
RCPT TO: <asad@SSUET.edu>
250 asad@SSUET.edu ... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Do you like ketchup?
How about pickles?
.
250 Message accepted for delivery
QUIT
221 SSUET.edu closing connection
Instructor: M. Rehan Rasheed
42
21
Application Layer
Smtp: http
Comparison with http
http: pull
email: push
both have ASCII command/response interaction, status codes
http: each object encapsulated in its own response (if v.1.0 or so
specified in 1.1)
smtp: multiple message parts sent in one connection (multipart
mess)
CE - 402
43
MIME version
method used
to encode data
multimedia data
type, subtype,
parameter declaration
encoded data
CE - 402
CC&N-CE-402
From: amir@yahoo.com
To: asad@SSUET.edu
Subject: Picture of yummy crepe.
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Type: image/jpeg
base64 encoded data .....
.........................
......base64 encoded data
.
44
22
Application Layer
SMTP
SMTP
senders mail
server
POP3 or
IMAP
receivers mail
server
POP
CE - 402
user
agent
IMAP
Relatively
straightforward
Keeps a copy of
everything you do on
the server
45
CE - 402
CC&N-CE-402
46
23
Application Layer
Bob
centralized
directory server
1
peers
IP address
content
1
2
Alice
CE - 402
47
CE - 402
CC&N-CE-402
file transfer is
decentralized, but
locating content is
highly decentralized
48
24
Application Layer
ordinary peer
group-leader peer
neighoring relationships
in overlay network
CE - 402
49
CE - 402
CC&N-CE-402
advantages of approach
no centralized directory server
disadvantages of approach
bootstrap node needed
group leaders can get
overloaded
50
25
Application Layer
Gnutella
no hierarchy
use bootstrap node to learn
about others
join message
join
CE - 402
51
Skype
CE - 402
CC&N-CE-402
52
26