Test 2 L8 Flashcards
The Web and Caching
Protocol: Hypertext Transfer Protocol (HTTP)
- application layer protocol to transfer web content
- protocol browser uses to request webpages
- protocol to return objects to browser
- layered on top of byte stream protocol like TP
Server is stateless
HTTP Requests
Request line
- indicates method of request (GET, POST sends data to server, HEAD returns headers of get request)
- includes URL
- includes version number
Optional headers
- referrer - what caused page to be requested
- user agent -client software
HTTP Response
Status line
- HTTP version
- response code indicating outcomes (100s information, 200s success, 300s redirect, 400s errors, 500s server errors)
- Server
- Lcoation
- Allow
- Content encoding
- Content length
- Expires
- Modified
Early HTTP
v.0.9/1.9
One request/response per TCP Connection
Advantage: simple to implement
Disadvantage: TCP connection for every request -overhead, slowing transfer,
- TCP three way handshake for every request
- TCP must start in slow start every time connection opens
- servers have many connections that are forced to keep TCP connections in time-wait states until timers expire, so reserve additional resources even after connections completed
Solution to increase efficiency: persistent connections
Persistent Connections
Multiple HTTP requests/responses are multiplexed on a single TCP connection
- -Delimiters indicate end of requests
- Content length allows receive to identify length of response
- —So server must know size of transfer in advance
Pipelining
Client sends the next request as soon as it encounters a referenced object
So as little as one RTT for all referenced objects before they begin to be fetched
Persistent connections with pipelining was default in HTTP 1.1
Caching
Improves performance
- Origin web server hosts content but is far away
- TCP throughput is inversely proportional to RTT
- So further away that web content is, the slower the web page will load because latency is bigger and throughput is lower
- Solution: fetch content from nearby location that has been cached
- Also benefit when multiple clients requesting same content because local clients see less latency/more throughput and ISP doesn’t have to pay to keep transferring content over expensive links
Can occur in multiple places
- Browser locally
- Network (ISP, content distribution networks)
Caches expire to ensure client see the most recent version of a page
- based on the expire setter
- cache can also check with origin server to check whether original content modified (304 not modified response)
Ways to redirect clients to caches:
- browser configuration to explicitly configure browser to point to local cache so all HTTP request first directed to local cache before request is forwarded to origin
- Origin server or service hosting the content direct browser to cache
- -Done by special reply to DNS request to ping potential cache servers
TCP Throughput is inversely proportional to…
RTT
Locations of caches
Can occur in multiple places
- Browser locally
- Network (ISP, content distribution networks)
Ways to redirect clients to caches
Ways to redirect clients to caches:
- browser configuration to explicitly configure browser to point to local cache so all HTTP request first directed to local cache before request is forwarded to origin
- Origin server or service hosting the content direct browser to cache
- -Done by special reply to DNS request to ping potential cache servers
Benefits of caching
Reduced transit costs for ISP
Improved performance for clients
Web Content Distribution Networks (CDN) defined
Overlay network of web caches designed to deliver content to a client from optimal location
-Optimal can be geographically closest or something else.
CDNs often have geographically disparate servers
Purpose to place caches as close to users as possible
Owned by content providers (google), networks (At&t) or independently (Akami)
Nonnetwork CDNs typically place servers in other autonomous systems or ISPs
The number of cache nodes vary.
How server selection works in CDN
Which server criteria
- least loaded server
- lowest latency (most typical)
- any alive server
Content Routing: How clients get redirected to the right server in CDN
How to direct clients
1-Routing systems (e.g. anycast): number all replicas with same IP address then allow routing to take them to closes replica
–simple but servers given very little control since at whims of Internet routing (simple but coarse)
2-Application-based (e.g. HTTP redirect): requires client to first go to origin server to get redirect, increasing latency (simple but delays)
3-Naming system (e.g. DNS): client looks up domain and response contains IP address of nearby cache. Significant flexibility in directing different clients to different server replicas (fine-grained control and fast)
CDNs ++ ISPs
CDNs and ISPs have symbiotic relationship when it comes to peering relationships
CDNs like to peer with ISP because peering directing with ISP where customer located because
- better throughput since no intermediate AS hops and network latency lower
- redundancy: more vectors to deliver content increases reliability
- burstiness: during large request events, having connectivity to multiple networks where content is hosted allows ISP to spread traffic across multiple transit links thereby reducing 95th percentile and lowering transit costs
ISPs like peering with CDNs (or host caches locally) because:
- providing content closer to ISP customers allows ISP to provide good performance for customers
- lower transit costs because traffic isn’t traversing costly links