19 #define beta_cubic 0.7 21 #define west_const (3 * (1 - beta_cubic) / (1 + beta_cubic)) 97 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
100 w_max = tc->cwnd / tc->snd_mss;
111 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
123 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
125 tc->cwnd = tc->ssthresh;
126 cd->
K =
K_cubic (cd, tc->cwnd / tc->snd_mss);
135 if (tc->cwnd_acc_bytes > thresh)
137 tc->cwnd += tc->snd_mss;
138 tc->cwnd_acc_bytes = 0;
147 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
153 if (tc->cwnd >= tc->tx_fifo_size)
158 tc->cwnd +=
clib_min (tc->snd_mss, tc->bytes_acked);
165 w_cubic =
W_cubic (cd, t + rtt_sec) * tc->snd_mss;
166 w_aimd = (
u64)
W_est (cd, t, rtt_sec) * tc->snd_mss;
167 if (w_cubic < w_aimd)
173 if (w_cubic > tc->cwnd)
185 thresh = (tc->snd_mss * tc->cwnd) / (w_cubic - tc->cwnd);
188 thresh =
clib_max (thresh, tc->snd_mss);
193 thresh = 50 * tc->cwnd;
202 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
203 tc->ssthresh = tc->snd_wnd;
220 if (
unformat (input,
"no-fast-convergence"))
static u64 W_cubic(cubic_data_t *cd, f64 t)
RFC 8312 Eq.
struct cubic_data_ cubic_data_t
static f64 transport_time_now(u32 thread_index)
f64 K
time period (in seconds) needed to increase the current window size to W_max if there are no further ...
static uword cubic_unformat_config(unformat_input_t *input)
struct _tcp_connection tcp_connection_t
static u32 W_est(cubic_data_t *cd, f64 t, f64 rtt)
RFC 8312 Eq.
static void cubic_cwnd_accumulate(tcp_connection_t *tc, u32 thresh, u32 bytes_acked)
#define TCP_TICK
TCP tick period (s)
u32 w_max
Inflection point of the cubic function (in snd_mss segments)
#define VLIB_INIT_FUNCTION(x)
static f64 cubic_time(u32 thread_index)
#define tcp_in_slowstart(tc)
static void cubic_recovered(tcp_connection_t *tc)
static void cubic_loss(tcp_connection_t *tc)
static void * tcp_cc_data(tcp_connection_t *tc)
static void tcp_cwnd_accumulate(tcp_connection_t *tc, u32 thresh, u32 bytes)
void newreno_rcv_cong_ack(tcp_connection_t *tc, tcp_cc_ack_t ack_type, tcp_rate_sample_t *rs)
static f64 K_cubic(cubic_data_t *cd, u32 wnd)
RFC 8312 Eq.
static void cubic_congestion(tcp_connection_t *tc)
f64 t_start
time (in sec) since the start of current congestion avoidance
struct cubic_cfg_ cubic_cfg_t
static void cubic_rcv_ack(tcp_connection_t *tc, tcp_rate_sample_t *rs)
STATIC_ASSERT(sizeof(cubic_data_t)<=TCP_CC_DATA_SZ,"cubic data len")
void tcp_cc_algo_register(tcp_cc_algorithm_type_e type, const tcp_cc_algorithm_t *vft)
Register exiting cc algo type.
struct _tcp_cc_algorithm tcp_cc_algorithm_t
clib_error_t * cubic_init(vlib_main_t *vm)
static u32 tcp_initial_cwnd(const tcp_connection_t *tc)
Initial cwnd as per RFC5681.
static u32 tcp_loss_wnd(const tcp_connection_t *tc)
static void cubic_conn_init(tcp_connection_t *tc)