15-744: Computer NetworkingApplication NetworkingOverviewHTTP BasicsHTTP RequestHTTP Request (cont.)Slide 7HTTP Request ExampleHTTP ResponseHTTP Response (cont.)HTTP Response ExampleTypical Workload (Web Pages)HTTP 0.9/1.0Single Transfer ExampleMore ProblemsNetscape SolutionPersistent Connection ExamplePersistent Connection SolutionPersistent Connection PerformanceRemaining ProblemsSlide 21Integrated Layer Processing (ILP)Application Lever Framing (ALF)Application Data Units RequirementsSlide 25Web cachingWhy web caching?HTTP support for cachingCache HierarchiesICP (Internet cache protocol)SquidSlide 32Slide 33Slide 34Slide 35Slide 36Optimal Cache Mesh BehaviorHintingSummary CacheBloom FiltersProblems with cachingSlide 43CDNServer SelectionRouting BasedRouting BasedL-7 switchingApplication BasedNaming BasedHow Akamai WorksSlide 52Slide 53HashingRobust hashingConsistent HashConsistent Hash – ExampleSlide 58Akamai – Subsequent RequestsNext Lecture: DNS, P2P & P2P Apps15-744: Computer NetworkingL-6 Application NetworkingL -6; 10-29-04© Srinivasan Seshan, 2004 2Application Networking•Web caching hierarchies•Content distribution networks•Assigned reading•[CT90] Architectural Consideration for a New Generation of Protocols •[FCAB98] Summary Cache: A Scalable Wide-Area Cache Sharing Protocol•[K+99] Web Caching with Consistent HashingL -6; 10-29-04© Srinivasan Seshan, 2004 3Overview•HTTP•ALF•Web caching•Content distribution networksL -6; 10-29-04© Srinivasan Seshan, 2004 4HTTP Basics•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 requestsL -6; 10-29-04© Srinivasan Seshan, 2004 5HTTP Request•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 versionL -6; 10-29-04© Srinivasan Seshan, 2004 6HTTP Request (cont.)•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•BodyL -6; 10-29-04© Srinivasan Seshan, 2004 7HTTP RequestL -6; 10-29-04© Srinivasan Seshan, 2004 8HTTP Request ExampleGET / 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-AliveL -6; 10-29-04© Srinivasan Seshan, 2004 9HTTP Response•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 phraseL -6; 10-29-04© Srinivasan Seshan, 2004 10HTTP Response (cont.)•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•BodyL -6; 10-29-04© Srinivasan Seshan, 2004 11HTTP Response ExampleHTTP/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…..L -6; 10-29-04© Srinivasan Seshan, 2004 12Typical Workload (Web Pages)•Multiple (typically small) objects per page •File sizes•Why different than request sizes?•Also heavy-tailed•Pareto distribution for tail•Lognormal for body of distribution•Embedded references•Number of embedded objects = pareto – p(x) = akax-(a+1)L -6; 10-29-04© Srinivasan Seshan, 2004 13HTTP 0.9/1.0•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 startsL -6; 10-29-04© Srinivasan Seshan, 2004 14Single 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 arriveL -6; 10-29-04© Srinivasan Seshan, 2004 15More 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•Why must server keep these?•Tends to be an order of magnitude greater than # of active connections, why?L -6; 10-29-04© Srinivasan Seshan, 2004 16Netscape Solution•Netscape•Use multiple concurrent connections to improve response time•Different parts of Web page arrive independently•Can grab more of the network bandwidth than other users•Doesn’t necessarily improve response time•TCP loss recovery ends up being timeout dominated because windows are small•Persistent connections [PM95]•Multiplex multiple transfers onto one TCP connection•Serialize transfers client makes next request only after previous responseL -6; 10-29-04© Srinivasan Seshan, 2004 17Persistent Connection ExampleClientServerACKACKDATDATACK0 RTT1 RTT2 RTTServer reads from diskClient sends HTTP request for HTMLClient parses HTMLClient sends HTTP request for imageImage begins to arriveDATServer reads from diskDATL -6; 10-29-04© Srinivasan Seshan, 2004 18Persistent Connection Solution•Serialized requests do not improve response time•Pipelining requests•Getall – request HTML document and all embeds•Requires server to parse HTML files•Doesn’t consider client cached documents•Getlist – request a set of documents•Implemented as a simple set of GETs•Prefetching•Must carefully balance impact of unused data transfers•Not widely used due to poor hit ratesL -6; 10-29-04© Srinivasan Seshan, 2004 19Persistent Connection Performance•Benefits
View Full Document