Multimedia Networking

Audio/Video is predominant on the internet!

OTT streaming: Media service is offered directly to viewers without cable/broadcast/satellite TV platforms (e.g. through set-top box).

Digitizing Audio

Analog audio will be sampled at constant rate (Hz: samples/sec)

Sample then quantized in 2 dimensions:

Bit rate = samples per sec * quantum size

ADC: analog-to-digital converter

DAC: digital-to-analog converter

Nyquist-Shannon sampling theorem

The sampling frequency must be at least double the analog’s highest signal frequency (via fast fourier decomposition).

\[f_s \ge 2d\]

Lossy compression

Digital video

Images at constant rate (frames/sec)

CBR (Constant bit rate): Video encoding rate fixed VBR (Variable bit rate): Encoding rate changes with amount of spatial/temporal coding.

Spatial coding:

Temporal coding:

Multimedia transfer types

  1. Streaming stored audio from server
  2. Conversational (bidirectional live)
  3. Streaming (unidirectional live)

Challenges:

  1. continuous playout constraints:
  2. interactivity (pause, fast-forward, rewind, jump through)
  3. lost/retransmitted video packets

Hence in real world scenario, the player cannot immediately start playing upon receiving the first frame (need to wait for enough frames in the buffer for continuous play first – client playout delay).

Client side buffering

  1. Initial fill of buffer until playout starts at $t_p$
  2. Playout begins at $t_p$
  3. Buffer fill level varies wrt time as fill rate $x(t)$ varies and $r$ (playout rate) is constant.

Underflow: Buffer will run out as $\bar{x} < r$ (video freeze until buffer fills again)

Overflow: Buffer won’t empty, provided initial playout delay is large enough to absorb variability in $x(t)$.

Initial playout delay tradeoff: Buffer starvation less likely, but larger delay until player starts watching.

Streaming multimedia

UDP

Push based streaming: Server sends small packets of media at a rate such that

\[x_\text{send} = x_\text{encoding} = k\]

Error recovery: application-level and time-permitting. Includes short playout delay to remove jitter.

Transmission rate is fixed by server, oblivious to congestion.

However end-to-end delay, playout delay can be very short.

Real Time Protocol (RTP): Multimedia payload types

UDP may not pass through firewalls.

HTTP

Pull based streaming: Client pulls a multimedia file via HTTP GET.

Server prepared “pieces” of media (segments). Announces to Client to retrieve when needed.

Has 3 buffers: send buffer, receive buffer, application playout buffer.

Fill rate fluctuates due to TCP congestion control (send/receive buffer).

Needs larger playout delay as a result.

VoIP

Requirement: Conversational aspect:

Talk spurts + Silent periods

App layer header on each chunk. Chunk + header encapsulated in UDP/TCP segment.

App sends segment into socket per 20ms.

## Two types of packet loss

  1. Network loss: datagram lost due to network congestion
  2. Delay loss: datagram arrives after scheduled playout time

Loss can be tolerated to some extent depending on encoding and concealment.

Playout delay

Fixed playout delay $q$:

Adaptive playout delay: To achieve low playout delay AND low late loss rate.

Exponentially weighted moving average (EWMA): used to estimate required delay.

Delay component 1 (average delay):

\[d_i = (1 - \alpha)d_{i-1} + \alpha(r_i - t_i)\]

EWMA to compute standard deviation as well with weight $\beta$.

Delay component 2 (standard deviation):

\[v_i = (1 - \beta)v_{i-1} + \beta |r_i - t_i - d_i|\]

When should I playout? Dependson $\%$ threshold of packets you must send successfully. If I want confidence of 99%, then i set my delay to 3 or 4 SD $v_i$ above average.

playout time = $t_i + d_i + Kv_i$

Recovery from packet loss

  1. ACK/NAK (each takes one RTT)
  2. Forward error correction (FEC): sending extra bits to recover without retransmission
    1. Simple FEC
    2. Piggybacking FEC
    3. Interleaving FEC

Simple FEC:

Piggybacking FEC:

Interleaving FEC:

Real Time Protocol (RTP)

Runs over UDP (in UDP segments). Each packet contains

Does not provide QoS guarantees:

Example:

Suite:

Above transport layer, below application layer, considered transport layer.

Advantage:

Challenges:

DASH

Divide media into streamlets, which will be transcoded into different quality.

.mpd file describes available videos and qualities.

Client executes ABR (adaptive bitrate algorithm) to determine which segment to next download.

Advantage:

Disadvantage:

Transport layer protocol: TCP

WebRTC

Transport layer protocol: UDP