ed8c4b44e6
netsend 127.0.0.1 6666-7777 [payloadsize] [packet_rate] [duration] This is useful to test the behaviour of systems that do some kind of flow classifications and so exhibit different behaviour depending on the number of flows that hit them. I plan to add a similar extension to sweep on a range of IP addresses, so we can issue a single command to flood (obviously, for testing purposes!) a number of different destinations. When there is only one destination, we do a preliminary connect() of the socket so we can use send() instead of sendto(). When we have multiple ports, the socket is not connect()'ed and we do a sendto() instead. There is a performance hit in this case, as the throughput on the loopback interface (with a firewall rule that blocks the transmission) goes down from 900kpps to 490kpps on my test machine. If the number of different destinations is limited, one option to explore is to have multiple connect()ed sockets. MFC after: 1 month |
||
---|---|---|
.. | ||
http | ||
httpd | ||
juggle | ||
netblast | ||
netreceive | ||
netsend | ||
tcpconnect | ||
tcpp | ||
tcpreceive | ||
Makefile | ||
Makefile.inc | ||
README |
Netsend and Netreceive ---------------------- This pair of binaries is used to fixed rate UDP performance testing. The netreceive tool consists solely of a UDP packet sink bound to a specified UDP port. Packets received on its port are copied to user space and discarded. The netsend tool acts as a packet source, generating packets of the specified size at the specified rate to a target IP address and port number: netsend [ip] [port] [payloadsize] [rate] [duration] The payloadsize field specifies the size of the UDP payload, not the total packet size, which will also include a variety of headers (typically, ethernet, IP, and UDP). The rate indicates the number of packets/second to attempt to deliver. The duration is the duration of the run in seconds. The netsend tool will wait for around two seconds to synchronize with the wall clock for timing purposes. It will then busy-wait between packet transmits. The netsend/netreceive tools are under the following copyright and license: /*- * Copyright (c) 2004 Robert N. M. Watson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ $FreeBSD$