Skip to content

Commit 58aeba4

Browse files
committed
compression: no mandatory algorithm
Drop deflate's MUST-implement status in both drafts. A mandatory algorithm is a conformance burden (a zstd-only endpoint shouldn't be non-conformant) and doesn't actually guarantee end-to-end compression on a relayed path anyway. Now both deflate and zstd are simply defined; endpoints advertise whichever they support, and a publisher uses an algorithm its peer advertised or `none` if they share none — verbatim, the same well-defined fallback as any unsupported case. Removes the "Requirement" column and the "always a safe choice" framing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W8bLV6vHzucLNvDhPk3bMP
1 parent 63798e0 commit 58aeba4

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

draft-lcurley-moq-compression.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ COMPRESSION Setup Option {
6666

6767
**Algorithm**:
6868
One or more Algorithm identifiers (see [Compression Algorithms](#compression-algorithms)) that the sender can decompress, each a varint, filling the Option Value.
69-
An endpoint that includes this option MUST list `deflate` (1); the identifier `none` (0) MUST NOT be listed (it requires no negotiation).
69+
The identifier `none` (0) MUST NOT be listed (it requires no negotiation); an endpoint lists whichever other algorithms it supports.
7070
An endpoint that does not support the extension omits the option.
7171

7272
A sender MUST NOT compress with an algorithm the receiver did not advertise, and MUST NOT compress before it has received the receiver's COMPRESSION option.
@@ -89,7 +89,7 @@ COMPRESSION Track Property {
8989
**Value**:
9090
The Algorithm identifier the publisher used for this track's payloads (see [Compression Algorithms](#compression-algorithms)).
9191
The absence of the property, or a value of `none` (0), means the track is uncompressed and its payloads are always transmitted verbatim.
92-
The publisher MUST choose an algorithm that its peer advertised in the [COMPRESSION Setup Option](#setup-negotiation); since `deflate` is mandatory to implement, it is always a safe choice.
92+
The publisher MUST choose an algorithm that its peer advertised in the [COMPRESSION Setup Option](#setup-negotiation), or `none` if the peer advertised none the publisher can produce.
9393

9494
The property is fixed for the lifetime of the track and MUST NOT change.
9595
A relay MUST forward it unchanged on every hop, including a hop that has not negotiated the extension: there it is simply an ignored unknown Key-Value-Pair, but forwarding it lets a further-downstream hop that does negotiate the extension still act on the publisher's algorithm.
@@ -124,13 +124,13 @@ A relay or cache can hold the object payloads compressed in memory and forward t
124124
## Compression Algorithms {#compression-algorithms}
125125
This document defines the following algorithms.
126126

127-
| ID | Name | Requirement | Description |
128-
|---:|:--------|:------------|:--------------------------------------------------------|
129-
| 0 | none | — | Verbatim; the absence of compression. Never advertised. |
130-
| 1 | deflate | mandatory | Raw DEFLATE {{RFC1951}}, with no zlib or gzip framing. |
131-
| 2 | zstd | optional | Zstandard {{RFC8878}}. |
127+
| ID | Name | Description |
128+
|---:|:--------|:--------------------------------------------------------|
129+
| 0 | none | Verbatim; the absence of compression. Never advertised. |
130+
| 1 | deflate | Raw DEFLATE {{RFC1951}}, with no zlib or gzip framing. |
131+
| 2 | zstd | Zstandard {{RFC8878}}. |
132132

133-
Every endpoint that advertises this extension MUST implement `deflate`, so the publisher always has a safe choice; `zstd` is optional.
133+
Endpoints advertise whichever of these algorithms they support; none is mandatory, and a publisher uses one its peer advertised (or `none` if they share none).
134134
Further algorithms MAY be registered (see [IANA Considerations](#iana-considerations)).
135135

136136

draft-lcurley-moq-lite.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ A relay MUST NOT forward the Path Parameter; like other per-hop setup metadata i
633633
### Compression Parameter {#compression-parameter}
634634
The Compression Parameter advertises the payload compression [algorithms](#compression) the sender can *decompress* on this hop.
635635
The Parameter Value is a sequence of algorithm identifiers, each a variable-length integer, packed back-to-back to fill the Parameter Length.
636-
An endpoint that supports compression MUST include `deflate` (1); `none` (0) MUST NOT be listed. An endpoint that does not support compression omits the parameter.
636+
The identifier `none` (0) MUST NOT be listed. An endpoint that does not support compression omits the parameter.
637637

638638
A relay MUST NOT forward the parameter (see [Session](#session)); it is negotiated independently on each hop.
639639
The list constrains what a publisher may use: a publisher MUST set `Publisher Compression` to an algorithm its peer advertised here (see [TRACK_INFO](#track-info)), and more generally a sender MUST NOT compress with an algorithm the receiver did not advertise, nor compress at all before it has received the receiver's Compression Parameter.
@@ -869,7 +869,7 @@ The compression algorithm the original publisher applied to this Track's payload
869869
- `0` (`none`): payloads are uncompressed (the default).
870870
- `1` (`deflate`) or `2` (`zstd`): payloads are compressed with that algorithm.
871871

872-
The publisher MUST choose an algorithm its peer advertised in the [Compression Parameter](#compression-parameter); `deflate` is mandatory to support, so it is always a safe choice.
872+
The publisher MUST choose an algorithm its peer advertised in the [Compression Parameter](#compression-parameter), or `0` if the peer advertised none the publisher can produce.
873873
The value is fixed for the lifetime of the Track and forwarded unchanged by relays, so even a hop that does not compress passes it along for a further-downstream hop to act on.
874874
It does not by itself cause compression: a receiver decompresses if and only if the value names a non-`none` algorithm and the receiver advertised that algorithm in its own [Compression Parameter](#compression-parameter); otherwise the payloads are verbatim (see [Compression](#compression)). A subscriber that does not recognize the value treats the payloads as verbatim, so an unknown future algorithm degrades to uncompressed rather than blocking the Track.
875875

@@ -885,13 +885,13 @@ A hop compresses a Track's payloads when, and only when, `Publisher Compression`
885885

886886
The following algorithms are defined:
887887

888-
| ID | Name | Requirement | Description |
889-
|---:|:--------|:------------|:--------------------------------------------------------|
890-
| 0 | none | — | Verbatim; the absence of compression. Never advertised. |
891-
| 1 | deflate | mandatory | Raw DEFLATE {{!RFC1951}}, with no zlib or gzip framing. |
892-
| 2 | zstd | optional | Zstandard {{!RFC8878}}. |
888+
| ID | Name | Description |
889+
|---:|:--------|:--------------------------------------------------------|
890+
| 0 | none | Verbatim; the absence of compression. Never advertised. |
891+
| 1 | deflate | Raw DEFLATE {{!RFC1951}}, with no zlib or gzip framing. |
892+
| 2 | zstd | Zstandard {{!RFC8878}}. |
893893

894-
Every endpoint that supports compression MUST implement `deflate`, so the publisher always has a safe choice; `zstd` is optional, and further algorithms MAY be defined by future extensions.
894+
Endpoints advertise whichever of these algorithms they support; none is mandatory, and a publisher uses one its peer advertised, or `none` if they share none. Further algorithms MAY be defined by future extensions.
895895

896896
Compression is **group-scoped** and applied only to frame payloads, never to the FRAME framing. Within a group the payloads form a single compressed stream in the Track's algorithm, reset at each group boundary, whose output is partitioned at frame boundaries: the compressor flushes at the end of each frame so that frame's slice is exactly the bytes stored in its `Payload` (delimited by `Message Length`). Both algorithms provide such a flush that retains the window (DEFLATE's sync flush; Zstandard's `ZSTD_e_flush`), so later frames in a group reuse the compression context. A receiver maintains a single decoder per group, reset at each group boundary, and feeds each frame's `Payload` through it in order: the first frame starts the decoder fresh — so a subscriber joining at a group boundary needs nothing earlier — while later frames retain cross-frame redundancy across the group. There is no shared state between groups; a frame with an empty payload contributes nothing to the stream.
897897

@@ -1114,7 +1114,7 @@ A generic library or relay MUST NOT inspect or modify the decompressed contents
11141114
- Removed `Publisher Max Latency`. The publisher's retention guarantee is no longer part of the wire format; retention for FETCH and future subscriptions is best-effort and left to the publisher.
11151115
- Timestamp-based expiration replaces wall-clock arrival time when a Track timescale is negotiated.
11161116
- Added QUIC datagram delivery for groups, sharing Subscribe IDs with existing subscriptions (no separate control stream).
1117-
- Added payload compression, scoped per group. `Publisher Compression` in TRACK_INFO now names the algorithm the publisher used (`none`/`deflate`/`zstd`), and a new SETUP `Compression` parameter carries the algorithms each endpoint can decompress on a hop. The publisher MUST pick an algorithm its peer advertised; `deflate` is mandatory (so always safe) and `zstd` is optional. There is no per-group or per-frame flag on the wire — a receiver decompresses iff `Publisher Compression` names a non-`none` algorithm it advertised, else treats payloads as verbatim. When compressed, a group's frame payloads (only the payloads, never the framing) form a single stream in that algorithm, reset at each group boundary and sliced per frame into each frame's opaque `Payload`, with the algorithm's redundant container bytes omitted (the RFC 7692 trim for deflate; magicless, checksum-less frames for zstd) since moq-lite frames the slices itself; the decoder keeps one context per group. Keeping the framing uncompressed lets a relay store payloads compressed and re-frame across transport versions without recompressing.
1117+
- Added payload compression, scoped per group. `Publisher Compression` in TRACK_INFO now names the algorithm the publisher used (`none`/`deflate`/`zstd`), and a new SETUP `Compression` parameter carries the algorithms each endpoint can decompress on a hop. The publisher MUST pick an algorithm its peer advertised (or `none` if they share none); `deflate` and `zstd` are defined, neither mandatory. There is no per-group or per-frame flag on the wire — a receiver decompresses iff `Publisher Compression` names a non-`none` algorithm it advertised, else treats payloads as verbatim. When compressed, a group's frame payloads (only the payloads, never the framing) form a single stream in that algorithm, reset at each group boundary and sliced per frame into each frame's opaque `Payload`, with the algorithm's redundant container bytes omitted (the RFC 7692 trim for deflate; magicless, checksum-less frames for zstd) since moq-lite frames the slices itself; the decoder keeps one context per group. Keeping the framing uncompressed lets a relay store payloads compressed and re-frame across transport versions without recompressing.
11181118
- Added Qmux [qmux] transport bindings for TCP/TLS and WebSocket, for environments where UDP is unavailable. The WebSocket binding uses the WebSocket message framing in place of the Qmux Record `Size` field.
11191119

11201120
## moq-lite-04

0 commit comments

Comments
 (0)