123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- #ifndef NGTCP2_BBR_H
- #define NGTCP2_BBR_H
- #ifdef HAVE_CONFIG_H
- # include <config.h>
- #endif
- #include <ngtcp2/ngtcp2.h>
- #include "ngtcp2_cc.h"
- #include "ngtcp2_window_filter.h"
- typedef struct ngtcp2_rst ngtcp2_rst;
- typedef enum ngtcp2_bbr_state {
- NGTCP2_BBR_STATE_STARTUP,
- NGTCP2_BBR_STATE_DRAIN,
- NGTCP2_BBR_STATE_PROBE_BW_DOWN,
- NGTCP2_BBR_STATE_PROBE_BW_CRUISE,
- NGTCP2_BBR_STATE_PROBE_BW_REFILL,
- NGTCP2_BBR_STATE_PROBE_BW_UP,
- NGTCP2_BBR_STATE_PROBE_RTT,
- } ngtcp2_bbr_state;
- typedef enum ngtcp2_bbr_ack_phase {
- NGTCP2_BBR_ACK_PHASE_ACKS_PROBE_STARTING,
- NGTCP2_BBR_ACK_PHASE_ACKS_PROBE_STOPPING,
- NGTCP2_BBR_ACK_PHASE_ACKS_PROBE_FEEDBACK,
- NGTCP2_BBR_ACK_PHASE_ACKS_REFILLING,
- } ngtcp2_bbr_ack_phase;
- typedef struct ngtcp2_cc_bbr {
- ngtcp2_cc cc;
- uint64_t initial_cwnd;
- ngtcp2_rst *rst;
- ngtcp2_rand rand;
- ngtcp2_rand_ctx rand_ctx;
-
- ngtcp2_window_filter max_bw_filter;
- ngtcp2_window_filter extra_acked_filter;
- ngtcp2_duration min_rtt;
- ngtcp2_tstamp min_rtt_stamp;
- ngtcp2_tstamp probe_rtt_done_stamp;
- int probe_rtt_round_done;
- uint64_t prior_cwnd;
- int idle_restart;
- ngtcp2_tstamp extra_acked_interval_start;
- uint64_t extra_acked_delivered;
-
- int loss_in_round;
- uint64_t bw_latest;
- uint64_t inflight_latest;
-
- uint64_t bw_lo;
- uint64_t inflight_lo;
-
- uint64_t next_round_delivered;
- int round_start;
- uint64_t round_count;
-
- uint64_t full_bw;
- size_t full_bw_count;
- int full_bw_reached;
- int full_bw_now;
-
- uint64_t pacing_gain_h;
- ngtcp2_bbr_state state;
- uint64_t cwnd_gain_h;
- int loss_round_start;
- uint64_t loss_round_delivered;
- uint64_t rounds_since_bw_probe;
- uint64_t max_bw;
- uint64_t bw;
- uint64_t cycle_count;
- uint64_t extra_acked;
- uint64_t bytes_lost_in_round;
- size_t loss_events_in_round;
- uint64_t offload_budget;
- uint64_t probe_up_cnt;
- ngtcp2_tstamp cycle_stamp;
- ngtcp2_bbr_ack_phase ack_phase;
- ngtcp2_duration bw_probe_wait;
- int bw_probe_samples;
- size_t bw_probe_up_rounds;
- uint64_t bw_probe_up_acks;
- uint64_t inflight_hi;
- int probe_rtt_expired;
- ngtcp2_duration probe_rtt_min_delay;
- ngtcp2_tstamp probe_rtt_min_stamp;
- int in_loss_recovery;
- uint64_t round_count_at_recovery;
- uint64_t max_inflight;
- ngtcp2_tstamp congestion_recovery_start_ts;
- } ngtcp2_cc_bbr;
- void ngtcp2_cc_bbr_init(ngtcp2_cc_bbr *bbr, ngtcp2_log *log,
- ngtcp2_conn_stat *cstat, ngtcp2_rst *rst,
- ngtcp2_tstamp initial_ts, ngtcp2_rand rand,
- const ngtcp2_rand_ctx *rand_ctx);
- #endif
|