TCPSSO(8)
π NAME π
okay so bestie, this is tcpsso(8) β the manual page for tcpsso, and its whole vibe is: set a socket option on a TCP endpoint. no cap, that's the one-liner. π«Ά
πΈ SYNOPSIS πΈ
the exact shapes it takes:
tcpsso -i id [level] optname optval
tcpsso -a [level] optname optval
tcpsso -C cc-algo [-S stack] [-s state] [level] optname optval
tcpsso [-C cc-algo] -S stack [-s state] [level] optname optval
tcpsso [-C cc-algo] [-S stack] -s state [level] optname optval
π DESCRIPTION π
tcpsso is the command-line bestie that applies a socket option at level, with the name optname and the value optval, on a TCP endpoint. literally from the command line, slay. β¨
β οΈ important caveat, bestie: TCP endpoints in theSYN_RCVDstate can only be handled bytcpssoif their prior state wasSYN_SENT. don't forget that part, fr fr.
π level, optname, optval β the trio π
level can be specified as a non-negative number or a symbolic name like SOL_SOCKET, IPPROTO_IP, IPPROTO_IPV6, or IPPROTO_TCP. If it's not specified, tcpsso deduces the level from optname, if optname is provided as a symbolic name. If that's not the case, IPPROTO_TCP is used. π
optname can be specified as a non-negative number or a symbolic name like SO_DEBUG, IP_TOS, IPV6_TCLASS, TCP_LOG, TCP_CONGESTION, or TCP_FUNCTION_BLK. so many iconic little names, iykyk. π¦
optval can be an integer value, which will be converted to a binary value and passed as an int value. If it cannot be parsed as an integer value, it will be processed as a string. If the optname is TCP_FUNCTION_BLK then optval is converted to a struct tcp_function_set. periodt. π
π― selector flags π―
-iid β if-iid is specified thentcpssowill apply the socket option to the TCP endpoint with theinp_gencntprovided as id. Theinp_gencntfor existing TCP endpoints can be determined by usingsockstat(1). π-aβ if-ais specified thentcpssowill apply the socket option to all TCP endpoints subject to the above state restrictions. π-Ccc-algo β if-Ccc-algo is specified thentcpssowill apply the socket option to all TCP endpoints using the TCP congestion control algorithm cc-algo and subject to the above state restrictions. π₯-Sstack β if-Sstack is specified thentcpssowill apply the socket option to all TCP endpoints using the TCP stack stack and subject to the above state restrictions. π-sstate β if-sstate is specified thentcpssowill apply the socket option to all TCP endpoints being in the state state. state is one ofCLOSED,LISTEN,SYN_SENT,SYN_RCVD,ESTABLISHED,CLOSE_WAIT,FIN_WAIT_1,CLOSING,LAST_ACK,FIN_WAIT_2, orTIME_WAIT. UsingSYN_RCVDonly applies to TCP endpoints in the stateSYN_RCVDif their prior state wasSYN_SENT. π«Ά
If multiple of -C cc-algo, -S stack, and -s state are specified, tcpsso will apply the socket option to all TCP endpoints using the congestion control algorithm cc-algo, being in the state state, and using the TCP stack stack, if specified. β¨
If none of the -a, -C, -S, or -s options are specified then the option -i must be specified. no skipping that, bestie. π
β EXIT STATUS β
The tcpsso utility exits 0 on success, and >0 if an error occurs. clean and simple, we love to see it. π
π EXAMPLES π
To diagnose a problem with a particular TCP connection to sshd(8), first determine its inp_gencnt using sockstat(1):
# sockstat -4 -c -i -p 22 -P tcp -q
root sshd 827 4 tcp4 \
192.168.1.1:22 192.168.1.2:53736 435
Then, use the following command to enable Black Box Logging on it:
# tcpsso -i 435 TCP_LOG 4
To switch all TCP endpoints from using the freebsd stack to the RACK stack use:
# tcpsso -S freebsd TCP_FUNCTION_BLK rack
Switch all TCP endpoints in the LISTEN state to the RACK stack by using:
# tcpsso -s LISTEN TCP_FUNCTION_BLK rack
The following command will set the congestion control module of all TCP endpoints currently using cubic as its congestion control algorithm to the congestion control algorithm newreno:
# tcpsso -C cubic TCP_CONGESTION newreno
π¦ SEE ALSO π¦
π HISTORY π
The tcpsso command first appeared in FreeBSD 14. iconic behavior. π
π AUTHORS π
Michael Tuexen β tuexen@FreeBSD.org
xoxo, bestie π β source/version: Debian, date: August 3, 2024, page: TCPSSO(8) / tcpsso(8). periodt. π«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 2022 Michael Tuexen <tuexen@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms