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

Update PTO pseudocode to better match text #3461

Merged
merged 9 commits into from
Mar 16, 2020
Merged
25 changes: 17 additions & 8 deletions draft-ietf-quic-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -1142,8 +1142,16 @@ SetLossDetectionTimer():
loss_detection_timer.update(earliest_loss_time)
return

if (server is at anti-amplification limit):
// The server's alarm is not set if nothing can be sent.
loss_detection_timer.cancel()
return

if (no ack-eliciting packets in flight &&
PeerNotAwaitingAddressValidation()):
peer not awaiting address validation):
// There is nothing to detect lost, so no timer is set.
// However, the client needs to arm the timer if the
// server might be blocked by the anti-amplification limit.
loss_detection_timer.cancel()
return

Expand Down Expand Up @@ -1179,20 +1187,21 @@ OnLossDetectionTimeout():
SetLossDetectionTimer()
return

if (endpoint is client without 1-RTT keys):
if (bytes_in_flight > 0):
// PTO. Send new data if available, else retransmit old data.
// If neither is available, send a single PING frame.
_, pn_space = GetEarliestTimeAndSpace(
time_of_last_sent_ack_eliciting_packet)
SendOneOrTwoAckElicitingPackets(pn_space)
else:
ianswett marked this conversation as resolved.
Show resolved Hide resolved
assert(endpoint is client without 1-RTT keys)
// Client sends an anti-deadlock packet: Initial is padded
// to earn more anti-amplification credit,
// a Handshake packet proves address ownership.
if (has Handshake keys):
SendOneAckElicitingHandshakePacket()
else:
SendOneAckElicitingPaddedInitialPacket()
else:
// PTO. Send new data if available, else retransmit old data.
// If neither is available, send a single PING frame.
_, pn_space = GetEarliestTimeAndSpace(
time_of_last_sent_ack_eliciting_packet)
SendOneOrTwoAckElicitingPackets(pn_space)

pto_count++
SetLossDetectionTimer()
Expand Down