TCPSSO(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– 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 the SYN_RCVD state can only be handled by tcpsso if their prior state was SYN_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 🎯

  • -i id β€” if -i id is specified then tcpsso will apply the socket option to the TCP endpoint with the inp_gencnt provided as id. The inp_gencnt for existing TCP endpoints can be determined by using sockstat(1). πŸ’…
  • -a β€” if -a is specified then tcpsso will apply the socket option to all TCP endpoints subject to the above state restrictions. πŸ‘‘
  • -C cc-algo β€” if -C cc-algo is specified then tcpsso will apply the socket option to all TCP endpoints using the TCP congestion control algorithm cc-algo and subject to the above state restrictions. πŸ”₯
  • -S stack β€” if -S stack is specified then tcpsso will apply the socket option to all TCP endpoints using the TCP stack stack and subject to the above state restrictions. 🌈
  • -s state β€” if -s state is specified then tcpsso will apply the socket option to all TCP endpoints being in the state state. state is one of CLOSED, LISTEN, SYN_SENT, SYN_RCVD, ESTABLISHED, CLOSE_WAIT, FIN_WAIT_1, CLOSING, LAST_ACK, FIN_WAIT_2, or TIME_WAIT. Using SYN_RCVD only applies to TCP endpoints in the state SYN_RCVD if their prior state was SYN_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