]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Set new defaults for congestion control parameters.
authorMike Perry <mikeperry-git@torproject.org>
Fri, 21 Jan 2022 15:17:20 +0000 (15:17 +0000)
committerMike Perry <mikeperry-git@torproject.org>
Tue, 22 Feb 2022 19:28:35 +0000 (19:28 +0000)
Defaults determined from Shadow experimentation.

More parameter functionality changes to follow.

src/core/or/congestion_control_common.c
src/core/or/congestion_control_common.h
src/core/or/congestion_control_flow.c
src/core/or/congestion_control_vegas.c

index 6d4f34cff85a644552937f2254e9deab7f78d136..09c6c04bf32ef59d84cab1e55a891b9b8b1a7cef 100644 (file)
  *
  * More details for each of the parameters can be found in proposal 324,
  * section 6.5 including tuning notes. */
-#define CIRCWINDOW_INIT (500)
-#define SENDME_INC_DFLT (50)
+#define SENDME_INC_DFLT (TLS_RECORD_MAX_CELLS)
+#define CIRCWINDOW_INIT (4*SENDME_INC_DFLT)
+
 #define CC_ALG_DFLT (CC_ALG_SENDME)
 #define CC_ALG_DFLT_ALWAYS (CC_ALG_VEGAS)
 
-#define CWND_INC_DFLT (50)
-#define CWND_INC_PCT_SS_DFLT (100)
+#define CWND_INC_DFLT (TLS_RECORD_MAX_CELLS)
+#define CWND_INC_PCT_SS_DFLT (50)
 #define CWND_INC_RATE_DFLT (1)
+
+#define CWND_MIN_DFLT (SENDME_INC_DFLT)
 #define CWND_MAX_DFLT (INT32_MAX)
-#define CWND_MIN_DFLT (MAX(100, SENDME_INC_DFLT))
 
 #define BWE_SENDME_MIN_DFLT (5)
 #define EWMA_CWND_COUNT_DFLT (2)
@@ -138,8 +140,8 @@ congestion_control_new_consensus_params(const networkstatus_t *ns)
         CWND_MAX_MIN,
         CWND_MAX_MAX);
 
-#define SENDME_INC_MIN 10
-#define SENDME_INC_MAX (1000)
+#define SENDME_INC_MIN 1
+#define SENDME_INC_MAX (255)
   cc_sendme_inc =
     networkstatus_get_param(NULL, "cc_sendme_inc",
         SENDME_INC_DFLT,
@@ -171,7 +173,7 @@ congestion_control_init_params(congestion_control_t *cc,
   const or_options_t *opts = get_options();
   cc->sendme_inc = params->sendme_inc_cells;
 
-#define CWND_INIT_MIN 100
+#define CWND_INIT_MIN SENDME_INC_DFLT
 #define CWND_INIT_MAX (10000)
   cc->cwnd =
     networkstatus_get_param(NULL, "cc_cwnd_init",
@@ -203,7 +205,7 @@ congestion_control_init_params(congestion_control_t *cc,
         CWND_INC_RATE_MIN,
         CWND_INC_RATE_MAX);
 
-#define CWND_MIN_MIN 20
+#define CWND_MIN_MIN SENDME_INC_DFLT
 #define CWND_MIN_MAX (1000)
   cc->cwnd_min =
     networkstatus_get_param(NULL, "cc_cwnd_min",
index 936cb5887c791ecf4139ad56daf18860228f14f9..1e5a00c9426891d37bf857960dc1515651aedfe6 100644 (file)
 #include "core/or/crypt_path_st.h"
 #include "core/or/circuit_st.h"
 
+/* The maximum whole number of cells that can fit in a
+ * full TLS record. This is 31. */
+#define TLS_RECORD_MAX_CELLS ((16 * 1024) / CELL_MAX_NETWORK_SIZE)
+
 typedef struct congestion_control_t congestion_control_t;
 
 /** Wrapper for the free function, set the CC pointer to NULL after free */
index c8b5ba247359676c128fb75989fb351ff05d839d..3a3a9522fd322bba7202b885c6c2ad5ff17b6531 100644 (file)
@@ -116,7 +116,7 @@ flow_control_new_consensus_params(const networkstatus_t *ns)
       CC_XON_RATE_BYTES_MAX)*RELAY_PAYLOAD_SIZE;
 
 #define CC_XON_EWMA_CNT_DFLT (2)
-#define CC_XON_EWMA_CNT_MIN (1)
+#define CC_XON_EWMA_CNT_MIN (2)
 #define CC_XON_EWMA_CNT_MAX (100)
   xon_ewma_cnt = networkstatus_get_param(ns, "cc_xon_ewma_cnt",
       CC_XON_EWMA_CNT_DFLT,
index 3206821f4c09ec7a71671cbe4cc8c5f4ffaa4a60..8e13499aff4c31ece60171de32674079ea524382 100644 (file)
 #include "core/or/channel.h"
 #include "feature/nodelist/networkstatus.h"
 
-#define VEGAS_GAMMA(cc)   (6*(cc)->sendme_inc)
-#define VEGAS_ALPHA(cc)   (3*(cc)->sendme_inc)
-#define VEGAS_BETA(cc)    (6*(cc)->sendme_inc)
+#define OUTBUF_CELLS (2*TLS_RECORD_MAX_CELLS)
 
-#define VEGAS_BDP_MIX_PCT       0
+#define VEGAS_ALPHA(cc)   (3*OUTBUF_CELLS-TLS_RECORD_MAX_CELLS)
+#define VEGAS_BETA(cc)    (3*OUTBUF_CELLS)
+#define VEGAS_GAMMA(cc)   (3*OUTBUF_CELLS)
+
+#define VEGAS_BDP_MIX_PCT       100
 
 /**
  * The original TCP Vegas used only a congestion window BDP estimator. We