Professional Documents
Culture Documents
Csen 503 Application Layer I: Amr El Mougy Rania Said Lamia Albadrawy
Csen 503 Application Layer I: Amr El Mougy Rania Said Lamia Albadrawy
Csen 503 Application Layer I: Amr El Mougy Rania Said Lamia Albadrawy
Application Layer I
Amr El Mougy
Rania Said
Lamia AlBadrawy
1-2
Introduction 2
Internet Traffic
1-3
2: Application Layer
application
transport
network
data link
physical
Network-core devices do
not run user applications
applications on end
systems allows for rapid
app development,
application
transport
network
data link
physical
application
transport
network
data link
physical
2: Application Layer
Application architectures
6
Client-server
Peer-to-peer (P2P)
Hybrid of client-server and P2P
2: Application Layer
Client-server architecture
7
server:
always-on host
permanent IP address
server farms for
scaling
clients:
client/server
2: Application Layer
2: Application Layer
no always-on server
arbitrary end systems
directly communicate peer-peer
peers are
intermittently
connected and change
IP addresses
10
Instant messaging
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
Note: applications
with P2P architectures
have client processes
& server processes
2: Application Layer
11
Sockets
12
process sends/receives
messages to/from its
socket
socket analogous to door
host or
server
host or
server
process
controlled by
app developer
process
socket
socket
TCP with
buffers,
variables
Internet
TCP with
buffers,
variables
controlled
by OS
Throughput
some apps (e.g., multimedia)
require minimum amount of
throughput to be effective
other apps (elastic apps)
make use of whatever
throughput they get
Security
Encryption, data integrity,
2: Application Layer
13
Data loss
Throughput
Time Sensitive
file transfer
e-mail
Web documents
real-time audio/video
no loss
no loss
no loss
loss-tolerant
no
no
no
yes, 100s msec
stored audio/video
interactive games
instant messaging
loss-tolerant
loss-tolerant
no loss
elastic
elastic
elastic
audio: 5kbps-1Mbps
video:10kbps-5Mbps
same as above
few kbps
elastic
Application
2: Application Layer
connection-oriented: setup
required between client and
server processes
UDP service:
15
Application
e-mail
remote terminal access
Web
file transfer
streaming multimedia
Internet telephony
Application
layer protocol
Underlying
transport protocol
TCP
TCP
TCP
TCP
TCP or UDP
2: Application Layer
typically UDP
Addressing processes
to receive messages,
process must have
identifier
host device has unique
32-bit IP address
Exercise: use ipconfig
from command prompt
to get your IP address
(Windows)
Q: does IP address of
host on which process
runs suffice for
identifying the process?
A: No, many
processes can be
running on same host
HTTP server: 80
Mail server: 25
2: Application Layer
17
Types of messages
exchanged,
Message syntax
Message semantics
meaning of information in
fields
Public-domain
protocols:
defined in RFCs
allows for
interoperability
e.g., HTTP, SMTP,
BitTorrent
Proprietary protocols:
e.g., Skype,
ppstream
2: Application Layer
18
path name
2: Application Layer
HTTP overview
HTTP: hypertext
transfer protocol
client/server model
client: browser that
requests, receives,
displays Web objects
server: Web server
sends objects in
response to requests
PC running
Explorer
HT
TP
req
ues
HT
t
TP
resp
ons
e
st
e
u
req
Server
P
se
T
n
T
o
H
running
esp
r
P
T
Apache Web
HT
server
Mac running
Navigator
2: Application Layer
20
HTTP messages
(application-layer protocol
messages) exchanged
between browser (HTTP
client) and Web server
(HTTP server)
HTTP is stateless
server maintains no
information about
past client requests
aside
21
HTTP connections
Nonpersistent HTTP
At most one object is
sent over a TCP
connection
Persistent HTTP
Multiple objects can
be sent over single
TCP connection
between client and
server
2: Application Layer
22
Nonpersistent HTTP
Suppose user enters URL www.someSchool.edu/someDepartment/home.index
(contains text, references to 10 jpeg images)
time
2: Application Layer
23
time
connection
response message
containing html file, displays
html. Parsing html file,
finds 10 referenced jpeg
objects
6. Steps 1-5 repeated for each of 10
jpeg objects
2: Application Layer
24
initiate TCP
connection
RTT
request
file
RTT
file
received
time
time to
transmit
file
time
Persistent HTTP
Nonpersistent HTTP issues:
Persistent HTTP
subsequent HTTP
messages between
same client/server sent
over open connection
26
request line
(GET, POST,
HEAD commands)
header
lines
Carriage return,
line feed
indicates end
of message
2: Application Layer
www.somesite.com/animalsearch?monkeys&banana
2: Application Layer
29
Method types
HTTP/1.0
GET
POST
HEAD
HTTP/1.1
GET, POST, HEAD
PUT
DELETE
2: Application Layer
30
status line
(protocol, status code, status phrase)
HTTP/1.1 200 OK
Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
header
Last-Modified: Mon, 22 Jun 1998 ...
lines
Content-Length: 6821
Content-Type: text/html
data, e.g.,
requested
HTML file
2: Application Layer
2: Application Layer
32
unique ID
entry in backend
database for ID
2: Application Layer
33
cookie file
ebay 8734
amazon 1678
server
usual http request msg
usual http response
Set-cookie: 1678
usual http request msg
cookie: 1678
Amazon server
creates ID
1678 for user create
entry
cookiespecific
action
access
access
ebay 8734
amazon 1678
cookie: 1678
backend
database
cookiespectific
action
2: Application Layer
34
Cookies (continued)
What cookies can
aside
bring:
Cookies and privacy:
cookies permit sites to
authorization
learn a lot about you
shopping carts
you may supply name and
recommendations
e-mail to sites
user session state
e-mail)
How(Web
to keep
state:
protocol endpoints: maintain state at
sender/receiver over multiple transactions
cookies: http messages carry state
2: Application Layer
35