quic-tensor-mesh
Headless PSK-authenticated multiplexed QUIC tensor shard transfer and RFC 9221
QUIC datagram round-trip demo built on github.com/tmc/apple/x/nwquic (Apple's
Network.framework, CGO_ENABLED=0, no Keychain or GUI prompts).
What it demonstrates
- Headless mutual PSK authentication over TLS 1.3 QUIC: generates ephemeral
in-memory ECDSA P-256
Sec_identity_t certificates (via SecKeyCreateWithData
SecCertificateCreateWithData + SecIdentityCreate) carrying an
HMAC-SHA256(PSK, Identity || SPKI) extension verified during the handshake
without touching any macOS Keychain.
- Multiplexed bidirectional QUIC streams: transfers 16 MiB partitioned across
4 concurrent bidirectional streams on one
NWConnectionGroup, verifying
distinct QUIC stream IDs (NWQuicGetStreamID: [4 8 12 16]) and per-stream
SHA-256 parity.
- RFC 9221 QUIC datagrams: performs an unreliable QUIC DATAGRAM ping/ack
round-trip over the same connection and measures RTT.
- Transport telemetry: collects
NWDataTransferReportCollect metrics across
the connection's streams (SentAppBytes, ReceivedAppBytes, SentWireBytes,
ReceivedWireBytes, RetransmittedBytes, RTT, and path count).
Usage
CGO_ENABLED=0 go run ./examples/network/quic-tensor-mesh
Flags:
-streams (default 4): number of concurrent bidirectional QUIC streams
-mib (default 16): total tensor payload size in MiB
-timeout (default 25s): overall operation timeout
Tests
CGO_ENABLED=0 go vet ./x/nwquic ./examples/network/quic-tensor-mesh
CGO_ENABLED=0 go test -v -count=1 -timeout 30s ./x/nwquic ./examples/network/quic-tensor-mesh
Measured Loopback Results (Apple Silicon macOS)
From CGO_ENABLED=0 go run ./examples/network/quic-tensor-mesh (16 MiB across 4 concurrent streams):
QUIC tensor mesh complete (headless PSK loopback)
streams: 4 (distinct IDs: [4 8 12 16])
payload: 16.00 MiB (16777216 bytes), SHA-256 parity OK on all streams
elapsed: 287.965ms
throughput: 55.56 MiB/s
datagram RTT: 24.926ms (RFC 9221 QUIC DATAGRAM round-trip OK)
transfer report: sentApp=16777216 recvApp=128 sentWire=67624703 recvWire=9599 retrans=0 minRTT=0s smoothedRTT=0s paths=1
From CGO_ENABLED=0 go test -v -count=1 -timeout 30s ./examples/network/quic-tensor-mesh:
16 MiB across 4 streams (IDs=[4 8 12 16]): 112.70 MiB/s in 141.965ms, datagramRTT=1.679ms, sentApp=16777216 smoothedRTT=0s