draft-ietf-quic-recovery-17.txt   draft-ietf-quic-recovery-18.txt 
QUIC J. Iyengar, Ed. QUIC J. Iyengar, Ed.
Internet-Draft Fastly Internet-Draft Fastly
Intended status: Standards Track I. Swett, Ed. Intended status: Standards Track I. Swett, Ed.
Expires: June 21, 2019 Google Expires: July 27, 2019 Google
December 18, 2018 January 23, 2019
QUIC Loss Detection and Congestion Control QUIC Loss Detection and Congestion Control
draft-ietf-quic-recovery-17 draft-ietf-quic-recovery-18
Abstract Abstract
This document describes loss detection and congestion control This document describes loss detection and congestion control
mechanisms for QUIC. mechanisms for QUIC.
Note to Readers Note to Readers
Discussion of this draft takes place on the QUIC working group Discussion of this draft takes place on the QUIC working group
mailing list (quic@ietf.org), which is archived at mailing list (quic@ietf.org), which is archived at
skipping to change at page 1, line 42 skipping to change at page 1, line 42
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on June 21, 2019. This Internet-Draft will expire on July 27, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
skipping to change at page 2, line 33 skipping to change at page 2, line 33
3.1.3. No Reneging . . . . . . . . . . . . . . . . . . . . . 6 3.1.3. No Reneging . . . . . . . . . . . . . . . . . . . . . 6
3.1.4. More ACK Ranges . . . . . . . . . . . . . . . . . . . 6 3.1.4. More ACK Ranges . . . . . . . . . . . . . . . . . . . 6
3.1.5. Explicit Correction For Delayed ACKs . . . . . . . . 6 3.1.5. Explicit Correction For Delayed ACKs . . . . . . . . 6
4. Generating Acknowledgements . . . . . . . . . . . . . . . . . 7 4. Generating Acknowledgements . . . . . . . . . . . . . . . . . 7
4.1. Crypto Handshake Data . . . . . . . . . . . . . . . . . . 7 4.1. Crypto Handshake Data . . . . . . . . . . . . . . . . . . 7
4.2. ACK Ranges . . . . . . . . . . . . . . . . . . . . . . . 7 4.2. ACK Ranges . . . . . . . . . . . . . . . . . . . . . . . 7
4.3. Receiver Tracking of ACK Frames . . . . . . . . . . . . . 8 4.3. Receiver Tracking of ACK Frames . . . . . . . . . . . . . 8
5. Computing the RTT estimate . . . . . . . . . . . . . . . . . 8 5. Computing the RTT estimate . . . . . . . . . . . . . . . . . 8
6. Loss Detection . . . . . . . . . . . . . . . . . . . . . . . 9 6. Loss Detection . . . . . . . . . . . . . . . . . . . . . . . 9
6.1. Acknowledgement-based Detection . . . . . . . . . . . . . 9 6.1. Acknowledgement-based Detection . . . . . . . . . . . . . 9
6.1.1. Packet Threshold . . . . . . . . . . . . . . . . . . 9 6.1.1. Packet Threshold . . . . . . . . . . . . . . . . . . 10
6.1.2. Time Threshold . . . . . . . . . . . . . . . . . . . 10 6.1.2. Time Threshold . . . . . . . . . . . . . . . . . . . 10
6.2. Timeout Loss Detection . . . . . . . . . . . . . . . . . 10 6.2. Timeout Loss Detection . . . . . . . . . . . . . . . . . 10
6.2.1. Crypto Retransmission Timeout . . . . . . . . . . . . 10 6.2.1. Crypto Retransmission Timeout . . . . . . . . . . . . 11
6.2.2. Probe Timeout . . . . . . . . . . . . . . . . . . . . 12 6.2.2. Probe Timeout . . . . . . . . . . . . . . . . . . . . 12
6.3. Tracking Sent Packets . . . . . . . . . . . . . . . . . . 13 6.3. Tracking Sent Packets . . . . . . . . . . . . . . . . . . 14
6.3.1. Sent Packet Fields . . . . . . . . . . . . . . . . . 14 6.3.1. Sent Packet Fields . . . . . . . . . . . . . . . . . 14
6.4. Pseudocode . . . . . . . . . . . . . . . . . . . . . . . 14 6.4. Pseudocode . . . . . . . . . . . . . . . . . . . . . . . 15
6.4.1. Constants of interest . . . . . . . . . . . . . . . . 14 6.4.1. Constants of interest . . . . . . . . . . . . . . . . 15
6.4.2. Variables of interest . . . . . . . . . . . . . . . . 15 6.4.2. Variables of interest . . . . . . . . . . . . . . . . 15
6.4.3. Initialization . . . . . . . . . . . . . . . . . . . 16 6.4.3. Initialization . . . . . . . . . . . . . . . . . . . 16
6.4.4. On Sending a Packet . . . . . . . . . . . . . . . . . 16 6.4.4. On Sending a Packet . . . . . . . . . . . . . . . . . 17
6.4.5. On Receiving an Acknowledgment . . . . . . . . . . . 16 6.4.5. On Receiving an Acknowledgment . . . . . . . . . . . 17
6.4.6. On Packet Acknowledgment . . . . . . . . . . . . . . 18 6.4.6. On Packet Acknowledgment . . . . . . . . . . . . . . 19
6.4.7. Setting the Loss Detection Timer . . . . . . . . . . 18 6.4.7. Setting the Loss Detection Timer . . . . . . . . . . 19
6.4.8. On Timeout . . . . . . . . . . . . . . . . . . . . . 19 6.4.8. On Timeout . . . . . . . . . . . . . . . . . . . . . 20
6.4.9. Detecting Lost Packets . . . . . . . . . . . . . . . 20 6.4.9. Detecting Lost Packets . . . . . . . . . . . . . . . 21
6.5. Discussion . . . . . . . . . . . . . . . . . . . . . . . 21 6.5. Discussion . . . . . . . . . . . . . . . . . . . . . . . 22
7. Congestion Control . . . . . . . . . . . . . . . . . . . . . 22 7. Congestion Control . . . . . . . . . . . . . . . . . . . . . 23
7.1. Explicit Congestion Notification . . . . . . . . . . . . 22 7.1. Explicit Congestion Notification . . . . . . . . . . . . 23
7.2. Slow Start . . . . . . . . . . . . . . . . . . . . . . . 22 7.2. Slow Start . . . . . . . . . . . . . . . . . . . . . . . 23
7.3. Congestion Avoidance . . . . . . . . . . . . . . . . . . 22 7.3. Congestion Avoidance . . . . . . . . . . . . . . . . . . 23
7.4. Recovery Period . . . . . . . . . . . . . . . . . . . . . 23 7.4. Recovery Period . . . . . . . . . . . . . . . . . . . . . 24
7.5. Probe Timeout . . . . . . . . . . . . . . . . . . . . . . 23 7.5. Ignoring Loss of Undecryptable Packets . . . . . . . . . 24
7.6. Pacing . . . . . . . . . . . . . . . . . . . . . . . . . 23 7.6. Probe Timeout . . . . . . . . . . . . . . . . . . . . . . 24
7.7. Sending data after an idle period . . . . . . . . . . . . 24 7.7. Pacing . . . . . . . . . . . . . . . . . . . . . . . . . 24
7.8. Discarding Packet Number Space State . . . . . . . . . . 24 7.8. Sending data after an idle period . . . . . . . . . . . . 25
7.9. Pseudocode . . . . . . . . . . . . . . . . . . . . . . . 24 7.9. Pseudocode . . . . . . . . . . . . . . . . . . . . . . . 25
7.9.1. Constants of interest . . . . . . . . . . . . . . . . 24 7.9.1. Constants of interest . . . . . . . . . . . . . . . . 25
7.9.2. Variables of interest . . . . . . . . . . . . . . . . 25 7.9.2. Variables of interest . . . . . . . . . . . . . . . . 26
7.9.3. Initialization . . . . . . . . . . . . . . . . . . . 26 7.9.3. Initialization . . . . . . . . . . . . . . . . . . . 27
7.9.4. On Packet Sent . . . . . . . . . . . . . . . . . . . 26 7.9.4. On Packet Sent . . . . . . . . . . . . . . . . . . . 27
7.9.5. On Packet Acknowledgement . . . . . . . . . . . . . . 26 7.9.5. On Packet Acknowledgement . . . . . . . . . . . . . . 27
7.9.6. On New Congestion Event . . . . . . . . . . . . . . . 26 7.9.6. On New Congestion Event . . . . . . . . . . . . . . . 27
7.9.7. Process ECN Information . . . . . . . . . . . . . . . 27 7.9.7. Process ECN Information . . . . . . . . . . . . . . . 28
7.9.8. On Packets Lost . . . . . . . . . . . . . . . . . . . 27 7.9.8. On Packets Lost . . . . . . . . . . . . . . . . . . . 28
8. Security Considerations . . . . . . . . . . . . . . . . . . . 27 8. Security Considerations . . . . . . . . . . . . . . . . . . . 28
8.1. Congestion Signals . . . . . . . . . . . . . . . . . . . 28 8.1. Congestion Signals . . . . . . . . . . . . . . . . . . . 29
8.2. Traffic Analysis . . . . . . . . . . . . . . . . . . . . 28 8.2. Traffic Analysis . . . . . . . . . . . . . . . . . . . . 29
8.3. Misreporting ECN Markings . . . . . . . . . . . . . . . . 28 8.3. Misreporting ECN Markings . . . . . . . . . . . . . . . . 29
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 28 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 28 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 29
10.1. Normative References . . . . . . . . . . . . . . . . . . 29 10.1. Normative References . . . . . . . . . . . . . . . . . . 30
10.2. Informative References . . . . . . . . . . . . . . . . . 29 10.2. Informative References . . . . . . . . . . . . . . . . . 30
10.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 31 10.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 31 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 32
A.1. Since draft-ietf-quic-recovery-16 . . . . . . . . . . . . 31 A.1. Since draft-ietf-quic-recovery-17 . . . . . . . . . . . . 32
A.2. Since draft-ietf-quic-recovery-14 . . . . . . . . . . . . 32 A.2. Since draft-ietf-quic-recovery-16 . . . . . . . . . . . . 32
A.3. Since draft-ietf-quic-recovery-13 . . . . . . . . . . . . 32 A.3. Since draft-ietf-quic-recovery-14 . . . . . . . . . . . . 33
A.4. Since draft-ietf-quic-recovery-12 . . . . . . . . . . . . 32 A.4. Since draft-ietf-quic-recovery-13 . . . . . . . . . . . . 33
A.5. Since draft-ietf-quic-recovery-11 . . . . . . . . . . . . 32 A.5. Since draft-ietf-quic-recovery-12 . . . . . . . . . . . . 34
A.6. Since draft-ietf-quic-recovery-10 . . . . . . . . . . . . 32 A.6. Since draft-ietf-quic-recovery-11 . . . . . . . . . . . . 34
A.7. Since draft-ietf-quic-recovery-09 . . . . . . . . . . . . 33 A.7. Since draft-ietf-quic-recovery-10 . . . . . . . . . . . . 34
A.8. Since draft-ietf-quic-recovery-08 . . . . . . . . . . . . 33 A.8. Since draft-ietf-quic-recovery-09 . . . . . . . . . . . . 34
A.9. Since draft-ietf-quic-recovery-07 . . . . . . . . . . . . 33 A.9. Since draft-ietf-quic-recovery-08 . . . . . . . . . . . . 34
A.10. Since draft-ietf-quic-recovery-06 . . . . . . . . . . . . 33 A.10. Since draft-ietf-quic-recovery-07 . . . . . . . . . . . . 34
A.11. Since draft-ietf-quic-recovery-05 . . . . . . . . . . . . 33 A.11. Since draft-ietf-quic-recovery-06 . . . . . . . . . . . . 35
A.12. Since draft-ietf-quic-recovery-04 . . . . . . . . . . . . 33 A.12. Since draft-ietf-quic-recovery-05 . . . . . . . . . . . . 35
A.13. Since draft-ietf-quic-recovery-03 . . . . . . . . . . . . 33 A.13. Since draft-ietf-quic-recovery-04 . . . . . . . . . . . . 35
A.14. Since draft-ietf-quic-recovery-02 . . . . . . . . . . . . 33 A.14. Since draft-ietf-quic-recovery-03 . . . . . . . . . . . . 35
A.15. Since draft-ietf-quic-recovery-01 . . . . . . . . . . . . 34 A.15. Since draft-ietf-quic-recovery-02 . . . . . . . . . . . . 35
A.16. Since draft-ietf-quic-recovery-00 . . . . . . . . . . . . 34 A.16. Since draft-ietf-quic-recovery-01 . . . . . . . . . . . . 35
A.17. Since draft-iyengar-quic-loss-recovery-01 . . . . . . . . 34 A.17. Since draft-ietf-quic-recovery-00 . . . . . . . . . . . . 35
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 34 A.18. Since draft-iyengar-quic-loss-recovery-01 . . . . . . . . 35
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 34 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 36
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 36
1. Introduction 1. Introduction
QUIC is a new multiplexed and secure transport atop UDP. QUIC builds QUIC is a new multiplexed and secure transport atop UDP. QUIC builds
on decades of transport and security experience, and implements on decades of transport and security experience, and implements
mechanisms that make it attractive as a modern general-purpose mechanisms that make it attractive as a modern general-purpose
transport. The QUIC protocol is described in [QUIC-TRANSPORT]. transport. The QUIC protocol is described in [QUIC-TRANSPORT].
QUIC implements the spirit of known TCP loss recovery mechanisms, QUIC implements the spirit of known TCP loss recovery mechanisms,
described in RFCs, various Internet-drafts, and also those prevalent described in RFCs, various Internet-drafts, and also those prevalent
skipping to change at page 8, line 44 skipping to change at page 8, line 44
When RTT is calculated, the ack delay field from the ACK frame SHOULD When RTT is calculated, the ack delay field from the ACK frame SHOULD
be limited to the max_ack_delay specified by the peer. Limiting be limited to the max_ack_delay specified by the peer. Limiting
ack_delay to max_ack_delay ensures a peer specifying an extremely ack_delay to max_ack_delay ensures a peer specifying an extremely
small max_ack_delay doesn't cause more spurious timeouts than a peer small max_ack_delay doesn't cause more spurious timeouts than a peer
that correctly specifies max_ack_delay. It SHOULD be subtracted from that correctly specifies max_ack_delay. It SHOULD be subtracted from
the RTT as long as the result is larger than the min_rtt. If the the RTT as long as the result is larger than the min_rtt. If the
result is smaller than the min_rtt, the RTT should be used, but the result is smaller than the min_rtt, the RTT should be used, but the
ack delay field should be ignored. ack delay field should be ignored.
Like TCP, QUIC calculates both smoothed RTT and RTT variance similar A sender calculates both smoothed RTT and RTT variance similar to
to those specified in [RFC6298]. those specified in [RFC6298], see Section 6.4.5.
A sender takes an RTT sample when an ACK frame is received that
acknowledges a larger packet number than before (see Section 6.4.5).
A sender will take multiple RTT samples per RTT when multiple such
ACK frames are received within an RTT. When multiple samples are
generated within an RTT, the smoothed RTT and RTT variance could
retain inadequate history, as suggested in [RFC6298]. Changing these
computations is currently an open research question.
min_rtt is the minimum RTT measured over the connection, prior to min_rtt is the minimum RTT measured over the connection, prior to
adjusting by ack delay. Ignoring ack delay for min RTT prevents adjusting by ack delay. Ignoring ack delay for min RTT prevents
intentional or unintentional underestimation of min RTT, which in intentional or unintentional underestimation of min RTT, which in
turn prevents underestimating smoothed RTT. turn prevents underestimating smoothed RTT.
6. Loss Detection 6. Loss Detection
QUIC senders use both ack information and timeouts to detect lost QUIC senders use both ack information and timeouts to detect lost
packets, and this section provides a description of these algorithms. packets, and this section provides a description of these algorithms.
skipping to change at page 10, line 29 skipping to change at page 10, line 38
Using max(SRTT, latest_RTT) protects from the two following cases: Using max(SRTT, latest_RTT) protects from the two following cases:
o the latest RTT sample is lower than the SRTT, perhaps due to o the latest RTT sample is lower than the SRTT, perhaps due to
reordering where packet whose ack triggered the Early Retransmit reordering where packet whose ack triggered the Early Retransmit
process encountered a shorter path; process encountered a shorter path;
o the latest RTT sample is higher than the SRTT, perhaps due to a o the latest RTT sample is higher than the SRTT, perhaps due to a
sustained increase in the actual RTT, but the smoothed SRTT has sustained increase in the actual RTT, but the smoothed SRTT has
not yet caught up. not yet caught up.
Implementers MAY experiment with using other reordering thresholds, Implementations MAY experiment with absolute thresholds, thresholds
including absolute thresholds, bearing in mind that a lower from previous connections, adaptive thresholds, or including RTT
multiplier reduces reordering resilience and increases spurious variance. Smaller thresholds reduce reordering resilience and
retransmissions, and a higher multiplier increases loss detection increase spurious retransmissions, and larger thresholds increase
delay. loss detection delay.
6.2. Timeout Loss Detection 6.2. Timeout Loss Detection
Timeout loss detection recovers from losses that cannot be handled by Timeout loss detection recovers from losses that cannot be handled by
acknowledgement-based loss detection. It uses a single timer which acknowledgement-based loss detection. It uses a single timer which
switches between a crypto retransmission timer and a probe timer. switches between a crypto retransmission timer and a probe timer.
6.2.1. Crypto Retransmission Timeout 6.2.1. Crypto Retransmission Timeout
Data in CRYPTO frames is critical to QUIC transport and crypto Data in CRYPTO frames is critical to QUIC transport and crypto
skipping to change at page 11, line 44 skipping to change at page 12, line 7
6.2.1.1. Retry and Version Negotiation 6.2.1.1. Retry and Version Negotiation
A Retry or Version Negotiation packet causes a client to send another A Retry or Version Negotiation packet causes a client to send another
Initial packet, effectively restarting the connection process and Initial packet, effectively restarting the connection process and
resetting congestion control and loss recovery state, including resetting congestion control and loss recovery state, including
resetting any pending timers. Either packet indicates that the resetting any pending timers. Either packet indicates that the
Initial was received but not processed. Neither packet can be Initial was received but not processed. Neither packet can be
treated as an acknowledgment for the Initial. treated as an acknowledgment for the Initial.
6.2.1.2. Discarding Initial State
As described in Section 17.5.1 of [QUIC-TRANSPORT], endpoints stop
sending and receiving Initial packets once they start exchanging
Handshake packets. At this point, all loss recovery state for the
Initial packet number space is also discarded. Packets that are in
flight for the packet number space are not declared as either
acknowledged or lost. After discarding state, new Initial packets
will not be sent.
The client MAY however compute an RTT estimate to the server as the The client MAY however compute an RTT estimate to the server as the
time period from when the first Initial was sent to when a Retry or a time period from when the first Initial was sent to when a Retry or a
Version Negotiation packet is received. The client MAY use this Version Negotiation packet is received. The client MAY use this
value to seed the RTT estimator for a subsequent connection attempt value to seed the RTT estimator for a subsequent connection attempt
to the server. to the server.
6.2.1.2. Discarding Keys and Packet State
When packet protection keys are discarded (see Section 4.9 of
[QUIC-TLS]), all packets that were sent with those keys can no longer
be acknowledged because their acknowledgements cannot be processed
anymore. The sender considers them no longer in flight. That is,
the sender SHOULD discard all recovery state associated with those
packets and MUST remove them from the count of bytes in flight.
Endpoints stop sending and receiving Initial packets once they start
exchanging Handshake packets (see Section 17.2.2.1 of
[QUIC-TRANSPORT]). At this point, recovery state for all in-flight
Initial packets is discarded.
When 0-RTT is rejected, recovery state for all in-flight 0-RTT
packets is discarded.
If a server accepts 0-RTT, but does not buffer 0-RTT packets that
arrive before Initial packets, early 0-RTT packets will be declared
lost, but that is expected to be infrequent.
It is expected that keys are discarded after packets encrypted with
them would be acknowledged or declared lost. Initial secrets however
might be destroyed sooner, as soon as handshake keys are available
(see Section 4.10 of [QUIC-TLS]).
6.2.2. Probe Timeout 6.2.2. Probe Timeout
A Probe Timeout (PTO) triggers a probe packet when ack-eliciting data A Probe Timeout (PTO) triggers a probe packet when ack-eliciting data
is in flight but an acknowledgement is not received within the is in flight but an acknowledgement is not received within the
expected period of time. A PTO enables a connection to recover from expected period of time. A PTO enables a connection to recover from
loss of tail packets or acks. The PTO algorithm used in QUIC loss of tail packets or acks. The PTO algorithm used in QUIC
implements the reliability functions of Tail Loss Probe [TLP] [RACK], implements the reliability functions of Tail Loss Probe [TLP] [RACK],
RTO [RFC5681] and F-RTO algorithms for TCP [RFC5682], and the timeout RTO [RFC5681] and F-RTO algorithms for TCP [RFC5682], and the timeout
computation is based on TCP's retransmission timeout period computation is based on TCP's retransmission timeout period
[RFC6298]. [RFC6298].
skipping to change at page 13, line 27 skipping to change at page 14, line 7
Probe packets sent on a PTO MUST be ack-eliciting. A probe packet Probe packets sent on a PTO MUST be ack-eliciting. A probe packet
SHOULD carry new data when possible. A probe packet MAY carry SHOULD carry new data when possible. A probe packet MAY carry
retransmitted unacknowledged data when new data is unavailable, when retransmitted unacknowledged data when new data is unavailable, when
flow control does not permit new data to be sent, or to flow control does not permit new data to be sent, or to
opportunistically reduce loss recovery delay. Implementations MAY opportunistically reduce loss recovery delay. Implementations MAY
use alternate strategies for determining the content of probe use alternate strategies for determining the content of probe
packets, including sending new or retransmitted data based on the packets, including sending new or retransmitted data based on the
application's priorities. application's priorities.
When a PTO timer expires, new or previously-sent data may not be
available to send and packets may still be in flight. A sender can
be blocked from sending new data in the future if packets are left in
flight. Under these conditions, a sender SHOULD mark any packets
still in flight as lost. If a sender wishes to establish delivery of
packets still in flight, it MAY send an ack-eliciting packet and re-
arm the PTO timer instead.
6.2.2.3. Loss Detection 6.2.2.3. Loss Detection
Delivery or loss of packets in flight is established when an ACK Delivery or loss of packets in flight is established when an ACK
frame is received that newly acknowledges one or more packets. frame is received that newly acknowledges one or more packets.
A PTO timer expiration event does not indicate packet loss and MUST A PTO timer expiration event does not indicate packet loss and MUST
NOT cause prior unacknowledged packets to be marked as lost. After a NOT cause prior unacknowledged packets to be marked as lost. After a
PTO timer has expired, an endpoint uses the following rules to mark PTO timer has expired, an endpoint uses the following rules to mark
packets as lost when an acknowledgement is received that newly packets as lost when an acknowledgement is received that newly
acknowledges packets. acknowledges packets.
skipping to change at page 16, line 37 skipping to change at page 17, line 32
Pseudocode for OnPacketSent follows: Pseudocode for OnPacketSent follows:
OnPacketSent(packet_number, ack_eliciting, in_flight, OnPacketSent(packet_number, ack_eliciting, in_flight,
is_crypto_packet, sent_bytes): is_crypto_packet, sent_bytes):
largest_sent_packet = packet_number largest_sent_packet = packet_number
sent_packets[packet_number].packet_number = packet_number sent_packets[packet_number].packet_number = packet_number
sent_packets[packet_number].time_sent = now sent_packets[packet_number].time_sent = now
sent_packets[packet_number].ack_eliciting = ack_eliciting sent_packets[packet_number].ack_eliciting = ack_eliciting
sent_packets[packet_number].in_flight = in_flight sent_packets[packet_number].in_flight = in_flight
if (ack_eliciting): if (in_flight):
if (is_crypto_packet): if (is_crypto_packet):
time_of_last_sent_crypto_packet = now time_of_last_sent_crypto_packet = now
time_of_last_sent_ack_eliciting_packet = now if (ack_eliciting):
time_of_last_sent_ack_eliciting_packet = now
OnPacketSentCC(sent_bytes) OnPacketSentCC(sent_bytes)
sent_packets[packet_number].size = sent_bytes sent_packets[packet_number].size = sent_bytes
SetLossDetectionTimer() SetLossDetectionTimer()
6.4.5. On Receiving an Acknowledgment 6.4.5. On Receiving an Acknowledgment
When an ACK frame is received, it may newly acknowledge any number of When an ACK frame is received, it may newly acknowledge any number of
packets. packets.
Pseudocode for OnAckReceived and UpdateRtt follow: Pseudocode for OnAckReceived and UpdateRtt follow:
skipping to change at page 17, line 29 skipping to change at page 18, line 29
ProcessECN(ack) ProcessECN(ack)
// Find all newly acked packets in this ACK frame // Find all newly acked packets in this ACK frame
newly_acked_packets = DetermineNewlyAckedPackets(ack) newly_acked_packets = DetermineNewlyAckedPackets(ack)
if (newly_acked_packets.empty()): if (newly_acked_packets.empty()):
return return
for acked_packet in newly_acked_packets: for acked_packet in newly_acked_packets:
OnPacketAcked(acked_packet.packet_number) OnPacketAcked(acked_packet.packet_number)
DetectLostPackets()
crypto_count = 0 crypto_count = 0
pto_count = 0 pto_count = 0
DetectLostPackets()
SetLossDetectionTimer() SetLossDetectionTimer()
UpdateRtt(latest_rtt, ack_delay): UpdateRtt(latest_rtt, ack_delay):
// min_rtt ignores ack delay. // min_rtt ignores ack delay.
min_rtt = min(min_rtt, latest_rtt) min_rtt = min(min_rtt, latest_rtt)
// Limit ack_delay by max_ack_delay // Limit ack_delay by max_ack_delay
ack_delay = min(ack_delay, max_ack_delay) ack_delay = min(ack_delay, max_ack_delay)
// Adjust for ack delay if it's plausible. // Adjust for ack delay if it's plausible.
if (latest_rtt - min_rtt > ack_delay): if (latest_rtt - min_rtt > ack_delay):
latest_rtt -= ack_delay latest_rtt -= ack_delay
skipping to change at page 23, line 18 skipping to change at page 24, line 18
packet or an increase in the ECN-CE counter. Because QUIC does not packet or an increase in the ECN-CE counter. Because QUIC does not
retransmit packets, it defines the end of recovery as a packet sent retransmit packets, it defines the end of recovery as a packet sent
after the start of recovery being acknowledged. This is slightly after the start of recovery being acknowledged. This is slightly
different from TCP's definition of recovery, which ends when the lost different from TCP's definition of recovery, which ends when the lost
packet that started recovery is acknowledged. packet that started recovery is acknowledged.
The recovery period limits congestion window reduction to once per The recovery period limits congestion window reduction to once per
round trip. During recovery, the congestion window remains unchanged round trip. During recovery, the congestion window remains unchanged
irrespective of new losses or increases in the ECN-CE counter. irrespective of new losses or increases in the ECN-CE counter.
7.5. Probe Timeout 7.5. Ignoring Loss of Undecryptable Packets
During the handshake, some packet protection keys might not be
available when a packet arrives. In particular, Handshake and 0-RTT
packets cannot be processed until the Initial packets arrive, and
1-RTT packets cannot be processed until the handshake completes.
Endpoints MAY ignore the loss of Handshake, 0-RTT, and 1-RTT packets
that might arrive before the peer has packet protection keys to
process those packets.
7.6. Probe Timeout
Probe packets MUST NOT be blocked by the congestion controller. A Probe packets MUST NOT be blocked by the congestion controller. A
sender MUST however count these packets as being additionally in sender MUST however count these packets as being additionally in
flight, since these packets adds network load without establishing flight, since these packets adds network load without establishing
packet loss. Note that sending probe packets might cause the packet loss. Note that sending probe packets might cause the
sender's bytes in flight to exceed the congestion window until an sender's bytes in flight to exceed the congestion window until an
acknowledgement is received that establishes loss or delivery of acknowledgement is received that establishes loss or delivery of
packets. packets.
If a threshold number of consecutive PTOs have occurred (pto_count is When an ACK frame is received that establishes loss of all in-flight
more than kPersistentCongestionThreshold, see Section 7.9.1), the packets sent prior to a threshold number of consecutive PTOs
network is considered to be experiencing persistent congestion, and (pto_count is more than kPersistentCongestionThreshold, see
the sender's congestion window MUST be reduced to the minimum Section 7.9.1), the network is considered to be experiencing
congestion window. persistent congestion, and the sender's congestion window MUST be
reduced to the minimum congestion window (kMinimumWindow). This
response of collapsing the congestion window on persistent congestion
is functionally similar to a sender's response on a Retransmission
Timeout (RTO) in TCP [RFC5681].
7.6. Pacing 7.7. Pacing
This document does not specify a pacer, but it is RECOMMENDED that a This document does not specify a pacer, but it is RECOMMENDED that a
sender pace sending of all in-flight packets based on input from the sender pace sending of all in-flight packets based on input from the
congestion controller. For example, a pacer might distribute the congestion controller. For example, a pacer might distribute the
congestion window over the SRTT when used with a window-based congestion window over the SRTT when used with a window-based
controller, and a pacer might use the rate estimate of a rate-based controller, and a pacer might use the rate estimate of a rate-based
controller. controller.
An implementation should take care to architect its congestion An implementation should take care to architect its congestion
controller to work well with a pacer. For instance, a pacer might controller to work well with a pacer. For instance, a pacer might
skipping to change at page 24, line 9 skipping to change at page 25, line 21
congestion window, or a pacer might pace out packets handed to it by congestion window, or a pacer might pace out packets handed to it by
the congestion controller. Timely delivery of ACK frames is the congestion controller. Timely delivery of ACK frames is
important for efficient loss recovery. Packets containing only ACK important for efficient loss recovery. Packets containing only ACK
frames should therefore not be paced, to avoid delaying their frames should therefore not be paced, to avoid delaying their
delivery to the peer. delivery to the peer.
As an example of a well-known and publicly available implementation As an example of a well-known and publicly available implementation
of a flow pacer, implementers are referred to the Fair Queue packet of a flow pacer, implementers are referred to the Fair Queue packet
scheduler (fq qdisc) in Linux (3.11 onwards). scheduler (fq qdisc) in Linux (3.11 onwards).
7.7. Sending data after an idle period 7.8. Sending data after an idle period
A sender becomes idle if it ceases to send data and has no bytes in A sender becomes idle if it ceases to send data and has no bytes in
flight. A sender's congestion window MUST not increase while it is flight. A sender's congestion window MUST NOT increase while it is
idle. idle.
When sending data after becoming idle, a sender MUST reset its When sending data after becoming idle, a sender MUST reset its
congestion window to the initial congestion window (see Section 4.1 congestion window to the initial congestion window (see Section 4.1
of [RFC5681]), unless it paces the sending of packets. A sender MAY of [RFC5681]), unless it paces the sending of packets. A sender MAY
retain its congestion window if it paces the sending of any packets retain its congestion window if it paces the sending of any packets
in excess of the initial congestion window. in excess of the initial congestion window.
A sender MAY implement alternate mechanisms to update its congestion A sender MAY implement alternate mechanisms to update its congestion
window after idle periods, such as those proposed for TCP in window after idle periods, such as those proposed for TCP in
[RFC7661]. [RFC7661].
7.8. Discarding Packet Number Space State
When keys for an packet number space are discarded, any packets sent
with those keys are removed from the count of bytes in flight. No
loss events will occur any in-flight packets from that space, as a
result of discarding loss recovery state (see Section 6.2.1.2). Note
that it is expected that keys are discarded after those packets would
be declared lost, but Initial secrets are destroyed earlier.
7.9. Pseudocode 7.9. Pseudocode
7.9.1. Constants of interest 7.9.1. Constants of interest
Constants used in congestion control are based on a combination of Constants used in congestion control are based on a combination of
RFCs, papers, and common practice. Some may need to be changed or RFCs, papers, and common practice. Some may need to be changed or
negotiated in order to better suit a variety of environments. negotiated in order to better suit a variety of environments.
kMaxDatagramSize: The sender's maximum payload size. Does not kMaxDatagramSize: The sender's maximum payload size. Does not
include UDP or IP overhead. The max packet size is used for include UDP or IP overhead. The max packet size is used for
skipping to change at page 25, line 11 skipping to change at page 26, line 13
flight, in bytes. Taken from [RFC6928]. The RECOMMENDED value is flight, in bytes. Taken from [RFC6928]. The RECOMMENDED value is
the minimum of 10 * kMaxDatagramSize and max(2* kMaxDatagramSize, the minimum of 10 * kMaxDatagramSize and max(2* kMaxDatagramSize,
14600)). 14600)).
kMinimumWindow: Minimum congestion window in bytes. The RECOMMENDED kMinimumWindow: Minimum congestion window in bytes. The RECOMMENDED
value is 2 * kMaxDatagramSize. value is 2 * kMaxDatagramSize.
kLossReductionFactor: Reduction in congestion window when a new loss kLossReductionFactor: Reduction in congestion window when a new loss
event is detected. The RECOMMENDED value is 0.5. event is detected. The RECOMMENDED value is 0.5.
kPersistentCongestionThreshold: Number of consecutive PTOs after kPersistentCongestionThreshold: Number of consecutive PTOs required
which network is considered to be experiencing persistent for persistent congestion to be established. The rationale for
congestion. The rationale for this threshold is to enable a this threshold is to enable a sender to use initial PTOs for
sender to use initial PTOs for aggressive probing, similar to Tail aggressive probing, as TCP does with Tail Loss Probe (TLP) [TLP]
Loss Probe (TLP) in TCP [TLP] [RACK]. Once the number of [RACK], before establishing persistent congestion, as TCP does
consecutive PTOs reaches this threshold - that is, persistent with a Retransmission Timeout (RTO) [RFC5681]. The RECOMMENDED
congestion is established - the sender responds by collapsing its value for kPersistentCongestionThreshold is 2, which is equivalent
congestion window to kMinimumWindow, similar to a Retransmission to having two TLPs before an RTO in TCP.
Timeout (RTO) in TCP [RFC5681]. The RECOMMENDED value for
kPersistentCongestionThreshold is 2, which is equivalent to having
two TLPs before an RTO in TCP.
7.9.2. Variables of interest 7.9.2. Variables of interest
Variables required to implement the congestion control mechanisms are Variables required to implement the congestion control mechanisms are
described in this section. described in this section.
ecn_ce_counter: The highest value reported for the ECN-CE counter by ecn_ce_counter: The highest value reported for the ECN-CE counter by
the peer in an ACK frame. This variable is used to detect the peer in an ACK frame. This variable is used to detect
increases in the reported ECN-CE counter. increases in the reported ECN-CE counter.
skipping to change at page 29, line 6 skipping to change at page 30, line 6
could be different. Failure to correctly respond to information could be different. Failure to correctly respond to information
about ECN markings is therefore difficult to detect. about ECN markings is therefore difficult to detect.
9. IANA Considerations 9. IANA Considerations
This document has no IANA actions. Yet. This document has no IANA actions. Yet.
10. References 10. References
10.1. Normative References 10.1. Normative References
[QUIC-TLS]
Thomson, M., Ed. and S. Turner, Ed., "Using TLS to Secure
QUIC", draft-ietf-quic-tls-18 (work in progress), January
2019.
[QUIC-TRANSPORT] [QUIC-TRANSPORT]
Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based
Multiplexed and Secure Transport", draft-ietf-quic- Multiplexed and Secure Transport", draft-ietf-quic-
transport-17 (work in progress), December 2018. transport-17 (work in progress), January 2019.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
skipping to change at page 31, line 20 skipping to change at page 32, line 20
[3] https://github.com/quicwg/base-drafts/labels/-recovery [3] https://github.com/quicwg/base-drafts/labels/-recovery
Appendix A. Change Log Appendix A. Change Log
*RFC Editor's Note:* Please remove this section prior to *RFC Editor's Note:* Please remove this section prior to
publication of a final version of this document. publication of a final version of this document.
Issue and pull request numbers are listed with a leading octothorp. Issue and pull request numbers are listed with a leading octothorp.
A.1. Since draft-ietf-quic-recovery-16 A.1. Since draft-ietf-quic-recovery-17
o After Probe Timeout discard in-flight packets or send another
(#2212, #1965)
o Endpoints discard initial keys as soon as handshake keys are
available (#1951, #2045)
o 0-RTT state is discarded when 0-RTT is rejected (#2300)
o Loss detection timer is cancelled when ack-eliciting frames are in
flight (#2117, #2093)
o Packets are declared lost if they are in flight (#2104)
o After becoming idle, either pace packets or reset the congestion
controller (#2138, 2187)
o Process ECN counts before marking packets lost (#2142)
o Mark packets lost before resetting crypto_count and pto_count
(#2208, #2209)
o Congestion and loss recovery state are discarded when keys are
discarded (#2237)
A.2. Since draft-ietf-quic-recovery-16
o Unify TLP and RTO into a single PTO; eliminate min RTO, min TLP o Unify TLP and RTO into a single PTO; eliminate min RTO, min TLP
and min crypto timeouts; eliminate timeout validation (#2114, and min crypto timeouts; eliminate timeout validation (#2114,
#2166, #2168, #1017) #2166, #2168, #1017)
o Redefine how congestion avoidance in terms of when the period o Redefine how congestion avoidance in terms of when the period
starts (#1928, #1930) starts (#1928, #1930)
o Document what needs to be tracked for packets that are in flight o Document what needs to be tracked for packets that are in flight
(#765, #1724, #1939) (#765, #1724, #1939)
skipping to change at page 32, line 5 skipping to change at page 33, line 30
o Limit ack_delay by max_ack_delay (#2060, #2099) o Limit ack_delay by max_ack_delay (#2060, #2099)
o Initial keys are discarded once Handshake are avaialble (#1951, o Initial keys are discarded once Handshake are avaialble (#1951,
#2045) #2045)
o Reorder ECN and loss detection in pseudocode (#2142) o Reorder ECN and loss detection in pseudocode (#2142)
o Only cancel loss detection timer if ack-eliciting packets are in o Only cancel loss detection timer if ack-eliciting packets are in
flight (#2093, #2117) flight (#2093, #2117)
A.2. Since draft-ietf-quic-recovery-14 A.3. Since draft-ietf-quic-recovery-14
o Used max_ack_delay from transport params (#1796, #1782) o Used max_ack_delay from transport params (#1796, #1782)
o Merge ACK and ACK_ECN (#1783) o Merge ACK and ACK_ECN (#1783)
A.3. Since draft-ietf-quic-recovery-13 A.4. Since draft-ietf-quic-recovery-13
o Corrected the lack of ssthresh reduction in CongestionEvent o Corrected the lack of ssthresh reduction in CongestionEvent
pseudocode (#1598) pseudocode (#1598)
o Considerations for ECN spoofing (#1426, #1626) o Considerations for ECN spoofing (#1426, #1626)
o Clarifications for PADDING and congestion control (#837, #838, o Clarifications for PADDING and congestion control (#837, #838,
#1517, #1531, #1540) #1517, #1531, #1540)
o Reduce early retransmission timer to RTT/8 (#945, #1581) o Reduce early retransmission timer to RTT/8 (#945, #1581)
o Packets are declared lost after an RTO is verified (#935, #1582) o Packets are declared lost after an RTO is verified (#935, #1582)
A.4. Since draft-ietf-quic-recovery-12 A.5. Since draft-ietf-quic-recovery-12
o Changes to manage separate packet number spaces and encryption o Changes to manage separate packet number spaces and encryption
levels (#1190, #1242, #1413, #1450) levels (#1190, #1242, #1413, #1450)
o Added ECN feedback mechanisms and handling; new ACK_ECN frame o Added ECN feedback mechanisms and handling; new ACK_ECN frame
(#804, #805, #1372) (#804, #805, #1372)
A.5. Since draft-ietf-quic-recovery-11 A.6. Since draft-ietf-quic-recovery-11
No significant changes. No significant changes.
A.6. Since draft-ietf-quic-recovery-10 A.7. Since draft-ietf-quic-recovery-10
o Improved text on ack generation (#1139, #1159) o Improved text on ack generation (#1139, #1159)
o Make references to TCP recovery mechanisms informational (#1195) o Make references to TCP recovery mechanisms informational (#1195)
o Define time_of_last_sent_handshake_packet (#1171) o Define time_of_last_sent_handshake_packet (#1171)
o Added signal from TLS the data it includes needs to be sent in a o Added signal from TLS the data it includes needs to be sent in a
Retry packet (#1061, #1199) Retry packet (#1061, #1199)
o Minimum RTT (min_rtt) is initialized with an infinite value o Minimum RTT (min_rtt) is initialized with an infinite value
(#1169) (#1169)
A.7. Since draft-ietf-quic-recovery-09 A.8. Since draft-ietf-quic-recovery-09
No significant changes. No significant changes.
A.8. Since draft-ietf-quic-recovery-08 A.9. Since draft-ietf-quic-recovery-08
o Clarified pacing and RTO (#967, #977) o Clarified pacing and RTO (#967, #977)
A.9. Since draft-ietf-quic-recovery-07 A.10. Since draft-ietf-quic-recovery-07
o Include Ack Delay in RTO(and TLP) computations (#981) o Include Ack Delay in RTO(and TLP) computations (#981)
o Ack Delay in SRTT computation (#961) o Ack Delay in SRTT computation (#961)
o Default RTT and Slow Start (#590) o Default RTT and Slow Start (#590)
o Many editorial fixes. o Many editorial fixes.
A.10. Since draft-ietf-quic-recovery-06 A.11. Since draft-ietf-quic-recovery-06
No significant changes. No significant changes.
A.11. Since draft-ietf-quic-recovery-05 A.12. Since draft-ietf-quic-recovery-05
o Add more congestion control text (#776) o Add more congestion control text (#776)
A.12. Since draft-ietf-quic-recovery-04 A.13. Since draft-ietf-quic-recovery-04
No significant changes. No significant changes.
A.13. Since draft-ietf-quic-recovery-03 A.14. Since draft-ietf-quic-recovery-03
No significant changes. No significant changes.
A.14. Since draft-ietf-quic-recovery-02 A.15. Since draft-ietf-quic-recovery-02
o Integrate F-RTO (#544, #409) o Integrate F-RTO (#544, #409)
o Add congestion control (#545, #395) o Add congestion control (#545, #395)
o Require connection abort if a skipped packet was acknowledged o Require connection abort if a skipped packet was acknowledged
(#415) (#415)
o Simplify RTO calculations (#142, #417) o Simplify RTO calculations (#142, #417)
A.15. Since draft-ietf-quic-recovery-01 A.16. Since draft-ietf-quic-recovery-01
o Overview added to loss detection o Overview added to loss detection
o Changes initial default RTT to 100ms o Changes initial default RTT to 100ms
o Added time-based loss detection and fixes early retransmit o Added time-based loss detection and fixes early retransmit
o Clarified loss recovery for handshake packets o Clarified loss recovery for handshake packets
o Fixed references and made TCP references informative o Fixed references and made TCP references informative
A.16. Since draft-ietf-quic-recovery-00 A.17. Since draft-ietf-quic-recovery-00
o Improved description of constants and ACK behavior o Improved description of constants and ACK behavior
A.17. Since draft-iyengar-quic-loss-recovery-01 A.18. Since draft-iyengar-quic-loss-recovery-01
o Adopted as base for draft-ietf-quic-recovery o Adopted as base for draft-ietf-quic-recovery
o Updated authors/editors list o Updated authors/editors list
o Added table of contents o Added table of contents
Acknowledgments Acknowledgments
Authors' Addresses Authors' Addresses
Jana Iyengar (editor) Jana Iyengar (editor)
Fastly Fastly
Email: jri.ietf@gmail.com Email: jri.ietf@gmail.com
 End of changes. 45 change blocks. 
132 lines changed or deleted 199 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/