Lecture6 7
Lecture6 7
PDFelement
CNT122
Application Underlying
Application layer protocol transport protocol
HTTP overview
HTTP: hypertext
transfer protocol
Web’s application layer PC running
protocol Explorer
client/server model
client: browser that
requests, receives, Server
“displays” Web objects running
Apache Web
server: Web server
server
sends objects in
response to requests
Mac running
Navigator
Architectural Overview
HTTP transfers pages from servers to
browsers
Architectural Overview
PDFelement
Our
focus
Architectural Overview
Steps a client (browser) takes to follow a hyperlink:
• Determine the protocol (HTTP)
• Ask DNS for the IP address of server
• Make a TCP connection to server
• Send request for the page; server sends it back
• Fetch other URLs as needed to display the page
• Close idle TCP connections
Steps a server takes to serve pages:
• Accept a TCP connection from client
• Get page request and map it to a resource (e.g., file name)
• Get the resource (e.g., file from disk)
• Send contents of the resource to the client.
• Release idle TCP connections
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
between client and
server.
Nonpersistent HTTP
(contains text,
Suppose user enters URL references to 10
www.someSchool.edu/someDepartment/home.index jpeg images)
time
CNT122 -- Computer Communications and Networks I 14
Remove Watermark Wondershare
PDFelement
Persistent HTTP
request line
(GET, POST,
HEAD commands) GET /somedir/page.html HTTP/1.1
Host: www.someschool.edu
User-agent: Mozilla/4.0
header Connection: close
lines Accept-language:fr
www.somesite.com/animalsearch?monkeys&banana
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
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
CNT122 -- Computer Communications and Networks I 26
Remove Watermark Wondershare
PDFelement
Caching example
Assumptions origin
average object size = 100,000 servers
bits
public
avg. request rate from Internet
institution’s browsers to origin
servers = 15/sec
delay from institutional router
1.5 Mbps
to any origin server and back access link
to router = 2 sec
institutional
Consequences network
10 Mbps LAN
utilization on LAN = 15%
utilization on access link = 100%
total delay = Internet delay +
access delay + LAN delay
= 2 sec + minutes + milliseconds
CNT122 -- Computer Communications and Networks I 29
Remove Watermark Wondershare
PDFelement
Conditional GET
Goal: don’t send object if cache server
cache has up-to-date cached HTTP request msg
version If-modified-since:
object
cache: specify date of <date>
not
cached copy in HTTP request
HTTP response modified
If-modified-since:
HTTP/1.0
<date>
304 Not Modified
server: response contains no
object if cached copy is up-
to-date: HTTP request msg
If-modified-since:
HTTP/1.0 304 Not <date> object
Modified modified
HTTP response
HTTP/1.0 200 OK
<data>