2 .\" SPDX-License-Identifier: BSD-2-Clause
4 .\" Copyright (c) 2022 Michael Tuexen <tuexen@FreeBSD.org>
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd set a socket option on a TCP endpoint
70 level socket option with name
74 on a TCP endpoint from the command line.
78 state can not be handled by
82 state can only be handled if their prior state was
86 can be specified as a non negative number or a symbolic name like
94 deduces the level from
96 if provided as a symbolic name.
97 If that is not the case,
102 can be specified as a non negative number or a symbolic name like
109 .Dv TCP_FUNCTION_BLK .
112 can be in integer value, which will be converted to a binary value and
113 passed as an int value.
114 If it cannot be parsed as an integer value, it will be processed as a string.
122 .Vt "struct tcp_function_set" .
128 will apply the socket option to the TCP endpoint with the
134 for existing TCP endpoints can be determined by using
141 will apply the socket option to all TCP endpoints subject to the above state
148 will apply the socket option to all TCP endpoints using the TCP
149 congestion control algorithm
151 and subject to the above state restrictions.
157 will apply the socket option to all TCP endpoints using the TCP
160 and subject to the above state restrictions.
166 will apply the socket option to all TCP endpoints being in the state
182 only applies to TCP endpoints in the state
184 if their prior state was
194 will apply the socket option to all TCP endpoints not being in the
197 and using the congestion control algorithm
201 and using the TCP stack
211 options are specified then the option
217 To diagnose a problem with a particular TCP connection to
223 .Bd -literal -offset indent
224 # sockstat -4 -c -i -p 22 -P tcp -q
225 root sshd 827 4 tcp4 \e
226 192.168.1.1:22 192.168.1.2:53736 435
229 Then, use the following command to enable Black Box Logging on it:
230 .Bd -literal -offset indent
231 # tcpsso -i 435 TCP_LOG 4
234 To switch all TCP endpoints from using the freebsd stack to the rack stack use:
235 .Bd -literal -offset indent
236 # tcpsso -S freebsd TCP_FUNCTION_BLK rack
239 The following command will set the congestion control module of all TCP
240 endpoints currently using cubic as its congestion control algorithm to the
241 congestion control algorithm newreno:
242 .Bd -literal -offset indent
243 # tcpsso -C cubic TCP_CONGESTION newreno
253 command first appeared in
256 .An Michael Tuexen Aq Mt tuexen@FreeBSD.org