lsquic_cubic.h revision 5392f7a3
1229fce07SDmitri Tikhonov/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc. See LICENSE. */ 250aadb33SDmitri Tikhonov/* 350aadb33SDmitri Tikhonov * lsquic_cubic.h -- CUBIC congestion control protocol. 450aadb33SDmitri Tikhonov */ 550aadb33SDmitri Tikhonov 650aadb33SDmitri Tikhonov#ifndef LSQUIC_CUBIC_H 750aadb33SDmitri Tikhonov#define LSQUIC_CUBIC_H 1 850aadb33SDmitri Tikhonov 95392f7a3SLiteSpeed Techstruct lsquic_conn; 105392f7a3SLiteSpeed Tech 1150aadb33SDmitri Tikhonovstruct lsquic_cubic { 1250aadb33SDmitri Tikhonov lsquic_time_t cu_min_delay; 1350aadb33SDmitri Tikhonov lsquic_time_t cu_epoch_start; 14bfc7bfd8SDmitri Tikhonov double cu_K; 15bfc7bfd8SDmitri Tikhonov unsigned long cu_origin_point; 16bfc7bfd8SDmitri Tikhonov unsigned long cu_last_max_cwnd; 17bfc7bfd8SDmitri Tikhonov unsigned long cu_cwnd; 18bfc7bfd8SDmitri Tikhonov unsigned long cu_tcp_cwnd; 19bfc7bfd8SDmitri Tikhonov unsigned long cu_ssthresh; 205392f7a3SLiteSpeed Tech const struct lsquic_conn 215392f7a3SLiteSpeed Tech *cu_conn; /* Used for logging */ 225392f7a3SLiteSpeed Tech const struct lsquic_rtt_stats 235392f7a3SLiteSpeed Tech *cu_rtt_stats; 2450aadb33SDmitri Tikhonov enum cubic_flags { 2550aadb33SDmitri Tikhonov CU_TCP_FRIENDLY = (1 << 0), 2650aadb33SDmitri Tikhonov } cu_flags; 27bfc7bfd8SDmitri Tikhonov unsigned cu_sampling_rate; 2850aadb33SDmitri Tikhonov lsquic_time_t cu_last_logged; 2950aadb33SDmitri Tikhonov}; 3050aadb33SDmitri Tikhonov 31bfc7bfd8SDmitri Tikhonov#define DEFAULT_CUBIC_FLAGS (CU_TCP_FRIENDLY) 32bfc7bfd8SDmitri Tikhonov 33bfc7bfd8SDmitri Tikhonov#define TCP_MSS 1460 3450aadb33SDmitri Tikhonov 355392f7a3SLiteSpeed Techextern const struct cong_ctl_if lsquic_cong_cubic_if; 3650aadb33SDmitri Tikhonov 3750aadb33SDmitri Tikhonovvoid 385392f7a3SLiteSpeed Techlsquic_cubic_set_flags (struct lsquic_cubic *cubic, enum cubic_flags flags); 3950aadb33SDmitri Tikhonov 4050aadb33SDmitri Tikhonov#endif 41