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

Split PTO calculation into a dedicated method #3681

Merged
merged 12 commits into from
May 31, 2020

Conversation

ianswett
Copy link
Contributor

@ianswett ianswett commented May 20, 2020

As @martinthomson pointed out in #3666, it was far too complex and error-prone as-is.

Fixes #3564 and #3674 by calculating the PTO timeout for each PN space and picking the earliest, as well as checking that there are inflight packets before calculating PTO for a PN space.

As @martinthomson pointed out in #3666, it was far too complex and error-prone as-is.

Als fixes #3564 and #3674 by calculating the PTO timeout for each PN space and picking the earliest, as well as checking that there are inflight packets before calculating PTO for a PN space.
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is much clearer.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
@martinthomson
Copy link
Member

FWIW, the problem with exponentially increasing max_ack_delay thing is pretty obvious here. I think that I might choose not to implement that bit :)

ianswett and others added 2 commits May 21, 2020 10:47
Co-authored-by: Martin Thomson <mt@lowentropy.net>
@MikeBishop MikeBishop added -recovery editorial An issue that does not affect the design of the protocol; does not require consensus. labels May 21, 2020
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
max(4 * rttvar, kGranularity) * (2 ^ pto_count)
# Arm PTO from now when there are no inflight packets
if (no in-flight packets):
return (now() + duration), Initial
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the following case: As a client, I need to send a Handshake packet to unblock the server's amplification limit, if the Initial packet number space was already dropped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The amplification factor is the gift that keeps on giving.

Copy link
Contributor

@martinduke martinduke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@janaiyengar janaiyengar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much cleaner -- thanks for working on it! A few comments.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
duration = (smoothed_rtt + max(4 * rttvar, kGranularity))
* (2 ^ pto_count)
# Arm PTO from now when there are no inflight packets
if (no in-flight packets):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this is for the amplification protection, something's missing here. Perhaps this should be
if (is_client && no packets in flight && !PeerCompletedAddressValidation()).
Otherwise, you never get into the case below on line 1293.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an assert that for !PeerCompletedAddressValidation().

I think the condition you're mentioning is:
"if (no in-flight packets in space):
continue;"

That's per PN-space, not for the connection as a whole.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind, I thought the code below to do the early return when no packets are in flight after address validation was removed. It's still there, so all good.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
ianswett and others added 2 commits May 30, 2020 16:58
Co-authored-by: Jana Iyengar <jri.ietf@gmail.com>
@janaiyengar janaiyengar merged commit 8644f6d into master May 31, 2020
@janaiyengar janaiyengar deleted the ianswett-split-pto-pseudocode branch May 31, 2020 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-recovery editorial An issue that does not affect the design of the protocol; does not require consensus.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SetLossDetectionTimer pseudocode is wrong
6 participants