From 6290d1447ecdc63e4b0a702d0a0bd27d01904d6a Mon Sep 17 00:00:00 2001 From: ianswett Date: Sun, 22 Mar 2020 16:26:34 -0400 Subject: [PATCH 01/19] Notify the congestion controller of losses first Fixes #3495 and #3288 by notifying the congestion controller of lost packets prior to notifying it of acknowledged packets and passing all lost packets into InPersistentCongestion(). --- draft-ietf-quic-recovery.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index bd4da6048e..4f51cd36fb 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1128,13 +1128,15 @@ OnAckReceived(ack, pn_space): if (ACK frame contains ECN information): ProcessECN(ack, pn_space) + lost_packets = DetectLostPackets(pn_space) + // Inform the congestion controller of lost packets and + // let it decide whether to retransmit immediately. + if (!lost_packets.empty()): + OnPacketsLost(lost_packets) for acked_packet in newly_acked_packets: OnPacketAcked(acked_packet.packet_number, pn_space) - DetectLostPackets(pn_space) - pto_count = 0 - SetLossDetectionTimer() @@ -1265,7 +1267,8 @@ OnLossDetectionTimeout(): GetEarliestTimeAndSpace(loss_time) if (earliest_loss_time != 0): // Time threshold loss Detection - DetectLostPackets(pn_space) + lost_packets = DetectLostPackets(pn_space) + OnPacketsLost(lost_packets) SetLossDetectionTimer() return @@ -1292,8 +1295,9 @@ OnLossDetectionTimeout(): ## Detecting Lost Packets -DetectLostPackets is called every time an ACK is received and operates on -the sent_packets for that packet number space. +DetectLostPackets is called every time an ACK is received or the time threshold +loss detection timer expires and operates on the sent_packets for that packet +number space. Pseudocode for DetectLostPackets follows: @@ -1327,11 +1331,7 @@ DetectLostPackets(pn_space): else: loss_time[pn_space] = min(loss_time[pn_space], unacked.time_sent + loss_delay) - - // Inform the congestion controller of lost packets and - // let it decide whether to retransmit immediately. - if (!lost_packets.empty()): - OnPacketsLost(lost_packets) + return lost_packets ~~~ @@ -1499,15 +1499,14 @@ Invoked when an ACK frame with an ECN section is received from the peer. Invoked from DetectLostPackets when packets are deemed lost. ~~~ - InPersistentCongestion(largest_lost_packet): + InPersistentCongestion(lost_packets): pto = smoothed_rtt + max(4 * rttvar, kGranularity) + max_ack_delay congestion_period = pto * kPersistentCongestionThreshold // Determine if all packets in the time period before the // newest lost packet, including the edges, are marked // lost - return AreAllPacketsLost(largest_lost_packet, - congestion_period) + return AreAllPacketsLost(lost_packets, congestion_period) OnPacketsLost(lost_packets): // Remove lost packets from bytes_in_flight. @@ -1517,7 +1516,7 @@ Invoked from DetectLostPackets when packets are deemed lost. CongestionEvent(largest_lost_packet.time_sent) // Collapse congestion window if persistent congestion - if (InPersistentCongestion(largest_lost_packet)): + if (InPersistentCongestion(lost_packets)): congestion_window = kMinimumWindow ~~~ From 0c944ea9badc434888c169b4609687d404ad2fcb Mon Sep 17 00:00:00 2001 From: ianswett Date: Sun, 22 Mar 2020 16:36:25 -0400 Subject: [PATCH 02/19] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 4f51cd36fb..4ee5043e58 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1129,12 +1129,12 @@ OnAckReceived(ack, pn_space): ProcessECN(ack, pn_space) lost_packets = DetectLostPackets(pn_space) - // Inform the congestion controller of lost packets and - // let it decide whether to retransmit immediately. if (!lost_packets.empty()): OnPacketsLost(lost_packets) - for acked_packet in newly_acked_packets: - OnPacketAcked(acked_packet.packet_number, pn_space) + for (acked_packet in newly_acked_packets): + if (acked_packet.in_flight): + OnPacketAcked(acked_packet) + sent_packets[pn_space].remove(acked_packet.packet_number) pto_count = 0 SetLossDetectionTimer() @@ -1161,28 +1161,6 @@ UpdateRtt(ack_delay): smoothed_rtt = 7/8 * smoothed_rtt + 1/8 * adjusted_rtt ~~~ - -## On Packet Acknowledgment - -When a packet is acknowledged for the first time, the following OnPacketAcked -function is called. Note that a single ACK frame may newly acknowledge several -packets. OnPacketAcked must be called once for each of these newly acknowledged -packets. - -OnPacketAcked takes two parameters: acked_packet, which is the struct detailed -in {{sent-packets-fields}}, and the packet number space that this ACK frame was -sent for. - -Pseudocode for OnPacketAcked follows: - -~~~ - OnPacketAcked(acked_packet, pn_space): - if (acked_packet.in_flight): - OnPacketAckedCC(acked_packet) - sent_packets[pn_space].remove(acked_packet.packet_number) -~~~ - - ## Setting the Loss Detection Timer QUIC loss detection uses a single timer for all timeout loss detection. The @@ -1433,14 +1411,14 @@ increases bytes_in_flight. ## On Packet Acknowledgement -Invoked from loss detection's OnPacketAcked and is supplied with the +Invoked from loss detection's OnAckReceived and is supplied with the acked_packet from sent_packets. ~~~ InCongestionRecovery(sent_time): return sent_time <= congestion_recovery_start_time - OnPacketAckedCC(acked_packet): + OnPacketAcked(acked_packet): // Remove from bytes_in_flight. bytes_in_flight -= acked_packet.size if (InCongestionRecovery(acked_packet.time_sent)): From 5f520e2d9207eb156fb3a6fec2a11318c975b36e Mon Sep 17 00:00:00 2001 From: ianswett Date: Sun, 29 Mar 2020 19:48:13 -0400 Subject: [PATCH 03/19] temp update --- draft-ietf-quic-recovery.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 4ee5043e58..b941c6b9cc 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1108,14 +1108,16 @@ OnAckReceived(ack, pn_space): largest_acked_packet[pn_space] = max(largest_acked_packet[pn_space], ack.largest_acked) + // Determine which packets have been acknowledged and remove + // them from sent_packets. + newly_acked_packets = DetectNewlyAckedPackets(ack, pn_space) // Nothing to do if there are no newly acked packets. - newly_acked_packets = DetermineNewlyAckedPackets(ack, pn_space) if (newly_acked_packets.empty()): return // If the largest acknowledged is newly acked and // at least one ack-eliciting was newly acked, update the RTT. - if (sent_packets[pn_space].contains(ack.largest_acked) && + if (newly_acked_packets.largest == ack.largest_acked && IncludesAckEliciting(newly_acked_packets)): latest_rtt = now - sent_packets[pn_space][ack.largest_acked].time_sent @@ -1129,12 +1131,7 @@ OnAckReceived(ack, pn_space): ProcessECN(ack, pn_space) lost_packets = DetectLostPackets(pn_space) - if (!lost_packets.empty()): - OnPacketsLost(lost_packets) - for (acked_packet in newly_acked_packets): - if (acked_packet.in_flight): - OnPacketAcked(acked_packet) - sent_packets[pn_space].remove(acked_packet.packet_number) + OnCongestionEvent(acked_packets, lost_packets) pto_count = 0 SetLossDetectionTimer() @@ -1411,17 +1408,17 @@ increases bytes_in_flight. ## On Packet Acknowledgement -Invoked from loss detection's OnAckReceived and is supplied with the +Invoked from OnCongestionEvent and is supplied with the acked_packet from sent_packets. ~~~ - InCongestionRecovery(sent_time): + InLossRecovery(sent_time): return sent_time <= congestion_recovery_start_time OnPacketAcked(acked_packet): // Remove from bytes_in_flight. bytes_in_flight -= acked_packet.size - if (InCongestionRecovery(acked_packet.time_sent)): + if (InLossRecovery(acked_packet.time_sent)): // Do not increase congestion window in recovery period. return if (IsAppOrFlowControlLimited()): From de8eca5e5b745c44c1c52b1c811f5068c565c112 Mon Sep 17 00:00:00 2001 From: ianswett Date: Sun, 29 Mar 2020 19:53:05 -0400 Subject: [PATCH 04/19] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index b941c6b9cc..2eae7d6062 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1131,7 +1131,9 @@ OnAckReceived(ack, pn_space): ProcessECN(ack, pn_space) lost_packets = DetectLostPackets(pn_space) - OnCongestionEvent(acked_packets, lost_packets) + if (!lost_packets.empty()): + OnPacketsLost(lost_packets) + OnPacketsAcked(newly_acked_packets) pto_count = 0 SetLossDetectionTimer() From 2594cd133feb9ef21f93fda32bca9dc6c997a494 Mon Sep 17 00:00:00 2001 From: ianswett Date: Sun, 29 Mar 2020 19:55:10 -0400 Subject: [PATCH 05/19] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 2eae7d6062..edfdfab67b 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1417,23 +1417,24 @@ acked_packet from sent_packets. InLossRecovery(sent_time): return sent_time <= congestion_recovery_start_time - OnPacketAcked(acked_packet): - // Remove from bytes_in_flight. - bytes_in_flight -= acked_packet.size - if (InLossRecovery(acked_packet.time_sent)): - // Do not increase congestion window in recovery period. - return - if (IsAppOrFlowControlLimited()): - // Do not increase congestion_window if application - // limited or flow control limited. - return - if (congestion_window < ssthresh): - // Slow start. - congestion_window += acked_packet.size - else: - // Congestion avoidance. - congestion_window += max_datagram_size * acked_packet.size - / congestion_window + OnPacketsAcked(acked_packets): + for (packet in acked_packets): + // Remove from bytes_in_flight. + bytes_in_flight -= packet.size + if (InLossRecovery(packet.time_sent)): + // Do not increase congestion window in recovery period. + return + if (IsAppOrFlowControlLimited()): + // Do not increase congestion_window if application + // limited or flow control limited. + return + if (congestion_window < ssthresh): + // Slow start. + congestion_window += packet.size + else: + // Congestion avoidance. + congestion_window += max_datagram_size * acked_packet.size + / congestion_window ~~~ From 05d9705c4dce2707f3bd8456b410e082c717a41c Mon Sep 17 00:00:00 2001 From: ianswett Date: Sun, 29 Mar 2020 19:57:13 -0400 Subject: [PATCH 06/19] Update draft-ietf-quic-recovery.md --- 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 edfdfab67b..584b21dc5c 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1410,8 +1410,8 @@ increases bytes_in_flight. ## On Packet Acknowledgement -Invoked from OnCongestionEvent and is supplied with the -acked_packet from sent_packets. +Invoked from loss detection's OnPacketAcked and is supplied with the +newly acked_packets from sent_packets. ~~~ InLossRecovery(sent_time): From 902703f7d3bc8931ba05e877e88a322f29c1d9b0 Mon Sep 17 00:00:00 2001 From: ianswett Date: Sun, 29 Mar 2020 20:00:50 -0400 Subject: [PATCH 07/19] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 584b21dc5c..2635c2e900 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1431,10 +1431,10 @@ newly acked_packets from sent_packets. if (congestion_window < ssthresh): // Slow start. congestion_window += packet.size - else: - // Congestion avoidance. - congestion_window += max_datagram_size * acked_packet.size - / congestion_window + return + // Congestion avoidance. + congestion_window += max_datagram_size * acked_packet.size + / congestion_window ~~~ From 35fad6f470bf6fd2316189ecb7a9ce376c93f4d9 Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:03:13 -0400 Subject: [PATCH 08/19] Update draft-ietf-quic-recovery.md Co-Authored-By: Jana Iyengar --- draft-ietf-quic-recovery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 2635c2e900..5c6f18bfdf 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1108,7 +1108,7 @@ OnAckReceived(ack, pn_space): largest_acked_packet[pn_space] = max(largest_acked_packet[pn_space], ack.largest_acked) - // Determine which packets have been acknowledged and remove + // DetectNewlyAckedPackets finds packets have been newly acknowledged and removes // them from sent_packets. newly_acked_packets = DetectNewlyAckedPackets(ack, pn_space) // Nothing to do if there are no newly acked packets. From 71bebc7cd1d63193b6e788deffb65aee681ab8cc Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:03:24 -0400 Subject: [PATCH 09/19] Update draft-ietf-quic-recovery.md Co-Authored-By: Jana Iyengar --- draft-ietf-quic-recovery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 5c6f18bfdf..a54ec04c4e 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1110,7 +1110,7 @@ OnAckReceived(ack, pn_space): // DetectNewlyAckedPackets finds packets have been newly acknowledged and removes // them from sent_packets. - newly_acked_packets = DetectNewlyAckedPackets(ack, pn_space) + newly_acked_packets = DetectAndRemoveAckedPackets(ack, pn_space) // Nothing to do if there are no newly acked packets. if (newly_acked_packets.empty()): return From c942fd8027c3ddbd03c658aca614282cb1b3f490 Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:03:35 -0400 Subject: [PATCH 10/19] Update draft-ietf-quic-recovery.md Co-Authored-By: Jana Iyengar --- draft-ietf-quic-recovery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index a54ec04c4e..b33aea84cf 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1130,7 +1130,7 @@ OnAckReceived(ack, pn_space): if (ACK frame contains ECN information): ProcessECN(ack, pn_space) - lost_packets = DetectLostPackets(pn_space) + lost_packets = DetectAndRemoveLostPackets(pn_space) if (!lost_packets.empty()): OnPacketsLost(lost_packets) OnPacketsAcked(newly_acked_packets) From 5d0f1778e301bc0aaae4c0a8d192814852000fda Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:08:24 -0400 Subject: [PATCH 11/19] Apply suggestions from code review Co-Authored-By: Jana Iyengar --- 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 b33aea84cf..cdc965c898 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1414,14 +1414,14 @@ Invoked from loss detection's OnPacketAcked and is supplied with the newly acked_packets from sent_packets. ~~~ - InLossRecovery(sent_time): + InCongestionRecovery(sent_time): return sent_time <= congestion_recovery_start_time OnPacketsAcked(acked_packets): for (packet in acked_packets): // Remove from bytes_in_flight. bytes_in_flight -= packet.size - if (InLossRecovery(packet.time_sent)): + if (InCongestionRecovery(packet.time_sent)): // Do not increase congestion window in recovery period. return if (IsAppOrFlowControlLimited()): From ef5ea9cf87e6742d05a8347c6a58e07d6bc8a27c Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:09:11 -0400 Subject: [PATCH 12/19] Update draft-ietf-quic-recovery.md Co-Authored-By: Jana Iyengar --- draft-ietf-quic-recovery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index cdc965c898..c033d1c9c1 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1410,7 +1410,7 @@ increases bytes_in_flight. ## On Packet Acknowledgement -Invoked from loss detection's OnPacketAcked and is supplied with the +Invoked from loss detection's OnAckReceived and is supplied with the newly acked_packets from sent_packets. ~~~ From 949bbab5c32eef55d23296330477c49bb60661ca Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:10:26 -0400 Subject: [PATCH 13/19] Update draft-ietf-quic-recovery.md Co-Authored-By: Jana Iyengar --- 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 c033d1c9c1..a46a4f2ffe 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1273,8 +1273,8 @@ OnLossDetectionTimeout(): ## Detecting Lost Packets DetectLostPackets is called every time an ACK is received or the time threshold -loss detection timer expires and operates on the sent_packets for that packet -number space. +loss detection timer expires. This function operates on the sent_packets for that +packet number space and returns a list of packets newly detected as lost. Pseudocode for DetectLostPackets follows: From 6c7ff3f90cef21648886155cd108e7eecf981e56 Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:17:12 -0400 Subject: [PATCH 14/19] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index a46a4f2ffe..7b143594fc 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1108,8 +1108,8 @@ OnAckReceived(ack, pn_space): largest_acked_packet[pn_space] = max(largest_acked_packet[pn_space], ack.largest_acked) - // DetectNewlyAckedPackets finds packets have been newly acknowledged and removes - // them from sent_packets. + // DetectNewlyAckedPackets finds packets have been newly + // acknowledged and removes them from sent_packets. newly_acked_packets = DetectAndRemoveAckedPackets(ack, pn_space) // Nothing to do if there are no newly acked packets. if (newly_acked_packets.empty()): @@ -1272,14 +1272,15 @@ OnLossDetectionTimeout(): ## Detecting Lost Packets -DetectLostPackets is called every time an ACK is received or the time threshold -loss detection timer expires. This function operates on the sent_packets for that -packet number space and returns a list of packets newly detected as lost. +DetectAndRemoveLostPackets is called every time an ACK is received or the time +threshold loss detection timer expires. This function operates on the +sent_packets for that packet number space and returns a list of packets newly +detected as lost. -Pseudocode for DetectLostPackets follows: +Pseudocode for DetectAndRemoveLostPackets follows: ~~~ -DetectLostPackets(pn_space): +DetectAndRemoveLostPackets(pn_space): assert(largest_acked_packet[pn_space] != infinite) loss_time[pn_space] = 0 lost_packets = {} From 3634c6b298b8e1e57fd89cc5247750d182767512 Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:23:01 -0400 Subject: [PATCH 15/19] Apply suggestions from code review Co-Authored-By: Jana Iyengar --- 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 7b143594fc..a886082313 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1483,7 +1483,7 @@ Invoked from DetectLostPackets when packets are deemed lost. max_ack_delay congestion_period = pto * kPersistentCongestionThreshold // Determine if all packets in the time period before the - // newest lost packet, including the edges, are marked + // largest newly lost packet, including the edges, are marked // lost return AreAllPacketsLost(lost_packets, congestion_period) @@ -1492,7 +1492,7 @@ Invoked from DetectLostPackets when packets are deemed lost. for (lost_packet : lost_packets): bytes_in_flight -= lost_packet.size largest_lost_packet = lost_packets.last() - CongestionEvent(largest_lost_packet.time_sent) + CongestionEvent(lost_packets.largest().time_sent) // Collapse congestion window if persistent congestion if (InPersistentCongestion(lost_packets)): From 2503587c41e812f77339cc30f3909abad187cb8d Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:25:49 -0400 Subject: [PATCH 16/19] Use largest() consistently --- draft-ietf-quic-recovery.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index a886082313..1df885180d 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1117,7 +1117,7 @@ OnAckReceived(ack, pn_space): // If the largest acknowledged is newly acked and // at least one ack-eliciting was newly acked, update the RTT. - if (newly_acked_packets.largest == ack.largest_acked && + if (newly_acked_packets.largest().packet_number == ack.largest_acked && IncludesAckEliciting(newly_acked_packets)): latest_rtt = now - sent_packets[pn_space][ack.largest_acked].time_sent @@ -1491,7 +1491,6 @@ Invoked from DetectLostPackets when packets are deemed lost. // Remove lost packets from bytes_in_flight. for (lost_packet : lost_packets): bytes_in_flight -= lost_packet.size - largest_lost_packet = lost_packets.last() CongestionEvent(lost_packets.largest().time_sent) // Collapse congestion window if persistent congestion From a90f17cacdfe043735ff599d4b16c3d510148259 Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:26:27 -0400 Subject: [PATCH 17/19] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 1df885180d..fd323da3d1 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1108,7 +1108,7 @@ OnAckReceived(ack, pn_space): largest_acked_packet[pn_space] = max(largest_acked_packet[pn_space], ack.largest_acked) - // DetectNewlyAckedPackets finds packets have been newly + // DetectNewlyAckedPackets finds packets that are newly // acknowledged and removes them from sent_packets. newly_acked_packets = DetectAndRemoveAckedPackets(ack, pn_space) // Nothing to do if there are no newly acked packets. From ae9bb473c0f1d882375d7e1e6acab6444f96b42f Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 12:29:52 -0400 Subject: [PATCH 18/19] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index fd323da3d1..f2cb832590 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1110,14 +1110,16 @@ OnAckReceived(ack, pn_space): // DetectNewlyAckedPackets finds packets that are newly // acknowledged and removes them from sent_packets. - newly_acked_packets = DetectAndRemoveAckedPackets(ack, pn_space) + newly_acked_packets = + DetectAndRemoveAckedPackets(ack, pn_space) // Nothing to do if there are no newly acked packets. if (newly_acked_packets.empty()): return // If the largest acknowledged is newly acked and // at least one ack-eliciting was newly acked, update the RTT. - if (newly_acked_packets.largest().packet_number == ack.largest_acked && + if (newly_acked_packets.largest().packet_number == + ack.largest_acked && IncludesAckEliciting(newly_acked_packets)): latest_rtt = now - sent_packets[pn_space][ack.largest_acked].time_sent @@ -1483,8 +1485,8 @@ Invoked from DetectLostPackets when packets are deemed lost. max_ack_delay congestion_period = pto * kPersistentCongestionThreshold // Determine if all packets in the time period before the - // largest newly lost packet, including the edges, are marked - // lost + // largest newly lost packet, including the edges, are + // marked lost return AreAllPacketsLost(lost_packets, congestion_period) OnPacketsLost(lost_packets): From b34f5f9be7847b80ae890f03012f95775b946de3 Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 31 Mar 2020 20:04:49 -0400 Subject: [PATCH 19/19] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 1 + 1 file changed, 1 insertion(+) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index f2cb832590..287db43861 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1247,6 +1247,7 @@ OnLossDetectionTimeout(): if (earliest_loss_time != 0): // Time threshold loss Detection lost_packets = DetectLostPackets(pn_space) + assert(!lost_packets.empty()) OnPacketsLost(lost_packets) SetLossDetectionTimer() return