Docsity

Content Distribution Networks - Computer Network Systems - Lecture Slides, Slides of Computer Networks

Partial preview of the text

Download Content Distribution Networks - Computer Network Systems - Lecture Slides and more Slides Computer Networks in PDF only on Docsity!

Lecture 11

Content Distribution Networks

(CDNs)

HTTP Caching

  • Clients often cache documents
    • When should origin be checked for changes?
    • Every time? Every session? Date?
  • HTTP includes caching information in headers
    • HTTP 0.9/1.0 used: “Expires: ”; “Pragma: no-cache”
    • HTTP/1.1 has “Cache-Control”
      • “No-Cache”, “Private”, “Max-age: ”
      • “E-tag: ”
  • If not expired, use cached copy
  • If expired, use condition GET request to origin
    • “If-Modified-Since: ”, “If-None-Match: ”
    • 304 (“Not Modified”) or 200 (“OK”) response

Caching Example (1)

Assumptions

  • Average object size = 100K bits
  • Avg. request rate from browsers to origin servers = 20/sec
  • Delay from institutional router to any origin server and back to router = 2 sec

Consequences

  • Utilization on LAN = 20%
  • Utilization on access link = 100%
  • Total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + milliseconds (^) 4

origin servers public Internet

institutional network (^) 10 Mbps LAN

1.5 Mbps access link

Caching Example (2)

Possible Solution

  • Increase bandwidth of access link to, say, 10 Mbps
  • Often a costly upgrade

Consequences

  • Utilization on LAN = 20%
  • Utilization on access link = 20%
  • Total delay = Internet delay + access delay + LAN delay = 2 sec + milliseconds

5

origin servers public Internet

institutional network (^) 10 Mbps LAN

10 Mbps access link

When a single cache isn’t enough

• What if the working set is > proxy disk?

  • Cooperation!

• A static hierarchy

  • Check local
  • If miss, check siblings
  • If miss, fetch through parent

• Internet Cache Protocol (ICP)

  • ICPv2 in RFC 2186 (& 2187)
  • UDP-based, short timeout 7

public Internet

Parent web cache

Problems

  • Significant fraction (>50%?) of HTTP objects uncachable
  • Sources of dynamism?
    • Dynamic data: Stock prices, scores, web cams
    • CGI scripts: results based on passed parameters
    • Cookies: results may be based on passed data
    • SSL: encrypted data is not cacheable
    • Advertising / analytics: owner wants to measure # hits
      • Random strings in content to ensure unique counting

• But…much dynamic content small, while static

content large (images, video, .js, .css, etc.)

Content Distribution Networks &

Server Selection

  • Replicate content on many servers
  • Challenges
    • How to replicate content
    • Where to replicate content
    • How to find replicated content
    • How to choose among know replicas
    • How to direct clients towards replica

Server Selection

• Which server?

  • Lowest load: to balance load on servers
  • Best performance: to improve client performance
    • Based on Geography? RTT? Throughput? Load?
  • Any alive node: to provide fault tolerance

• How to direct clients to a particular server?

  • As part of routing: anycast, cluster load balancing
  • As part of application: HTTP redirect
  • As part of naming: DNS

Content and Internet Traffic

Internet traffic:

1.Shifts seismically

(emailFTPWebP2Pvideo)

2.Has many small/unpopular and few

large/popular flows – mice and elephants

Zipf popularity distribution, 1/k (^) Shows up as a line on log-log plot

Server Farms and Web Proxies (1)

Server farms enable large-scale Web servers:

– Front-end load-balances requests over servers

– Servers access the same backend database

CDNs – Content Delivery Networks (1)

CDNs scale Web servers by having clients get content from a nearby CDN node (cache)

Content Delivery Networks (2)

Directing clients to nearby CDN nodes with DNS:

– Client query returns local CDN node as response

– Local CDN node caches content for nearby clients

and reduces load on the origin server

How Akamai Works

  • Clients fetch html document from primary server
    • E.g. fetch index.html from cnn.com
  • URLs for replicated content are replaced in HTML
    • E.g. replaced with

    • Or, cache.cnn.com, and CNN adds CNAME (alias) for cache.cnn.com  a73.g.akamai.net

  • Client resolves aXYZ.g.akamaitech.net hostname
    • Maps to a server in one of Akamai’s clusters

How Akamai Works

  • Akamai only replicates static content
    • At least, simple version. Akamai also lets sites write code that run on their servers, but that’s a pretty different beast
  • Modified name contains original file name
  • Akamai server is asked for content
    1. Checks local cache
    2. Check other servers in local cluster
    3. Otherwise, requests from primary server and cache file
  • CDN is a large-scale, distributed network
    • Akamai has ~25K servers spread over ~1K clusters world-wide
    • Why do you want servers in many different locations?
    • Why might video distribution architectures be different?