Beruflich Dokumente
Kultur Dokumente
time
6. Steps 1-5 repeated for each of 10
jpeg objects
Round Trip Time (RTT):
time for a small packet
to travel from client to
server and back
Response time
One RTT to initiate TCP
connection
One RTT for HTTP request
and first few bytes of HTTP
response to return
File transmission time
▪ 2RTT+transmt time
Nonpersistent HTTP Persistent HTTP
issues Server leaves connection
Requires 2 RTTs per object open after sending
OS overhead for each TCP response
connection Subsequent HTTP
Browsers of ten open messages between same
parallel TCP connections to client/server sent over
fetch referenced objects open connection
Client sends requests as
soon as it encounters a
referenced object
As little as one RTT for all
the referenced objects
▪ With pipelining
▪ Without pipelining
Two types of HTTP messages: request, response
HTTP request message
ASCII
carriage return character
request line
(GET, POST, GET /index.html HTTP/1.1\r\n line-feed character
HEAD commands) Host: www-net.cs.umass.edu\r\n
User-Agent: Firefox/3.6.10\r\n
header Accept: text/html,application/xhtml+xml\r\n
lines Accept-Language: en-us,en;q=0.5\r\n
Accept-Encoding: gzip,deflate\r\n
carriage return, Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n
line feed at start Keep-Alive: 115\r\n
of line indicates Connection: keep-alive\r\n
\r\n
end of header lines
method sp URL sp version cr lf request
line
header field name value cr lf
header
~
~ ~
~ lines
~
~ entity body ~
~ body
POST method
web page often includes form input
input is uploaded to server in entity body
URL method
uses GET method
input is uploaded in URL field of request line
www.somesite.com/animalsearch?monkeys&banana
HTTP/1.0 HTTP/1.1
GET GET, POST, HEAD
Request an object from PUT
server Uploads file in entity
POST body to path specified in
Upload information URL field
using forms DELETE
HEAD Deletes file specified in
Asks server to leave the URL field
requested object out of
response
status line
(protocol
status code HTTP/1.1 200 OK\r\n
status phrase) Date: Sun, 26 Sep 2010 20:09:20 GMT\r\n
Server: Apache/2.0.52 (CentOS)\r\n
Last-Modified: Tue, 30 Oct 2007 17:00:02
GMT\r\n
header ETag: "17dc6-a5c-bf716880"\r\n
lines Accept-Ranges: bytes\r\n
Content-Length: 2652\r\n
Keep-Alive: timeout=10, max=100\r\n
Connection: Keep-Alive\r\n
Content-Type: text/html; charset=ISO-8859-
1\r\n
\r\n
data, e.g., data data data data data ...
requested
HTML file
version sp Status code sp phrase cr lf status
line
header field name: value cr lf
header
~
~ ~
~ lines
~
~ entity body ~
~ body
200 OK
Request succeeded, requested object later in this
message
301 Moved Permanently
Requested object moved, new location specified later
in this message
400 Bad Request
Request message not understood by server
404 Not Found
Requested document not found on this server
505 HTTP version Not Supported
Requested protocol is not supported by the server
Many web sites use cookies Example
Four Components: Susan always access
1. Cookie header line of Internet from the same PC
HTTP response Visits specific e-commerce
message site for first time
2. Cookie header line in When initial HTTP requests
next HTTP request arrives at site, site creates:
message ▪ Unique ID
▪ Entry in backend database
3. Cookie file kept on for ID
user’s host, managed
by user’s browser
4. Back-end database at
web site
client server
ebay 8734
usual http request msg Amazon server
cookie file creates ID
usual http response 1678 for user create backend
set-cookie: 1678
ebay 8734 entry database
amazon 1678
usual http request msg
cookie: 1678 cookie- access
specific
usual http response msg action