xref: /openbsd-src/usr.bin/tcpbench/tcpbench.1 (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1.\" $OpenBSD: tcpbench.1,v 1.15 2011/09/09 00:40:54 haesbaert Exp $
2.\"
3.\" Copyright (c) 2008 Damien Miller <djm@mindrot.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: September 9 2011 $
18.Dt TCPBENCH 1
19.Os
20.Sh NAME
21.Nm tcpbench
22.Nd TCP/UDP benchmarking and measurement tool
23.Sh SYNOPSIS
24.Nm
25.Fl l
26.Nm
27.Op Fl uv
28.Op Fl B Ar buf
29.Op Fl b Ar addr
30.Op Fl k Ar kvars
31.Op Fl n Ar connections
32.Op Fl p Ar port
33.Op Fl r Ar interval
34.Op Fl S Ar space
35.Op Fl T Ar toskeyword
36.Op Fl V Ar rtable
37.Ar hostname
38.Nm
39.Bk -words
40.Fl s
41.Op Fl uv
42.Op Fl B Ar buf
43.Op Fl k Ar kvars
44.Op Fl p Ar port
45.Op Fl r Ar interval
46.Op Fl S Ar space
47.Op Fl T Ar toskeyword
48.Op Fl V Ar rtable
49.Ek
50.Sh DESCRIPTION
51.Nm
52is a small tool that performs throughput benchmarking and concurrent
53sampling of kernel network variables.
54.Pp
55.Nm
56is run as a client/server pair.
57The server must be invoked with the
58.Fl s
59flag, which will cause it to listen for incoming connections.
60The client must be invoked with the
61.Ar hostname
62of a listening server to connect to.
63.Pp
64Once connected, the client will send TCP or UDP traffic as fast as possible to
65the server.
66Both the client and server will periodically display throughput
67statistics along with any kernel variables the user has selected to
68sample (using the
69.Fl k
70option, which is only available in TCP mode).
71A list of available kernel variables may be obtained using the
72.Fl l
73option.
74.Pp
75The options are as follows:
76.Bl -tag -width Ds
77.It Fl B Ar buf
78Specify the size of the internal read/write buffer used by
79.Nm .
80The default is 262144 bytes for TCP client/server and UDP server.
81In UDP client mode this may be used to specify the packet size on the test
82stream.
83.It Fl b Ar addr
84Specifies the IP address of the interface which is used to send the packets.
85.It Fl k Ar kvars
86Specify one or more kernel variables to monitor; multiple variables must be
87separated with commas.
88This option is only valid in TCP mode.
89The default is not to monitor any variables.
90Using this option requires read access to
91.Pa /dev/kmem .
92.It Fl l
93List the name of kernel variables available for monitoring and exit.
94.It Fl n Ar connections
95Use the given number of TCP connections (default: 1).
96UDP is connectionless so this option isn't valid.
97.It Fl p Ar port
98Specify the port used for the test stream (default: 12345).
99.It Fl r Ar interval
100Specify the statistics interval reporting rate in milliseconds (default: 1000).
101.It Fl S Ar space
102Set the size of the socket buffer used for the test stream.
103On the client this option will resize the send buffer;
104on the server it will resize the receive buffer.
105.It Fl s
106Place
107.Nm
108in server mode, where it will listen on all interfaces for incoming
109connections.
110It defaults to using TCP if
111.Fl u
112is not specified.
113.It Fl T Ar toskeyword
114Change the IPv4 TOS or IPv6 TCLASS value.
115.Ar toskeyword
116may be one of
117.Ar critical ,
118.Ar inetcontrol ,
119.Ar lowdelay ,
120.Ar netcontrol ,
121.Ar throughput ,
122.Ar reliability ,
123or one of the DiffServ Code Points:
124.Ar ef ,
125.Ar af11 ... af43 ,
126.Ar cs0 ... cs7 ;
127or a number in either hex or decimal.
128.It Fl u
129Use UDP instead of TCP; this must be specified on both the client
130and the server.
131Transmitted packets per second (TX PPS) will be accounted on the client
132side, while received packets per second (RX PPS) whill be accounted on the
133server side.
134UDP has no Protocol Control Block (PCB) so the
135.Fl k
136flags don't apply.
137.It Fl V Ar rtable
138Set the routing table to be used.
139The default is 0.
140.It Fl v
141Display verbose output.
142If specified more than once, increase the detail of information displayed.
143.El
144.Sh SEE ALSO
145.Xr netstat 1 ,
146.Xr pstat 8
147.Sh HISTORY
148The
149.Nm
150program first appeared in
151.Ox 4.4 .
152.Sh AUTHORS
153.An -nosplit
154The
155.Nm
156program was written by
157.An Damien Miller Aq djm@openbsd.org .
158.Pp
159UDP mode and libevent port by
160.An Christiano F. Haesbaert Aq haesbaert@haesbaert.org .
161