Skip to content

Architecture

André Borchert edited this page Aug 10, 2026 · 5 revisions

Architecture

Swift is the active implementation. The C99/ and CPP/ trees define planned layouts and implementation plans; they do not contain protocol implementations.

Package graph

Public API and command-line tools
  -> WebTransport
  -> WebTransportNetworkRuntime
  -> WebTransportHTTP3Core
  -> WebTransportQUICCore + WebTransportTLSCore
  -> WebTransportCryptoApple + WebTransportUDPApple

More precisely:

  • WebTransport depends on WebTransportHTTP3Core, WebTransportNetworkRuntime, and WebTransportQUICCore.
  • WebTransportNetworkRuntime depends on the crypto, HTTP/3, QUIC, TLS, and UDP modules.
  • WebTransportHTTP3Core, WebTransportTLSCore, and WebTransportCryptoApple depend on WebTransportQUICCore.
  • WebTransportCLIConformance supplies shared scenarios to both command-line tools.

Client connection flow

  1. WebTransportClient receives a public API configuration or command-line arguments.
  2. A real network session validates that packet transport is selected.
  3. WebTransportQUICClient applies the selected trust policy and opens a Network.framework QUIC connection.
  4. The client exchanges HTTP/3 control streams.
  5. It sends a WebTransport extended CONNECT request on a bidirectional request stream.
  6. The response headers and negotiated settings are validated.
  7. A WebTransportNetworkSession carries application streams, datagrams, drain, and close operations.

Server connection flow

  1. WebTransportServer receives listener configuration or --listen arguments.
  2. A real network session validates that packet transport is selected.
  3. WebTransportQUICServer creates a TLS identity and a Network.framework listener.
  4. The server accepts a QUIC connection and exchanges HTTP/3 control streams.
  5. It decodes the extended CONNECT request.
  6. WebTransportServerSessionPolicy checks authority, path, optional origin, supported protocols, and required settings.
  7. The server returns response headers and creates a WebTransportNetworkSession.

Component responsibilities

WebTransport

The public Swift concurrency API. It defines client and server configuration, endpoints, actors, listeners, sessions, bidirectional streams, opt-in logging, and public error descriptions. Public API compatibility and redacted output are its main compatibility constraints.

WebTransportNetworkRuntime

The Network.framework QUIC/TLS/HTTP/3 runtime. It owns endpoint parsing, trust selection, network sessions, datagrams, timeouts, and connection lifecycle behavior.

WebTransportHTTP3Core

HTTP/3 frames and settings, QPACK, extended CONNECT, WebTransport sessions, streams, datagrams, buffering, and flow control. This module parses peer-controlled data and requires strict bounds and deterministic malformed-input behavior.

WebTransportQUICCore

QUIC byte cursors, variable-length integers, packets, frames, transport parameters, stream identifiers, and connection state primitives.

WebTransportTLSCore

TLS 1.3 handshake messages, certificate verification, key schedule, and QUIC TLS state. Application-key readiness is gated by trust, CertificateVerify, Finished, ALPN h3, and QUIC transport parameters.

WebTransportCryptoApple

Apple-backed QUIC initial-key derivation and packet-protection helpers.

WebTransportUDPApple

A Darwin UDP helper for tests and local packet probes. Its public binding path is restricted to loopback hosts.

WebTransportCLIConformance

The shared positive and negative scenario harness used by WebTransportClient and WebTransportServer.

Trust boundaries

  • Command-line and configuration input enters through argument and endpoint parsing.
  • Network peers control HTTP/3, QPACK, QUIC, TLS, stream, datagram, and session input.
  • Platform trust is the default; local self-signed trust is explicit and loopback-only.
  • Public logging and errors must not reveal secrets, payloads, connection identifiers, raw session identifiers, or peer close text.
  • External interoperability scripts accept environment configuration and write proof artifacts under .build/.

See Security and Trust for the security invariants attached to these boundaries.

Clone this wiki locally