TUIC v5 Protocol Specification¶
- Document: TUIC Protocol Specification Version
0x05 - Category: Informational
- Chinese edition: 简体中文
Status of This Memo¶
This document specifies version 0x05 of the TUIC protocol. TUIC relays multiplexed TCP streams and UDP datagrams over encrypted QUIC connections with TLS 1.3, and serves as the wire-format reference for wind-tuic and compatible implementations.
Abstract¶
TUIC is a command-driven proxy protocol for relaying TCP and UDP traffic over a single encrypted QUIC connection. It supports stream multiplexing, 0-RTT UDP session establishment, TLS keying-material-exporter authentication, and fragmentation and reassembly for large UDP datagrams. This specification defines the protocol architecture, command wire formats, address encoding, operational procedures, header overhead calculations, and security considerations.
1. Introduction¶
1.1. Purpose¶
TUIC provides secure, multiplexed TCP and UDP traffic relaying over QUIC, addressing the following goals:
- Efficient multiplexing of concurrent TCP connections and UDP sessions over a single QUIC connection;
- Zero round-trip time (0-RTT) UDP association establishment;
- Transparent handling of TCP byte streams and Full Cone NAT UDP datagrams;
- Robust fragmentation and reassembly for UDP datagrams exceeding the QUIC datagram limit.
1.2. Protocol Version¶
This document specifies TUIC protocol version 0x05.
1.3. Relation to Other Protocols¶
TUIC uses QUIC [RFC9000] as its primary transport and can coexist with HTTP/3 [RFC9114] on the same listener (for example, by classifying streams on their leading bytes for masquerading).
2. Conventions and Terminology¶
2.1. Requirements Language¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
2.2. Terminology¶
- Client: The endpoint initiating the TUIC connection and relay requests.
- Server: The endpoint accepting the TUIC connection and performing relay operations.
- Command: A protocol control message consisting of a fixed header and type-specific payload.
- Association: A UDP session identified by a unique 16-bit identifier.
- Fragment: A slice of a UDP datagram carried in an individual
Packetcommand. - Target: The final destination of relayed traffic.
2.3. Numeric Conventions¶
Unless explicitly stated otherwise, all multi-byte numeric fields are encoded in network byte order (big-endian). Field sizes are abbreviated as:
1B= 1 byte (8 bits)2B= 2 bytes (16 bits)4B= 4 bytes (32 bits)16B= 16 bytes (128 bits)
3. Protocol Architecture¶
3.1. Layering Model¶
+---------------------------+
| App Data |
+---------------------------+
| TUIC Protocol |
+---------------------------+
| QUIC (with TLS 1.3) |
+---------------------------+
| UDP |
+---------------------------+
3.2. Connection Model¶
A TUIC session runs over a single QUIC connection. Multiple TCP connections and UDP associations MAY be multiplexed concurrently over that connection.
3.3. Stream and Datagram Usage¶
- Unidirectional streams: Used for commands that do not require an in-stream response (
Authenticate,Packet,Dissociate). - Bidirectional streams: Used for TCP relaying via
Connect. - QUIC datagrams: MAY be used for
PacketandHeartbeatcommands to reduce latency and head-of-line blocking. - Transport selection: A sender MUST NOT use QUIC DATAGRAM frames to relay
Packetcommands unless the peer has advertised themax_datagram_frame_sizetransport parameter. When the peer has not advertised DATAGRAM support, the sender MUST fall back to unidirectional streams forPacketcommands so peers that cannot receive datagrams still receive replies.
4. Message Format¶
4.1. Base Command Header¶
Every TUIC command begins with a 2-byte base header:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version | Type | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
| Type-Specific Payload (var)... |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Version (1B): Protocol version identifier, fixed to
0x05. - Type (1B): Command type identifier (Section 4.2).
- Type-Specific Payload: Variable-length body determined by
Type.
4.2. Command Type Registry¶
| Value | Command Name | Reference |
|---|---|---|
0x00 |
Authenticate |
Section 5.1 |
0x01 |
Connect |
Section 5.2 |
0x02 |
Packet |
Section 5.3 |
0x03 |
Dissociate |
Section 5.4 |
0x04 |
Heartbeat |
Section 5.5 |
All other values are reserved for future use.
5. Command Definitions¶
5.1. Authenticate (0x00)¶
Establishes client identity and authorization.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version | 0x00 | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
| |
+ UUID (16B) +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ TOKEN (32B) +
| |
+ +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- UUID (16B): Client identifier encoded as a UUID [RFC4122].
- TOKEN (32B): Authentication token derived via a TLS Keying Material Exporter [RFC5705] with:
- Label: the client's UUID value;
- Context: the raw password bytes;
- Length: 32 bytes.
Procedure:
- The client MUST send
Authenticateon a unidirectional stream before any other command. - The server MUST verify that
TOKENmatches the expected credential forUUID. - If verification fails, the server MUST terminate the connection.
- If verification succeeds, the server enables processing of subsequent relay commands.
Note: A server MAY accept headers of other commands before authentication completes and suspend processing until verification succeeds.
5.2. Connect (0x01)¶
Initiates bidirectional TCP relaying to a target address.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version | 0x01 | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
| Target Address (var)... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Target Address: Encoded per Section 6; MUST NOT be
None (0xFF).
Procedure:
- The client opens a new bidirectional QUIC stream.
- The client sends
Connectwith the target address, immediately followed by application bytes if desired. - The server establishes a TCP connection to the target.
- Bidirectional data relaying proceeds between the QUIC stream and the target TCP connection.
- Closing the stream in either direction ends relaying for that direction or connection.
5.3. Packet (0x02)¶
Relays UDP datagrams with optional fragmentation and reassembly.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version | 0x02 | Assoc ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Packet ID | Frag Total | Frag ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Size | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
| Target Address (var)... |
+ +
| Payload... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Assoc ID (2B): UDP association identifier (Section 7.3).
- Packet ID (2B): Sequence identifier shared by all fragments of a UDP datagram.
- Frag Total (1B): Total fragment count; MUST satisfy
1 <= Frag Total <= 255. - Frag ID (1B): Zero-based fragment index; MUST be strictly less than
Frag Total. - Payload Size (2B): Byte length of
Payloadin this fragment (excludingTarget Address). - Target Address: Encoded per Section 6. Non-initial fragments (
Frag ID > 0) SHOULD useNone (0xFF). - Payload: Fragment slice of the original UDP datagram.
Fragmentation rules:
- Fragments sharing
(Assoc ID, Packet ID)belong to the same UDP datagram; - All fragments of a datagram MUST carry the same
Frag Total; Frag IDMUST span0throughFrag Total - 1;- Receivers MUST reassemble fragments in
Frag IDorder before forwarding; - Incomplete fragment groups SHOULD be discarded after a timeout (RECOMMENDED: 30 seconds).
5.4. Dissociate (0x03)¶
Explicitly terminates a UDP association.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version | 0x03 | Assoc ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Assoc ID (2B): Identifier of the UDP association to terminate.
Procedure:
- The client sends
Dissociateon a unidirectional stream. - The server closes the associated UDP socket and releases all resources bound to
Assoc ID. - Subsequent
Packetcommands referencing thatAssoc IDSHOULD be ignored or rejected.
5.5. Heartbeat (0x04)¶
Keeps the connection alive and detects liveness loss.
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Version | 0x04 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Heartbeat carries no payload beyond the 2-byte base header.
- Either endpoint MAY send
Heartbeatperiodically; HeartbeatSHOULD be sent over QUIC datagrams to minimize overhead;- RECOMMENDED interval during active relaying: 30–60 seconds;
- No response is required or expected.
6. Address Encoding¶
Target addresses use a Type-Length-Value (TLV) encoding.
6.1. Generic Format¶
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Addr Type | Address (var)... |
+-+-+-+-+-+-+-+-+ +
| Port (2B) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
6.2. Address Type Registry¶
| Value | Type | Address Body Size | Total Size |
|---|---|---|---|
0x00 |
Domain |
1 + N bytes |
4 + N bytes |
0x01 |
IPv4 |
4 bytes | 7 bytes |
0x02 |
IPv6 |
16 bytes | 19 bytes |
0xFF |
None |
0 bytes | 1 byte |
6.3. Type Specifications¶
Domain (0x00)¶
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x00 | Length | Domain Name (var)... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Port (2B) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Length (1B): Number of bytes in the domain name (
1..=255); - Domain Name: ASCII or UTF-8 encoded hostname;
- Port (2B): Big-endian TCP or UDP port number.
IPv4 (0x01)¶
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x01 | IPv4 Address (4B) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| IPv4 last byte| Port (2B) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- IPv4 Address (4B): Network-order IPv4 address;
- Port (2B): Big-endian port number.
IPv6 (0x02)¶
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x02 | |
+-+-+-+-+-+-+-+-+ +
| |
+ IPv6 Address (16B) +
| |
+ +
| |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | Port (2B) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- IPv6 Address (16B): Network-order IPv6 address;
- Port (2B): Big-endian port number.
None (0xFF)¶
- Used only in non-initial
Packetfragments to save header space; - MUST NOT be used in
Connectcommands or initial fragments (Frag ID == 0).
7. Protocol Operations¶
7.1. Connection Establishment¶
- The client completes a QUIC handshake with the server.
- The client sends
Authenticateon a new unidirectional stream. - The server validates the authentication token.
- Once authenticated, the connection is ready to relay TCP and UDP traffic.
7.2. TCP Relay¶
- Client to server: The client opens a bidirectional QUIC stream, sends
Connectwith the target address, and writes application bytes; the server connects to the target and forwards data. - Server to client: The server reads from the target TCP socket and writes directly to the bidirectional QUIC stream.
- Termination: Either side MAY close the stream to signal termination; when the QUIC stream closes, the server MUST close the target TCP connection.
7.3. UDP Relay¶
- Association setup: The client allocates an unused 16-bit
Assoc IDand sends the firstPacketcommand; the server binds a UDP socket for thatAssoc ID, and both sides track the mapping. - Datagram forwarding:
- Client to server: the server extracts the destination address from
Packetand sends the UDP datagram; - Server to client: when a datagram arrives on the associated UDP socket, the server sends a
Packetcommand carrying the remote source address. - Full Cone NAT semantics: Once associated, the UDP socket accepts datagrams from any remote source and relays them back to the client with their encoded source addresses.
- Association teardown: The client sends
Dissociate; the server closes the UDP socket and removes the mapping.
7.4. UDP Fragmentation and Reassembly¶
Fragmentation is REQUIRED whenever a UDP payload exceeds max_datagram_size - header_overhead:
Sending:
- Compute maximum payload sizes for initial and continuation fragments per Section 8.
- Split the UDP payload into
Frag Totalslices and assign a uniquePacket ID. - Include the full target address in fragment
0; subsequent fragments MAY useNone (0xFF). - Send each slice as a separate
Packetcommand.
Reassembly:
- Collect incoming fragments keyed by
(Assoc ID, Packet ID). - Once fragments
0..Frag Total - 1have all arrived, concatenate their payloads inFrag IDorder and forward the datagram to the destination carried by fragment0. - If an incomplete group exceeds the timeout (RECOMMENDED: 30 seconds), discard it and release its resources.
7.5. Error Handling¶
TUIC follows a fail-silent error model:
- Invalid commands: Receivers SHOULD silently discard commands with unknown
Typevalues and MAY terminate the connection on malformed commands. - Authentication failure: The server MUST immediately terminate the connection and SHOULD send a QUIC
CONNECTION_CLOSEframe. - Network errors: Stream errors close only the affected stream without explicit signaling; connection errors terminate the QUIC connection.
- Implementation guidance: Log errors for diagnostics, reset connections on fatal authentication failures, and isolate recoverable stream failures from other multiplexed streams.
8. Header Size and Fragmentation Calculations¶
8.1. Base Command Header¶
Version (1B) + Type (1B) = 2B
8.2. Fixed Packet Overhead (Excluding Address)¶
Version (1B)
Type (1B)
Assoc ID (2B)
Packet ID (2B)
Frag Total (1B)
Frag ID (1B)
Size (2B)
----------------
Total: 10 bytes
8.3. Address Field Sizes¶
| Address Type | Formula | Size |
|---|---|---|
None (0xFF) |
1 |
1B |
IPv4 (0x01) |
1 + 4 + 2 |
7B |
IPv6 (0x02) |
1 + 16 + 2 |
19B |
Domain (0x00) |
1 + 1 + N + 2 (N <= 255) |
4 + N bytes |
8.4. Total Packet Header Overhead¶
- Initial fragment (full address):
10 + addr_size
| Address Type | Initial Fragment Overhead |
|---|---|
| IPv4 | 17B |
| IPv6 | 29B |
Domain "example.com" (11B) |
25B |
- Subsequent fragments (
Noneaddress):10 + 1 = 11B
8.5. Maximum Unfragmented Payload¶
For a given QUIC maximum datagram payload D:
Example for D = 1200:
| Address Type | Max Payload |
|---|---|
| IPv4 | 1183B |
| IPv6 | 1171B |
| 11-byte Domain | 1175B |
8.6. Fragment Size Formulas¶
- Uniform fragment sizing (simplified):
- Optimized fragment sizing (full address in fragment 0,
Nonethereafter):
first_payload = D - (10 + addr_size)
subsequent_payload = D - 11
remaining = total_payload - first_payload
extra_frags = ceil(remaining / subsequent_payload)
frag_count = 1 + extra_frags
8.7. Implementation Limits¶
- Fragment count MUST NOT exceed
255(Frag Totalis a 1-byte unsigned integer). - Maximum fragmentable UDP payload (IPv4 example):
(D - 17) + 254 * (D - 11). - Implementations SHOULD use saturating arithmetic to prevent underflow.
- Implementations MUST account for underlying QUIC and TLS framing overhead when determining
D.
9. Security Considerations¶
9.1. Authentication¶
Authentication relies on TLS Keying Material Exporters [RFC5705]:
- Binds tokens to the active TLS session, preventing cross-session replay;
- Requires high-entropy passwords and secure credential storage;
- Implementations MUST enforce rate or attempt limits on authentication and terminate connections upon failure.
9.1.1. 0-RTT and Authentication¶
During session resumption, a client may send early (0-RTT) data alongside its initial handshake flight. Because Authenticate derives its TOKEN from a TLS Keying Material Exporter that is only available after the TLS 1.3 handshake completes [RFC8446], a client cannot compute a valid token before handshake completion and cannot send Authenticate in 0-RTT data.
Implementations enabling 0-RTT (zero_rtt_handshake / reduce-rtt):
- MAY establish connections via 0-RTT resumption, but MUST wait for TLS handshake completion before sending
Authenticate; - MUST NOT attempt to export keying material before handshake completion (backends such as rustls reject the call, and sending a premature token causes authentication failure);
- Servers accepting connections at 0.5-RTT MUST wait for handshake completion before verifying tokens;
- MUST NOT rely on 0-RTT for replay protection, as early data is inherently replayable.
9.2. Encryption¶
All TUIC commands and payloads are protected by the underlying QUIC (TLS 1.3) layer, providing confidentiality, integrity, and transport-level replay protection.
9.3. Denial of Service (DoS) Mitigation¶
- Resource exhaustion: Bound concurrent UDP associations per connection, expire incomplete fragment groups, and cap total reassembly table size.
- Amplification abuse: Servers SHOULD rate-limit UDP forwarding and MAY restrict reachable target addresses (such as blocking loopback and private networks via ACLs).
9.4. Privacy Considerations¶
Target addresses are encrypted inside QUIC, but packet sizes and timing may still leak traffic patterns. Deployments requiring stronger resistance SHOULD consider traffic padding.
10. References¶
10.1. Normative References¶
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally Unique Identifier (UUID) URN Namespace", RFC 4122, July 2005.
- [RFC5705] Rescorla, E., "Keying Material Exporters for Transport Layer Security (TLS)", RFC 5705, March 2010.
- [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, May 2017.
- [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, August 2018.
- [RFC9000] Iyengar, J., Ed., and M. Thomson, Ed., "QUIC: A UDP-Based Multiplexed and Secure Transport", RFC 9000, May 2021.
10.2. Informative References¶
- [RFC9114] Bishop, M., Ed., "HTTP/3", RFC 9114, June 2022.
Appendix A. Example Packet Encodings¶
A.1. Authenticate Command¶
Version: 0x05
Type: 0x00
UUID: 550e8400-e29b-41d4-a716-446655440000
TOKEN: [32 bytes of derived key material]
Hex (first 18 bytes):
05 00 55 0e 84 00 e2 9b 41 d4 a7 16 44 66 55 44
00 00 [32-byte TOKEN...]
A.2. Connect Command (IPv4)¶
Version: 0x05
Type: 0x01
Addr Type: 0x01 (IPv4)
Address: 192.0.2.1
Port: 80
Hex:
05 01 01 c0 00 02 01 00 50
A.3. Packet Command (Initial Fragment)¶
Version: 0x05
Type: 0x02
Association ID: 0x0001
Packet ID: 0x0042
Frag Total: 2
Frag ID: 0
Size: 1183
Addr Type: 0x01 (IPv4)
Address: 203.0.113.1
Port: 53
Hex (header only, 17 bytes):
05 02 00 01 00 42 02 00 04 9f 01 cb 00 71 01 00 35
[Payload follows...]
A.4. Packet Command (Subsequent Fragment)¶
Version: 0x05
Type: 0x02
Association ID: 0x0001
Packet ID: 0x0042
Frag Total: 2
Frag ID: 1
Size: 500
Addr Type: 0xFF (None)
Hex (header only, 11 bytes):
05 02 00 01 00 42 02 01 01 f4 ff
[Payload follows...]
Appendix B. Implementation Checklist¶
Implementers SHOULD verify support for:
- [ ] Protocol version
0x05recognition and validation - [ ] All five commands (
Authenticate,Connect,Packet,Dissociate,Heartbeat) - [ ] All four address types (
Domain,IPv4,IPv6,None) - [ ] Big-endian encoding for all multi-byte integers
- [ ] Post-handshake TLS Keying Material Exporter authentication
- [ ] Bidirectional QUIC stream TCP relaying
- [ ] Full Cone UDP relaying with association management and uni-stream fallback when peer lacks DATAGRAM support
- [ ] MTU-aware fragmentation and timeout-bounded reassembly
- [ ] Fragment count limit (
<= 255) and saturating arithmetic for header overhead calculations - [ ] Immediate connection termination on authentication failure and DoS resource bounds