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

Disable quiche pacing while is not actually performed by curl #11068

Closed
wants to merge 1 commit into from

Conversation

francoismichel
Copy link
Contributor

Hi,

Just a one-line commit that disables pacing in the quiche library as currently curl does not
perform pacing when sending the QUIC packets.

When pacing is enabled, quiche assumes that packet are sent at the asked time,
see https://github.com/cloudflare/quiche/blob/6cef26b946695300b214cd837a92dc1774c0ba84/quiche/src/recovery/mod.rs#L376

If packets are sent earlier than the asked time, it can lead to wrong RTT estimations (undersestimations), as the RTT estimation will be based on the packet sent time. At its turn, this can have an impact on the hystart algorithm
afterwards that is currently enabled too, and quiche may exit the slow-start too early and underestimate the link bandwidth.

@github-actions github-actions bot added the HTTP/3 h3 or quic related label May 3, 2023
@bagder
Copy link
Member

bagder commented May 3, 2023

What would it take to do the reverse? I mean actually comply with the pacing?

@francoismichel
Copy link
Contributor Author

francoismichel commented May 3, 2023

quiche stores the expected sending time of a packet in the send_info structure here:

nwritten = quiche_conn_send(ctx->qconn, buf, buflen, &x->send_info);

In curl, the buffer containing the send_info seems regularly discarded and overwritten in a for loop in the call to Curl_bufq_sipn hereunder, so we lose this sending time information (the info of interest is stored in readx.sendinfo):

nread = Curl_bufq_sipn(&ctx->q.sendbuf, 0,
read_pkt_to_send, &readx, &result);

I don't know well all the internals of curl, but we would need a way to store and keep this send_infoalong with the packet. One way to do so would be to add a sending_time or similar information to be returned by Curl_bufq_peek, but this will probably imply quite a lot of code changes.
Another way would be to not queue quiche packets in the bufq structure until their actual sending time, but this would require a new level of buffering in curl_quiche.c...

Maybe there are other simpler ways around this. I could have a look at it at some point but right now I am busy with a lot of urgent stuff. :-(

Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

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

Seems sensible!

@bagder
Copy link
Member

bagder commented May 3, 2023

Thanks!

@bagder bagder closed this in 89f6faf May 3, 2023
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTTP/3 h3 or quic related
Development

Successfully merging this pull request may close these issues.

None yet

2 participants