Skip to content

Commit

Permalink
Merge pull request #3461 from quicwg/ianswett-pto-pseudocode
Browse files Browse the repository at this point in the history
Update PTO pseudocode to better match text
  • Loading branch information
ianswett committed Mar 16, 2020
2 parents 6598cf1 + aacd077 commit 061a913
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions draft-ietf-quic-recovery.md
Expand Up @@ -1220,8 +1220,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 @@ -1257,20 +1265,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:
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

0 comments on commit 061a913

Please sign in to comment.