From 51204d8032f1a49a8498962fb25c4056740ee466 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Wed, 30 Sep 2020 20:32:02 +1000 Subject: [PATCH 1/3] Move key discard to loss recovery section None of the variables here are congestion control variables, so this is clearly loss recovery logic that is just misplaced. --- draft-ietf-quic-recovery.md | 45 +++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 1b1179528b..6b4403af42 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1574,6 +1574,29 @@ DetectAndRemoveLostPackets(pn_space): ~~~ +## Upon Dropping Initial or Handshake Keys + +When Initial or Handshake keys are discarded, packets from the space +are discarded and loss detection state is updated. + +Pseudocode for OnPacketNumberSpaceDiscarded follows: + +~~~ +OnPacketNumberSpaceDiscarded(pn_space): + assert(pn_space != ApplicationData) + // Remove any unacknowledged packets from flight. + foreach packet in sent_packets[pn_space]: + if packet.in_flight + bytes_in_flight -= size + sent_packets[pn_space].clear() + // Reset the loss detection and PTO timer + time_of_last_ack_eliciting_packet[pn_space] = 0 + loss_time[pn_space] = 0 + pto_count = 0 + SetLossDetectionTimer() +~~~ + + # Congestion Control Pseudocode We now describe an example implementation of the congestion controller described @@ -1769,28 +1792,6 @@ OnPacketsLost(lost_packets): congestion_recovery_start_time = 0 ~~~ -## Upon dropping Initial or Handshake keys - -When Initial or Handshake keys are discarded, packets from the space -are discarded and loss detection state is updated. - -Pseudocode for OnPacketNumberSpaceDiscarded follows: - -~~~ -OnPacketNumberSpaceDiscarded(pn_space): - assert(pn_space != ApplicationData) - // Remove any unacknowledged packets from flight. - foreach packet in sent_packets[pn_space]: - if packet.in_flight - bytes_in_flight -= size - sent_packets[pn_space].clear() - // Reset the loss detection and PTO timer - time_of_last_ack_eliciting_packet[pn_space] = 0 - loss_time[pn_space] = 0 - pto_count = 0 - SetLossDetectionTimer() -~~~ - # Change Log > **RFC Editor's Note:** Please remove this section prior to From 4d49737dae5663562f59138ab0942d60b6930cf8 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Thu, 1 Oct 2020 09:58:19 +1000 Subject: [PATCH 2/3] Split between sections --- draft-ietf-quic-recovery.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 6b4403af42..1666440a3f 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1584,10 +1584,7 @@ Pseudocode for OnPacketNumberSpaceDiscarded follows: ~~~ OnPacketNumberSpaceDiscarded(pn_space): assert(pn_space != ApplicationData) - // Remove any unacknowledged packets from flight. - foreach packet in sent_packets[pn_space]: - if packet.in_flight - bytes_in_flight -= size + RemoveFromBytesInFlight(sent_packets[pn_space]) sent_packets[pn_space].clear() // Reset the loss detection and PTO timer time_of_last_ack_eliciting_packet[pn_space] = 0 @@ -1792,6 +1789,24 @@ OnPacketsLost(lost_packets): congestion_recovery_start_time = 0 ~~~ + +## Removing Discarded Packets From Bytes In Flight + +When Initial or Handshake keys are discarded, packets sent in that space no +longer count toward bytes in flight. + +Pseudocode for RemoveFromBytesInFlight follows: + +~~~ +RemoveFromBytesInFlight(discarded): + // Remove any unacknowledged packets from flight. + foreach packet in discarded: + if packet.in_flight + bytes_in_flight -= size +~~~ + + + # Change Log > **RFC Editor's Note:** Please remove this section prior to From 46f4f1eee24cf4adac511cacad735d139e9ecaeb Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Thu, 1 Oct 2020 11:06:53 +1000 Subject: [PATCH 3/3] Discarded packets, not just discarded --- draft-ietf-quic-recovery.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 1666440a3f..b6ead8f2c4 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1798,9 +1798,9 @@ longer count toward bytes in flight. Pseudocode for RemoveFromBytesInFlight follows: ~~~ -RemoveFromBytesInFlight(discarded): +RemoveFromBytesInFlight(discarded_packets): // Remove any unacknowledged packets from flight. - foreach packet in discarded: + foreach packet in discarded_packets: if packet.in_flight bytes_in_flight -= size ~~~