19 #define beta_cubic 0.7 21 #define west_const (3 * (1 - beta_cubic) / (1 + beta_cubic)) 31 .ssthresh = 0x7FFFFFFFU,
99 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
102 w_max = tc->cwnd / tc->snd_mss;
108 tc->cwnd = tc->ssthresh;
114 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
119 cd->
w_max = tc->cwnd / tc->snd_mss;
125 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
127 tc->cwnd = tc->ssthresh;
128 cd->
K =
K_cubic (cd, tc->cwnd / tc->snd_mss);
137 if (tc->cwnd_acc_bytes > thresh)
139 tc->cwnd += tc->snd_mss;
140 tc->cwnd_acc_bytes = 0;
149 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
155 if (tc->cwnd >= tc->tx_fifo_size)
160 tc->cwnd += tc->bytes_acked;
167 w_cubic =
W_cubic (cd, t + rtt_sec) * tc->snd_mss;
168 w_aimd = (
u64)
W_est (cd, t, rtt_sec) * tc->snd_mss;
169 if (w_cubic < w_aimd)
175 if (w_cubic > tc->cwnd)
187 thresh = (tc->snd_mss * tc->cwnd) / (w_cubic - tc->cwnd);
190 thresh =
clib_max (thresh, tc->snd_mss);
195 thresh = 50 * tc->cwnd;
204 cubic_data_t *cd = (cubic_data_t *)
tcp_cc_data (tc);
224 if (
unformat (input,
"no-fast-convergence"))
226 else if (
unformat (input,
"ssthresh %u", &ssthresh))
static u64 W_cubic(cubic_data_t *cd, f64 t)
RFC 8312 Eq.
static clib_time_type_t transport_time_now(u32 thread_index)
struct cubic_data_ cubic_data_t
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)
STATIC_ASSERT(sizeof(cubic_data_t)<=TCP_CC_DATA_SZ, "cubic data len")
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)
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)