BUG/MEDIUM: quic: Wrong K CUBIC calculation.
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 12 Feb 2024 10:07:54 +0000 (11:07 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Feb 2024 15:39:46 +0000 (16:39 +0100)
commita09215644988b4131d5a84af95edad388da9e6f3
tree734a709a5837bc5dbe97a59b8850bf481696a037
parent38c93f27bac14b82ca7565fa7fc0263f6ecef494
BUG/MEDIUM: quic: Wrong K CUBIC calculation.

The formula for K CUBIC calculation is as follows:

K = cubic_root(W_max * (1 - beta_quic) / C).

Note that this does not match the comment. But the aim of this patch is to not
hide a bug inside another patch to update this K CUBIC calculation.

The unit of C is bytes/s^3 (or segments/s^3). And we want to store K as
milliseconds. So, the conversion inside the cubic_root() to convert seconds in
milliseconds is wrong. The unit used here is bytes/(ms/1000)^3 or
bytes*1000^3/ms^3. That said, it is preferable to compute K as seconds, then
convert to milliseconds as done by this patch.

Must be backported as far as 2.6.

(cherry picked from commit 406c63ba44666deb7f09a36748039aaafa8a7d5d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/quic_cc_cubic.c