




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















Progress reports
Review from last time
HTTP protocol request and response messages
Connection persistence: HTTP 1.0 vs HTTP 1.
Appreciate the smart edge in action with state persistence in HTTPvia Cookies
Get a tour of the File Transfer Protocol
Separate command and data channels
..and a tour of email
Three parts of SMTP
Difference between SMTP (push) and POP3 (pull) protocol
Some enhancements like MIME
Some slides and pictures gratefully acknowledged from Kurose, Shull,
Tannenbaum
Review: HTTP Transport and state Uses layer 4 transport
Client initiates TCP connection(creates socket) to server, port 80
Server accepts TCP connectionfrom client
HTTP messages (application-layer protocol messages)exchanged between browser(HTTP client) and Web server(HTTP server)
TCP connection closed
HTTP is “stateless”
Review: HTTP Request
Two types of HTTP messages:
request
,
response
HTTP request message:
GET /somedir/page.html HTTP/1.1Host: www.someschool.eduUser-agent: Mozilla/4.0Connection: closeAccept-language:fr (extra carriage return, line feed)
request line
HEAD commands)
header
lines
Carriage return,
line feed
indicates end
of message
Review: HTTP/1.0 - Nonpersistent
1a.
Client initiates a TCP connec-tion to
www.someSchool.edu
on port 80.
Client sends HTTP request for /someDepartment/home.index to TCP socket set up in
1a.
Server at host www.someSchool.edu
accepts
connection and acknowledges.
Server receives messagethrough socket, finds,encapsulates, and sendsobject in HTTP response.
Client receives responsemessage. TCP connectionterminates. Clientextracts file, examinesHTML, and requests otherobjects.
Server instructs TCP socketto initiate TCP connectiontear-down (but first waits tohear from client first to seethe message got there intact).
First four steps are repeatedfor each referenced object.
Review: Non-Persistent HTTP Definition of RTT:
time to send a
small packet to travel fromclient to server and back.
Response time:
one RTT to initiate TCPconnection
one RTT for HTTP request andfirst few bytes of HTTPresponse to return
file transmission time
total = 2RTT+transmit time Question is:Can we speed things up?
time totransmitfile
initiate TCPconnection
RTT
requestfile
RTT
filereceived
time
time
Benefits of Persistent HTTP Nonpersistent HTTP issues:
requires 2 RTTs per object
OS overhead for
each
connection
browsers often open parallelTCP connections to fetchreferenced objects
Persistent HTTP
server leaves connection openafter sending response
subsequent HTTP messagesbetween same client/serversent over open connection
Persistent
without
pipelining:
client issues new requestonly when previous responsehas been received
one RTT for each referencedobject
Persistent
with
pipelining:
default in HTTP/1.
client sends requests as soonas it encounters a referencedobject
as little as one RTT for allthe referenced objects
Why would this be useful? Where have you encountered this inyour life?
This can be viewed as example of ‘smart edge’ philosophy
Cookies: Keeping State (cont.)
usual http response msg usual http response msg
cookie file
one week later:
usual http request msg
cookie: 1678
cookie- specific
action
access
ebay 8734
usual http request msg
Amazon server
creates ID
1678 for user
create
entry
usual http response
Set-cookie: 1678
ebay 8734amazon 1678
usual http request msg
cookie: 1678
cookie- specific
action
access
ebay 8734amazon 1678
backenddatabase
Cookies as a distributed database
Cookies – Convenience vs privacy
What cookies do for
them (and your privacy):
Cookies permit sitesto learn a lot aboutyou (like what?)
aside
FTP: separate control, data connections
nd
client
server
TCP control connection
port 21
TCP data connection
port 20
FTP, like HTTP, runs on top of TCP.
However, unlike HTTP, FTP uses two parallelTCP connections to transfer a file, a
control
connection
and a
data connection
. We say FTP
sends its control information
out-of band.
Also unlike HTTP, FTP maintains state