Skip to content

Commit 48d3f82

Browse files
authored
Merge pull request #12 from mondain/draft-18
Draft 18
2 parents 7694c97 + d1a6853 commit 48d3f82

23 files changed

Lines changed: 1990 additions & 73 deletions

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@
66

77
# CMake
88
CMakeUserPresets.json
9+
CMakeCache.txt
10+
CMakeFiles/
11+
CTestTestfile.cmake
12+
DartConfiguration.tcl
13+
Makefile
14+
cmake_install.cmake
915
Testing/
1016

17+
# In-source build binaries
18+
/openmoq-publisher
19+
/openmoq-publisher-*-tests
20+
/libopenmoq_publisher_lib.a
21+
1122
# Editors
1223
.DS_Store
1324
.idea/

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists
6161
# all of which compile sources that transitively include picotls.h.
6262
include_directories(BEFORE "${OPENMOQ_PICOTLS_SOURCE_DIR}/picotlsvs/picotls")
6363
endif()
64-
if(APPLE)
64+
if(NOT WIN32)
6565
# picotls appends literal "(" and ")" list items when Brotli is
6666
# discovered via pkg-config. On macOS, CMake rejects the resulting
6767
# malformed source-prefixed link directories during generate. Scope
@@ -73,7 +73,7 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists
7373
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/openmoq-empty-pkgconfig")
7474
endif()
7575
add_subdirectory("${OPENMOQ_PICOQUIC_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/picoquic")
76-
if(APPLE)
76+
if(NOT WIN32)
7777
set(ENV{PKG_CONFIG_LIBDIR} "${_openmoq_saved_pkg_config_libdir}")
7878
set(ENV{PKG_CONFIG_PATH} "${_openmoq_saved_pkg_config_path}")
7979
unset(_openmoq_saved_pkg_config_libdir)
@@ -199,6 +199,12 @@ if(OPENMOQ_BUILD_TESTS)
199199
target_link_libraries(openmoq-publisher-api-tests PRIVATE openmoq_publisher_lib)
200200
add_test(NAME openmoq-publisher-api-tests COMMAND openmoq-publisher-api-tests)
201201

202+
add_executable(openmoq-publisher-control-message-tests
203+
tests/moqt_control_messages_test.cpp
204+
)
205+
target_link_libraries(openmoq-publisher-control-message-tests PRIVATE openmoq_publisher_lib)
206+
add_test(NAME openmoq-publisher-control-message-tests COMMAND openmoq-publisher-control-message-tests)
207+
202208
if(OPENMOQ_HAS_PICOQUIC AND OPENMOQ_RUN_PICOQUIC_SMOKE_TESTS)
203209
add_executable(openmoq-publisher-picoquic-smoke-tests
204210
tests/picoquic_smoke_test.cpp

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`moqxr` is a C++20 OpenMOQ publisher contribution project for Linux, macOS, and Windows.
44

5-
It packages MP4 input into CMSF-style publishable objects, supports MOQT draft-specific framing for drafts 14 and 16, and can either inspect the generated publish plan locally or publish it over a picoquic-backed transport when local `picoquic` and `picotls` checkouts are available.
5+
It packages MP4 input into CMSF-style publishable objects, supports MOQT draft-specific framing for drafts 14, 16, and 18, and can either inspect the generated publish plan locally or publish it over a picoquic-backed transport when local `picoquic` and `picotls` checkouts are available.
66

77
## Overview
88

@@ -42,6 +42,7 @@ This keeps the project aligned with CMAF-style publication while reusing the sam
4242

4343
- `draft-ietf-moq-transport-14` is the primary target
4444
- `draft-ietf-moq-transport-16` is represented as a secondary compatibility profile
45+
- `draft-ietf-moq-transport-18` support is implemented for version selection, setup/request framing codec paths, and request-stream response correlation; interop hardening is still in progress
4546
- draft-specific assumptions are documented in [docs/protocol-mapping.md](docs/protocol-mapping.md)
4647

4748
## Repository layout
@@ -51,6 +52,7 @@ This keeps the project aligned with CMAF-style publication while reusing the sam
5152
- `tests`: CTest-based unit coverage
5253
- `docs`: protocol notes and design references
5354
- `docs/publisher-api.md`: step-by-step application integration guide for the C++ publisher API
55+
- `docs/draft18-implementation-plan.md`: implementation plan for draft-18 transport support
5456
- `docs/transport-plan.md`: picoquic integration plan and implementation checklist
5557
- `.github/workflows/ci.yml`: GitHub Actions build and test workflow for Linux, macOS, and Windows
5658
- `.github/workflows/release.yml`: GitHub Actions release-build workflow that uploads Linux, macOS, and Windows archives
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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

Comments
 (0)