Professional Documents
Culture Documents
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.
Nonpersistent HTTP
(contains text, Suppose user enters URL references to 10 www.someSchool.edu/someDepartment/home.index jpeg images)
time
When the user requests the webpage 11 TCP connections are generated
RTT
request file RTT file received time time to transmit file
time
time
Persistent HTTP
Nonpersistent HTTP issues: Requires 2 RTTs per object Maintain TCP buffers in both client and server Burden on the Web Server High overhead Persistent HTTP Server leaves TCP connection open after sending response Subsequent HTTP messages between same client/server sent over open connection Default mode is Persistent with pipelining
First Line of HTTP request message The request line has three fields Method field can take on several values GET,POST, PUT, DELETE etc Majority of HTTP request messages use GET URL field HTTP version field Header Lines Host: Host on which the object resides User-agent: Identifies the client program e.g. Mozilla/4.0 Connection: Shows whether the connection should be closed or not Accept-language: Shows the language the client prefers
GET method Used with the POST method Web page often includes form input Input is sent to server in body
PUT method: To upload objects to web server DELETE method Allows a user or an application to delete an object on web server
Header Line Connection: Shows whether the connection should be closed or not Date and time: When the HTTP response was created Server: Analogous to user-agent in request message Last-modified: When the Object was last created or modified Content-length: Number of bytes in object being sent Content-Type: Indicates the object type (HTML text etc.)
200 OK
Request succeeded and information is returned in response Requested object moved, new location specified later in this message (Location:) Request message not understood by server Requested document not found on this server
servers to identify users Server wishes to restrict user access Wants to serve content as a function of user identity Many major Web sites use cookies
Four components:
1) Cookie header line of HTTP response message 2) Cookie header line in HTTP request message 3) Cookie file kept on users host, managed by users browser 4) Back-end database at Web site
Example: Susan accesses Internet always from PC visits specific ecommerce site for first time When initial HTTP requests arrives at server, server creates: unique ID entry in backend database for ID
cookie file
amazon 1678
Set-cookie: 1678
usual http request msg
entry
cookie: 1678
cookiespecific action
cookiespectific action
access
access
backend database
cookie: 1678
Cookies (continued)
Cookies Pages visited in which order and at what times Shopping carts One click shopping Recommendations of other products Cookies and privacy: Cookies permit sites to learn a lot about you Can inform third party You may supply name and e-mail to sites
For more info on Cookies see RFC-2965 HTTP State Management Mechanism www.cookiecentral.com
Client
Client