1f772f9feSLawrence Stewart.\" 2f772f9feSLawrence Stewart.\" Copyright (c) 2010-2011 The FreeBSD Foundation 3f772f9feSLawrence Stewart.\" 4f772f9feSLawrence Stewart.\" This documentation was written at the Centre for Advanced Internet 5f772f9feSLawrence Stewart.\" Architectures, Swinburne University of Technology, Melbourne, Australia by 6f772f9feSLawrence Stewart.\" David Hayes and Lawrence Stewart under sponsorship from the FreeBSD 7f772f9feSLawrence Stewart.\" Foundation. 8f772f9feSLawrence Stewart.\" 9f772f9feSLawrence Stewart.\" Redistribution and use in source and binary forms, with or without 10f772f9feSLawrence Stewart.\" modification, are permitted provided that the following conditions 11f772f9feSLawrence Stewart.\" are met: 12f772f9feSLawrence Stewart.\" 1. Redistributions of source code must retain the above copyright 13f772f9feSLawrence Stewart.\" notice, this list of conditions and the following disclaimer. 14f772f9feSLawrence Stewart.\" 2. Redistributions in binary form must reproduce the above copyright 15f772f9feSLawrence Stewart.\" notice, this list of conditions and the following disclaimer in the 16f772f9feSLawrence Stewart.\" documentation and/or other materials provided with the distribution. 17f772f9feSLawrence Stewart.\" 18f772f9feSLawrence Stewart.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19f772f9feSLawrence Stewart.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20f772f9feSLawrence Stewart.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21f772f9feSLawrence Stewart.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 22f772f9feSLawrence Stewart.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23f772f9feSLawrence Stewart.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24f772f9feSLawrence Stewart.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25f772f9feSLawrence Stewart.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26f772f9feSLawrence Stewart.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27f772f9feSLawrence Stewart.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28f772f9feSLawrence Stewart.\" SUCH DAMAGE. 29f772f9feSLawrence Stewart.\" 30bb1d472dSRichard Scheffenegger.Dd September 13, 2022 31f772f9feSLawrence Stewart.Dt MOD_CC 4 32f772f9feSLawrence Stewart.Os 33f772f9feSLawrence Stewart.Sh NAME 34f772f9feSLawrence Stewart.Nm mod_cc 35f772f9feSLawrence Stewart.Nd Modular congestion control 36f772f9feSLawrence Stewart.Sh DESCRIPTION 37f772f9feSLawrence StewartThe modular congestion control framework allows the TCP implementation to 38f772f9feSLawrence Stewartdynamically change the congestion control algorithm used by new and existing 39f772f9feSLawrence Stewartconnections. 40f772f9feSLawrence StewartAlgorithms are identified by a unique 41f772f9feSLawrence Stewart.Xr ascii 7 42f772f9feSLawrence Stewartname. 43f772f9feSLawrence StewartAlgorithm modules can be compiled into the kernel or loaded as kernel modules 44f772f9feSLawrence Stewartusing the 45f772f9feSLawrence Stewart.Xr kld 4 46f772f9feSLawrence Stewartfacility. 47f772f9feSLawrence Stewart.Pp 48bb1d472dSRichard ScheffeneggerThe default algorithm is CUBIC, and all connections use the default unless 49d519cedbSGleb Smirnoffexplicitly overridden using the 50d519cedbSGleb Smirnoff.Dv TCP_CONGESTION 51d519cedbSGleb Smirnoffsocket option (see 52f772f9feSLawrence Stewart.Xr tcp 4 53f772f9feSLawrence Stewartfor details). 54f772f9feSLawrence StewartThe default can be changed using a 55f772f9feSLawrence Stewart.Xr sysctl 3 56f772f9feSLawrence StewartMIB variable detailed in the 57f772f9feSLawrence Stewart.Sx MIB Variables 58f772f9feSLawrence Stewartsection below. 59d519cedbSGleb Smirnoff.Pp 60d519cedbSGleb SmirnoffAlgorithm specific parameters can be set or queried using the 61d519cedbSGleb Smirnoff.Dv TCP_CCALGOOPT 62d519cedbSGleb Smirnoffsocket option (see 63d519cedbSGleb Smirnoff.Xr tcp 4 64d519cedbSGleb Smirnofffor details). 65d519cedbSGleb SmirnoffCallers must pass a pointer to an algorithm specific data, and specify 66d519cedbSGleb Smirnoffits size. 67b8d60729SRandall Stewart.Pp 68b8d60729SRandall StewartUnloading a congestion control module will fail if it is used as a 69b8d60729SRandall Stewartdefault by any Vnet. 70b8d60729SRandall StewartWhen unloading a module, the Vnet default is 71b8d60729SRandall Stewartused to switch a connection to an alternate congestion control. 72b8d60729SRandall StewartNote that the new congestion control module may fail to initialize its 73b8d60729SRandall Stewartinternal memory, if so it will fail the module unload. 74b8d60729SRandall StewartIf this occurs often times retrying the unload will succeed since the temporary 75b8d60729SRandall Stewartmemory shortage as the new CC module malloc's memory, that prevented the 76b8d60729SRandall Stewartswitch is often transient. 77f772f9feSLawrence Stewart.Sh MIB Variables 78f772f9feSLawrence StewartThe framework exposes the following variables in the 79f772f9feSLawrence Stewart.Va net.inet.tcp.cc 80f772f9feSLawrence Stewartbranch of the 81f772f9feSLawrence Stewart.Xr sysctl 3 82f772f9feSLawrence StewartMIB: 83a9696510SRandall Stewart.Bl -tag -width ".Va hystartplusplus.css_growth_div" 84f772f9feSLawrence Stewart.It Va available 85f772f9feSLawrence StewartRead-only list of currently available congestion control algorithms by name. 86f772f9feSLawrence Stewart.It Va algorithm 87f772f9feSLawrence StewartReturns the current default congestion control algorithm when read, and changes 88f772f9feSLawrence Stewartthe default when set. 89f772f9feSLawrence StewartWhen attempting to change the default algorithm, this variable should be set to 90f772f9feSLawrence Stewartone of the names listed by the 91f772f9feSLawrence Stewart.Va net.inet.tcp.cc.available 92f772f9feSLawrence StewartMIB variable. 93370efe5aSLawrence Stewart.It Va abe 9412b678e9SMichael TuexenEnable support for RFC 8511, 95370efe5aSLawrence Stewartwhich alters the window decrease factor applied to the congestion window in 96370efe5aSLawrence Stewartresponse to an ECN congestion signal. 97370efe5aSLawrence StewartRefer to individual congestion control man pages to determine if they implement 98370efe5aSLawrence Stewartsupport for ABE and for configuration details. 99370efe5aSLawrence Stewart.It Va abe_frlossreduce 100370efe5aSLawrence StewartIf non-zero, apply standard beta instead of ABE-beta during ECN-signalled 101370efe5aSLawrence Stewartcongestion recovery episodes if loss also needs to be repaired. 102a9696510SRandall Stewart.It Va hystartplusplus.bblogs 103a9696510SRandall StewartThis boolean controls if black box logging will be done for hystart++ events. 104a9696510SRandall StewartIf set to zero (the default) no logging is performed. 105a9696510SRandall StewartIf set to one then black box logs will be generated on all hystart++ events. 106a9696510SRandall Stewart.It Va hystartplusplus.css_rounds 107a9696510SRandall StewartThis value controls the number of rounds that CSS runs for. 108a9696510SRandall StewartThe default value matches the current internet-draft of 5. 109a9696510SRandall Stewart.It Va hystartplusplus.css_growth_div 110a9696510SRandall StewartThis value controls the divisor applied to slowstart during CSS. 111a9696510SRandall StewartThe default value matches the current internet-draft of 4. 112a9696510SRandall Stewart.It Va hystartplusplus.n_rttsamples 113a9696510SRandall StewartThis value controls how many rtt samples must be collected in each round for 114a9696510SRandall Stewarthystart++ to be active. 115a9696510SRandall StewartThe default value matches the current internet-draft of 8. 116a9696510SRandall Stewart.It Va hystartplusplus.maxrtt_thresh 117a9696510SRandall StewartThis value controls the maximum rtt variance clamp when considering if CSS is needed. 118a9696510SRandall StewartThe default value matches the current internet-draft of 16000 (in microseconds). 119a9696510SRandall StewartFor further explanation please see the internet-draft. 120a9696510SRandall Stewart.It Va hystartplusplus.minrtt_thresh 121a9696510SRandall StewartThis value controls the minimum rtt variance clamp when considering if CSS is needed. 122a9696510SRandall StewartThe default value matches the current internet-draft of 4000 (in microseconds). 123a9696510SRandall StewartFor further explanation please see the internet-draft. 124f772f9feSLawrence Stewart.El 125b8d60729SRandall Stewart.Pp 126b8d60729SRandall StewartEach congestion control module may also expose other MIB variables 127b8d60729SRandall Stewartto control their behaviour. 128bb1d472dSRichard ScheffeneggerNote that both NewReno and CUBIC now support Hystart++ based on the version 3 of the internet-draft. 129b8d60729SRandall Stewart.Sh Kernel Configuration 130b8d60729SRandall StewartAll of the available congestion control modules may also be loaded 131*ffc4f93eSBenedict Reuschlingvia kernel configuration options. 132b8d60729SRandall StewartA kernel configuration is required to have at least one congestion control 133b8d60729SRandall Stewartalgorithm built into it via kernel option and a system default specified. 134b8d60729SRandall StewartCompilation of the kernel will fail if these two conditions are not met. 135b8d60729SRandall Stewart.Sh Kernel Configuration Options 136b8d60729SRandall StewartThe framework exposes the following kernel configuration options. 137b8d60729SRandall Stewart.Bl -tag -width ".Va CC_NEWRENO" 138b8d60729SRandall Stewart.It Va CC_NEWRENO 139bb1d472dSRichard ScheffeneggerThis directive loads the NewReno congestion control algorithm. 140b8d60729SRandall Stewart.It Va CC_CUBIC 141bb1d472dSRichard ScheffeneggerThis directive loads the CUBIC congestion control algorithm and is included 142bb1d472dSRichard Scheffeneggerin GENERIC by default. 143b8d60729SRandall Stewart.It Va CC_VEGAS 144b8d60729SRandall StewartThis directive loads the vegas congestion control algorithm, note that 145b8d60729SRandall Stewartthis algorithm also requires the TCP_HHOOK option as well. 146b8d60729SRandall Stewart.It Va CC_CDG 147b8d60729SRandall StewartThis directive loads the cdg congestion control algorithm, note that 148b8d60729SRandall Stewartthis algorithm also requires the TCP_HHOOK option as well. 149b8d60729SRandall Stewart.It Va CC_DCTCP 150b8d60729SRandall StewartThis directive loads the dctcp congestion control algorithm. 151b8d60729SRandall Stewart.It Va CC_HD 152b8d60729SRandall StewartThis directive loads the hd congestion control algorithm, note that 153b8d60729SRandall Stewartthis algorithm also requires the TCP_HHOOK option as well. 154b8d60729SRandall Stewart.It Va CC_CHD 155b8d60729SRandall StewartThis directive loads the chd congestion control algorithm, note that 156b8d60729SRandall Stewartthis algorithm also requires the TCP_HHOOK option as well. 157b8d60729SRandall Stewart.It Va CC_HTCP 158b8d60729SRandall StewartThis directive loads the htcp congestion control algorithm. 159b8d60729SRandall Stewart.It Va CC_DEFAULT 160b8d60729SRandall StewartThis directive specifies the string that represents the name of the system default algorithm, the GENERIC kernel 161bb1d472dSRichard Scheffeneggerdefaults this to CUBIC. 162b8d60729SRandall Stewart.El 163f772f9feSLawrence Stewart.Sh SEE ALSO 1645547f9fbSKevin Lo.Xr cc_cdg 4 , 165f772f9feSLawrence Stewart.Xr cc_chd 4 , 166f772f9feSLawrence Stewart.Xr cc_cubic 4 , 16764807b30SHiren Panchasara.Xr cc_dctcp 4 , 168f772f9feSLawrence Stewart.Xr cc_hd 4 , 169f772f9feSLawrence Stewart.Xr cc_htcp 4 , 170f772f9feSLawrence Stewart.Xr cc_newreno 4 , 171f772f9feSLawrence Stewart.Xr cc_vegas 4 , 172f772f9feSLawrence Stewart.Xr tcp 4 , 173b8d60729SRandall Stewart.Xr config 5 , 174b8d60729SRandall Stewart.Xr config 8 , 175f772f9feSLawrence Stewart.Xr mod_cc 9 176f772f9feSLawrence Stewart.Sh ACKNOWLEDGEMENTS 177f772f9feSLawrence StewartDevelopment and testing of this software were made possible in part by grants 178f772f9feSLawrence Stewartfrom the FreeBSD Foundation and Cisco University Research Program Fund at 179f772f9feSLawrence StewartCommunity Foundation Silicon Valley. 180f772f9feSLawrence Stewart.Sh HISTORY 181f772f9feSLawrence StewartThe 182f772f9feSLawrence Stewart.Nm 183f772f9feSLawrence Stewartmodular congestion control framework first appeared in 184f772f9feSLawrence Stewart.Fx 9.0 . 185f772f9feSLawrence Stewart.Pp 186f772f9feSLawrence StewartThe framework was first released in 2007 by James Healy and Lawrence Stewart 187f772f9feSLawrence Stewartwhilst working on the NewTCP research project at Swinburne University of 188f772f9feSLawrence StewartTechnology's Centre for Advanced Internet Architectures, Melbourne, Australia, 189f772f9feSLawrence Stewartwhich was made possible in part by a grant from the Cisco University Research 190f772f9feSLawrence StewartProgram Fund at Community Foundation Silicon Valley. 191f772f9feSLawrence StewartMore details are available at: 192f772f9feSLawrence Stewart.Pp 193f772f9feSLawrence Stewarthttp://caia.swin.edu.au/urp/newtcp/ 194f772f9feSLawrence Stewart.Sh AUTHORS 195f772f9feSLawrence Stewart.An -nosplit 196f772f9feSLawrence StewartThe 197f772f9feSLawrence Stewart.Nm 198f772f9feSLawrence Stewartfacility was written by 1996c899950SBaptiste Daroussin.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org , 2006c899950SBaptiste Daroussin.An James Healy Aq Mt jimmy@deefa.com 201f772f9feSLawrence Stewartand 2026c899950SBaptiste Daroussin.An David Hayes Aq Mt david.hayes@ieee.org . 203f772f9feSLawrence Stewart.Pp 204f772f9feSLawrence StewartThis manual page was written by 2056c899950SBaptiste Daroussin.An David Hayes Aq Mt david.hayes@ieee.org 206f772f9feSLawrence Stewartand 2076c899950SBaptiste Daroussin.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org . 208