Skip to content

Commit

Permalink
Permit 0-RTT after Retry and VN
Browse files Browse the repository at this point in the history
After the discussion on #1507, I've been convinced that there is no real
value in preventing a client from attempting 0-RTT after a Retry.  And,
it would seem like Version Negotiation has essentially the same
properties, so excluding it would be inconsistent.

This allows this, explores the consequences for packet numbers (don't
reset them!), and updates the recovery text to include Version
Negotiation.

Closes #1507.
  • Loading branch information
martinthomson committed Jul 9, 2018
1 parent 21f9ba5 commit fe48863
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
12 changes: 6 additions & 6 deletions draft-ietf-quic-recovery.md
Expand Up @@ -306,14 +306,14 @@ the CRYPTO frames were sent at 1RTT encryption.
When an acknowledgement is received for a handshake packet, the new RTT is
computed and the alarm SHOULD be set for twice the newly computed smoothed RTT.

#### Retry
#### Retry and Version Negotiation

A Retry packet causes the content of the client's Initial packet to be
immediately retransmitted along with the token present in the Retry.
A Retry or Version Negotiation packet causes a client to send another Initial
packet, effectively restarting the connection process.

The Retry indicates that the Initial was received but not processed. It MUST
NOT be treated as an acknowledgment for the Initial, but it MAY be used for an
RTT measurement.
Either packet indicates that the Initial was received but not processed. Either
packet cannot be treated as an acknowledgment for the Initial, but they MAY be
used to improve the RTT estimate.

### Tail Loss Probe {#tlp}

Expand Down
37 changes: 34 additions & 3 deletions draft-ietf-quic-transport.md
Expand Up @@ -603,6 +603,11 @@ the packet. This prevents an off-path attacker from injecting a Retry packet.
The client responds to a Retry packet with an Initial packet that includes the
provided Retry Token to continue connection establishment.

A client MAY attempt 0-RTT after receiving a Retry packet by sending 0-RTT
packets to the connection ID provided by the server. A client that sends
additional 0-RTT packets MUST NOT reset the packet number to 0 after a Retry
packet, see {{retry-0rtt-pn}}.

A server that might send another Retry packet in response to a subsequent
Initial packet MUST set the Source Connection ID to new value of at least 8
octets in length. This allows clients to distinguish between Retry packets when
Expand Down Expand Up @@ -729,9 +734,9 @@ Connection ID.

### Tokens

If the client has a token received in a NEW_TOKEN frame on a previous connection
to what it believes to be the same server, it can include that value in the
Token field of its Initial packet.
If the client has an token received in a NEW_TOKEN frame on a previous
connection to what it believes to be the same server, it can include that value
in the Token field of its Initial packet.

A token allows a server to correlate activity between connections.
Specifically, the connection where the token was issued, and any connection
Expand Down Expand Up @@ -778,6 +783,28 @@ are in a different packet number space to other packets (see
{{packet-numbers}}).


### 0-RTT Packet Numbers {#retry-0rtt-pn}

Packet numbers for 0-RTT protected packets use the same space as 0-RTT protected
packets.

After a client receives a Retry or Version Negotiation packet, it MAY attempt to
send data in 0-RTT packets after it sends a new Initial packet. However, a
client MUST NOT reset the packet number it uses for 0-RTT packets. The keys
used to protect 0-RTT keys are not guaranteed to change as a result of
responding to a Retry or Version Negotiation packet.

Receiving a Retry or Version Negotiation packet, especially a Retry that changes
the connection ID used for subsequent packets, indicates a strong possibility
that 0-RTT packets could be lost. A client only receives acknowledgments for
its 0-RTT packets once the handshake is complete. Consequently, a server might
expect 0-RTT packets to start with a packet number of 0. Therefore, in
determining the length of the packet number encoding for 0-RTT packets, a client
MUST assume that all packets up to the current packet number are in flight,
starting from a packet number of 0. Thus, 0-RTT packets could need to use a
longer packet number encoding.


### Minimum Packet Size

The payload of a UDP datagram carrying the Initial packet MUST be expanded to at
Expand Down Expand Up @@ -1319,6 +1346,10 @@ Version Negotiation packet.
A client MUST ignore a Version Negotiation packet that lists the client's chosen
version.

A client MAY attempt 0-RTT after receiving a Version Negotiation packet. A
client that sends additional 0-RTT packets MUST NOT reset the packet number to 0
after a Retry packet, see {{retry-0rtt-pn}}.

Version negotiation packets have no cryptographic protection. The result of the
negotiation MUST be revalidated as part of the cryptographic handshake (see
{{version-validation}}).
Expand Down

0 comments on commit fe48863

Please sign in to comment.