Author: sbruno
Date: Thu May  3 15:01:27 2018
New Revision: 333211
URL: https://svnweb.freebsd.org/changeset/base/333211

Log:
  cc_cubic:
  - Update cubic parameters to draft-ietf-tcpm-cubic-04
  
  Submitted by: Matt Macy <mm...@mattmacy.io>
  Reviewed by:  lstewart
  Differential Revision:        https://reviews.freebsd.org/D10556

Modified:
  head/sys/netinet/cc/cc_cubic.h

Modified: head/sys/netinet/cc/cc_cubic.h
==============================================================================
--- head/sys/netinet/cc/cc_cubic.h      Thu May  3 14:48:42 2018        
(r333210)
+++ head/sys/netinet/cc/cc_cubic.h      Thu May  3 15:01:27 2018        
(r333211)
@@ -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 @@ extern int hz;
 
 /*
  * 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 @@ theoretical_cubic_k(double wmax_pkts)
 
        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 @@ theoretical_tf_cwnd(int ticks_since_cong, int rtt_tick
     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 @@ reno_cwnd(int ticks_since_cong, int rtt_ticks, unsigne
 /*
  * 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 @@ tf_cwnd(int ticks_since_cong, int rtt_ticks, unsigned 
 {
 
        /* 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_ */
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to