-
Notifications
You must be signed in to change notification settings - Fork 204
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
Clarify OnAckReceived pseudocode #2140
Conversation
9385133
to
f9ad5a9
Compare
Split the |
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.
A minor nit, but this is a nice cleanup. Thanks! I'll approve, but @ianswett should take a look as well.
@@ -716,6 +717,9 @@ Pseudocode for OnAckReceived and UpdateRtt follow: | |||
|
|||
~~~ | |||
OnAckReceived(ack): | |||
largest_acked_packet = max(largest_acked_packet, |
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.
I think this accurately describes the text we have, but I think we should add some text that you MAY use the largest acked from the most recent ACK, which could reduce spurious retransmits when one packet arrives far out of order?
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.
To clarify, I'm ok doing this in a follow up PR.
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.
you MAY use the largest acked from the most recent ACK, which could reduce spurious retransmits when one packet arrives far out of order
Any reason not to make this the sole recommendation? I had some trouble coming up with a case where that might occur, which is why I didn't take that route originally, but I think I see it now: when a reordered ACK newly acknowledges a packet such that the newly acknowledged packet is > ack.largest_acked - kPacketThreshold, but <= largest_acked_packet - kPacketThreshold.
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.
Er, wait, that's nonsense. Still having trouble seeing the case.
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.
It's the case when one packet is far out of order, and then subsequent packets arrive in order. ie: 100 is received, then 1, 2, 3, 4, 5, etc. I don't fully understand the cause, but I've seen small UDP packets jump ahead of large ones in a number of traces.
But I suspect Jana and I will merge this as is and we can add follow-up text about that issue if we think it's valuable.
I ran into a few points of confusion in the existing code:
largest_acked_packet
is not explicitProcessECN
references elements ofsent_packets
after they are removed byOnPacketAcked
DetectLostPackets
is passed an undefined variableThe fixes are trivial, except for the last: it isn't clear to me whether
DetectLostPackets
was intended to be called withack.largest_acked
orlargest_acked_packet
. These only differ when ACKs are reordered, and because the prior invocation ofDetectLostPackets
with a higherlargest_acked
would have already deemed lost all packets that the later invocation might deem lost, I don't think the behavior differs even then. Hence, removing the argument and consistently referencinglargest_acked_packet
seems to be the simpler option.