diff --git a/share/man/man4/cc_cdg.4 b/share/man/man4/cc_cdg.4 index 38f8ed397def..1b14e094ff84 100644 --- a/share/man/man4/cc_cdg.4 +++ b/share/man/man4/cc_cdg.4 @@ -1,155 +1,156 @@ .\" .\" Copyright (c) 2013 Swinburne University of Technology, Melbourne, Australia .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd July 2, 2013 +.Dd May 13, 2021 .Dt CC_CDG 4 .Os .Sh NAME .Nm cc_cdg .Nd CDG Congestion Control Algorithm .Sh DESCRIPTION CAIA-Delay Gradient (CDG) is a hybrid congestion control algorithm which reacts to both packet loss and inferred queuing delay. It attempts to operate as a delay-based algorithm where possible, but utilises heuristics to detect loss-based TCP cross traffic and will compete effectively as required. CDG is therefore incrementally deployable and suitable for use on shared networks. .Pp During delay-based operation, CDG uses a delay-gradient based probabilistic backoff mechanism, and will also try to infer non congestion related packet losses and avoid backing off when they occur. During loss-based operation, CDG essentially reverts to .Xr cc_newreno 4 Ns - Ns like behaviour. .Pp CDG switches to loss-based operation when it detects that a configurable number of consecutive delay-based backoffs have had no measurable effect. It periodically attempts to return to delay-based operation, but will keep switching back to loss-based operation as required. .Sh MIB Variables The algorithm exposes the following variables in the .Va net.inet.tcp.cc.cdg branch of the .Xr sysctl 3 MIB: .Bl -tag -width ".Va exp_backoff_scale" .It Va version Current algorithm/implementation version number. .It Va beta_delay Delay-based window decrease factor as a percentage (on delay-based backoff, w = w * beta_delay / 100). Default is 70. .It Va beta_loss Loss-based window decrease factor as a percentage (on loss-based backoff, w = w * beta_loss / 100). Default is 50. .It Va exp_backoff_scale Scaling parameter for the probabilistic exponential backoff. Default is 2. .It Va smoothing_factor Number of samples used for moving average smoothing (0 means no smoothing). Default is 8. .It Va loss_compete_consec_cong Number of consecutive delay-gradient based congestion episodes which will trigger loss-based CC compatibility. Default is 5. .It Va loss_compete_hold_backoff Number of consecutive delay-gradient based congestion episodes to hold the window backoff for loss-based CC compatibility. Default is 5. .It Va alpha_inc If non-zero, this enables an experimental mode where CDG's window increase factor (alpha) is increased by 1 MSS every .Va alpha_inc RTTs during congestion avoidance mode. (Setting .Va alpha_inc to 1 results in the most aggressive growth of the window increase factor over time. Use higher .Va alpha_inc values for slower growth.) Default is 0. .El .Sh SEE ALSO .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr h_ertt 4 , .Xr mod_cc 4 , .Xr tcp 4 , .Xr khelp 9 , .Xr mod_cc 9 .Rs .%A "D. A. Hayes" .%A "G. Armitage" .%T "Revisiting TCP Congestion Control using Delay Gradients" .%J "Networking 2011 Proceedings, Part II" .%D "May 2011" .%P "328-341" .Re .Rs .%A "N. Khademi" .%A "G. Armitage" .%T "Minimising RTT across homogeneous 802.11 WLANs with CAIA Delay-Gradient TCP (v0.1)" .%R "CAIA Technical Report 121113A" .%D "November 2012" .%U "http://caia.swin.edu.au/reports/121113A/CAIA-TR-121113A.pdf" .Re .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and The Cisco University Research Program Fund, a corporate advised fund of Silicon Valley Community Foundation. .Sh HISTORY The .Nm congestion control module first appeared in .Fx 9.2 . .Pp The module was first released in 2011 by David Hayes whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Sh AUTHORS .An -nosplit The .Nm congestion control module was written by .An David Hayes Aq Mt david.hayes@ieee.org . This manual page was written by .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org and .An Grenville Armitage Aq Mt garmitage@swin.edu.au . .Sh BUGS The underlying algorithm and parameter values are still a work in progress and may not be optimal for some network scenarios. diff --git a/share/man/man4/cc_chd.4 b/share/man/man4/cc_chd.4 index 963d89247fde..32b0444f89d7 100644 --- a/share/man/man4/cc_chd.4 +++ b/share/man/man4/cc_chd.4 @@ -1,128 +1,130 @@ .\" .\" Copyright (c) 2010-2011 The FreeBSD Foundation .\" All rights reserved. .\" .\" This documentation was written at the Centre for Advanced Internet .\" Architectures, Swinburne University of Technology, Melbourne, Australia by .\" David Hayes under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_CHD 4 .Os .Sh NAME .Nm cc_chd .Nd CHD Congestion Control Algorithm .Sh DESCRIPTION CHD enhances the HD algorithm implemented in .Xr cc_hd 4 . It provides tolerance to non-congestion related packet loss and improvements to coexistence with traditional loss-based TCP flows, especially when the bottleneck link is lightly multiplexed. .Pp Like HD, the algorithm aims to keep network queuing delays below a particular threshold (queue_threshold) and decides to reduce the congestion window (cwnd) probabilistically based on its estimate of the network queuing delay. .Pp It differs from HD in three key aspects: .Bl -bullet .It The probability of cwnd reduction due to congestion is calculated once per round trip time instead of each time an acknowledgement is received as done by .Xr cc_hd 4 . .It Packet losses that occur while the queuing delay is less than queue_threshold do not cause cwnd to be reduced. .It CHD uses a shadow window to help regain lost transmission opportunities when competing with loss-based TCP flows. .El .Sh MIB Variables The algorithm exposes the following tunable variables in the .Va net.inet.tcp.cc.chd branch of the .Xr sysctl 3 MIB: .Bl -tag -width ".Va queue_threshold" .It Va queue_threshold Queueing congestion threshold (qth) in ticks. Default is 20. .It Va pmax Per RTT maximum backoff probability as a percentage. Default is 50. .It Va qmin Minimum queuing delay threshold (qmin) in ticks. Default is 5. .It Va loss_fair If 1, cwnd is adjusted using the shadow window when a congestion related loss is detected. Default is 1. .It Va use_max If 1, the maximum RTT seen within the measurement period is used as the basic delay measurement for the algorithm, otherwise a sampled RTT measurement is used. Default is 1. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr h_ertt 4 , .Xr mod_cc 4 , .Xr tcp 4 , .Xr khelp 9 , .Xr mod_cc 9 .Rs .%A "D. A. Hayes" .%A "G. Armitage" .%T "Improved coexistence and loss tolerance for delay based TCP congestion control" .%J "in 35th Annual IEEE Conference on Local Computer Networks" .%D "October 2010" .%P "24-31" .Re .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Community Foundation Silicon Valley. .Sh HISTORY The .Nm congestion control module first appeared in .Fx 9.0 . .Pp The module was first released in 2010 by David Hayes whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Sh AUTHORS .An -nosplit The .Nm congestion control module and this manual page were written by .An David Hayes Aq Mt david.hayes@ieee.org . diff --git a/share/man/man4/cc_cubic.4 b/share/man/man4/cc_cubic.4 index 75df183fa16f..92ac8971e867 100644 --- a/share/man/man4/cc_cubic.4 +++ b/share/man/man4/cc_cubic.4 @@ -1,114 +1,116 @@ .\" .\" Copyright (c) 2009 Lawrence Stewart .\" Copyright (c) 2010-2011 The FreeBSD Foundation .\" All rights reserved. .\" .\" Portions of this documentation were written at the Centre for Advanced .\" Internet Architectures, Swinburne University of Technology, Melbourne, .\" Australia by David Hayes under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_CUBIC 4 .Os .Sh NAME .Nm cc_cubic .Nd CUBIC Congestion Control Algorithm .Sh DESCRIPTION The CUBIC congestion control algorithm was designed to provide increased throughput in fast and long-distance networks. It attempts to maintain fairness when competing with legacy NewReno TCP in lower speed scenarios where NewReno is able to operate adequately. .Pp The congestion window is increased as a function of the time elapsed since the last congestion event. During regular operation, the window increase function follows a cubic function, with the inflection point set to be the congestion window value reached at the last congestion event. CUBIC also calculates an estimate of the congestion window that NewReno would have achieved at a given time after a congestion event. When updating the congestion window, the algorithm will choose the larger of the calculated CUBIC and estimated NewReno windows. .Pp CUBIC also backs off less on congestion by changing the multiplicative decrease factor from 1/2 (used by standard NewReno TCP) to 4/5. .Pp The implementation was done in a clean-room fashion, and is based on the Internet Draft and paper referenced in the .Sx SEE ALSO section below. .Sh MIB Variables There are currently no tunable MIB variables. .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr mod_cc 4 , .Xr tcp 4 , .Xr mod_cc 9 .Rs .%A "Sangtae Ha" .%A "Injong Rhee" .%A "Lisong Xu" .%T "CUBIC for Fast Long-Distance Networks" .%U "http://tools.ietf.org/id/draft-rhee-tcpm-cubic-02.txt" .Re .Rs .%A "Sangtae Ha" .%A "Injong Rhee" .%A "Lisong Xu" .%T "CUBIC: a new TCP-friendly high-speed TCP variant" .%J "SIGOPS Oper. Syst. Rev." .%V "42" .%N "5" .%D "July 2008" .%P "64-74" .Re .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Community Foundation Silicon Valley. .Sh HISTORY The .Nm congestion control module first appeared in .Fx 9.0 . .Pp The module was first released in 2009 by Lawrence Stewart whilst studying at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Sh AUTHORS .An -nosplit The .Nm congestion control module and this manual page were written by .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org and .An David Hayes Aq Mt david.hayes@ieee.org . diff --git a/share/man/man4/cc_dctcp.4 b/share/man/man4/cc_dctcp.4 index 5c5be4fed96e..8c23f2eaa134 100644 --- a/share/man/man4/cc_dctcp.4 +++ b/share/man/man4/cc_dctcp.4 @@ -1,146 +1,147 @@ .\" .\" Copyright (c) 2014 Midori Kato .\" Copyright (c) 2014 The FreeBSD Foundation .\" All rights reserved. .\" .\" Portions of this documentation were written at Keio University, Japan. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd July 29, 2019 +.Dd May 13, 2021 .Dt CC_DCTCP 4 .Os .Sh NAME .Nm cc_dctcp .Nd DCTCP Congestion Control Algorithm .Sh DESCRIPTION The DCTCP (data center TCP) congestion control algorithm aims to maximise throughput and minimise latency in data center networks by utilising the proportion of Explicit Congestion Notification (ECN) marks received from capable hardware as a congestion signal. .Pp DCTCP uses fraction of ECN marked packets to update congestion window. The window reduction ratio is always <= 1/2. Only when all of the packets are marked, congestion window is halved. .Pp In order to keep the accuracy of the ECN marked fraction, a DCTCP receiver mirrors back incoming (or missing) CE marks by setting (or clearing) ECE marks. This feedback methodology is also adopted when the receiver uses delayed ACK. .Pp The .Fx DCTCP implementation includes two minor modifications for the one-sided deployment. Considering the situation that DCTCP is used as sender and classic ECN is used as receiver, DCTCP sets the CWR flag as the reaction to the ECE flag. In addition, when classic ECN is used as sender and DCTCP is used as receiver, DCTCP avoids to mirror back ACKs only when the CWR flag is set in the incoming packet. .Pp The other specifications are based on the paper and the RFC referenced in the .Sx SEE ALSO section below. .Sh MIB Variables The algorithm exposes the following tunable variables in the .Va net.inet.tcp.cc.dctcp branch of the .Xr sysctl 3 MIB: .Bl -tag -width ".Va slowstart" .It Va alpha The initial value to estimate the congestion on the link. The valid range is from 0 to 1024, where 1024 reduces the congestion window to half, if a CE is observed in the first window and .Va alpha could not yet adjust to the congestion level on that path. Default is 1024. .It Va shift_g An estimation gain in the .Va alpha calculation. This influences the responsiveness when adjusting alpha to the most recent observed window. Valid range from 0 to 10, the default is 4, resulting in an effective gain of 1 / ( 2 ^ .Va shift_g ), or 1/16th. .It Va slowstart A flag if the congestion window should be reduced by one half after slow start. Valid settings 0 and 1, default 0. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr mod_cc 4 , .Xr tcp 4 , .Xr mod_cc 9 .Rs .%A "Mohammad Alizadeh" .%A "Albert Greenberg" .%A "David A. Maltz" .%A "Jitendra Padhye" .%A "Parveen Patel" .%A "Balaji Prabhakar" .%A "Sudipta Sengupta" .%A "Murari Sridharan" .%T "Data Center TCP (DCTCP)" .%U "http://research.microsoft.com/pubs/121386/dctcp-public.pdf" .%J "ACM SIGCOMM 2010" .%D "July 2010" .%P "63-74" .Re .Rs .%A "Stephen Bensley" .%A "Dave Thaler" .%A "Praveen Balasubramanian" .%A "Lars Eggert" .%A "Glenn Judd" .%T "Data Center TCP (DCTCP): TCP Congestion Control for Data Centers" .%U "https://tools.ietf.org/html/rfc8257" .Re .Sh HISTORY The .Nm congestion control module first appeared in .Fx 11.0 . .Pp The module was first released in 2014 by Midori Kato studying at Keio University, Japan. .Sh AUTHORS .An -nosplit The .Nm congestion control module and this manual page were written by .An Midori Kato Mt katoon@sfc.wide.ad.jp and .An Lars Eggert Mt lars@netapp.com with help and modifications from .An Hiren Panchasara Mt hiren@FreeBSD.org diff --git a/share/man/man4/cc_hd.4 b/share/man/man4/cc_hd.4 index 497e61616a0a..d56d9b77b4d9 100644 --- a/share/man/man4/cc_hd.4 +++ b/share/man/man4/cc_hd.4 @@ -1,120 +1,122 @@ .\" .\" Copyright (c) 2010-2011 The FreeBSD Foundation .\" All rights reserved. .\" .\" This documentation was written at the Centre for Advanced Internet .\" Architectures, Swinburne University of Technology, Melbourne, Australia by .\" David Hayes under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_HD 4 .Os .Sh NAME .Nm cc_hd .Nd HD Congestion Control Algorithm .Sh DESCRIPTION The HD congestion control algorithm is an implementation of the Hamilton Institute's delay-based congestion control which aims to keep network queuing delays below a particular threshold (queue_threshold). .Pp HD probabilistically reduces the congestion window (cwnd) based on its estimate of the network queuing delay. The probability of reducing cwnd is zero at hd_qmin or less, rising to a maximum at queue_threshold, and then back to zero at the maximum queuing delay. .Pp Loss-based congestion control algorithms such as NewReno probe for network capacity by filling queues until there is a packet loss. HD competes with loss-based congestion control algorithms by allowing its probability of reducing cwnd to drop from a maximum at queue_threshold to be zero at the maximum queuing delay. This has been shown to work well when the bottleneck link is highly multiplexed. .Sh MIB Variables The algorithm exposes the following tunable variables in the .Va net.inet.tcp.cc.hd branch of the .Xr sysctl 3 MIB: .Bl -tag -width ".Va queue_threshold" .It Va queue_threshold Queueing congestion threshold (qth) in ticks. Default is 20. .It Va pmax Per packet maximum backoff probability as a percentage. Default is 5. .It Va qmin Minimum queuing delay threshold (qmin) in ticks. Default is 5. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr h_ertt 4 , .Xr mod_cc 4 , .Xr tcp 4 , .Xr khelp 9 , .Xr mod_cc 9 .Rs .%A "L. Budzisz" .%A "R. Stanojevic" .%A "R. Shorten" .%A "F. Baker" .%T "A strategy for fair coexistence of loss and delay-based congestion control algorithms" .%J "IEEE Commun. Lett." .%D "Jul 2009" .%V "13" .%N "7" .%P "555-557" .Re .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Community Foundation Silicon Valley. .Sh FUTURE WORK The Hamilton Institute have recently made some improvements to the algorithm implemented by this module and have called it Coexistent-TCP (C-TCP). The improvements should be evaluated and potentially incorporated into this module. .Sh HISTORY The .Nm congestion control module first appeared in .Fx 9.0 . .Pp The module was first released in 2010 by David Hayes whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Sh AUTHORS .An -nosplit The .Nm congestion control module and this manual page were written by .An David Hayes Aq Mt david.hayes@ieee.org . diff --git a/share/man/man4/cc_htcp.4 b/share/man/man4/cc_htcp.4 index 0e141bb79a7d..46d94a12114a 100644 --- a/share/man/man4/cc_htcp.4 +++ b/share/man/man4/cc_htcp.4 @@ -1,136 +1,138 @@ .\" .\" Copyright (c) 2008 Lawrence Stewart .\" Copyright (c) 2010-2011 The FreeBSD Foundation .\" All rights reserved. .\" .\" Portions of this documentation were written at the Centre for Advanced .\" Internet Architectures, Swinburne University of Technology, Melbourne, .\" Australia by David Hayes under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_HTCP 4 .Os .Sh NAME .Nm cc_htcp .Nd H-TCP Congestion Control Algorithm .Sh DESCRIPTION The H-TCP congestion control algorithm was designed to provide increased throughput in fast and long-distance networks. It attempts to maintain fairness when competing with legacy NewReno TCP in lower speed scenarios where NewReno is able to operate adequately. .Pp The congestion window is increased as a function of the time elapsed since the last congestion event. The window increase algorithm operates like NewReno for the first second after a congestion event, and then switches to a high-speed mode based on a quadratic increase function. .Pp The implementation was done in a clean-room fashion, and is based on the Internet Draft and other documents referenced in the .Sx SEE ALSO section below. .Sh MIB Variables The algorithm exposes the following tunable variables in the .Va net.inet.tcp.cc.htcp branch of the .Xr sysctl 3 MIB: .Bl -tag -width ".Va adaptive_backoff" .It Va adaptive_backoff Controls use of the adaptive backoff algorithm, which is designed to keep network queues non-empty during congestion recovery episodes. Default is 0 (disabled). .It Va rtt_scaling Controls use of the RTT scaling algorithm, which is designed to make congestion window increase during congestion avoidance mode invariant with respect to RTT. Default is 0 (disabled). .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr mod_cc 4 , .Xr tcp 4 , .Xr mod_cc 9 .Rs .%A "D. Leith" .%A "R. Shorten" .%T "H-TCP: TCP Congestion Control for High Bandwidth-Delay Product Paths" .%U "http://tools.ietf.org/id/draft-leith-tcp-htcp-06.txt" .Re .Rs .%A "D. Leith" .%A "R. Shorten" .%A "T. Yee" .%T "H-TCP: A framework for congestion control in high-speed and long-distance networks" .%B "Proc. PFLDnet" .%D "2005" .Re .Rs .%A "G. Armitage" .%A "L. Stewart" .%A "M. Welzl" .%A "J. Healy" .%T "An independent H-TCP implementation under FreeBSD 7.0: description and observed behaviour" .%J "SIGCOMM Comput. Commun. Rev." .%V "38" .%N "3" .%D "July 2008" .%P "27-38" .Re .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Community Foundation Silicon Valley. .Sh HISTORY The .Nm congestion control module first appeared in .Fx 9.0 . .Pp The module was first released in 2007 by James Healy and Lawrence Stewart whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia, which was made possible in part by a grant from the Cisco University Research Program Fund at Community Foundation Silicon Valley. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Sh AUTHORS .An -nosplit The .Nm congestion control module was written by .An James Healy Aq Mt jimmy@deefa.com and .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org . .Pp This manual page was written by .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org and .An David Hayes Aq Mt david.hayes@ieee.org . diff --git a/share/man/man4/cc_newreno.4 b/share/man/man4/cc_newreno.4 index 8169c04c3eaa..0ac59beeec48 100644 --- a/share/man/man4/cc_newreno.4 +++ b/share/man/man4/cc_newreno.4 @@ -1,154 +1,156 @@ .\" .\" Copyright (c) 2009 Lawrence Stewart .\" Copyright (c) 2011 The FreeBSD Foundation .\" All rights reserved. .\" .\" Portions of this documentation were written at the Centre for Advanced .\" Internet Architectures, Swinburne University of Technology, Melbourne, .\" Australia by Lawrence Stewart under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd August 6, 2019 +.Dd May 13, 2021 .Dt CC_NEWRENO 4 .Os .Sh NAME .Nm cc_newreno .Nd NewReno Congestion Control Algorithm .Sh SYNOPSIS .In netinet/cc/cc_newreno.h .Sh DESCRIPTION The NewReno congestion control algorithm is the default for TCP. Details about the algorithm can be found in RFC5681. .Sh Socket Options The .Nm module supports a number of socket options under TCP_CCALGOOPT (refer to .Xr tcp 4 and .Xr mod_cc 9 for details) which can be set with .Xr setsockopt 2 and tested with .Xr getsockopt 2 . The .Nm socket options use this structure defined in : .Bd -literal struct cc_newreno_opts { int name; uint32_t val; } .Ed .Bl -tag -width ".Va CC_NEWRENO_BETA_ECN" .It Va CC_NEWRENO_BETA Multiplicative window decrease factor, specified as a percentage, applied to the congestion window in response to a congestion signal per: cwnd = (cwnd * CC_NEWRENO_BETA) / 100. Default is 50. .It Va CC_NEWRENO_BETA_ECN Multiplicative window decrease factor, specified as a percentage, applied to the congestion window in response to an ECN congestion signal when .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * CC_NEWRENO_BETA_ECN) / 100. Default is 80. .El .Sh MIB Variables The algorithm exposes these variables in the .Va net.inet.tcp.cc.newreno branch of the .Xr sysctl 3 MIB: .Bl -tag -width ".Va beta_ecn" .It Va beta Multiplicative window decrease factor, specified as a percentage, applied to the congestion window in response to a congestion signal per: cwnd = (cwnd * beta) / 100. Default is 50. .It Va beta_ecn Multiplicative window decrease factor, specified as a percentage, applied to the congestion window in response to an ECN congestion signal when .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * beta_ecn) / 100. Default is 80. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_vegas 4 , .Xr mod_cc 4 , .Xr tcp 4 , .Xr mod_cc 9 .Rs .%A "Mark Allman" .%A "Vern Paxson" .%A "Ethan Blanton" .%T "TCP Congestion Control" .%O "RFC 5681" .Re .Rs .%A "Naeem Khademi" .%A "Michael Welzl" .%A "Grenville Armitage" .%A "Gorry Fairhurst" .%T "TCP Alternative Backoff with ECN (ABE)" .%O "RFC 8511" .Re .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Community Foundation Silicon Valley. .Sh HISTORY The .Nm congestion control algorithm first appeared in its modular form in .Fx 9.0 . .Pp The module was first released in 2007 by James Healy and Lawrence Stewart whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia, which was made possible in part by a grant from the Cisco University Research Program Fund at Community Foundation Silicon Valley. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Sh AUTHORS .An -nosplit The .Nm congestion control module was written by .An James Healy Aq Mt jimmy@deefa.com , .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org and .An David Hayes Aq Mt david.hayes@ieee.org . .Pp Support for TCP ABE was added by .An Tom Jones Aq Mt tj@enoti.me . .Pp This manual page was written by .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org . diff --git a/share/man/man4/cc_vegas.4 b/share/man/man4/cc_vegas.4 index 45b4b6244017..ad043b218a4d 100644 --- a/share/man/man4/cc_vegas.4 +++ b/share/man/man4/cc_vegas.4 @@ -1,136 +1,138 @@ .\" .\" Copyright (c) 2010-2011 The FreeBSD Foundation .\" All rights reserved. .\" .\" This documentation was written at the Centre for Advanced Internet .\" Architectures, Swinburne University of Technology, Melbourne, Australia by .\" David Hayes under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd May 13, 2021 .Dt CC_VEGAS 4 .Os .Sh NAME .Nm cc_vegas .Nd Vegas Congestion Control Algorithm .Sh DESCRIPTION The Vegas congestion control algorithm uses what the authors term the actual and expected transmission rates to determine whether there is congestion along the network path i.e. .Bl -item -offset indent .It actual rate = (total data sent in a RTT) / RTT .It expected rate = cwnd / RTTmin .It diff = expected - actual .El .Pp where RTT is the measured instantaneous round trip time and RTTmin is the smallest round trip time observed during the connection. .Pp The algorithm aims to keep diff between two parameters alpha and beta, such that: .Bl -item -offset indent .It alpha < diff < beta .El .Pp If diff > beta, congestion is inferred and cwnd is decremented by one packet (or the maximum TCP segment size). If diff < alpha, then cwnd is incremented by one packet. Alpha and beta govern the amount of buffering along the path. .Pp The implementation was done in a clean-room fashion, and is based on the paper referenced in the .Sx SEE ALSO section below. .Sh IMPLEMENTATION NOTES The time from the transmission of a marked packet until the receipt of an acknowledgement for that packet is measured once per RTT. This implementation does not implement Brakmo's and Peterson's original duplicate ACK policy since clock ticks in today's machines are not as coarse as they were (i.e. 500ms) when Vegas was originally designed. Note that modern TCP recovery processes such as fast retransmit and SACK are enabled by default in the TCP stack. .Sh MIB Variables The algorithm exposes the following tunable variables in the .Va net.inet.tcp.cc.vegas branch of the .Xr sysctl 3 MIB: .Bl -tag -width ".Va alpha" .It Va alpha Query or set the Vegas alpha parameter as a number of buffers on the path. When setting alpha, the value must satisfy: 0 < alpha < beta. Default is 1. .It Va beta Query or set the Vegas beta parameter as a number of buffers on the path. When setting beta, the value must satisfy: 0 < alpha < beta. Default is 3. .El .Sh SEE ALSO +.Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr h_ertt 4 , .Xr mod_cc 4 , .Xr tcp 4 , .Xr khelp 9 , .Xr mod_cc 9 .Rs .%A "L. S. Brakmo" .%A "L. L. Peterson" .%T "TCP Vegas: end to end congestion avoidance on a global internet" .%J "IEEE J. Sel. Areas Commun." .%D "October 1995" .%V "13" .%N "8" .%P "1465-1480" .Re .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Community Foundation Silicon Valley. .Sh HISTORY The .Nm congestion control module first appeared in .Fx 9.0 . .Pp The module was first released in 2010 by David Hayes whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Sh AUTHORS .An -nosplit The .Nm congestion control module and this manual page were written by .An David Hayes Aq Mt david.hayes@ieee.org . diff --git a/share/man/man9/mod_cc.9 b/share/man/man9/mod_cc.9 index 7e9ab2488437..8be6fb2381bd 100644 --- a/share/man/man9/mod_cc.9 +++ b/share/man/man9/mod_cc.9 @@ -1,350 +1,351 @@ .\" .\" Copyright (c) 2008-2009 Lawrence Stewart .\" Copyright (c) 2010-2011 The FreeBSD Foundation .\" All rights reserved. .\" .\" Portions of this documentation were written at the Centre for Advanced .\" Internet Architectures, Swinburne University of Technology, Melbourne, .\" Australia by David Hayes and Lawrence Stewart under sponsorship from the .\" FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd January 21, 2016 +.Dd May 13, 2021 .Dt MOD_CC 9 .Os .Sh NAME .Nm mod_cc , .Nm DECLARE_CC_MODULE , .Nm CCV .Nd Modular Congestion Control .Sh SYNOPSIS .In netinet/tcp.h .In netinet/cc/cc.h .In netinet/cc/cc_module.h .Fn DECLARE_CC_MODULE "ccname" "ccalgo" .Fn CCV "ccv" "what" .Sh DESCRIPTION The .Nm framework allows congestion control algorithms to be implemented as dynamically loadable kernel modules via the .Xr kld 4 facility. Transport protocols can select from the list of available algorithms on a connection-by-connection basis, or use the system default (see .Xr mod_cc 4 for more details). .Pp .Nm modules are identified by an .Xr ascii 7 name and set of hook functions encapsulated in a .Vt "struct cc_algo" , which has the following members: .Bd -literal -offset indent struct cc_algo { char name[TCP_CA_NAME_MAX]; int (*mod_init) (void); int (*mod_destroy) (void); int (*cb_init) (struct cc_var *ccv); void (*cb_destroy) (struct cc_var *ccv); void (*conn_init) (struct cc_var *ccv); void (*ack_received) (struct cc_var *ccv, uint16_t type); void (*cong_signal) (struct cc_var *ccv, uint32_t type); void (*post_recovery) (struct cc_var *ccv); void (*after_idle) (struct cc_var *ccv); int (*ctl_output)(struct cc_var *, struct sockopt *, void *); }; .Ed .Pp The .Va name field identifies the unique name of the algorithm, and should be no longer than TCP_CA_NAME_MAX-1 characters in length (the TCP_CA_NAME_MAX define lives in .In netinet/tcp.h for compatibility reasons). .Pp The .Va mod_init function is called when a new module is loaded into the system but before the registration process is complete. It should be implemented if a module needs to set up some global state prior to being available for use by new connections. Returning a non-zero value from .Va mod_init will cause the loading of the module to fail. .Pp The .Va mod_destroy function is called prior to unloading an existing module from the kernel. It should be implemented if a module needs to clean up any global state before being removed from the kernel. The return value is currently ignored. .Pp The .Va cb_init function is called when a TCP control block .Vt struct tcpcb is created. It should be implemented if a module needs to allocate memory for storing private per-connection state. Returning a non-zero value from .Va cb_init will cause the connection set up to be aborted, terminating the connection as a result. .Pp The .Va cb_destroy function is called when a TCP control block .Vt struct tcpcb is destroyed. It should be implemented if a module needs to free memory allocated in .Va cb_init . .Pp The .Va conn_init function is called when a new connection has been established and variables are being initialised. It should be implemented to initialise congestion control algorithm variables for the newly established connection. .Pp The .Va ack_received function is called when a TCP acknowledgement (ACK) packet is received. Modules use the .Fa type argument as an input to their congestion management algorithms. The ACK types currently reported by the stack are CC_ACK and CC_DUPACK. CC_ACK indicates the received ACK acknowledges previously unacknowledged data. CC_DUPACK indicates the received ACK acknowledges data we have already received an ACK for. .Pp The .Va cong_signal function is called when a congestion event is detected by the TCP stack. Modules use the .Fa type argument as an input to their congestion management algorithms. The congestion event types currently reported by the stack are CC_ECN, CC_RTO, CC_RTO_ERR and CC_NDUPACK. CC_ECN is reported when the TCP stack receives an explicit congestion notification (RFC3168). CC_RTO is reported when the retransmission time out timer fires. CC_RTO_ERR is reported if the retransmission time out timer fired in error. CC_NDUPACK is reported if N duplicate ACKs have been received back-to-back, where N is the fast retransmit duplicate ack threshold (N=3 currently as per RFC5681). .Pp The .Va post_recovery function is called after the TCP connection has recovered from a congestion event. It should be implemented to adjust state as required. .Pp The .Va after_idle function is called when data transfer resumes after an idle period. It should be implemented to adjust state as required. .Pp The .Va ctl_output function is called when .Xr getsockopt 2 or .Xr setsockopt 2 is called on a .Xr tcp 4 socket with the .Va struct sockopt pointer forwarded unmodified from the TCP control, and a .Va void * pointer to algorithm specific argument. .Pp The .Fn DECLARE_CC_MODULE macro provides a convenient wrapper around the .Xr DECLARE_MODULE 9 macro, and is used to register a .Nm module with the .Nm framework. The .Fa ccname argument specifies the module's name. The .Fa ccalgo argument points to the module's .Vt struct cc_algo . .Pp .Nm modules must instantiate a .Vt struct cc_algo , but are only required to set the name field, and optionally any of the function pointers. The stack will skip calling any function pointer which is NULL, so there is no requirement to implement any of the function pointers. Using the C99 designated initialiser feature to set fields is encouraged. .Pp Each function pointer which deals with congestion control state is passed a pointer to a .Vt struct cc_var , which has the following members: .Bd -literal -offset indent struct cc_var { void *cc_data; int bytes_this_ack; tcp_seq curack; uint32_t flags; int type; union ccv_container { struct tcpcb *tcp; struct sctp_nets *sctp; } ccvc; }; .Ed .Pp .Vt struct cc_var groups congestion control related variables into a single, embeddable structure and adds a layer of indirection to accessing transport protocol control blocks. The eventual goal is to allow a single set of .Nm modules to be shared between all congestion aware transport protocols, though currently only .Xr tcp 4 is supported. .Pp To aid the eventual transition towards this goal, direct use of variables from the transport protocol's data structures is strongly discouraged. However, it is inevitable at the current time to require access to some of these variables, and so the .Fn CCV macro exists as a convenience accessor. The .Fa ccv argument points to the .Vt struct cc_var passed into the function by the .Nm framework. The .Fa what argument specifies the name of the variable to access. .Pp Apart from the .Va type and .Va ccv_container fields, the remaining fields in .Vt struct cc_var are for use by .Nm modules. .Pp The .Va cc_data field is available for algorithms requiring additional per-connection state to attach a dynamic memory pointer to. The memory should be allocated and attached in the module's .Va cb_init hook function. .Pp The .Va bytes_this_ack field specifies the number of new bytes acknowledged by the most recently received ACK packet. It is only valid in the .Va ack_received hook function. .Pp The .Va curack field specifies the sequence number of the most recently received ACK packet. It is only valid in the .Va ack_received , .Va cong_signal and .Va post_recovery hook functions. .Pp The .Va flags field is used to pass useful information from the stack to a .Nm module. The CCF_ABC_SENTAWND flag is relevant in .Va ack_received and is set when appropriate byte counting (RFC3465) has counted a window's worth of bytes has been sent. It is the module's responsibility to clear the flag after it has processed the signal. The CCF_CWND_LIMITED flag is relevant in .Va ack_received and is set when the connection's ability to send data is currently constrained by the value of the congestion window. Algorithms should use the absence of this flag being set to avoid accumulating a large difference between the congestion window and send window. .Sh SEE ALSO .Xr cc_cdg 4 , .Xr cc_chd 4 , .Xr cc_cubic 4 , +.Xr cc_dctcp 4 , .Xr cc_hd 4 , .Xr cc_htcp 4 , .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr mod_cc 4 , .Xr tcp 4 .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Community Foundation Silicon Valley. .Sh FUTURE WORK Integrate with .Xr sctp 4 . .Sh HISTORY The modular Congestion Control (CC) framework first appeared in .Fx 9.0 . .Pp The framework was first released in 2007 by James Healy and Lawrence Stewart whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia, which was made possible in part by a grant from the Cisco University Research Program Fund at Community Foundation Silicon Valley. More details are available at: .Pp http://caia.swin.edu.au/urp/newtcp/ .Sh AUTHORS .An -nosplit The .Nm framework was written by .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org , .An James Healy Aq Mt jimmy@deefa.com and .An David Hayes Aq Mt david.hayes@ieee.org . .Pp This manual page was written by .An David Hayes Aq Mt david.hayes@ieee.org and .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .