Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Include ack_delay when deciding with PN space to arm PTO for #3666
Include ack_delay when deciding with PN space to arm PTO for #3666
Changes from all commits
f2d8181
5e8f35e
0c3f6fc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it was great before, but I think that this change obfuscates things.
I think that the inclusion of the max_ack_delay argument overloads GetEarliestTimeAndSpace in a way that just highlights how the dual purpose to which the function is applied is not appropriate.
We use this function for working out two things:
The former is not affected by max_ack_delay. The PTO calculation is, but this change adds max_ack_delay to the baseline rather than the PTO calculation itself.
For one, that's a fundamental change in logic for one (because PTO number 2 used to include 2*max_ack_delay and now it doesn't. Maybe that was a bug that this fixes, but that needs to be clear.
However, the main problem is the way that this code now communicates its intent. If the intent is to start with a baseline (t_sent) and to add a PTO (RTT + 4*rttvar) that is then doubled each time, and only then compensate for ACK delay, you want to show your work, not hide it:
Or is it, with maybe a fix for the packet number space issue...
The trick is that the code that triggers SendOneOrTwoAckElicitingPackets() needs to follow the same logic. But that too is too clever. Basing that on the reference time (the time you sent the last packet) rather than the time that the timer is expected to pop is obtuse (even if it is correct as you currently formulate it).
Why not provide a CalculatePtoTime() function and use that? This code doesn't need to be optimized, so you can calculate everything always.
This needs tweaking for the case where sent_time == 0, but that is just a case of factoring out the PTO interval calculation. Note that you aren't adding max_ack_delay in that case, which is another difference.