Annotation of src/usr.bin/tcpbench/tcpbench.1, Revision 1.24
1.24 ! jmc 1: .\" $OpenBSD: tcpbench.1,v 1.23 2016/09/25 23:31:50 deraadt Exp $
1.1 djm 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: .\"
1.24 ! jmc 17: .Dd $Mdocdate: September 25 2016 $
1.9 jmc 18: .Dt TCPBENCH 1
1.1 djm 19: .Os
20: .Sh NAME
21: .Nm tcpbench
1.12 jmc 22: .Nd TCP/UDP benchmarking and measurement tool
1.1 djm 23: .Sh SYNOPSIS
24: .Nm
25: .Fl l
26: .Nm
1.21 claudio 27: .Op Fl 46RUuv
1.2 jmc 28: .Op Fl B Ar buf
1.15 haesbaer 29: .Op Fl b Ar addr
1.1 djm 30: .Op Fl k Ar kvars
1.3 henning 31: .Op Fl n Ar connections
1.1 djm 32: .Op Fl p Ar port
1.11 claudio 33: .Op Fl r Ar interval
1.1 djm 34: .Op Fl S Ar space
1.13 haesbaer 35: .Op Fl T Ar toskeyword
1.17 henning 36: .Op Fl t Ar secs
1.8 guenther 37: .Op Fl V Ar rtable
1.1 djm 38: .Ar hostname
39: .Nm
1.7 jmc 40: .Bk -words
1.1 djm 41: .Fl s
1.21 claudio 42: .Op Fl 46Uuv
1.2 jmc 43: .Op Fl B Ar buf
1.1 djm 44: .Op Fl k Ar kvars
45: .Op Fl p Ar port
1.11 claudio 46: .Op Fl r Ar interval
1.14 jmc 47: .Op Fl S Ar space
1.13 haesbaer 48: .Op Fl T Ar toskeyword
1.8 guenther 49: .Op Fl V Ar rtable
1.21 claudio 50: .Op Ar hostname
1.7 jmc 51: .Ek
1.1 djm 52: .Sh DESCRIPTION
53: .Nm
54: is a small tool that performs throughput benchmarking and concurrent
55: sampling of kernel network variables.
56: .Pp
57: .Nm
58: is run as a client/server pair.
59: The server must be invoked with the
60: .Fl s
61: flag, which will cause it to listen for incoming connections.
62: The client must be invoked with the
63: .Ar hostname
64: of a listening server to connect to.
65: .Pp
1.11 claudio 66: Once connected, the client will send TCP or UDP traffic as fast as possible to
1.1 djm 67: the server.
68: Both the client and server will periodically display throughput
69: statistics along with any kernel variables the user has selected to
70: sample (using the
71: .Fl k
1.11 claudio 72: option, which is only available in TCP mode).
1.1 djm 73: A list of available kernel variables may be obtained using the
74: .Fl l
75: option.
76: .Pp
77: The options are as follows:
78: .Bl -tag -width Ds
1.20 dlg 79: .It Fl 4
1.24 ! jmc 80: Force
1.20 dlg 81: .Nm
82: to use IPv4 addresses only.
83: .It Fl 6
1.24 ! jmc 84: Force
1.20 dlg 85: .Nm
86: to use IPv6 addresses only.
1.2 jmc 87: .It Fl B Ar buf
1.5 jmc 88: Specify the size of the internal read/write buffer used by
1.1 djm 89: .Nm .
1.11 claudio 90: The default is 262144 bytes for TCP client/server and UDP server.
1.12 jmc 91: In UDP client mode this may be used to specify the packet size on the test
1.11 claudio 92: stream.
1.15 haesbaer 93: .It Fl b Ar addr
1.24 ! jmc 94: Specify the IP address of the interface which is used to send the packets.
1.1 djm 95: .It Fl k Ar kvars
1.2 jmc 96: Specify one or more kernel variables to monitor; multiple variables must be
1.12 jmc 97: separated with commas.
98: This option is only valid in TCP mode.
1.1 djm 99: The default is not to monitor any variables.
1.5 jmc 100: Using this option requires read access to
1.23 deraadt 101: .Pa /dev/kmem ,
102: which may be restricted based upon the value of the
103: .Ar kern.allowkmem
104: .Xr sysctl 8 .
1.2 jmc 105: .It Fl l
106: List the name of kernel variables available for monitoring and exit.
1.3 henning 107: .It Fl n Ar connections
1.12 jmc 108: Use the given number of TCP connections (default: 1).
109: UDP is connectionless so this option isn't valid.
1.1 djm 110: .It Fl p Ar port
1.12 jmc 111: Specify the port used for the test stream (default: 12345).
1.21 claudio 112: .It Fl R
113: In client mode the write buffer size is randomized up to the size specified via
114: .Fl B .
1.11 claudio 115: .It Fl r Ar interval
116: Specify the statistics interval reporting rate in milliseconds (default: 1000).
1.2 jmc 117: .It Fl S Ar space
1.12 jmc 118: Set the size of the socket buffer used for the test stream.
1.2 jmc 119: On the client this option will resize the send buffer;
120: on the server it will resize the receive buffer.
1.1 djm 121: .It Fl s
122: Place
123: .Nm
124: in server mode, where it will listen on all interfaces for incoming
1.12 jmc 125: connections.
126: It defaults to using TCP if
1.11 claudio 127: .Fl u
1.12 jmc 128: is not specified.
1.13 haesbaer 129: .It Fl T Ar toskeyword
130: Change the IPv4 TOS or IPv6 TCLASS value.
131: .Ar toskeyword
132: may be one of
133: .Ar critical ,
134: .Ar inetcontrol ,
135: .Ar lowdelay ,
136: .Ar netcontrol ,
137: .Ar throughput ,
138: .Ar reliability ,
139: or one of the DiffServ Code Points:
140: .Ar ef ,
141: .Ar af11 ... af43 ,
142: .Ar cs0 ... cs7 ;
143: or a number in either hex or decimal.
1.17 henning 144: .It Fl t Ar secs
145: Stop after
146: .Ar secs
147: seconds.
1.21 claudio 148: .It Fl U
149: Use AF_UNIX sockets instead of IPv4 or IPv6 sockets.
1.22 jmc 150: In client and server mode
1.21 claudio 151: .Ar hostname
152: is used as the path to the AF_UNIX socket.
1.11 claudio 153: .It Fl u
1.12 jmc 154: Use UDP instead of TCP; this must be specified on both the client
155: and the server.
156: Transmitted packets per second (TX PPS) will be accounted on the client
1.16 haesbaer 157: side, while received packets per second (RX PPS) will be accounted on the
1.12 jmc 158: server side.
159: UDP has no Protocol Control Block (PCB) so the
1.11 claudio 160: .Fl k
161: flags don't apply.
1.8 guenther 162: .It Fl V Ar rtable
163: Set the routing table to be used.
1.1 djm 164: .It Fl v
165: Display verbose output.
166: If specified more than once, increase the detail of information displayed.
167: .El
168: .Sh SEE ALSO
1.2 jmc 169: .Xr netstat 1 ,
1.1 djm 170: .Xr pstat 8
1.10 fkr 171: .Sh HISTORY
172: The
173: .Nm
174: program first appeared in
175: .Ox 4.4 .
176: .Sh AUTHORS
1.12 jmc 177: .An -nosplit
1.10 fkr 178: The
179: .Nm
180: program was written by
1.18 schwarze 181: .An Damien Miller Aq Mt djm@openbsd.org .
1.12 jmc 182: .Pp
1.11 claudio 183: UDP mode and libevent port by
1.18 schwarze 184: .An Christiano F. Haesbaert Aq Mt haesbaert@haesbaert.org .