flowgrind(1)
π¦ flowgrind(1) β the Flowgrind Manual, bestie edition π
okay so. flowgrind is your new bestie and she's an advanced TCP traffic generator for Linux, FreeBSD, and Mac OS X. she's in the Flowgrind Manual family. she's iconic, she's thorough, and she's about to measure literally everything. let's get into it β¨
πΈ NAME πΈ
flowgrind β advanced TCP traffic generator for Linux, FreeBSD, and Mac OS X
π SYNOPSIS π
flowgrind [OPTION]...
that's it. that's the whole vibe. options go in, science comes out π
π DESCRIPTION π
okay so flowgrind is an advanced TCP traffic generator for testing and benchmarking Linux, FreeBSD, and Mac OS X TCP/IP stacks. unlike other performance measurement tools (no names, no shade π) she features a distributed architecture, where throughput and other metrics are measured between arbitrary flowgrind server processes β the flowgrind daemon, flowgrindd(1).
so like, what does she actually measure? besides goodput (that's throughput bestie), she measures the application layer interarrival time (IAT) and round-trip time (RTT), blockcount, and network transactions/s. and unlike most cross-platform testing tools, flowgrind collects and reports the TCP metrics returned by the TCP_INFO socket option, which are usually internal to the TCP/IP stack β like, she's reading the kernel's diary, iykyk. on Linux and FreeBSD this includes among others the kernel's estimation of the end-to-end RTT, the size of the TCP congestion window (CWND) and the slow start threshold (SSTHRESH). the way that's so much information π«Ά
flowgrind has a distributed architecture. she's split into two components: the flowgrind daemon, flowgrindd(1), and the flowgrind controller. using the controller, flows between any two systems running the flowgrind daemon can be set up (that's a third party test, main character energy). at regular intervals during the test the controller collects and displays the measured results from the daemons. she can run multiple flows at once with the same or different settings, and individually schedule every single one. test and control connection can optionally be diverted to different interfaces. periodt.
the traffic generation itself is either bulk transfer, rate-limited, or sophisticated request/response tests. and flowgrind uses libpcap to automatically dump traffic for qualitative analysis. obsessed honestly π
β¨ OPTIONS β¨
okay so there are two important groups of options: controller options and flow options. like the name suggests, controller options apply globally and potentially affect all flows, while flow-specific options only apply to the subset of flows selected using the -F option.
π‘ Mandatory arguments to long options are mandatory for short options too. no cap.
π§ General options π§
-h,--help[=WHAT]β display help and exit. the optionalWHATcan either be'socket'for help on socket options or'traffic'for traffic generation help. she's helpful like that π-v,--versionβ print version information and exit. just a lil flex β¨
π Controller options π
-c,--show-colon=TYPE[,TYPE]...β display intermediated interval report columnTYPEin output. allowed values forTYPEare:'interval','through','transac','iat','kernel'(all show per default), and'blocks','rtt','delay'(optional)-d,--debugβ increase debugging verbosity. add option multiple times to increase the verbosity. stackable, like my feelings π-e,--dump-prefix=PREβ prepend prefixPREto dump filename (default:"flowgrind-")-i,--report-interval=#.#β reporting interval, in seconds (default:0.05s)--log-file[=FILE]β write output to logfileFILE(default:flowgrind-'timestamp'.log)-mβ report throughput in2**20bytes/s (default:10**6bit/s)-n,--flows=#β number of test flows (default:1)-oβ overwrite existing log files (default: don't)-pβ don't print symbolic values (likeINT_MAX) instead of numbers-q,--quietβ be quiet, do not log to screen (default: off). shy era π-s,--tcp-stack=TYPEβ don't determine unit of source TCP stacks automatically. force unit toTYPE, whereTYPEis'segment'or'byte'-wβ write output to logfile (same as--log-file)
π¦ Flow options π¦
all flows have two endpoints, a source and a destination. the distinction between source and destination endpoints only affects connection establishment. when starting a flow the destination endpoint listens on a socket and the source endpoint connects to it. for the actual test this makes no difference β both endpoints have exactly the same capabilities. data can be sent in either direction and many settings can be configured individually for each endpoint. equal rights, we love to see it π
some of these options take the flow endpoint as argument, denoted by 'x' in the option syntax. 'x' needs to be replaced with either 's' for the source endpoint, 'd' for the destination endpoint or 'b' for both endpoints. to specify different values for each endpoint, separate them by comma. for instance -W s=8192,d=4096 sets the advertised window to 8192 at the source and 4096 at the destination. slay.
-A xβ use minimal response size needed for RTT calculation (same as-G s=p:C:40)-B x=#β set requested sending buffer, in bytes-C xβ stop flow if it is experiencing local congestion-D x=DSCPβ DSCP value for type-of-service (TOS) IP header byte-Eβ enumerate bytes in payload instead of sending zeros-F #[,#]...β flow options following this option apply only to the given flow IDs. useful in combination with-nto set specific options for certain flows. numbering starts with0, so-F 1refers to the second flow. with-1all flow can be referred-G x=(q|p|g):(C|U|E|N|L|P|W):#1:[#2]β activate stochastic traffic generation and set parameters according to the used distribution. for additional information see section'Traffic Generation Option'-H x=HOST[/CONTROL[:PORT]]β test from/toHOST. optional argument is the address and port for theCONTROLconnection to the same host. an endpoint that isn't specified is assumed to belocalhost-J #β use random seed#(default: read/dev/urandom)-Iβ enable one-way delay calculation (no clock synchronization)-Lβ callconnect()on test socket immediately before starting to send data (late connect). if not specified the test connection is established in the preparation phase before the test starts-M xβ dump traffic usinglibpcap.flowgrindd(1)must be run as root-Nβshutdown()each socket direction after test flow-O x=OPTβ set socket optionOPTon test socket. for additional information see section'Socket Options'-P xβ do not iterate throughselect()to continue sending in case block size did not suffice to fill sending queue (pushy)-Qβ summarize only, no intermediated interval reports are computed (quiet)-R x=#.#(z|k|M|G)(b|B)β send at specified rate per second, where:z=2**0,k=2**10,M=2**20,G=2**30, andb= bits/s (default),B= bytes/s-S x=#β set block (message) size, in bytes (same as-G s=q:C:#)-T x=#.#β set flow duration, in seconds (default:s=10,d=0)-U x=#β set application buffer size, in bytes (default:8192) β truncates values if used with stochastic traffic generation-W x=#β set requested receiver buffer (advertised window), in bytes-Y x=#.#β set initial delay before the host starts to send, in seconds
π TRAFFIC GENERATION OPTION π
via option -G flowgrind supports stochastic traffic generation, which allows her to conduct besides normal bulk also advanced rate-limited and request-response data transfers. she's versatile okay π€
the stochastic traffic generation option -G takes the flow endpoint as argument, denoted by 'x' in the option syntax. 'x' needs to be replaced with either 's' for the source endpoint, 'd' for the destination endpoint or 'b' for both endpoints. however, please note that bidirectional traffic generation can lead to unexpected results π. to specify different values for each endpoint, separate them by comma.
-G x=(q|p|g):(C|U|E|N|L|P|W):#1:[#2]
flow parameter:
qβ request size (in bytes)pβ response size (in bytes)gβ request interpacket gap (in seconds)
distributions:
Cβ constant (#1: value,#2: not used)Uβ uniform (#1: min,#2: max)Eβ exponential (#1: lamba - lifetime,#2: not used)Nβ normal (#1: mu - mean value,#2: sigma_square - variance)Lβ lognormal (#1: zeta - mean,#2: sigma - std dev)Pβ pareto (#1: k - shape,#2: x_min - scale)Wβ weibull (#1: lambda - scale,#2: k - shape)
π«Ά advanced distributions like weibull are only available if flowgrind is compiled with libgsl support. check before you commit bestie.
-U #β specify a cap for the calculated values for request and response sizes, needed because the advanced distributed values are unbounded, but we need to know the buffersize (it's not needed for constant values or uniform distribution). values outside the bounds are recalculated until a valid result occurs but at most10times (then the bound value is used)
π SOCKET OPTION π
flowgrind allows you to set the following standard and non-standard socket options via option -O.
all socket options take the flow endpoint as argument, denoted by 'x' in the option syntax. 'x' needs to be replaced with either 's' for the source endpoint, 'd' for the destination endpoint or 'b' for both endpoints. to specify different values for each endpoint, separate them by comma. moreover, it is possible to repeatedly pass the same endpoint in order to specify multiple socket options. stack them like accessories β¨
πΈ Standard socket options πΈ
-O x=TCP_CONGESTION=ALGβ set congestion control algorithmALGon test socket-O x=TCP_CORKβ setTCP_CORKon test socket-O x=TCP_NODELAYβ disable nagle algorithm on test socket-O x=SO_DEBUGβ setSO_DEBUGon test socket-O x=IP_MTU_DISCOVERβ setIP_MTU_DISCOVERon test socket if not already enabled by system default-O x=ROUTE_RECORDβ setROUTE_RECORDon test socket
π¦ Non-standard socket options π¦
-O x=TCP_MTCPβ setTCP_MTCP(15) on test socket-O x=TCP_ELCNβ setTCP_ELCN(20) on test socket-O x=TCP_LCDβ setTCP_LCD(21) on test socket
okay that's the first half and bestie, we are not done yet β more parts are coming, so don't go anywhere π
π EXAMPLES π
Bestie, these are the classic moves. Steal them, they work. π
flowgrind
testing localhost IPv4 TCP performance with default settings</p>, same as flowgrind -H b=127.0.0.1 -T s=10,d=0. The flowgrind daemon needs to be run on localhost β¨
flowgrind -H b=::1/127.0.0.1
same as above, but testing localhost IPv6 TCP performance with default settings π¦
flowgrind -H s=host1,d=host2
bulk TCP transfer between host1 and host2. Host1 acts as source, host2 as destination endpoint. Both endpoints need to be run the flowgrind daemon. The default flow options are used, with a flow duration of 10 seconds and a data stream from host1 to host2 π₯
flowgrind -H s=host1,d=host2 -T s=0,d=10
same as the above but instead with a flow sending data for 10 seconds from host2 to host1 πΈ
flowgrind -n 2 -F 0 -H s=192.168.0.1,d=192.168.0.69 -F 1 -H
s=10.0.0.1,d=10.0.0.2
setup two parallel flows, first flow between 192.168.0.1 and 192.168.0.69, second flow between 10.0.0.1 to 10.0.0.2 π
flowgrind -p -H s=10.0.0.100/192.168.1.100,d=10.0.0.101/192.168.1.101 -A
s
setup one flow between 10.0.0.100 and 10.0.0.101 and use 192.168.1.x IP addresses for the control traffic. Activate minimal response for RTT calculation π
flowgrind -i 0.001 -T s=1 | egrep ^S | gnuplot -persist -e 'plot "-"
using 3:5 with lines title "Throughput" '
setup one flow over the loopback device and plot the data of the sender with the help of gnuplot π
flowgrind -G s=q:C:400 -G s=p:N:2000:50 -G s=g:U:0.005:0.01 -U 32000
-G s=q:C:400: use constant request size of 400 bytes-G s=p:N:2000:50: use normal distributed response size with mean 2000 bytes and variance 50-G s=g:U:0.005:0.01: use uniform distributed interpacket gap with min 0.005s and max 10ms-U 32000: truncate block sizes at 32 kbytes (needed for normal distribution)
π TRAFFIC SCENARIOS π
Okay so here's the tea: the following examples demonstrate how flowgrind's traffic generation capability can be used. These have been incorporated in different tests for flowgrind and have been proven meaningful. However, as Internet traffic is diverse, there is no guarantee that these are appropriate in every situation. π
π Request Response Style (HTTP)
This scenario is based on the work in http://www.3gpp2.org/Public_html/specs/C.R1002-0_v1.0_041221.pdf.
flowgrind -M s -G s=q:C:350 -G s=p:L:9055:115.17 -U 100000
-r 42: use random seed 42 to make measurements reproducible-M s: dump traffic on sender side-G s=q:C:350: use constant requests size 350 bytes-G s=p:L:9055:115: use lognormal distribution with mean 9055 and variance 115 for response size-U 100000: Truncate response at 100 kbytes
For this scenario we recommend to focus on RTT (lower values are better) and Network Transactions/s as metric (higher values are better) π
π Interactive Session (Telnet)
This scenario emulates a telnet session.
flowgrind -G s=q:U:40:10000 -G s=q:U:40:10000 -O b=TCP_NODELAY
-G s=q:U:40:10000--G s=q:U:40:10000: use uniform distributed request and response size between 40B and 10kB-O b=TCP_NODELAY: set socket options TCP_NODELAY as used by telnet applications
For this scenario RTT (lower is better) and Network Transactions/s are useful metrics (higher is better). β¨
π¦ Rate Limited (Streaming Media)
This scenario emulates a video stream transfer with a bitrate of 800 kbit/s.
flowgrind -G s=q:C:800 -G s=g:N:0.008:0.001
Use normal distributed interpacket gap with mean 0.008 and a small variance (0.001). In conjunction with a request size of 800 bytes an average bitrate of approx 800 kbit/s is achieved. The variance is added to emulate a variable bitrate like it's used in todays video codecs. π¬
For this scenario the IAT (lower is better) and minimal throughput (higher is better) are interesting metrics. π
π OUTPUT COLUMNS π
πΈ Flow/endpoint identifiers
#β flow endpoint, either'S'for source or'D'for destinationIDβ numerical flow identifierbeginandendβ boundaries of the measurement interval in seconds. The time shown is the elapsed time since receiving the RPC message to start the test from the daemons point of view
π Application layer metrics
throughβ transmitting goodput of the flow endpoint during this measurement interval, measured in Mbit/s (default) or MB/s (-m)transacβ number of successfully received response blocks per second (we call it network transactions/s)requ/respβ number of request and response block sent during this measurement interval (column disabled by default)IATβ block inter-arrival time (IAT). Together with the minimum and maximum the arithmetic mean for that specific measurement interval is displayed. If no block is received during report interval,'inf'is displayed.DLYandRTTβ 1-way and 2-way block delay respectively the block latency and the block round-trip time (RTT). For both delays the minimum and maximum encountered values in that measurement interval are displayed together with the arithmetic mean. If no block, respectively block acknowledgment is arrived during that report interval,'inf'is displayed. Both, the 1-way and 2-way block delay are disabled by default (see option-Iand-A).
π§ Kernel metrics (TCP_INFO)
All following TCP specific metrics are obtained from the kernel through the TCP_INFO socket option at the end of every report interval. The sampling rate can be changed via option -i. β¨
cwnd(tcpi_cwnd) β size of TCP congestion window (CWND) in number of segments (Linux) or bytes (FreeBSD)ssth(tcpi_snd_sshtresh) β size of the slow-start threshold in number of segments (Linux) or bytes (FreeBSD)uack(tcpi_unacked) β number of currently unacknowledged segments, i.e., number of segments in flight (FlightSize) (Linux only)sack(tcpi_sacked) β number of selectively acknowledged segments (Linux only)lost(tcpi_lost) β number of segments assumed lost (Linux only)retr(tcpi_retrans) β number of unacknowledged retransmitted segments (Linux only)tret(tcpi_retransmits) β number of retransmissions triggered by a retransmission timeout (RTO) (Linux only)fack(tcpi_fackets) β number of segments between SND.UNA and the highest selectively acknowledged sequence number (SND.FACK) (Linux only)reor(tcpi_reordering) β segment reordering metric. The Linux kernel can detect and cope with reordering without significant loss of performance if the distance a segment gets displaced does not exceed the reordering metric (Linux only)rtt(tcpi_rtt) andrttvar(tcpi_rttvar) β TCP round-trip time and its variance given in msrto(tcpi_rto) β the retransmission timeout given in msbkof(tcpi_backoff) β number of RTO backoffs (Linux only)ca state(tcpi_ca_state) β internal state of the TCP congestion control state machine as implemented in the Linux kernel. Can be one ofopen,disorder,cwr,recoveryorloss(Linux only)Openβ is the normal state. It indicates that no duplicate acknowledgment (ACK) is received and no segment is considered lostDisorderβ is entered upon the reception of the first consecutive duplicate ACK or selective acknowledgment (SACK)CWRβ is entered when a notification from Explicit Congestion Notification (ECN) is receivedRecoveryβ is entered when three duplicate ACKs or a equivalent number of SACKs are received. In this state congestion control and loss recovery procedures like Fast Retransmit and Fast Recovery (RFC 5861) are executedLossβ is entered if the RTO expires. Again congestion control and loss recovery procedures are executed
smssandpmtuβ sender maximum segment size and path maximum transmission unit in bytes
π Internal flowgrind state (only enabled in debug builds)
statusβ state of the flow inside flowgrind for diagnostic purposes. It is a tuple of two values, the first for sending and the second for receiving. Ideally the states of both the source and destination endpoints of a flow should be symmetrical but since they are not synchronized they may not change at the same time. The possible values are:cβ Direction completed sending/receivingdβ Waiting for initial delayfβ Fault statelβ Active state, nothing yet transmitted or receivednβ Normal activity, some data got transmitted or receivedoβ Flow has zero duration in that direction, no data is going to be exchanged
π AUTHORS π
Flowgrind was original started by Daniel Schaffrath. The distributed measurement architecture and advanced traffic generation were later on added by Tim Kosse and Christian Samsel. Currently, flowgrind is developed and maintained by Arnd Hannemann and Alexander Zimmermann. π
π«Ά BUGS π«Ά
The development and maintenance of flowgrind is primarily done via github <https://github.com/flowgrind/flowgrind>. Please report bugs via the issue webpage <https://github.com/flowgrind/flowgrind/issues>. π
β NOTES β
Output of flowgrind is gnuplot compatible, so you can easily plot flowlogs flowgrind's output (aka flowlogs) πβ¨
π SEE ALSO π
flowgrindd(1), flowgrind-stop(1), gnuplot(1)
okay bestie that's the whole page, no cap π this little icon is from January 2021 and it's the manual for flowgrind(1) β go forth and measure, you absolute main character ππ
π¦
π¦ where this page comes from
- debian bookworm: flowgrind 0.8.2-2+b2
- debian trixie: flowgrind 0.8.2-2+b4
- opensuse-leap 16.0: flowgrind 0.8.2-bp160.1.13 Β· GPL-2.0-only
- opensuse-leap 16.0: flowgrind 0.8.2-bp160.1.13 Β· GPL-2.0-only
- opensuse-leap 16.0: flowgrind 0.8.2-bp160.1.13 Β· GPL-2.0-only
- opensuse-leap 16.0: flowgrind 0.8.2-bp160.1.13 Β· GPL-2.0-only
- ubuntu jammy: flowgrind 0.8.2-2build1
- ubuntu noble: flowgrind 0.8.2-2build3
- ubuntu questing: flowgrind 0.8.2-2build4
- ubuntu resolute: flowgrind 0.8.2-2build5
- ubuntu stonking: flowgrind 0.8.2-2build5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms