|
| 1 | +# Draft-18 Implementation Plan |
| 2 | + |
| 3 | +This plan tracks adding `draft-ietf-moq-transport-18` support to `moqxr`. |
| 4 | + |
| 5 | +Reference reviewed: <https://datatracker.ietf.org/doc/html/draft-ietf-moq-transport-18> (12 May 2026). |
| 6 | + |
| 7 | +## Goals |
| 8 | + |
| 9 | +1. Add draft-18 as a selectable profile in CLI and API. |
| 10 | +2. Preserve existing draft-14 and draft-16 behavior. |
| 11 | +3. Incrementally introduce draft-18 wire semantics with tests at each phase. |
| 12 | + |
| 13 | +## Current Status |
| 14 | + |
| 15 | +- Completed: |
| 16 | + - Phase A: version plumbing (`kDraft18`, CLI/API selection, ALPN defaults). |
| 17 | + - Phase B: draft-18 codec support in control messages: |
| 18 | + - `SETUP` (`0x2F00`) handling. |
| 19 | + - setup options parsing/encoding for `PATH` and `AUTHORITY`. |
| 20 | + - draft-18 `REQUEST_OK` / `REQUEST_ERROR` parsing support. |
| 21 | + - dedicated control-message tests. |
| 22 | + - Phase C (partial): request-stream semantics in session layer: |
| 23 | + - per-request bidirectional stream request/response flow for namespace/publish paths. |
| 24 | + - strict response correlation on request streams, including: |
| 25 | + - unexpected response type rejection |
| 26 | + - GOAWAY rejection on request stream |
| 27 | + - duplicate terminal response rejection |
| 28 | + - legacy (draft-14/16) shared-control-stream publish response ID validation hardening. |
| 29 | +- Remaining: |
| 30 | + - Complete Phase C across all request categories used by this publisher. |
| 31 | + - Phase D data-stream/object framing alignment and additional draft-18 conformance checks. |
| 32 | + - Phase E interop and production hardening. |
| 33 | + |
| 34 | +## Phase A: Version Plumbing (Low Risk) |
| 35 | + |
| 36 | +Files: |
| 37 | + |
| 38 | +- `include/openmoq/publisher/moq_draft.h` |
| 39 | +- `src/moq_draft.cpp` |
| 40 | +- `src/cli_options.cpp` |
| 41 | +- `src/publisher_api.cpp` |
| 42 | +- `tests/cli_options_test.cpp` |
| 43 | + |
| 44 | +Deliverables: |
| 45 | + |
| 46 | +1. `kDraft18` enum value and string conversion. |
| 47 | +2. ALPN default selection for raw QUIC (`moqt-18`). |
| 48 | +3. CLI accepts `--draft 18`. |
| 49 | +4. API maps WebTransport protocol offer for draft-18. |
| 50 | +5. Basic tests for draft parsing. |
| 51 | + |
| 52 | +## Phase B: Control Message Codec for Draft-18 |
| 53 | + |
| 54 | +Primary files: |
| 55 | + |
| 56 | +- `include/openmoq/publisher/transport/moqt_control_messages.h` |
| 57 | +- `src/transport/moqt_control_messages.cpp` |
| 58 | + |
| 59 | +Work: |
| 60 | + |
| 61 | +1. Add draft-18 message constants: |
| 62 | + - `SETUP` message type `0x2F00`. |
| 63 | +2. Implement draft-18 `SETUP` option KVP handling: |
| 64 | + - `PATH (0x01)` |
| 65 | + - `AUTHORITY (0x05)` |
| 66 | + - Option parsing model that ignores unknown setup options. |
| 67 | +3. Add draft-18 `REQUEST_OK (0x07)` and `REQUEST_ERROR (0x05)` codec support. |
| 68 | +4. Introduce tests for message length/parsing and parameter handling. |
| 69 | + |
| 70 | +## Phase C: Session Request-Stream Semantics |
| 71 | + |
| 72 | +Primary file: |
| 73 | + |
| 74 | +- `src/transport/moqt_session.cpp` |
| 75 | + |
| 76 | +Work: |
| 77 | + |
| 78 | +1. Add draft-18 request stream lifecycle: |
| 79 | + - one bidirectional stream per request type (`PUBLISH`, `SUBSCRIBE_NAMESPACE`, etc.). |
| 80 | +2. Read responses (`REQUEST_OK` / `REQUEST_ERROR`) on matching request stream. |
| 81 | +3. Keep existing control stream behavior for draft-14/16. |
| 82 | +4. Add per-request state bookkeeping and robust stream-close handling. |
| 83 | + |
| 84 | +Status: |
| 85 | + |
| 86 | +- Implemented for publish namespace and publish-track handshake paths. |
| 87 | +- Includes strict request-stream response validation and duplicate-response rejection. |
| 88 | +- Remaining stream choreography work is focused on full request coverage and expanded state tracking. |
| 89 | + |
| 90 | +## Phase D: Data Stream/Object Framing Alignment |
| 91 | + |
| 92 | +Primary files: |
| 93 | + |
| 94 | +- `src/transport/moqt_control_messages.cpp` |
| 95 | +- `src/transport/moqt_session.cpp` |
| 96 | + |
| 97 | +Work: |
| 98 | + |
| 99 | +1. Validate/align subgroup header flags for draft-18 (`0b0XX1XXXX` family). |
| 100 | +2. Add explicit handling for `FIRST_OBJECT` semantics. |
| 101 | +3. Confirm object ID delta handling and end-of-group behavior. |
| 102 | +4. Add regression tests with malformed inputs and expected protocol errors. |
| 103 | + |
| 104 | +## Phase E: Interop + Hardening |
| 105 | + |
| 106 | +Work: |
| 107 | + |
| 108 | +1. Add an interop checklist document for at least one draft-18 relay target. |
| 109 | +2. Capture failure taxonomy and map to existing `TransportStatus` messages. |
| 110 | +3. Confirm no regressions in: |
| 111 | + - draft-14 test flows |
| 112 | + - draft-16 test flows |
| 113 | + - WebTransport connect flows |
| 114 | + |
| 115 | +## Test Strategy |
| 116 | + |
| 117 | +1. Unit tests for codec and message validation in `moqt_control_messages`. |
| 118 | +2. Session-level tests in `tests/moqt_session_test.cpp` for request-stream choreography. |
| 119 | +3. End-to-end sanity using existing build + ctest workflow. |
| 120 | + |
| 121 | +## Risks |
| 122 | + |
| 123 | +1. Architectural mismatch: current request ID flow vs draft-18 per-request streams. |
| 124 | +2. Parameter parsing strictness causing interop breakage if not version-gated. |
| 125 | +3. Unintended regressions to draft-14/draft-16 behavior. |
| 126 | + |
| 127 | +## Mitigations |
| 128 | + |
| 129 | +1. Strict version gates around all draft-18-only behavior. |
| 130 | +2. Land in small commits with tests per step. |
| 131 | +3. Preserve legacy paths untouched where practical. |
0 commit comments