15-441 Computer NetworkingOutlineHTTP Basics (Review)How to Mark End of Message? (Review)HTTP Request (review)HTTP Request (cont.) (review)Slide 7HTTP Request Example (review)HTTP Response (review)HTTP Response (cont.) (review)HTTP Response Example (review)Slide 12Typical Workload (Web Pages)HTTP 0.9/1.0 (mostly review)Single Transfer ExampleMore ProblemsPersistent Connection Solution (review)Persistent Connection Example (review)Persistent HTTP (review)Slide 20HTTP CachingExample Cache Check RequestExample Cache Check ResponseWays to cacheWeb Proxy CachesCaching Example (1)Caching Example (2)Caching Example (3)ProblemsContent Distribution Networks (CDNs)Slide 31Content Distribution Networks & Server SelectionServer SelectionApplication BasedNaming BasedHow Akamai WorksSlide 37Slide 38Simple HashingConsistent HashConsistent Hash – ExampleSlide 42Akamai – Subsequent RequestsImpact on DNS UsageHTTP (Summary)Typical Workload (Server)Caching Proxies – Sources for Misses15-441 Computer NetworkingLecture 25 – The WebLecture 19: 2006-11-02 2Outline•HTTP review and details (more in notes)•Persistent HTTP review•HTTP caching•Content distribution networksLecture 19: 2006-11-02 3HTTP Basics (Review)•HTTP layered over bidirectional byte stream•Almost always TCP•Interaction•Client sends request to server, followed by response from server to client•Requests/responses are encoded in text•Stateless•Server maintains no information about past client requestsLecture 19: 2006-11-02 4How to Mark End of Message? (Review)•Size of message Content-Length•Must know size of transfer in advance•Delimiter MIME-style Content-Type•Server must “escape” delimiter in content•Close connection•Only server can do thisLecture 19: 2006-11-02 5HTTP Request (review)•Request line•Method•GET – return URI•HEAD – return headers only of GET response•POST – send data to the server (forms, etc.)•URL (relative)•E.g., /index.html•HTTP versionLecture 19: 2006-11-02 6HTTP Request (cont.) (review)•Request headers•Authorization – authentication info•Acceptable document types/encodings•From – user email•If-Modified-Since•Referrer – what caused this page to be requested•User-Agent – client software•Blank-line•BodyLecture 19: 2006-11-02 7HTTP Request (review)Lecture 19: 2006-11-02 8HTTP Request Example (review)GET / HTTP/1.1Accept: */*Accept-Language: en-usAccept-Encoding: gzip, deflateUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)Host: www.intel-iris.netConnection: Keep-AliveLecture 19: 2006-11-02 9HTTP Response (review)•Status-line•HTTP version•3 digit response code•1XX – informational•2XX – success•200 OK•3XX – redirection•301 Moved Permanently•303 Moved Temporarily•304 Not Modified•4XX – client error•404 Not Found•5XX – server error•505 HTTP Version Not Supported•Reason phraseLecture 19: 2006-11-02 10HTTP Response (cont.) (review)•Headers•Location – for redirection•Server – server software•WWW-Authenticate – request for authentication•Allow – list of methods supported (get, head, etc)•Content-Encoding – E.g x-gzip•Content-Length•Content-Type•Expires•Last-Modified•Blank-line•BodyLecture 19: 2006-11-02 11HTTP Response Example (review)HTTP/1.1 200 OKDate: Tue, 27 Mar 2001 03:49:38 GMTServer: Apache/1.3.14 (Unix) (Red-Hat/Linux) mod_ssl/2.7.1 OpenSSL/0.9.5a DAV/1.0.2 PHP/4.0.1pl2 mod_perl/1.24Last-Modified: Mon, 29 Jan 2001 17:54:18 GMTETag: "7a11f-10ed-3a75ae4a"Accept-Ranges: bytesContent-Length: 4333Keep-Alive: timeout=15, max=100Connection: Keep-AliveContent-Type: text/html…..Lecture 19: 2006-11-02 12Outline•HTTP intro and details•Persistent HTTP •HTTP caching•Content distribution networksLecture 19: 2006-11-02 13Typical Workload (Web Pages)•Multiple (typically small) objects per page •File sizes•Heavy-tailed•Pareto distribution for tail•Lognormal for body of distribution-- For reference/interest only --•Embedded references•Number of embedded objects = pareto – p(x) = akax-(a+1)Lecture 19: 2006-11-02 14HTTP 0.9/1.0 (mostly review)•One request/response per TCP connection•Simple to implement•Disadvantages•Multiple connection setups three-way handshake each time•Several extra round trips added to transfer•Multiple slow startsLecture 19: 2006-11-02 15Single Transfer ExampleClientServerSYNSYNSYNSYNACKACKACKACKACKDATDATDATDATFINACK0 RTT1 RTT2 RTT3 RTT4 RTTServer reads from diskFINServer reads from diskClient opens TCP connectionClient sends HTTP request for HTMLClient parses HTMLClient opens TCP connectionClient sends HTTP request for imageImage begins to arriveLecture 19: 2006-11-02 16More Problems•Short transfers are hard on TCP•Stuck in slow start•Loss recovery is poor when windows are small•Lots of extra connections•Increases server state/processing•Server also forced to keep TIME_WAIT connection state-- Things to think about --•Why must server keep these?•Tends to be an order of magnitude greater than # of active connections, why?Lecture 19: 2006-11-02 17Persistent Connection Solution (review)•Multiplex multiple transfers onto one TCP connection•How to identify requests/responses•Delimiter Server must examine response for delimiter string•Content-length and delimiter Must know size of transfer in advance•Block-based transmission send in multiple length delimited blocks•Store-and-forward wait for entire response and then use content-length•Solution use existing methods and close connection otherwiseLecture 19: 2006-11-02 18Persistent Connection Example (review)ClientServerACKACKDATDATACK0 RTT1 RTT2 RTTServer reads from diskClient sends HTTP request for HTMLClient parses HTMLClient sends HTTP request for imageImage begins to arriveDATServer reads from diskDATLecture 19: 2006-11-02 19Persistent HTTP (review)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 objectsPersistent HTTP•Server leaves connection open after sending response•Subsequent HTTP messages between same client/server are sent over connectionPersistent without pipelining:•Client issues new request only when previous response has been received•One RTT for each referenced objectPersistent with pipelining:•Default in HTTP/1.1•Client sends
View Full Document