
















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!

















2: Application Layer 4
First some jargon
»Web page consists of objects
»Object can be HTML file, JPEG image, Java applet, audio file,…
»Web page consists of base HTML-file which includes several
referenced objects
»Each object is addressable by a URL
»Example URL:
www.someschool.edu/someDept/pic.gif
host name path name
Docsity.com
2: Application Layer 5
»Web’s application layer protocol
»client/server model
» client: browser that requests, receives, “displays” Web objects » server: Web server sends objects in response to requests
»HTTP 1.0: RFC 1945
»HTTP 1.1: RFC 2068
PC running Explorer
Server running Apache Web server
Mac running Navigator
2: Application Layer 7
Nonpersistent HTTP
»At most one object is sent
over a TCP connection.
»HTTP/1.0 uses
nonpersistent HTTP
Persistent HTTP »Multiple objects can be sent over single TCP connection between client and server. »HTTP/1.1 uses persistent connections in default mode
2: Application Layer 8
Suppose user enters URL www.someSchool.edu/someDepartment/home.index (contains text, references to 10 jpeg images) 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80
1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client
time
2: Application Layer 10
RESPONSE TIME MODELING
Definition of RRT: time to send
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
total = 2RTT+transmit time
time to transmit file
initiate TCP connection RTT request file RTT
File received
time time
2: Application Layer 11
PERSISTENT HTTP
Nonpersistent HTTP issues:
»requires 2 RTTs per object
»OS must work and allocate host resources for each TCP connection
»but browsers often open parallel TCP connections to fetch referenced objects
Persistent HTTP
»server leaves connection open after sending response
»subsequent HTTP messages between same client/server are sent over connection
Persistent without pipelining: »client issues new request only when previous response has been received »one RTT for each referenced object Persistent with pipelining: »default in HTTP/1. »client sends requests as soon as it encounters a referenced object »as little as one RTT for all the referenced objects
2: Application Layer 13
HTTP REQUEST MESSAGE: GENERAL FORMAT
2: Application Layer 14
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
2: Application Layer 16
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 ...
status line (protocol status code status phrase)
header lines
data, e.g., requested HTML file
Docsity.com
2: Application Layer 17
» request succeeded, requested object later in this message
» requested object moved, new location specified later in this message (Location:)
» request message not understood by server
» requested document not found on this server
In first line in server->client response message. A few sample codes:
2: Application Layer 19
Many major Web sites use
cookies
Four components:
Example: » Susan access Internet always from same PC » She visits a specific e- commerce site for first time » When initial HTTP requests arrives at site, site creates a unique ID and creates an entry in backend database for ID
2: Application Layer 20
COOKIES: KEEPING “STATE” (CONT.)
client (^) server
usual http request msg usual http response + Set-cookie: 1678
usual http request msg cookie: 1678 usual http response msg
usual http request msg cookie: 1678 usual http response msg
cookie- specific action
cookie- spectific action
server creates ID 1678 for user
Cookie file amazon: 1678 ebay: 8734
Cookie file
ebay: 8734
Cookie file amazon: 1678 ebay: 8734
one week later: