]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - tools/tools/netrate/tcpp/README
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / tools / tools / netrate / tcpp / README
1 tcpp -- Parallel TCP Exercise Tool
2
3 This is a new tool, and is rife with bugs.  However, it appears to create
4 even more problems for device drivers and the kernel, so that's OK.
5
6 This tool generates large numbers of TCP connections and stuffs lots of data
7 into them.  One binary encapsulates both a client and a server.  Each of the
8 client and the server generates a certain number of worker processes, each of
9 which in turn uses its own TCP port.  The number of server processes must be
10 >= the number of client processes, or some of the ports required by the
11 client won't have a listener.  The client then proceeds to make connections 
12 and send data to the server.  Each worker multiplexes many connections at
13 once, up to a maximum parallelism limit.  The client can use one or many IP
14 addresses, in order to make more 4-tuples available for testing, and will
15 automatically spread the load of new connections across available source
16 addresses.
17
18 You will need to retune your TCP stack for high volume, see Configuration
19 Notes below.
20
21 The server has very little to configure, use the following command line
22 flags:
23
24   -s                           Select server mode
25   -p <numprocs>                Number of workers, should be >= client -p arg
26   -r <baseport>                Non-default base TCP port, should match client
27   -T                           Print CPU usage every ten seconds
28   -m <maxconnectionsperproc>   Maximum simultaneous connections/proc, should
29                                be >= client setting.
30
31 Typical use:
32
33   ./tcpp -s -p 4 -m 1000000
34
35 This selects server mode, four workers, and at most 1 million TCP connections
36 per worker at a time.
37
38 The client has more to configure, with the following flags:
39
40   -c <remoteIP>                Select client mode, and specific dest IP
41   -C                           Print connections/second instead of GBps
42   -M <localIPcount>            Number of sequential local IPs to use; req. -l
43   -T                           Include CPU use summary in stats at end of run
44   -b <bytespertcp>             Data bytes per connection
45   -l <localIPbase>             Starting local IP address to bind
46   -m <maxtcpsatonce>           Max simultaneous conn/worker (see server -m)
47   -p <numprocs>                Number of workers, should be <= server -p
48   -r <baseport>                Non-default base TCP port, should match server
49   -t <tcpsperproc>             How many connections to use per worker
50   
51 Typical use:
52
53   ./tcpp -c 192.168.100.201 -p 4 -t 100000 -m 10000 -b 100000 \
54     -l 192.168.100.101 -M 4
55
56 This creates four workers, each of which will (over its lifetime) set up and
57 use 100,000 TCP connections carrying 100K of data, up to 10,000 simultaneous
58 connection at any given moment.  tcpp will use four source IP addresses,
59 starting with 192.168.100.101, and all connections will be to the single
60 destination IP of 192.168.100.201.
61
62 Having (p) <= the number of cores is advisable.  When multiple IPs are used
63 on the client, they will be sequential starting with the localIPbase set with
64 -l.
65
66 Known Issues
67 ------------
68
69 The bandwidth estimate doesn't handle failures well.  It also has serious
70 rounding errors and probably conceptual problems.
71
72 It's not clear that kevent() is "fair" to multiple connections.
73
74 Rather than passing the length for each connection, we might want to pass
75 it once with a control connection up front.  On the other hand, the server
76 is quite dumb right now, so we could take advantage of this to do size
77 mixes.
78
79 Configuration Notes
80 -------------------
81
82 In my testing, I use sysctl.conf entries of:
83
84 net.inet.ip.portrange.first=100
85 kern.ipc.maxsockets=1000000
86 net.inet.tcp.maxtcptw=3000000
87 kern.ipc.somaxconn=49152
88
89 # For running !multiq, do this before loading the driver:
90 kenv hw.cxgb.singleq="1"
91
92 kldload if_cxgb
93
94 # Consider turning off TSO and/or adjusting the MTU for some scenarios:
95 ifconfig cxgb0 -tso
96 ifconfig cxgb0 mtu 1500
97
98
99 $FreeBSD$