IT273 Multimedia System Application

Multimedia System ApplicationUnit 910 min read

Multimedia Networking & Streaming: Protocols, QoS, CDN, Adaptive Bitrate

Unit 9 of Multimedia System Application covers how multimedia content travels across networks—streaming protocols (RTMP, HLS, DASH), Quality of Service (QoS) techniques, Content Delivery Networks (CDNs), adaptive bitrate streaming, and real-world deployments in apps like YouTube, Daraz, and eSewa.

Core Concepts

1. Multimedia Networking Basics

Multimedia networking involves transmitting audio, video, and interactive content over networks (LAN/WAN) with minimal delay and high quality. Unlike static files, multimedia requires:

  • Low latency (delay < 2s for streaming)
  • High bandwidth (e.g., 4K video needs ~25 Mbps)
  • Error resilience (lost packets degrade quality less than text)

Why it matters: Without proper networking, video calls (Zoom), live sports (Nepali Premier League), or e-learning (TU’s online classes) would freeze or buffer.


2. Streaming Protocols: How Content Flows

Streaming delivers content without full downloads. Key protocols:

Protocol Use Case How It Works Example Apps
RTMP Live streaming (low latency) Pushes data in real-time (TCP-based, no buffering) OBS Studio, Facebook Live
HLS Adaptive streaming (Apple) Splits video into small HTTP chunks (MP4), adjusts quality dynamically YouTube, Netflix
DASH Standardized adaptive streaming Uses MPEG-DASH (ISO standard), supports multi-bitrate, multi-codec Amazon Prime Video, Ncell TV
WebRTC Real-time peer-to-peer (P2P) Enables direct browser-to-browser video calls (used in WebSocket) Google Meet, Pathao’s driver app

Worked Example: Daraz Live Streaming Daraz sellers use RTMP to broadcast product demos. The workflow:

  1. Seller’s phone → OBS Studio (encodes video to RTMP).
  2. RTMP stream → Daraz’s CDN (distributed servers).
  3. CDN delivers HLS chunks to users’ browsers.
  4. Browser (using hls.js) reassembles chunks into playable video.

Why HLS? Daraz’s global users have varying internet speeds; HLS dynamically switches between 720p (2 Mbps) and 480p (500 Kbps).


3. Quality of Service (QoS) for Multimedia

QoS ensures multimedia traffic gets priority over emails/files. Techniques:

  • Traffic Shaping: Limits bandwidth for non-critical traffic (e.g., NTC throttles torrent downloads during peak hours).
  • Prioritization: Marks packets with DSCP (Differentiated Services Code Point) to bypass queues.
  • Buffering: Pre-loads data (e.g., YouTube buffers 5–10s ahead).

Mermaid Diagram: QoS in a Router

QoS Queue → Forward to CDNHigh Priority (DSCP=46)Best-Effort Queue → Forward LaterLow Priority (Email)Packet InspectionQoS Mechanism in Router
Hierarchical QoS decision flow in a router (NTC throttling example)

Real-World Example: Ncell’s 4G QoS During Tihar festivals, Ncell uses QoS to:

  • Prioritize WhatsApp calls (VoIP) over file downloads.
  • Reduce latency for Pathao rides (real-time GPS updates).

4. Content Delivery Networks (CDNs)

A CDN is a network of servers that cache content closer to users. How it works:

  1. User requests https://daraz.com/live.
  2. DNS redirects to the nearest CDN edge server (e.g., in Kathmandu instead of Singapore).
  3. Server delivers pre-cached video chunks.
Encrypted ChunksOrigin Server (Netflix)Cached ContentAnycast RoutingEdge Servers (Nepal)ABR Client (ExoPlayer)User DeviceCDN Architecture
Real-world CDN topology for Nepalese users (Ncell/NTC)

Advantages:

  • Lower latency (faster load times).
  • Reduced server load (origin server handles fewer requests).
  • Scalability (handles traffic spikes, e.g., NEPSE stock updates).

Disadvantages:

  • Cost: CDNs like Cloudflare or Akamai charge per GB.
  • Stale content: Cached data may not be real-time (e.g., live cricket scores).

Worked Example: eSewa’s Payment Streaming When you pay via eSewa:

  1. Your request → eSewa’s origin server (hosted in Nepal).
  2. CDN caches frequently accessed pages (e.g., login screen) in Pokhara/Kathmandu nodes.
  3. During Dashain sales, CDN ensures smooth checkout even if origin server is slow.

5. Adaptive Bitrate Streaming (ABR)

ABR dynamically adjusts video quality based on network conditions. How it works:

  1. Player checks bitrate (e.g., 1.5 Mbps).
  2. If speed drops to 500 Kbps, switches to lower-resolution chunks.
  3. If speed improves, switches back to 4K.
010203040240p (360kbps)10360p (800kbps)25480p (1.5Mbps)40720p (3Mbps)25
Bitrate adaptation in Kathmandu (Ncell 4G jitter data)

Algorithms Used:

  • Bitrate Ladder: Pre-defined quality levels (e.g., 240p, 360p, 720p, 1080p).
  • Buffer Management: Maintains 5–30s buffer to avoid stalls.

Real-World Example: YouTube in Kathmandu

  • Slow connection (2 Mbps): Plays 720p.
  • Fast connection (10 Mbps): Plays 1080p.
  • Mobile data (1 Mbps): Switches to 360p to avoid buffering.

6. Multimedia over Mobile Networks

Mobile streaming faces challenges:

  • Limited bandwidth (4G: ~50 Mbps vs. 5G: ~1 Gbps).
  • Handover delays (switching between cell towers).
  • Battery drain (continuous buffering).

Solutions:

Challenge Solution Example
High latency 5G + Edge Computing Ncell’s 5G live cricket streaming
Battery drain Low-power codecs (AV1, VP9) YouTube’s VP9 videos
Handover delays Seamless Wi-Fi calling WhatsApp calls in Kathmandu

7. Security in Multimedia Streaming

Threats:

  • Man-in-the-Middle (MITM): Intercepts streams (e.g., hacking eSewa’s payment video calls).
  • DDoS Attacks: Overloads servers (e.g., targeting NEPSE’s live trading streams).
  • Piracy: Unauthorized redistribution (e.g., leaked Nepali Premier League matches).

Solutions:

  • HTTPS + TLS: Encrypts streams (e.g., YouTube uses TLS 1.3).
  • DRM (Digital Rights Management): Protects premium content (e.g., Netflix’s Widevine).
  • Watermarking: Embeds user IDs in streams (used by Ncell TV).

Mermaid Diagram: Secure Streaming Pipeline

sequenceDiagram
    User->>CDN: Requests Video (HTTPS)
    CDN->>Origin: Checks DRM License
    Origin-->>CDN: Returns Encrypted Chunks
    CDN-->>User: Streams via TLS
    User->>Player: Decrypts with Widevine

In the Real World

  1. YouTube (Google)

    • Idea Used: DASH + ABR
    • How: YouTube’s adaptive bitrate uses MPEG-DASH to switch between 240p to 8K based on your internet speed. During load shedding, it drops to 360p to avoid buffering.
    • Nepal Tie-In: Students in Kathmandu experience lower bitrates than in Thamel due to ISP throttling.
  2. Pathao (Ride-Hailing App)

    • Idea Used: WebRTC + QoS
    • How: Pathao uses WebRTC for real-time driver-passenger voice calls. During traffic jams, QoS ensures the call stays clear while GPS updates (low-latency UDP) take priority over map tiles (TCP).
    • Worked Example: If your Pathao driver’s call drops, it’s likely due to high packet loss in Kathmandu’s congested 4G network.
  3. Ncell TV (Telecom)

    • Idea Used: HLS + CDN
    • How: Ncell TV streams IPTV using HLS for adaptive playback. During IPL matches, their CDN in Lalitpur caches popular channels to reduce latency for subscribers.
    • Nepal Challenge: Rural areas (e.g., Darchula) suffer from high latency due to limited fiber backhaul.
  4. eSewa (Digital Payments)

    • Idea Used: HTTPS + CDN
    • How: When you transfer money, eSewa’s CDN serves the payment page from the nearest server (e.g., Kathmandu instead of Singapore). TLS 1.3 encrypts your transaction to prevent MITM attacks.
    • Real Scenario: During Dashain, eSewa’s CDN prevents crashes by distributing load across Pokhara, Biratnagar, and Kathmandu nodes.

Exam Tip

What Examiners Look For

  1. Protocol Differences: Always compare RTMP (live) vs. HLS/DASH (adaptive). Mention latency vs. scalability trade-offs.
  2. QoS Techniques: Link to real networks (e.g., "NTC uses QoS to prioritize VoIP over torrents").
  3. CDN Workflow: Draw a 3-step diagram (user → edge server → origin).
  4. ABR Math: If asked to calculate bitrate switches, use:
    • Buffer formula: Buffer Size (s) = (Bitrate × 2) / (Network Speed).
    • Example: For a 5 Mbps video on a 1 Mbps connection, buffer needed = (5 × 2) / 1 = 10s.
  5. Security: Pair DRM with TLS in answers (e.g., "Netflix uses Widevine DRM over HTTPS").

Common Pitfalls

  • Confusing RTMP (live) with HLS (VOD): RTMP is unidirectional; HLS is chunked HTTP.
  • Ignoring Mobile Constraints: Always mention 4G vs. 5G or battery impact if asked about mobile streaming.
  • Overlooking CDN Costs: Examiners may ask why a company doesn’t use CDN (answer: "Small businesses like local Daraz sellers may skip CDNs due to high costs").

Practice Question with Solution

Question: Explain how WhatsApp video calls use multimedia networking concepts. Include protocols, QoS, and security.

Solution:

  1. Protocol: WhatsApp uses WebRTC (peer-to-peer) for real-time video. If P2P fails, it falls back to Google’s CDN.
  2. QoS: During calls, WhatsApp marks packets with DSCP=46 (EF) to bypass ISP queues (e.g., Ncell prioritizes calls over downloads).
  3. Adaptive Bitrate: Switches between 360p (low data) and 720p (high data) based on network speed.
  4. Security:
    • SRTP (Secure RTP) encrypts audio/video.
    • TLS 1.2 secures signaling (call setup).
  5. Real-World Example: In Kathmandu traffic, if your call buffers, it’s due to high packet loss (QoS helps but can’t fix ISP congestion).

Visual:

sequenceDiagram
    User1->>User2: WebRTC Offer (SDP with ICE candidates)
    User2->>User1: WebRTC Answer (SDP + DTLS setup)
    User1->>CDN: Fallback Request (if P2P fails)
    User1->>User2: SRTP-Encrypted Stream (DSCP=46)
    User2->>User1: ACK (with jitter buffer status)
    Note over User1,User2: Kathmandu ISP: Packet loss → Buffering
    Note over User1,CDN: Widevine DRM check (if premium content)

Based on the TU BIM syllabus for Multimedia System Application (IT273), unit 9.

Discussion

Loading…