DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

ttcp(1Mtcp)


ttcp -- test TCP and UDP performance

Synopsis

ttcp -t [-A align] [-b size] [-d] [-D] [-f format] [-l buflen] [-n numbufs] [-O offset] [-p port] [-s] [-u] [-v] dest_machine

ttcp -r [-A align] [-b size] [-B] [-d] [-f format] [-l buflen] [-O offset] [-p port] [-s] [-T] [-u] [-v]

Description

ttcp times the transmission and reception of data between two systems using the UDP or TCP protocols. It differs from common ``blast'' tests, which tend to measure the remote inetd as much as the network performance and which usually do not allow measurements at the remote end of a UDP transmission.

For testing, start the transmitter with -t and -s after starting the receiver with -r and -s. Tests lasting at least tens of seconds should be used to obtain accurate measurements. Graphical presentations of throughput versus buffer size for buffers ranging from tens of bytes to several pages can illuminate bottlenecks.

Without the -s option, the default behavior is to transmit data from stdin (-t specified) or to print received data to stdout (-r specified).

Options


-A align
Align the start of buffers to this modulus (default 16384).

-b size
Set size of socket buffer. The default varies from system to system. This parameter affects the maximum UDP packet length.

-B
When receiving data, output only full blocks, using the block size specified by -l. This option is useful for programs, such as tar, that require complete blocks.

-d
Debug: set the SO_DEBUG socket option.

-D
If transmitting using TCP, do not buffer data when sending (sets the TCP_NODELAY socket option).

-f format
Specify the format of the throughput rate:

k
kilobits per second

K
kilobytes per second (default)

m
megabits per second

M
megabytes per second

g
gigabits per second

G
gigabytes per second

-l buflen
Length of buffers in bytes (default 8192). For UDP, this value is the number of data bytes in each packet. The system limits the maximum UDP packet length. This limit can be changed with the -b option.

-n numbufs
Number of source buffers to transmit (default 2048).

-O offset
Align the start of buffers to this offset (default 0). For example, -A8192 -O1 causes buffers to start at the second byte of an 8192-byte page.

-p port
Port number to send to or listen on (default 5001). On some systems, this port may be allocated to another network daemon.

-r
Receive mode.

-s
If transmitting, send fabricated data to the network; if receiving, sink (discard) the data.

-t
Transmit mode.

-T
Touch: access each byte of data as it is read in order to measure cache effects.

-u
Use UDP instead of TCP.

-v
Verbose: print more statistics.

References

ping(1Mtcp), traceroute(1Mtcp)

Examples

To set up a simple TCP throughput test between the machines alpha (transmitter) and bravo (receiver), first enter the following command on bravo:

ttcp -r -n 32768 -s

Then enter the following command on alpha:

ttcp -t -n 32768 -s IP_bravo

IP_bravo is the IP address of bravo. To measure UDP throughput, the -u option should also be specified at both ends.

ttcp can also be used as a ``network pipe'' for moving directory hierarchies between systems when routing problems exist or when the use of other mechanisms is undesirable. For example, on the destination machine, use:

ttcp -r -B | tar xvpf -

On the source machine, use:

tar cf - directory | ttcp -t dest_machine

Machines can be ``chained'' by running the following command on each intermediate machine:

ttcp -r | ttcp -t next_machine


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004