Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access loss recovery state in congestion control pseudocode #4174

Merged
merged 2 commits into from
Oct 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions draft-ietf-quic-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,9 @@ min_rtt:
: The minimum RTT seen in the connection, ignoring acknowledgment delay, as
described in {{min-rtt}}.

first_rtt_sample:
: The time that the first RTT sample was obtained.

max_ack_delay:
: The maximum amount of time by which the receiver intends to delay
acknowledgments for packets in the Application Data packet number
Expand Down Expand Up @@ -1282,6 +1285,7 @@ latest_rtt = 0
smoothed_rtt = kInitialRtt
rttvar = kInitialRtt / 2
min_rtt = 0
first_rtt_sample = 0
for pn_space in [ Initial, Handshake, ApplicationData ]:
largest_acked_packet[pn_space] = infinite
time_of_last_ack_eliciting_packet[pn_space] = 0
Expand Down Expand Up @@ -1385,10 +1389,11 @@ OnAckReceived(ack, pn_space):


UpdateRtt(ack_delay):
if (is first RTT sample):
if (first_rtt_sample == 0):
min_rtt = latest_rtt
smoothed_rtt = latest_rtt
rttvar = latest_rtt / 2
first_rtt_sample = now()
return

// min_rtt ignores acknowledgment delay.
Expand Down Expand Up @@ -1637,9 +1642,8 @@ ssthresh:
the mode is slow start and the window grows by the number of bytes
acknowledged.

first_rtt_sample:
: The time that the first RTT sample was obtained.

The congestion control pseudocode also accesses some of the variables from the
loss recovery pseudocode.

## Initialization

Expand All @@ -1651,7 +1655,6 @@ congestion_window = kInitialWindow
bytes_in_flight = 0
congestion_recovery_start_time = 0
ssthresh = infinite
first_rtt_sample = 0
for pn_space in [ Initial, Handshake, ApplicationData ]:
ecn_ce_counters[pn_space] = 0
~~~
Expand Down Expand Up @@ -1682,9 +1685,6 @@ InCongestionRecovery(sent_time):
return sent_time <= congestion_recovery_start_time

OnPacketsAcked(acked_packets):
if (first_rtt_sample == 0):
first_rtt_sample = now()

for acked_packet in acked_packets:
OnPacketAcked(acked_packet)

Expand Down Expand Up @@ -1759,7 +1759,8 @@ OnPacketsLost(lost_packets):
// Reset the congestion window if the loss of these
// packets indicates persistent congestion.
// Only consider packets sent after getting an RTT sample.
assert(first_rtt_sample != 0)
if (first_rtt_sample == 0):
return
pc_lost = {}
for lost in lost_packets:
if lost.time_sent > first_rtt_sample:
Expand Down