From f179c18b8eff59b53126d09e88e0a7d469946f0d Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 15 Jul 2020 08:55:33 +0900 Subject: [PATCH 1/9] now -> now() --- 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 5f081fe0d8..447d9287cd 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1203,7 +1203,7 @@ OnAckReceived(ack, pn_space): ack.largest_acked && IncludesAckEliciting(newly_acked_packets)): latest_rtt = - now - sent_packets[pn_space][ack.largest_acked].time_sent + now() - sent_packets[pn_space][ack.largest_acked].time_sent ack_delay = 0 if (pn_space == ApplicationData): ack_delay = ack.ack_delay From 1ab312b9ab0601be6489ba89d553cf8ee2a7e4f3 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 15 Jul 2020 08:58:09 +0900 Subject: [PATCH 2/9] using ".sent_bytes" instead of undefined ".size" --- draft-ietf-quic-recovery.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 447d9287cd..a10127503a 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1154,7 +1154,7 @@ Pseudocode for OnPacketSent follows: if (ack_eliciting): time_of_last_ack_eliciting_packet[pn_space] = now() OnPacketSentCC(sent_bytes) - sent_packets[pn_space][packet_number].size = sent_bytes + sent_packets[pn_space][packet_number].sent_bytes = sent_bytes SetLossDetectionTimer() ~~~ @@ -1515,7 +1515,7 @@ newly acked_packets from sent_packets. OnPacketsAcked(acked_packets): for packet in acked_packets: // Remove from bytes_in_flight. - bytes_in_flight -= packet.size + bytes_in_flight -= packet.sent_bytes if (InCongestionRecovery(packet.time_sent)): // Do not increase congestion window in recovery period. return @@ -1525,10 +1525,10 @@ newly acked_packets from sent_packets. return if (congestion_window < ssthresh): // Slow start. - congestion_window += packet.size + congestion_window += packet.sent_bytes return // Congestion avoidance. - congestion_window += max_datagram_size * acked_packet.size + congestion_window += max_datagram_size * acked_packet.sent_bytes / congestion_window ~~~ @@ -1584,7 +1584,7 @@ Invoked when DetectAndRemoveLostPackets deems packets lost. OnPacketsLost(lost_packets): // Remove lost packets from bytes_in_flight. for lost_packet in lost_packets: - bytes_in_flight -= lost_packet.size + bytes_in_flight -= lost_packet.sent_bytes CongestionEvent(lost_packets.largest().time_sent) // Collapse congestion window if persistent congestion From 07e87d3dce371b016b69c47ade45b9bb7858820e Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 15 Jul 2020 16:12:34 +0900 Subject: [PATCH 3/9] fixing OnPacketsAcked Credit: @junhochoi --- draft-ietf-quic-recovery.md | 42 +++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index a10127503a..7b00e87eee 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1512,24 +1512,30 @@ newly acked_packets from sent_packets. 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.sent_bytes - if (InCongestionRecovery(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.sent_bytes - return - // Congestion avoidance. - congestion_window += max_datagram_size * acked_packet.sent_bytes - / congestion_window + OnPacketsAcked(acked_packets): + for acked_packet in acked_packets: + OnPacketAcked(acked_packet) + + OnPacketAcked(packet): + // Remove from bytes_in_flight. + bytes_in_flight -= packet.sent_bytes + + // Do not increase congestion_window if application + // limited or flow control limited. + if (IsAppOrFlowControlLimited()) + return + + // Do not increase congestion window in recovery period. + if (InCongestionRecovery(packet.time_sent)): + return + + if (congestion_window < ssthresh): + // Slow start. + congestion_window += packet.sent_bytes + else: + // Congestion avoidance. + congestion_window += max_datagram_size * acked_packet.sent_bytes + / congestion_window ~~~ From 1a689213f8bd66f411f6ab56d18711979c0e40e4 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 15 Jul 2020 16:31:02 +0900 Subject: [PATCH 4/9] defining IncludesAckEliciting. --- draft-ietf-quic-recovery.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 7b00e87eee..39309b63f5 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1182,6 +1182,12 @@ When an ACK frame is received, it may newly acknowledge any number of packets. Pseudocode for OnAckReceived and UpdateRtt follow: ~~~ +IncludesAckEliciting(packets): + for packet in packets: + if (packet.ack_eliciting): + return true + return false + OnAckReceived(ack, pn_space): if (largest_acked_packet[pn_space] == infinite): largest_acked_packet[pn_space] = ack.largest_acked From 65dc7ea163cffb7bb5645973b121ebe12b100678 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 15 Jul 2020 16:36:48 +0900 Subject: [PATCH 5/9] unifying packet and acked_packet since acked_packet was not defined anywhere. --- 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 39309b63f5..716ab8abba 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1522,9 +1522,9 @@ newly acked_packets from sent_packets. for acked_packet in acked_packets: OnPacketAcked(acked_packet) - OnPacketAcked(packet): + OnPacketAcked(acked_packet): // Remove from bytes_in_flight. - bytes_in_flight -= packet.sent_bytes + bytes_in_flight -= acked_packet.sent_bytes // Do not increase congestion_window if application // limited or flow control limited. @@ -1532,12 +1532,12 @@ newly acked_packets from sent_packets. return // Do not increase congestion window in recovery period. - if (InCongestionRecovery(packet.time_sent)): + if (InCongestionRecovery(acked_packet.time_sent)): return if (congestion_window < ssthresh): // Slow start. - congestion_window += packet.sent_bytes + congestion_window += acked_packet.sent_bytes else: // Congestion avoidance. congestion_window += max_datagram_size * acked_packet.sent_bytes From f68b55397402a49b753c5e2cb3d5e52e05a1262e Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Thu, 16 Jul 2020 09:41:02 +0900 Subject: [PATCH 6/9] fixing indentation in pseudocode Co-authored-by: Junho Choi <1229714+junhochoi@users.noreply.github.com> --- draft-ietf-quic-recovery.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 716ab8abba..1ad14698d7 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1515,8 +1515,8 @@ Invoked from loss detection's OnAckReceived and is supplied with the newly acked_packets from sent_packets. ~~~ - InCongestionRecovery(sent_time): - return sent_time <= congestion_recovery_start_time + InCongestionRecovery(sent_time): + return sent_time <= congestion_recovery_start_time OnPacketsAcked(acked_packets): for acked_packet in acked_packets: @@ -1529,19 +1529,19 @@ newly acked_packets from sent_packets. // Do not increase congestion_window if application // limited or flow control limited. if (IsAppOrFlowControlLimited()) - return + return // Do not increase congestion window in recovery period. if (InCongestionRecovery(acked_packet.time_sent)): - return + return if (congestion_window < ssthresh): - // Slow start. - congestion_window += acked_packet.sent_bytes + // Slow start. + congestion_window += acked_packet.sent_bytes else: - // Congestion avoidance. - congestion_window += max_datagram_size * acked_packet.sent_bytes - / congestion_window + // Congestion avoidance. + congestion_window += max_datagram_size * acked_packet.sent_bytes + / congestion_window ~~~ From 652aa2e1959c77875000cf72386391ad67d9947d Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Thu, 16 Jul 2020 16:06:47 +0900 Subject: [PATCH 7/9] Wrapping a line of pseudocode to fix CI Co-authored-by: Martin Thomson --- draft-ietf-quic-recovery.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 1ad14698d7..b369537561 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1154,7 +1154,8 @@ Pseudocode for OnPacketSent follows: if (ack_eliciting): time_of_last_ack_eliciting_packet[pn_space] = now() OnPacketSentCC(sent_bytes) - sent_packets[pn_space][packet_number].sent_bytes = sent_bytes + sent_packets[pn_space][packet_number].sent_bytes = + sent_bytes SetLossDetectionTimer() ~~~ From 8a4861f8d9dbe9ef785173f24ae11c18facd8039 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Thu, 16 Jul 2020 16:21:08 +0900 Subject: [PATCH 8/9] Wrapping a line of pseudocode to fix CI Co-authored-by: Martin Thomson --- draft-ietf-quic-recovery.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index b369537561..1b4b27867f 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1541,7 +1541,8 @@ newly acked_packets from sent_packets. congestion_window += acked_packet.sent_bytes else: // Congestion avoidance. - congestion_window += max_datagram_size * acked_packet.sent_bytes + congestion_window += + max_datagram_size * acked_packet.sent_bytes / congestion_window ~~~ From c2ffa5a4b025cb221eeec0865fd460354213a860 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Thu, 16 Jul 2020 17:10:03 +0900 Subject: [PATCH 9/9] removing trailing space. --- 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 1b4b27867f..d350450844 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -1541,7 +1541,7 @@ newly acked_packets from sent_packets. congestion_window += acked_packet.sent_bytes else: // Congestion avoidance. - congestion_window += + congestion_window += max_datagram_size * acked_packet.sent_bytes / congestion_window ~~~