MINOR: quic: implement BBR congestion control algorithm for QUIC

Implement the version 3 of BBR for QUIC specified by the IETF in this draft:

https://datatracker.ietf.org/doc/draft-ietf-ccwg-bbr/

Here is an extract from the Abstract part to sum up the the capabilities of BBR:

BBR ("Bottleneck Bandwidth and Round-trip propagation time") uses recent
measurements of a transport connection's delivery rate, round-trip time, and
packet loss rate to build an explicit model of the network path. BBR then uses
this model to control both how fast it sends data and the maximum volume of data
it allows in flight in the network at any time. Relative to loss-based congestion
control algorithms such as Reno [RFC5681] or CUBIC [RFC9438], BBR offers
substantially higher throughput for bottlenecks with shallow buffers or random
losses, and substantially lower queueing delays for bottlenecks with deep buffers
(avoiding "bufferbloat"). BBR can be implemented in any transport protocol that
supports packet-delivery acknowledgment. Thus far, open source implementations
are available for TCP [RFC9293] and QUIC [RFC9000].

In haproxy, this implementation is considered as still experimental. It depends
on the newly implemented pacing feature.

BBR was asked in GH #2516 by @KazuyaKanemura, @osevan and @kennyZ96.
This commit is contained in:
Frederic Lecaille 2024-09-05 10:33:38 +02:00
parent 472d575950
commit d04adf44dc
4 changed files with 1543 additions and 2 deletions

View File

@ -654,7 +654,8 @@ OPTIONS_OBJS += src/quic_rx.o src/mux_quic.o src/h3.o src/quic_tx.o \
src/cfgparse-quic.o src/qmux_trace.o src/qpack-enc.o \
src/qpack-tbl.o src/h3_stats.o src/quic_stats.o \
src/quic_fctl.o src/cbuf.o src/quic_rules.o \
src/quic_token.o src/quic_pacing.o src/quic_cc_drs.o
src/quic_token.o src/quic_pacing.o src/quic_cc_drs.o \
src/quic_cc_bbr.o
endif
ifneq ($(USE_QUIC_OPENSSL_COMPAT:0=),)

View File

@ -36,6 +36,7 @@
extern struct quic_cc_algo quic_cc_algo_nr;
extern struct quic_cc_algo quic_cc_algo_cubic;
extern struct quic_cc_algo quic_cc_algo_bbr;
extern struct quic_cc_algo *default_quic_cc_algo;
/* Fake algorithm with its fixed window */
@ -81,6 +82,7 @@ struct quic_cc_event {
enum quic_cc_algo_type {
QUIC_CC_ALGO_TP_NEWRENO,
QUIC_CC_ALGO_TP_CUBIC,
QUIC_CC_ALGO_TP_BBR,
QUIC_CC_ALGO_TP_NOCC,
};
@ -88,7 +90,7 @@ struct quic_cc {
/* <conn> is there only for debugging purpose. */
struct quic_conn *qc;
struct quic_cc_algo *algo;
uint32_t priv[20];
uint32_t priv[158];
};
struct quic_cc_path {
@ -118,6 +120,8 @@ struct quic_cc_path {
/* Burst size if pacing is used. Not used if congestion algo handle pacing itself. */
uint32_t pacing_burst;
uint64_t delivery_rate; /* bytes per second */
size_t send_quantum;
uint32_t recovery_start_ts;
};
struct quic_cc_algo {

View File

@ -101,6 +101,8 @@ static inline void quic_cc_path_init(struct quic_cc_path *path, int ipv4, unsign
path->pacing_burst = burst;
quic_cc_init(&path->cc, algo, qc);
path->delivery_rate = 0;
path->send_quantum = 64 * 1024;
path->recovery_start_ts = TICK_ETERNITY;
}
/* Return the remaining <room> available on <path> QUIC path for prepared data

1534
src/quic_cc_bbr.c Normal file

File diff suppressed because it is too large Load Diff