Download presentation
Presentation is loading. Please wait.
1
1 HTTP - Hypertext Transfer Protocol Arthur : Yigal Eliaspur Date : 28.1.2001
2
2 HTTP Overview n Web’s application-layer protocol n in use by the WWW since 1990 n client/server paradigm –in the web: clients : browsers (IExplorer,Netscape..) server : web servers (Apache,IIS..) n Request/Response Protocol: n Web servers usually using TCP port 80 response request SC
3
3 HTTP Overview (cont.) n Stateless protocol - HTTP server maintains no information about the client.
4
4 HTTP Versions n HTTP 0.9 Simple GET protocol for the Web limits on data transfer (1024 characters) n HTTP 1.0 Headers give information about the data transferred. Greater data type/quantity transfer in both directions n HTTP 1.1 Supports hierarchical proxy servers caching persistent connections
5
5 HTTP 0.9 GET example n telnet www.cs.huji.ac.il 80 n GET /~dbsi/index.html n output :...................... Connection closed by foreign host
6
6 HTTP 1.0 n developed between 1992 and 1996. n Exchange more than simple text Headers allowed in both requests and responses Extends GET request to allow headers Adds HEAD request to get information Adds POST request, sends information with the request
7
7 Request message format
8
8 Response message format
9
9 HTTP Request/Response example
10
10 Response-codes
11
11 Headers types n General –Date, Pragma.. n Request –Authorization, From, If-Modifed-Since, Referer, User-Agent.. n Response –Location, Server, WWW-Authenticate... n Entity –Allow, Content-Encoding, Content-Length, Content-Type, Expires, Last-Modified, extension-header...
12
12 POST & HEAD messages POST sends information with the request in the Entity Body. Useful when the user fills out a form. HEAD return only the request result without the data itself (I.e. only the Status line and the Header lines) use for debugging HTTP servers and for page update checking.
13
13 Upgrading Header n allows the client to specify what additional communication protocols it supports n The server may choose to switch protocols, but this is not mandatory. n Example: Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
14
14 Caching n Why? –Reduces response time Request is satisfied from cache closest to browser Takes less time to get the page and display it –Reduces traffic Each page only accessed from the server once Reduces bandwidth used by browser –Saves money if client is paying by traffic –Keeps bandwidth requirements down
15
15 Caching (cont.) n Risks? –Might not be ``semantically transparent'’ the response is different from what would have been returned by the origin server.
16
16 Caching in HTTP/1.0 n simple caching mechanism: Origin server may mark a response, using the Expires header cache validity checking using a ”conditional request“ which include : If-Modified-Since & Last- Modified headers. n server responds: –304 (Not Modified) –200 (OK) + the New entry.
17
17 Caching in HTTP/1.0 (cont.) The Pragma: no-cache request Header indicate that a request should not be satisfied from a cache. n PROBLEM - origin servers/clients can’t give full and explicit instructions to caches (will be explained later)
18
18 Caching in HTTP/1.1 n retains the basic HTTP/1.0 design –new features –more careful specifications of the existing features. Entry start as fresh. Become stale - when reaches its expiration time. must revalidate it with the origin server.
19
19 Caching in HTTP/1.1 (cont.) cache validator string : entity tag. –two responses resource with the same entity tag must be identical. – Can include : fine-grained timestamp, internal database pointer... –If-None-Match header with one or more entity tags. Much stronger then If-Modified-Since.
20
20 Caching in HTTP/1.1 (cont.) Cache-Control header –server/client implicit directives to caches –directives examples: max-age - relative expiration time. –HTTP/1.0 Expires header can lead to clock skew failure. no-transform - prevent proxies response transformations. – like reduce image complexity over a slow link (WAP) private & no-store - prevent the storage of some or all of a response.
21
21 Caching in HTTP/1.1 (cont.) Vary header - include list of headers that identical the request beside the URL field. – For example : Accept-Language, Accept-Charset...
22
22 Cooperative Cashing
23
23 Cooperative Cashing (cont.) n Higher level cache ( e.g. national cash) –larger user population –higher hit rates. n Multiple Web cashes which cooperate => Improve overall performance. n Cooperative cashes usualy built from clusters –divide the traffic overhead –improve storage capacity
24
24 Cooperative Cashing (cont.) –which of the cashes we sould ask for a particular doc? Hash routing (of URLs) - an object want be present in more then one cash. n HTTP/1.1 introduces the concept of hop-by-hop headers: –message headers that apply only to a given connection, and not to the entire path. –This enable much more power with proxies (cashes) usage.
25
25 Cooperative Cashing (cont.) n HTTP 1.1 hop-by-hop headers: Connection –options that are desired for that particular connection (e.g connection:close.) Public –lists the set of methods supported by the server Proxy-Authenticate –enable authentication methods between two hops. Transfer-Encoding - –compression method between two hops. Upgrade –additional communication protocols supported.
26
26 Persistent & Non Persistent Connections. n Persistent Connections: Opens new TCP connection for each request. For example : for a web page with 10 image - 11 new TCP connections is needed. Used in HTTP/1.0 n nonpersistent connections : one TCP connection can serve more then one request/response pair. Less connection establishing overhead, smaller slow-start delay. Used as default in HTTP/1.1
27
27 Persistent & Non Persistent Connections.(cont.) n nonpersistent connections, two types: –without pipelining the client issues a new request only when the previous response has been arrived. – with pipelining client send the request as soon as it encounters a reference. Multiple request/response on the same TCP packet. Or on back-to-back packets.
28
28 Compression n most image formats (GIF, JPEG, MPEG) are precompressed. n many other data types used in the Web are not. n compression could save almost 40% of the bytes sent via HTTP n need for negotiating the use of codings.
29
29 Compression (cont.) Client send : Accept-Encoding header –indicate what content-codings it can handle, and which ones it prefers. n Server Send : –Content-Encoding header - for end-to-end coding indication. –Transfer-Encoding header - for hop-to-hop coding indication. (supported only in HTTP/1.1)
30
30 W3C Performance Measurements n "Microscape" Benchmark, 43 inline images Scenarios HTTP/1.0: using 4 simultaneous connections HTTP/1.1: using 1 persistent connection HTTP/1.1 pipeline: using 1 persistent connection HTTP/1.1 pipeline + compression: using 1 connection
31
31 W3C Performance Measurements (cont.)
32
32 Authentication n Many sites require users to provide a username and password in order to access the documents housed on the server. n Provide mechanism for keeping track of users (more then security mechanism). n How does it’s work? Client send –ordinary request message server responds with –401 Authorization Required status code –WWW-Authenticate header which specified how to perform authentication
33
33 Authentication (cont.) Client resend –the requested message but this time including Authorization header (e.g. user-name & password.) The client continue to add this header for each following request to that server.
34
34 Cookies n Another site mechanism for keeping tracks of users. n Example: –Client contact a web site for the first time. –Server response with : Set-cookie : 1678453 header –client store the cookie value and the server name in a special “cookie file”. –For each further request for that server the client will add the Cookie : 1678453 header
35
35 Cookies (cont.) n Usage: –server requires authentication but doesn’t want to hassle a user with a user-name and password. –Remembering user’s preferences for advertising. –Enable creating a virtual shopping cart. n Problems –users who accesses the same site from different machines.
36
36 References n http://www.ietf.org/rfc/rfc2068.txt http://www.ietf.org/rfc/rfc2068.txt n http://www.ietf.org/rfc/rfc1945.txt http://www.ietf.org/rfc/rfc1945.txt n http://www.w3.org/Protocols/ http://www.w3.org/Protocols/ n http://www8.org/w8-papers/5c- protocols/key/key.html http://www8.org/w8-papers/5c- protocols/key/key.html n Computer Networks by Joames Fokurose & Keith W.Ross.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.