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);
113 tc->cwnd = tc->ssthresh;
114 cd->
K =
K_cubic (cd, tc->cwnd / tc->snd_mss);
123 if (tc->cwnd_acc_bytes > thresh)
125 tc->cwnd += tc->snd_mss;
126 tc->cwnd_acc_bytes = 0;
135 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
141 if (tc->cwnd >= tc->tx_fifo_size)
146 tc->cwnd +=
clib_min (tc->snd_mss, tc->bytes_acked);
153 w_cubic =
W_cubic (cd, t + rtt_sec) * tc->snd_mss;
154 w_aimd = (
u64)
W_est (cd, t, rtt_sec) * tc->snd_mss;
155 if (w_cubic < w_aimd)
161 if (w_cubic > tc->cwnd)
173 thresh = (tc->snd_mss * tc->cwnd) / (w_cubic - tc->cwnd);
176 thresh =
clib_max (thresh, tc->snd_mss);
181 thresh = 50 * tc->cwnd;
190 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
191 tc->ssthresh = tc->snd_wnd;
208 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 * tcp_cc_data(tcp_connection_t *tc)
static void tcp_cwnd_accumulate(tcp_connection_t *tc, u32 thresh, u32 bytes)
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_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)
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 void cubic_rcv_ack(tcp_connection_t *tc)
void newreno_rcv_cong_ack(tcp_connection_t *tc, tcp_cc_ack_t ack_type)
static void cubic_conn_init(tcp_connection_t *tc)