docs/waves/networking-layer-definition.md
Networking Layer Definition (WAP 1.x)
Date: 2026-03-04
Owner: transport-rust / browser / engine-wasm integration
This is the practical build definition for networking layer work in Waves.
1) What to build
Build in explicit layers with profile-gated behavior:
WDP: address/port-capable datagram transport and adaptor profile.WCMP: selected error and diagnostic message structures.WSP: connectionless methods and headers for the strict profile; session, capability negotiation, and Push only when explicitly claimed.WTP: conditional transaction semantics for connection-oriented WSP.WTLS: security façade with explicit phase plan (phase A shim, phase B full implementation).
Transport profile scope for this document is the strict WDP/WCMP/connectionless-WSP path plus explicit gates for optional modules.
2) What must not be built here
- WML parsing and rendering.
- Browser input handling and host-window semantics.
- Runtime rendering state ownership.
Those remain in engine-wasm and browser as per contract boundaries.
3) Contract alignment checklist
- Parser outputs are pure value types (
WspPdu,WtpPdu,WdpDatagram,WtlsRecord). - No global mutable parser state.
- Deterministic traces for state transitions and timers.
- Feature flags must preserve API compatibility.
4) Protocol definitions in priority order
- Effective
WAP-200sequence: strict WDP source and SCR authority. WAP-202: strict WCMP source and SCR authority.- Effective
WAP-203sequence: strict WSP source and SCR authority. - Effective
WAP-201sequence: conditional WTP authority only when connection-oriented WSP is claimed. WAP-259,WAP-224,WAP-230, and OMA corrections: successor delta/context evidence only.WAP-261/WAP-199: WTLS placeholder and roadmap (security path).
5) Build order with acceptance gates
- The three exact transport ledgers must stay valid before parser or profile contract shifts.
WDPtransport abstractions and UDP implementation with validated port mapping.WCMPselected message structures and deterministic error rules.WSPconnectionless GET/POST/REPLY codec and selected header baseline.- Browser integration surface contract verification (
transport.ts). - Conditional WTP and connection-oriented WSP only after an extension-profile claim activates them.
- Optional WTLS shim enablement.
6) Open questions closed by design
- WSP mode profile should be explicit and persisted in runtime profile config.
- WSP session is tied to peer quadruplet and aborted on disconnect/suspend.
- Push is allowed only when profile advertises facility.
- SAR/ESAR remain optional and disabled unless explicitly enabled.
7) Mapping to existing work-items
T0-08WTP retransmission/TID/window.T0-09WSP connectionless matrix.T0-10assigned-number registry fixtures.T0-11capability bounds enforcement.T0-14profile decision gates.
8) Recommended next step
Create golden fixtures for:
- the eight selected WSP connectionless rows and source-derived GET/POST/REPLY encodings,
- the two selected ICMP-backed WCMP rows, with the general-WCMP codec gated to explicitly selected non-IP bearers,
WDPUDP receive/send roundtrip with9200/9201/9202/9203mapping,- transport profile gating for
connectionless_only, conditionalconnection_mode,wtls_optional, andpush_enabled.