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

Rewrite of RTT estimation section #2592

Merged
merged 16 commits into from Apr 12, 2019
Merged

Rewrite of RTT estimation section #2592

merged 16 commits into from Apr 12, 2019

Conversation

janaiyengar
Copy link
Contributor

I started with trying to introduce rationale for why only ack-eliciting packets are used for RTT computation, and ended up restructuring the section.

Closes #2567, #2568.

rewrite of RTT estimation section
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
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
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
endpoint:

- SHOULD use the lesser of the value reported in Ack Delay field of the ACK
frame and the peer's max_ack_delay transport parameter ({{ack-delay}}).
Copy link
Member

Choose a reason for hiding this comment

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

Why SHOULD? Why use 2119 language here at all?

When correcting an RTT sample, endpoints first limit the reported Ack Delay to the value of the max_ack_delay transport parameter. The RTT sample is then reduced by the resulting delay value. If correcting for host delays would result in a sample that is less than min_rtt, the unmodified sample is used. This guards against underestimation of RTT as a result of inflated reporting of host delays.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. Ultimately, this is bounded by another value that the peer advertises (max_ack_delay), so there's no additional safety issue here.

On the first RTT sample in a connection, the smoothed_rtt is set to the
latest_rtt. The peer-reported host delay MUST NOT be used on the first sample,
since correcting for it would result in a smoothed_rtt that is smaller than the
min_rtt.
Copy link
Member

Choose a reason for hiding this comment

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

This assertion isn't necessary. Yes, the one sample you have for min_rtt is equal to latest_rtt, so of course any host delay will not be applied. So this just duplicates the earlier requirement. If anything, just note that there is no point in applying host delay corrections as they are never applied.

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 think the way the text flows now makes this statement moot. I'm removing it.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
janaiyengar and others added 5 commits April 8, 2019 12:11
Co-Authored-By: janaiyengar <jri.ietf@gmail.com>
Co-Authored-By: janaiyengar <jri.ietf@gmail.com>
Co-Authored-By: janaiyengar <jri.ietf@gmail.com>
Copy link
Contributor Author

@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.

Thanks for your comments, @martinthomson

An endpoint uses only locally observed times in generating RTT samples and does
not correct for any host delays reported by the peer ({{ack-delay}}).

An RTT sample MUST NOT be generated for a packet that is not newly acknowledged.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Samples are generated using both the packet and the ack, so I have used "for packet" a couple of times. I like your phrasing better though, so using it.

endpoint:

- SHOULD use the lesser of the value reported in Ack Delay field of the ACK
frame and the peer's max_ack_delay transport parameter ({{ack-delay}}).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. Ultimately, this is bounded by another value that the peer advertises (max_ack_delay), so there's no additional safety issue here.

On the first RTT sample in a connection, the smoothed_rtt is set to the
latest_rtt. The peer-reported host delay MUST NOT be used on the first sample,
since correcting for it would result in a smoothed_rtt that is smaller than the
min_rtt.
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 think the way the text flows now makes this statement moot. I'm removing it.

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.

This is a big improvement over what we had. Nice work.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved

An endpoint MUST NOT excessively delay acknowledgements of ack-eliciting
packets. Specifically, an endpoint is expected to enforce a maximum delay to
packets. Specifically, an endpoint is expected to enforce a maximum delay to
avoid causing spurious timeouts at the peer. The maximum ack delay is
Copy link
Member

Choose a reason for hiding this comment

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

The text doesn't say what delay is being "enforced". Maybe:

[...] an endpoint is expected to send acknowledgments within its advertised delay to avoid causing spurious timeouts at its peer.

But maybe you can remove this sentence now that the "contract" text is here.

latest_rtt = latest_rtt - ack_delay
smoothed_rtt = 7/8 * smoothed_rtt + 1/8 * latest_rtt
rttvar_sample = abs(smoothed_rtt - latest_rtt)
corrected_rtt = latest_rtt - ack_delay
Copy link
Member

Choose a reason for hiding this comment

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

Maybe adjusted_rtt instead. "Corrected" implies that there is some notion of "correctness" that applies.

Copy link
Contributor

@ianswett ianswett left a comment

Choose a reason for hiding this comment

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

Thanks for the substantial rework, some comments.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
~~~
latest_rtt = ack_time - send_time_of_largest_acked
~~~

First RTT sample:
An endpoint uses only locally observed times in generating RTT samples and does
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused about where this is going, since we're going to adjust later on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This subsection is talking about generating RTT samples, which do not adjust for host delays.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would just remove this paragraph, because it's potentially confusing and I'm not sure what it's adding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair, it's not necessary yet, so removed.

not adjust for any host delays reported by the peer ({{host-delay}}).

A peer reports host delays for only the largest acknowledged packet in an ACK
frame, which is assumed by subsequent computations of smoothed_rtt and rttvar in
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unclear what the latter half of this sentence means? Maybe remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above -- this section on generating RTT samples doesn't use host delay, but later subsections (srtt, rttvar) do.

Copy link
Contributor

Choose a reason for hiding this comment

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

Bump, I'm still unclear on what the latter half of the sentence is trying to communicate.

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've rewritten the para, so hopefully it reads better.

draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
Copy link
Contributor Author

@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.

Thanks, Ian -- updated.

draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Show resolved Hide resolved
to adjust for any host delays - importantly, for delayed acknowledgements - when
estimating the path RTT. In certain deployments, a packet might be held in the
OS kernel or elsewhere on the host before being processed by the QUIC
stack. Where possible, an endpoint SHOULD include these delays when populating
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is going to need some more work anyway (#2596), but I've changed it to a MAY. What complexities does it create?

draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Show resolved Hide resolved
~~~
latest_rtt = ack_time - send_time_of_largest_acked
~~~

First RTT sample:
An endpoint uses only locally observed times in generating RTT samples and does
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This subsection is talking about generating RTT samples, which do not adjust for host delays.

not adjust for any host delays reported by the peer ({{host-delay}}).

A peer reports host delays for only the largest acknowledged packet in an ACK
frame, which is assumed by subsequent computations of smoothed_rtt and rttvar in
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above -- this section on generating RTT samples doesn't use host delay, but later subsections (srtt, rttvar) do.

draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
Copy link
Contributor Author

@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.

Thanks, Ian, responses below.

draft-ietf-quic-recovery.md Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Show resolved Hide resolved
~~~
latest_rtt = ack_time - send_time_of_largest_acked
~~~

First RTT sample:
An endpoint uses only locally observed times in generating RTT samples and does
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair, it's not necessary yet, so removed.

not adjust for any host delays reported by the peer ({{host-delay}}).

A peer reports host delays for only the largest acknowledged packet in an ACK
frame, which is assumed by subsequent computations of smoothed_rtt and rttvar in
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've rewritten the para, so hopefully it reads better.

Copy link
Contributor

@ianswett ianswett left a comment

Choose a reason for hiding this comment

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

Two small suggestions, but looks good otherwise.

Co-Authored-By: janaiyengar <jri.ietf@gmail.com>
@martinthomson martinthomson added -recovery editorial An issue that does not affect the design of the protocol; does not require consensus. labels Apr 12, 2019
Co-Authored-By: janaiyengar <jri.ietf@gmail.com>
@martinthomson martinthomson removed the editorial An issue that does not affect the design of the protocol; does not require consensus. label Apr 12, 2019
@martinthomson martinthomson added the design An issue that affects the design of the protocol; resolution requires consensus. label Apr 12, 2019
@janaiyengar
Copy link
Contributor Author

Thanks, @ianswett -- I've taken in your suggestions. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-recovery design An issue that affects the design of the protocol; resolution requires consensus.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restructure RTT section
3 participants