Академический Документы
Профессиональный Документы
Культура Документы
Application Layer
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.gi f path name host name
5
HTTP overview
HTTP: hypertext transfer protocol
Webs application layer protocol client/server model o client: browser that requests, receives, displays Web objects o server: Web server sends objects in response to requests HTTP 1.0: RFC 1945 HTTP 1.1: RFC 2068
HTTP request PC running Explorer HTTP response
HTTP request
HTTP is stateless
server maintains no information about past client requests Protocols that maintain state are complex! past history (state) must be maintained if server/client crashes, their views of state may be inconsistent, must be reconciled
aside
HTTP connections
Nonpersistent HTTP Persistent HTTP At most one object is Multiple objects can be sent over single TCP sent over a TCP connection between connection. client and server. HTTP/1.0 uses HTTP/1.1 uses nonpersistent HTTP persistent connections
in default mode
Nonpersistent HTTP
(contains text, references to 10 jpeg images) www.someSchool.edu/someDepartment/home.inde
time
5. HTTP client receives response message containing html file, displays html. Parsing html time file, finds 10 referenced jpeg objects
6. Steps 1-5 repeated for each of
10 jpeg objects
11
time
12
Persistent HTTP
Persistent without pipelining: client issues new request only when previous response requires 2 RTTs per object has been received OS must work and one RTT for each referenced allocate host resources for object Persistent with pipelining: each TCP connection default in HTTP/1.1 but browsers often open client sends requests as soon parallel TCP connections as it encounters a referenced to fetch referenced objects object Persistent HTTP as little as one RTT for all the server leaves connection referenced objects
open after sending response subsequent HTTP messages between same client/server are sent over connection
13
origin server
14
15
16
Quiz Retake
What are the key differences between FTP and HTTP? [2] Consider an HTTP client that wants to retrieve a Web document at a given URL. The IP address of the HTTP server is initially unknown. The Web document at the URL has one embedded GIF image that resides at the same server as the original document. What transport and application layer protocols besides HTTP are needed in this scenario? [3] Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS look-up is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1, RTTn. Further suppose that the Web page is an HTML text file and four additional objects. Let RTT0 denote a RTT between the local host and the server containing the object. Assuming zero transmission time of the object, how much time elapses from when the client clicks on the link until the client receives the entire Web page? Assume a non-persistent HTTP protocol with no parallel TCP connections. [4]
17