2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
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.
77 can be specified as a non negative number or a symbolic name like
85 deduces the level from
87 if provided as a symbolic name.
88 If that is not the case,
93 can be specified as a non negative number or a symbolic name like
100 .Dv TCP_FUNCTION_BLK .
103 can be in integer value, which will be converted to a binary value and
104 passed as an int value.
105 If it cannot be parsed as an integer value, it will be processed as a string.
113 .Vt "struct tcp_function_set" .
119 will apply the socket option to the TCP endpoint with the
125 for existing TCP endpoints can be determined by using
132 will apply the socket option to all TCP endpoints not being in the state
139 will apply the socket option to all TCP endpoints using the TCP
140 congestion control algorithm
142 and not being in the state
149 will apply the socket option to all TCP endpoints using the TCP
152 and not being in the state
159 will apply the socket option to all TCP endpoints being in the state
181 will apply the socket option to all TCP endpoints not being in the
184 and using the congestion control algorithm
188 and using the TCP stack
198 options are specified then the option
204 To diagnose a problem with a particular TCP connection to
210 .Bd -literal -offset indent
211 # sockstat -4 -c -i -p 22 -P tcp -q
212 root sshd 827 4 tcp4 \e
213 192.168.1.1:22 192.168.1.2:53736 435
216 Then, use the following command to enable Black Box Logging on it:
217 .Bd -literal -offset indent
218 # tcpsso -i 435 TCP_LOG 4
221 To switch all TCP endpoints from using the freebsd stack to the rack stack use:
222 .Bd -literal -offset indent
223 # tcpsso -S freebsd TCP_FUNCTION_BLK rack
226 The following command will set the congestion control module of all TCP
227 endpoints currently using cubic as its congestion control algorithm to the
228 congestion control algorithm newreno:
229 .Bd -literal -offset indent
230 # tcpsso -C cubic TCP_CONGESTION newreno
240 command first appeared in
243 .An Michael Tuexen Aq Mt tuexen@FreeBSD.org