-
Notifications
You must be signed in to change notification settings - Fork 117
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
Do not send too much #428
Do not send too much #428
Conversation
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.
Looks good.
Just curious, if send_window
could become negative, should we also change this line?
https://github.com/h2o/quicly/blob/master/lib/quicly.c#L4165
@hfujita Thank you for the review.
I do not think we have to, as the return type of Thinking a bit more, it's my impression that the danger is us accidentally changing code that depends on the signedness of the value; hence 79d6178. |
I see. I just realized that I thought |
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.
Why do we want to retain this property? Why should send_window be allowed to become negative?
That's an interesting point. Not that I have a strong opinion, but this value is not the window retained by the congestion controller; this variable is a member of The variable is initialized in IMO the question here are:
I tend to think that the answer to the first question is yes. Regarding the second question, I do not have an opinion. |
Thanks for your response, @kazuho. After our discussion (offline), I think the following is true:
I agree that we should get this PR in asap however. |
Thank you for the reviews.
I am super glad to hear this analysis, and I think it is correct. |
Confirmed that master behaves as @janaiyengar assumed. https://gist.github.com/kazuho/51981d3a3b36dced97bb52d167ecd573 has logs from each branch. In case of this branch, the first application flight is 13 packets, then for every ACK acking 2 packets, the sender sends 4 packets. In case of master, the first application flight is 20 packets, then it waits for 2 ACKs acking 4 packets, before sending another burst. |
Up until now, quicly has been sending too much, unless the amount of data that can be sent at given moment is the exact multiple of the MTU size.
In effect, quicly is thought to have been rounding up the send window size by the unit of 10 datagrams (the number of datagram buffers supplied by the caller to to
quicly_send
), because whenst_quicly_send_context_t::send_window
is calculated from CWND size and bytes inflight, the value rarely becomes an exact multiple of MTU.When PTO expires or when a time threshold loss detection is triggered while the CWND is full,
send_window
is set to an exact multiple of MTU and therefore quicly has behaved correctly.EDIT. This regression seems to have gone in in #409.