Index: head/sys/netinet/cc/cc_cubic.h =================================================================== --- head/sys/netinet/cc/cc_cubic.h +++ head/sys/netinet/cc/cc_cubic.h @@ -51,23 +51,23 @@ /* 0.5 << CUBIC_SHIFT. */ #define RENO_BETA 128 -/* ~0.8 << CUBIC_SHIFT. */ -#define CUBIC_BETA 204 +/* ~0.7 << CUBIC_SHIFT. */ +#define CUBIC_BETA 179 -/* ~0.2 << CUBIC_SHIFT. */ -#define ONE_SUB_CUBIC_BETA 51 +/* ~0.3 << CUBIC_SHIFT. */ +#define ONE_SUB_CUBIC_BETA 77 /* 3 * ONE_SUB_CUBIC_BETA. */ -#define THREE_X_PT2 153 +#define THREE_X_PT3 231 /* (2 << CUBIC_SHIFT) - ONE_SUB_CUBIC_BETA. */ -#define TWO_SUB_PT2 461 +#define TWO_SUB_PT3 435 /* ~0.4 << CUBIC_SHIFT. */ #define CUBIC_C_FACTOR 102 -/* CUBIC fast convergence factor: ~0.9 << CUBIC_SHIFT. */ -#define CUBIC_FC_FACTOR 230 +/* CUBIC fast convergence factor: (1+beta_cubic)/2. */ +#define CUBIC_FC_FACTOR 217 /* Don't trust s_rtt until this many rtt samples have been taken. */ #define CUBIC_MIN_RTT_SAMPLES 8 @@ -79,9 +79,8 @@ /* * Implementation based on the formulae found in the CUBIC Internet Draft - * "draft-rhee-tcpm-cubic-02". + * "draft-ietf-tcpm-cubic-04". * - * Note BETA used in cc_cubic is equal to (1-beta) in the I-D */ static __inline float @@ -91,7 +90,7 @@ C = 0.4; - return (pow((wmax_pkts * 0.2) / C, (1.0 / 3.0)) * pow(2, CUBIC_SHIFT)); + return (pow((wmax_pkts * 0.3) / C, (1.0 / 3.0)) * pow(2, CUBIC_SHIFT)); } static __inline unsigned long @@ -120,7 +119,7 @@ uint32_t smss) { - return ((wmax * 0.8) + ((3 * 0.2) / (2 - 0.2) * + return ((wmax * 0.7) + ((3 * 0.3) / (2 - 0.3) * (ticks_since_cong / (float)rtt_ticks) * smss)); } @@ -232,7 +231,7 @@ /* * Compute an approximation of the "TCP friendly" cwnd some number of ticks * after a congestion event that is designed to yield the same average cwnd as - * NewReno while using CUBIC's beta of 0.8. RTT should be the average RTT + * NewReno while using CUBIC's beta of 0.7. RTT should be the average RTT * estimate for the path measured over the previous congestion epoch and wmax is * the value of cwnd at the last congestion event. */ @@ -242,8 +241,8 @@ { /* Equation 4 of I-D. */ - return (((wmax * CUBIC_BETA) + (((THREE_X_PT2 * ticks_since_cong * - smss) << CUBIC_SHIFT) / TWO_SUB_PT2 / rtt_ticks)) >> CUBIC_SHIFT); + return (((wmax * CUBIC_BETA) + (((THREE_X_PT3 * ticks_since_cong * + smss) << CUBIC_SHIFT) / TWO_SUB_PT3 / rtt_ticks)) >> CUBIC_SHIFT); } #endif /* _NETINET_CC_CUBIC_H_ */