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

pacing #452

Merged
merged 39 commits into from
Mar 12, 2024
Merged

pacing #452

merged 39 commits into from
Mar 12, 2024

Conversation

kazuho
Copy link
Member

@kazuho kazuho commented May 17, 2021

Things to consider:

  • Should burst-size (10 mtu) be configurable?
  • As of dc13a40, pace is 2x flow rate in slow start phase, 1.2x in congestion avoidance phase. ATM, pace is 2x flow rate regardless of in slow start. Use smaller multiplier for congestion avoidance phase? Pacing rate is 2x for both slow start and congestion avoidance phase; for rationale, see the discussion below.
  • Dispatch resolution is max(packets_per_ms, 1), meaning that when the flow rate is small, quicly sends one packet at a time. Should we change that to 2 packets or something? When the flow rate is small, two packets are dispatched at once, see comment below.
  • At the moment, the pacer precedes the flow rate by 10mtu to 11mtu. Should we change it to 9mtu to 10mtu? -> done in c9be530. Pacer sends burst of 10mtu, then sends 2 packets in batch so that the pace would precede the flow rate by between 8mtu and 10 mtu.

ToDo:

  • Add end-to-end tests? But what kind of? Done.

@kazuho kazuho mentioned this pull request May 17, 2021
2 tasks
@kazuho kazuho requested a review from janaiyengar May 17, 2021 16:03
@kazuho kazuho mentioned this pull request Nov 4, 2023
lib/cc-reno.c Outdated Show resolved Hide resolved
Copy link
Member Author

@kazuho kazuho left a comment

Choose a reason for hiding this comment

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

Considering that the pacer is an additional restriction on how much we can send (on top of CWND), maybe we need need to update when the delivery rate estimator starts running.

FWIW, current logic is do_send is:

        if (can_send_stream_data &&
            (s->num_datagrams == s->max_datagrams || conn->egress.loss.sentmap.bytes_in_flight >= conn->egress.cc.cwnd)) {
            /* as the flow is CWND-limited, start delivery rate estimator */
            quicly_ratemeter_in_cwnd_limited(&conn->egress.ratemeter, s->first_packet_number);
        } else {
            quicly_ratemeter_not_cwnd_limited(&conn->egress.ratemeter, conn->egress.packet_number);
        }

As you can see, pacer is not taken into consideration (as the name of the function is becoming weird).

PS. This issue has been addressed in c8ec914.

@kazuho
Copy link
Member Author

kazuho commented Mar 9, 2024

I think we are now ready to merge this PR.

The final design details are:

  • Packets are paced at millisecond granularity.
  • If flow rate is below 10mtu / msec, burst of 10 packets is allowed.
  • When rate is below 2mtu / msec, timing is adjusted so that 2 packets are emitted at once. Doing so reduces the frequency of packet emission leading to less CPU usage, while having minimal impact on the growth of CWND during slot start (as receivers send one ACK per two packets being received, ACKs will arrive at the same moment regardless of if the sender delays the emission of the first packet to the moment the 2nd packet is dispatched).
    Screenshot 2024-03-09 at 17 13 50

@kazuho kazuho mentioned this pull request Mar 10, 2024
3 tasks
@kazuho kazuho merged commit 251467d into master Mar 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant