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