Skip to content

Commit e6fc4e4

Browse files
committed
Clarify TCP padding
1 parent 4931e3e commit e6fc4e4

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎draft-denis-dprive-dnscrypt.md‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,10 @@ They MAY adjust the target as response sizes and path limits become known.
369369
The target MUST stay within the transport size limits.
370370
Full PQ queries use the padding rule in {{pq-padding}}.
371371

372-
For TCP queries, a client SHOULD add a random padding component to reduce length-based identification of repeated queries.
372+
For TCP queries sent directly to a resolver, a client SHOULD add a random padding component to reduce length-based identification of repeated queries.
373373

374374
The UDP minimum does not apply.
375+
{{relay-behavior}} gives the padding for queries sent to a relay over TCP.
375376

376377
For responses, the resolver SHOULD round the padded plaintext length to a multiple of 64 and SHOULD use between 1 and 256 padding bytes, including the delimiter.
377378

@@ -535,6 +536,12 @@ An encrypted query's padding similarly determines the response budget on the rel
535536
If an encrypted DNS response is truncated, a client can retry with a larger padded inner query, within the UDP limit.
536537

537538
Using TCP to the relay alone does not increase that budget or provide TCP to the resolver.
539+
A client sending an encrypted query to a relay over TCP SHOULD therefore pad the complete inner query to 4096 bytes.
540+
This applies to all encryption systems, including PQ queries with a KEM ciphertext and resumed queries.
541+
Otherwise, a response truncated over UDP can be truncated again over TCP.
542+
543+
Such an inner query is usually fragmented between the relay and the resolver.
544+
A client SHOULD NOT use a relay to reach a resolver known to drop fragmented UDP queries.
538545

539546
Clients SHOULD choose a relay and resolver operated by different organizations, preferably on different networks.
540547

@@ -715,6 +722,7 @@ A client SHOULD use a configurable UDP payload target, initially 1232 bytes, and
715722
For a relayed query, the 28-byte relay prefix counts toward this target on the client-to-relay connection.
716723

717724
The relay-to-resolver connection remains UDP and its response budget is the size of the inner query, as described in {{relay-behavior}}.
725+
PQ queries sent to a relay over TCP use the padding in {{relay-behavior}}.
718726

719727
## Stateless Resumption {#pq-resumption}
720728

@@ -838,7 +846,8 @@ The normal requirements for a fresh, nonzero resolver nonce still apply, includi
838846

839847
Resumed UDP queries use the normal query-size target in {{padding}}, initially 256 bytes for the complete DNSCrypt packet.
840848

841-
Through a relay, that inner packet also determines the upstream response budget, even if the client uses TCP to the relay.
849+
Through a relay, the inner query size also limits the upstream response, even if the client uses TCP to the relay.
850+
Resumed queries sent to a relay over TCP use the padding in {{relay-behavior}}.
842851

843852
A resolver MUST silently discard a query with an invalid or expired ticket.
844853

0 commit comments

Comments
 (0)