mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 23:31:40 +02:00
This patch implements an algorithm which may be used by congestion algorithms for QUIC to estimate the current delivery rate of a sender. It is at least used by BBR and could be used by others congestion algorithms as cubic. This algorithm was specified by an RFC draft here: https://datatracker.ietf.org/doc/html/draft-cheng-iccrg-delivery-rate-estimation before being merged into BBR v3 here: https://datatracker.ietf.org/doc/html/draft-cardwell-ccwg-bbr#section-4.5.2.2
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
#include <inttypes.h>
|
|
|
|
#include <haproxy/window_filter.h>
|
|
|
|
/* Per-ACK Rate Sample State */
|
|
struct quic_cc_rs {
|
|
uint64_t delivered;
|
|
uint64_t prior_delivered;
|
|
uint64_t tx_in_flight;
|
|
uint64_t lost;
|
|
uint64_t prior_lost;
|
|
int64_t last_end_seq;
|
|
uint32_t interval;
|
|
uint32_t prior_time;
|
|
uint32_t send_elapsed;
|
|
uint32_t ack_elapsed;
|
|
uint32_t is_app_limited;
|
|
};
|
|
|
|
/* Delivery rate sampling */
|
|
struct quic_cc_drs {
|
|
struct quic_cc_rs rs;
|
|
struct wf wf;
|
|
uint64_t round_count;
|
|
uint64_t next_round_delivered;
|
|
uint64_t delivered;
|
|
uint64_t lost;
|
|
int64_t last_seq;
|
|
uint32_t delivered_time;
|
|
uint32_t first_sent_time;
|
|
int is_cwnd_limited; /* boolean */
|
|
int app_limited; /* boolean */
|
|
};
|
|
|
|
void quic_cc_drs_init(struct quic_cc_drs *drs);
|
|
void quic_cc_drs_on_pkt_sent(struct quic_cc_path *path,
|
|
struct quic_tx_packet *pkt, struct quic_cc_drs *drs);
|
|
void quic_cc_drs_update_rate_sample(struct quic_cc_drs *drs,
|
|
struct quic_tx_packet *pkt);
|
|
void quic_cc_drs_on_ack_recv(struct quic_cc_drs *drs, struct quic_cc_path *path,
|
|
uint64_t pkt_delivered);
|