Commit 0a6cde87 authored by Mike Perry's avatar Mike Perry
Browse files

Set new defaults for congestion control parameters.

Defaults determined from Shadow experimentation.

More parameter functionality changes to follow.
parent d4cf3fad
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -35,16 +35,18 @@
 *
 * 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",
+4 −0
Original line number Diff line number Diff line
@@ -13,6 +13,10 @@
#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 */
+1 −1
Original line number Diff line number Diff line
@@ -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,
+6 −4
Original line number Diff line number Diff line
@@ -23,11 +23,13 @@
#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