CDN

Video Streaming

CDN was first introduced to distribute non-video content, but it is widely used in video streaming these days.
Video traffic is a major consumer of Internet bandwidth. (80% of residental ISP traffic in 2020!)

Video is sequence of images displayed at constant rate. Because sending the video as is would eat up too much traffic, we use coding!
A single frame is chosen and called the keyframe - other frames are encoded as differences from the keyframe.

  • Spatial coding: Remove redundancy within image.

  • Temporal coding: Remove redundancy between image. (i.e. between frame i and frame i+1)

  • CBR (constant bit rate): Video encoding rate is fixed.

  • VBR (variable bit rate): Video encoding rate changes as amount of spatial, temporal coding changes.

Challenges

Server-to-client bandwidth will vary over time with changing network congestion levels.

Continuous playout constraint: playout timing of client must match original timing.
Since network delays are variable, client need a buffer to match continuous playout constraint.

Also, client should interact (e.g. pause, fast-forward, rewind) with video, and packet lost might happen.
To match continuous playout constraint, it is usually better to just ignore lost packets.

DASH (Dynamic, Adaptive, Streaming over HTTP)

Server:

  • Divides video file into multiple chunks.
  • Each chunk encoded at multiple different rates.
  • Different rate encodings stored in different files.
  • Files replicated in various CDN nodes.
  • Manifest file: provides URLs for different chunks.

Client:

  • Periodically estimates server-to-client bandwidth.
  • Consulting manifest, requests one chunk at a time.
    • Chooses maximum coding rate sustainable given current bandwidth.
    • Can choose different coding rates at different points in time (depending on available bandwidth at time), and from different servers.

Client should be intelligent! client determines:

  • when to request chunk (to prevent buffer starvation or buffer overflow)
  • what encoding rate should it request (to get the highest video quality for the given bandwidth)
  • where to request chunk (to choose server that is close to client or has high available bandwidth)

Content distribution networks (CDNs)

We have to stream content to hundreds of thousands of simultaneous users.
Single large server just can't scale.
Instead, we use multiple copies of videos at multiple geographically distributed sites!

  • Enter deep: push CDN servers deep into many access networks (closer to user!)
  • Bring home: smaller number of larger clusters in POPs near access networks
  1. Bob browses video.
  2. Bob requests video manifest to server.
  3. Server responds with manifest file that contains URL of CDN servers.
  4. Bob select CDN server with DASH.