Professional Documents
Culture Documents
Networks
HTTP
path name
2
HTTP
overview
HTTP:
hypertext
transfer
protocol
Uses TCP:
HTT
P
HTT
reque
PC
P
re
s
spo t
running
nse
Explorer
t
ues se
req
Server
n
TP
espo
T
H
r
running
TP
T
H
Apache
Web
Mac
running
server
Navigator
HTTP is stateless
HTTP
connecOons
Nonpersistent
HTTP
At
most
one
object
is
sent
over
a
TCP
connecOon.
Persistent
HTTP
MulOple
objects
can
be
sent
over
single
TCP
connecOon
between
client
and
server.
Nonpersistent
HTTP
Suppose
user
enters
URL
www.someSchool.edu/someDepartment/home.index
(contains
text,
references
to
10
jpeg
images)
1a.
HTTP
client
iniOates
TCP
connecOon
to
HTTP
server
(process)
at
www.someSchool.edu
on
port
80
initiate TCP
connection
RTT
request
file
RTT
file
received
time
time to
transmit
file
time
Persistent
HTTP
Nonpersistent
HTTP
issues:
requires
2
RTTs
per
object
OS
overhead
for
each
TCP
connecOon
browsers
oeen
open
parallel
TCP
connecOons
to
fetch
referenced
objects
Persistent
HTTP
server
leaves
connecOon
open
aeer
sending
response
subsequent
HTTP
messages
between
same
client/server
sent
over
open
connecOon
client
sends
requests
as
soon
as
it
encounters
a
referenced
object
as
lifle
as
one
RTT
for
all
the
referenced
objects
request line
(GET, POST,
HEAD commands)
Carriage return,
line feed
indicates end
of message
www.somesite.com/animalsearch?monkeys&banana
10
Method
types
HTTP/1.0
GET
POST
HEAD
HTTP/1.1
GET,
POST,
HEAD
PUT
DELETE
deletes
le
specied
in
the
URL
eld
11
data, e.g.,
requested
HTML file
HTTP/1.1 200 OK
Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 22 Jun 1998 ...
Content-Length: 6821
Content-Type: text/html
data data data data data ...
12
13
14
cookie file
ebay 8734
amazon 1678
server
usual http request msg
usual http response
Set-cookie: 1678
Amazon server
creates ID
1678 for user create
entry
cookie: 1678
cookiespecific
action
access
access
usual http request msg
cookie: 1678
backend
database
cookiespectific
action
15
Cookies
(conOnued)
What
cookies
can
bring:
authorizaOon
shopping
carts
recommendaOons
user
session
state
(Web
e-
mail)
aside
origin
server
Proxy
HT
TP
est
req server
equ
r
H
u
P
est
T
client TTP
nse
HT
spo
res
e
r
pon
TP
se
HT
t
s
ue
eq
Pr
nse
T
po
HT
es
r
TP
HT
client
origin
server
17
18
Caching
example
origin
servers
AssumpOons
average
object
size
=
1,000,000
bits
avg.
request
rate
from
insOtuOons
browsers
to
origin
servers
=
15/sec
delay
from
insOtuOonal
router
to
any
origin
server
and
back
to
router
=
2
sec
Consequences
uOlizaOon
on
LAN
=
15%
uOlizaOon
on
access
link
=
100%
total
delay
=
Internet
delay
+
access
delay
+
LAN
delay
=
2
sec
+
minutes
+
milliseconds
public
Internet
15 Mbps
access link
institutional
network
institutional
cache
19
possible
soluOon
increase
bandwidth
of
access
link
to,
say,
100
Mbps
public
Internet
consequence
uOlizaOon
on
LAN
=
15%
uOlizaOon
on
access
link
=
15%
Total
delay
=
Internet
delay
+
access
delay
+
LAN
delay
=
2
sec
+
msecs
+
msecs
oeen
a
costly
upgrade
100 Mbps
access link
institutional
network
institutional
cache
20
10
public
Internet
15 Mbps
access link
institutional
network
institutional
cache
21
CondiOonal
GET
Goal:
dont
send
object
if
cache
has
up-to-date
cached
version
cache:
specify
date
of
cached
copy
in
HTTP
request
If-modified-since:
<date>
server
cache
HTTP request msg
If-modified-since:
<date>
HTTP response
object
not
modified
HTTP/1.0
304 Not Modified
HTTP response
object
modified
HTTP/1.0 200 OK
<data>
22
11