moq-lite Protocol
moq-lite is the core transport protocol that provides real-time pub/sub capabilities over QUIC. It’s designed to be generic, efficient, and CDN-friendly.While compatible with a subset of the IETF MoQ specification, moq-lite focuses on practical features and deployability. We highly recommend using moq-lite over the full IETF standard until at least draft-30.
Overview
moq-lite provides a structured way to publish and subscribe to live data streams with:- Built-in concurrency: Multiple streams delivered in parallel
- Automatic deduplication: Efficient use of network resources
- Flexible prioritization: Control delivery order based on importance
- Partial reliability: Trade reliability for latency when needed
- CDN-compatible: Simple rules that relays can enforce without application knowledge
The Hierarchy
moq-lite organizes data in a hierarchical structure from largest to smallest:Origin
An Origin is a collection of broadcasts produced by one or more sessions.Broadcast
A Broadcast is a collection of tracks produced by a single publisher.- A live video stream (with video, audio, and chat tracks)
- A telemetry feed (with sensor data tracks)
- A real-time game state (with player position tracks)
- Has a unique name/path
- Published by a single source
- Can contain multiple tracks
- Can be announced for discovery
Track
A Track is a collection of groups within a broadcast, delivered out-of-order until they expire.- Video renditions (e.g., “video/1080p”, “video/720p”)
- Audio channels (e.g., “audio/en”, “audio/es”)
- Chat messages (e.g., “chat”)
- Telemetry (e.g., “metrics”)
- Out-of-order delivery: Groups within a track can arrive in any order
- Time-based expiration: Old groups can be dropped
- Independent: Each track is delivered independently
- Metadata: Contains delivery hints (priority, caching rules)
Tracks are like HTTP/2 streams - multiplexed, independent, and prioritizable.
Group
A Group is a collection of frames delivered in-order until cancelled.- A video Group of Pictures (GOP)
- An audio frame
- A chat message
- A complete JSON document
- In-order delivery: Frames arrive in sequence
- Atomic: Either all frames arrive or the group is abandoned
- Cancellable: Can be aborted mid-delivery if no longer relevant
- Independent: Each group uses a separate QUIC stream
Frame
A Frame is a sized chunk of data within a group.- Encoded video frame
- Audio sample
- Text message
- Binary data
- Fixed size: Size is known upfront
- Ordered: Delivered in sequence within a group
- Chunked: Can be split across multiple QUIC packets
Producer/Consumer API
The moq-lite API is built around producer/consumer pairs at each level:- Rust Producer
- TypeScript Producer
- Rust Consumer
- TypeScript Consumer
Delivery Semantics
moq-lite supports different delivery patterns based on metadata:Priority
Controls which content is delivered first when bandwidth is constrained:- Higher priority: Delivered before lower priority (e.g., audio > video)
- Same priority: Delivered in order of creation
- Dynamic: Can change based on network conditions
Caching
Controls whether content is cached at relays:- Cacheable: Stored and forwarded to late joiners
- Ephemeral: Discarded if no active subscribers
Expiration
Controls how long content remains relevant:- Time-based: Discard after N seconds
- Sequence-based: Discard after N newer groups
- Explicit: Discard when marked as expired
Network Characteristics
Deduplication
When multiple subscribers request the same content:- Relay receives one copy from publisher
- Relay forwards to all subscribers
- Network bandwidth scales with subscriber count, not stream count
Concurrency
Multiple tracks and groups are delivered in parallel:- Each group uses a separate QUIC stream
- Tracks are multiplexed automatically
- No head-of-line blocking between groups
Partial Reliability
Based on QUIC’s stream cancellation:- Groups can be abandoned if they fall behind
- Newer content prioritized over old
- Application controls trade-off between completeness and latency
Relay Behavior
The moq-relay server operates on moq-lite primitives:relay.toml
- Accepts publish and subscribe connections
- Forwards groups based on subscriptions
- Deduplicates identical subscriptions
- Enforces authentication rules
- Does not inspect or understand media
Protocol Specification
For the detailed wire format and protocol specification, see:Next Steps
hang Media Layer
Learn how media is encoded on top of moq-lite
Architecture
Understand the full protocol stack
Publishing Guide
Start publishing with moq-lite
Relay Setup
Deploy your own moq-relay server