TCPBENCH(1)

πŸ“¦
version 2.02 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ TCPBENCH(1) β€” the tcpbench glow-up ✨

okay bestie, welcome to tcpbench, from the General Commands Manual section of your fave Unix, and it's giving network benchmarking icon. Sit down, grab a boba, we're measuring throughput 🫢


🌸 NAME 🌸

tcpbench β€” TCP/UDP benchmarking and measurement tool. yes queen, that's the whole name, short and slay πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

tcpbench -l
tcpbench [-46DRUuv] [-B buf] [-b sourceaddr] [-k kvars] [-n connections]
         [-p port] [-r interval] [-S space] [-T toskeyword] [-t secs]
         [-V rtable] hostname
tcpbench -s [-46DUuv] [-B buf] [-k kvars] [-p port] [-r interval]
         [-S space] [-T toskeyword] [-V rtable] [hostname]

like. look at her. three whole modes. main character energy fr fr ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

tcpbench is a small tool β€” tiny, humble, iconic β€” that does throughput benchmarking and concurrent sampling of kernel network variables. so like, it runs the numbers and it takes notes on the kernel while it does it. multitasking queen πŸ’…

You run it as a client/server pair, periodt. The server HAS to be invoked with the -s flag β€” that's the one that makes it listen for incoming connections. The client has to be invoked with the hostname of a listening server, so it knows who to connect to. they're a duo. you can't have one without the other, iykyk 😭

Once they're connected, the client sends TCP or UDP traffic as fast as possible to the server. Both sides periodically compute and display throughput statistics. okay so the deets:

  • For UDP, the server starts computing these when it receives the first datagram.
  • For TCP, it stops when it has no connections.

That display also includes any kernel variables you've selected to sample with the -k option β€” and heads up, -k is only available in TCP mode 🫠. Wanna know what variables exist? The -l option gives you the list.

A summary over the periodic throughput statistics is displayed on exit. Want it more accurate? Decrease the interval, bestie β€” accuracy may be increased by decreasing the interval. The summary bytes and duration cover the interval from transfer start to process exit. And you can also peek at the summary while tcpbench is running by sending it a SIGINFO signal β€” see the status argument of stty(1) for more info on that. no cap 🌈

The options are as follows:


πŸ’– OPTIONS πŸ’–

  • -4 β€” Force tcpbench to use IPv4 addresses only. v4 girlies only, sorry πŸ’…
  • -6 β€” Force tcpbench to use IPv6 addresses only. v6 supremacy, we love to see it ✨
  • -B buf β€” Specify the size of the internal read/write buffer tcpbench uses. The default is 262144 bytes for TCP client/server and UDP server. In UDP client mode, this may be used to specify the packet size on the test stream. so it's a buffer OR a packet size depending on the vibe 🫢
  • -b sourceaddr β€” Specify the IP address to send the packets from. super useful on machines with multiple interfaces β€” like, pick your fave interface, bestie 🌸
  • -D β€” Enable debugging on the socket. we're nosy today and that's valid πŸ™ˆ
  • -k kvars β€” Specify one or more kernel variables to monitor; multiple variables must be separated with commas. This option is only valid in TCP mode. The default is not to monitor any variables. no k, no notes πŸ’…
  • -l β€” List the name of kernel variables available for monitoring, then exit. it's a lil menu, take a look πŸŽ€
  • -n connections β€” Use the given number of TCP connections (default: 1). UDP is connectionless, so this option isn't valid there. can't count connections that don't exist, bestie 😭
  • -p port β€” Specify the port used for the test stream (default: 12345). the classic πŸ“
  • -R β€” In client mode, the write buffer size is randomized up to the size specified via -B. chaos but make it intentional πŸ’€
  • -r interval β€” Specify the statistics interval reporting rate in milliseconds (default: 1000). If set to 0, nothing is printed. silence is golden, periodt 🀫
  • -S space β€” Set the size of the socket buffer used for the test stream. On the client this resizes the send buffer; on the server it resizes the receive buffer. two different jobs, one flag, we love a multitasker ✨
  • -s β€” Place tcpbench in server mode, where it listens on all interfaces for incoming connections. It defaults to using TCP if -u is not specified. she's serving, literally πŸ’…
  • -T toskeyword β€” Change the IPv4 TOS or IPv6 TCLASS value. toskeyword may be one of critical, inetcontrol, lowdelay, netcontrol, throughput, reliability, or one of the DiffServ Code Points: ef, af11 ... af43, cs0 ... cs7; or a number in either hex or decimal. so many options, pick your fighter πŸ‘‘
  • -t secs β€” Stop after secs seconds. boundaries, bestie, we're setting them πŸŽ€
  • -U β€” Use AF_UNIX sockets instead of IPv4 or IPv6 sockets. In client and server mode hostname is used as the path to the AF_UNIX socket. local girlies rise up πŸ¦‹
  • -u β€” Use UDP instead of TCP; this must be specified on both the client and the server. Transmitted packets per second (TX PPS) will be accounted on the client side, while received packets per second (RX PPS) will be accounted on the server side. UDP has no Protocol Control Block (PCB) so the -k flags don't apply. no PCB, no kernel var sampling, that's just the rules 😭
  • -V rtable β€” Set the routing table to be used. choosing your path in life fr fr 🌈
  • -v β€” Display verbose output. If specified more than once, increase the detail of information displayed. stack it. more v's, more tea πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

netstat(1), pstat(8)

go read those too, they're the supporting cast and they ate πŸ’…


⭐ HISTORY ⭐

The tcpbench program first appeared in OpenBSD 4.4. an elder icon, we stan a legacy ✨


🌈 AUTHORS 🌈

The tcpbench program was written by Damien Miller <djm@openbsd.org>.

UDP mode and libevent port by Christiano F. Haesbaert <haesbaert@haesbaert.org>.

two absolute legends, giving us the tool AND the UDP glow-up πŸ«ΆπŸ’–


and that's the whole page, bestie!! this cutie came out of the Debian packaging, dated August 15, 2022 β€” so when you see her floating around your system, that's the era she's from. go benchmark something, you're gonna slay πŸ’…βœ¨πŸŽ€
πŸ“¦ where this page comes from