Networking & Protocols • Streaming Protocols (HLS, DASH, RTMP)Easy⏱️ ~3 min
What are Streaming Protocols and the Ingest vs Delivery Architecture?
Production streaming systems separate ingest (getting live video from the broadcaster) from delivery (distributing to millions of viewers). Real Time Messaging Protocol (RTMP) dominates ingest because it provides low latency (approximately 1 to 3 seconds), is resilient over Transmission Control Protocol (TCP), and has universal encoder support. The broadcaster's camera or encoder sends a continuous stream to an edge Point of Presence (POP) via RTMP. Once ingested, the stream is transcoded into multiple quality levels and repackaged for mass delivery.
For delivery, HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH) are dominant because they work over standard HTTP ports (firewall friendly), leverage existing Content Delivery Network (CDN) infrastructure, and support Adaptive Bitrate (ABR) streaming where the player automatically switches quality based on network conditions. This separation allows you to optimize each stage independently: ingest for reliability and speed, delivery for scale and cacheability. The architecture enables a single ingest point to fan out to millions of viewers through CDN distribution.
Twitch demonstrates this pattern at scale with RTMP ingest from broadcasters and HLS delivery to viewers. Popular Twitch channels regularly exceed 100,000 concurrent viewers, and a channel with 100,000 concurrent sessions at an average 3 megabits per second (Mbps) generates approximately 300 gigabits per second (Gbps) sustained egress. The cost implications are significant: a 2 hour live event with 1 million average concurrent viewers at 3 Mbps yields approximately 2.7 petabytes (PB) of egress, costing between $54,000 and $216,000 in bandwidth alone at typical CDN rates of $0.02 to $0.08 per gigabyte (GB).
💡 Key Takeaways
•RTMP ingest provides 1 to 3 second latency with universal encoder support, but suffers from TCP head of line blocking on lossy networks
•HLS and DASH delivery enable CDN caching and ABR streaming, with segments typically cached at edge servers for hours or days
•A 100,000 viewer stream at 3 Mbps generates 300 Gbps egress; 1 million viewers for 2 hours costs $54,000 to $216,000 in bandwidth alone
•Alternative ingest protocols like Secure Reliable Transport (SRT) and Reliable Internet Stream Transport (RIST) use UDP with Automatic Repeat Request (ARQ) for better loss recovery on unreliable networks
•WebRTC ingest enables sub second latency but sacrifices CDN friendliness and increases infrastructure complexity compared to RTMP plus HLS delivery
•Production systems use dual path ingest (different POPs or providers) with automatic switchover on packet loss or latency threshold violations for critical events
📌 Examples
Twitch architecture: Broadcasters send RTMP streams to regional edge ingest points, which transcode to multiple bitrates (160p at 160 to 250 kilobits per second up to 1080p at 4 to 6 Mbps), then package as HLS for CDN delivery to millions of concurrent viewers
YouTube Live accepts RTMP and SRT ingest, then delivers via HLS and DASH with three latency tiers: Normal (20 to 60 seconds), Low latency (10 to 20 seconds), and Ultra low latency (2 to 5 seconds using partial chunks)
Amazon IVS provides managed live streaming with RTMP ingest and Low Latency HLS (LL-HLS) delivery, achieving 2 to 5 second end to end latency globally while handling thousands to hundreds of thousands of concurrent viewers per channel