Tor 0.4.9.0-alpha-dev
Data Structures | Macros | Enumerations | Functions
congestion_control_st.h File Reference

Structure definitions for congestion control. More...

#include "core/or/crypt_path_st.h"
#include "core/or/circuit_st.h"

Go to the source code of this file.

Data Structures

struct  vegas_params_t
 
struct  congestion_control_t
 

Macros

#define NUM_CC_ALGS   (CC_ALG_NOLA+1)
 
#define NUM_BDP_ALGS   (BDP_ALG_PIECEWISE+1)
 
#define CWND_INC(cc)   ((cc)->cwnd_inc)
 

Enumerations

enum  cc_alg_t { CC_ALG_SENDME = 0 , CC_ALG_WESTWOOD = 1 , CC_ALG_VEGAS = 2 , CC_ALG_NOLA = 3 }
 
enum  bdp_alg_t { BDP_ALG_CWND_RTT = 0 , BDP_ALG_SENDME_RATE = 1 , BDP_ALG_INFLIGHT_RTT = 2 , BDP_ALG_PIECEWISE = 3 }
 

Functions

static uint64_t CWND_UPDATE_RATE (const struct congestion_control_t *cc)
 
static uint64_t SENDME_PER_CWND (const struct congestion_control_t *cc)
 
static uint64_t CWND_INC_SS (const struct congestion_control_t *cc)
 

Detailed Description

Structure definitions for congestion control.

Definition in file congestion_control_st.h.

Macro Definition Documentation

◆ CWND_INC

#define CWND_INC (   cc)    ((cc)->cwnd_inc)

Returns the amount to increment (and for Vegas, also decrement) the congestion window by, every update period.

This is controlled by the cc_cwnd_inc consensus parameter.

Definition at line 240 of file congestion_control_st.h.

◆ NUM_BDP_ALGS

#define NUM_BDP_ALGS   (BDP_ALG_PIECEWISE+1)

Total number of BDP algs in bdp_alg_t enum

Definition at line 80 of file congestion_control_st.h.

◆ NUM_CC_ALGS

#define NUM_CC_ALGS   (CC_ALG_NOLA+1)

Definition at line 50 of file congestion_control_st.h.

Enumeration Type Documentation

◆ bdp_alg_t

enum bdp_alg_t

Signifies how we estimate circuit BDP

Definition at line 53 of file congestion_control_st.h.

◆ cc_alg_t

enum cc_alg_t

Signifies which sendme algorithm to use

Enumerator
CC_ALG_SENDME 

OG Tor fixed-sized circ and stream windows. It sucks, but it is important to make sure that the new algs can compete with the old garbage.

CC_ALG_WESTWOOD 

Prop#324 TOR_WESTWOOD - Deliberately aggressive. Westwood may not even converge to fairness in some cases because max RTT will also increase on congestion, which boosts the Westwood RTT congestion threshold. So it can cause runaway queue bloat, which may or may not lead to a robot uprising... Ok that's Westworld, not Westwood. Still, we need to test Vegas and NOLA against something more aggressive to ensure they do not starve in the presence of cheaters. We also need to make sure cheaters trigger the oomkiller in those cases.

CC_ALG_VEGAS 

Prop#324 TOR_VEGAS - TCP Vegas-style BDP tracker. Because Vegas backs off whenever it detects queue delay, it can be beaten out by more aggressive algs. However, in live network testing, it seems to do just fine against current SENDMEs. It outperforms Westwood and does not stall.

CC_ALG_NOLA 

Prop#324: TOR_NOLA - NOLA looks the BDP right in the eye and uses it immediately as CWND. No slow start, no other congestion signals, no delay, no bullshit. Like TOR_VEGAS, it also uses aggressive BDP estimates, to avoid out-competition. It seems a bit better throughput than Vegas, but its aggressive BDP and rapid updates may lead to more queue latency.

Definition at line 16 of file congestion_control_st.h.

Function Documentation

◆ CWND_INC_SS()

static uint64_t CWND_INC_SS ( const struct congestion_control_t cc)
inlinestatic

Returns the amount to increment the congestion window each update, during slow start.

Congestion control literature recommends either doubling the cwnd every cwnd during slow start, or some similar exponential growth (such as 50% more every cwnd, for Vegas).

This is controlled by a consensus parameter 'cwnd_inc_pct_ss', which allows us to specify the percent of the current consensus window to update by.

Definition at line 229 of file congestion_control_st.h.

◆ CWND_UPDATE_RATE()

static uint64_t CWND_UPDATE_RATE ( const struct congestion_control_t cc)
inlinestatic

Returns the number of sendme acks we will receive before we update cwnd.

Congestion control literature recommends only one update of cwnd per cwnd worth of acks. However, we can also tune this to be more frequent by increasing the 'cc_cwnd_inc_rate' consensus parameter. This tuning only applies after slow start.

If this returns 0 due to high cwnd_inc_rate, the calling code will update every sendme ack.

Definition at line 194 of file congestion_control_st.h.

Referenced by congestion_control_init().

◆ SENDME_PER_CWND()

static uint64_t SENDME_PER_CWND ( const struct congestion_control_t cc)
inlinestatic

Gives us the number of SENDMEs in a CWND, rounded.

Definition at line 210 of file congestion_control_st.h.

Referenced by congestion_control_vegas_process_sendme().