Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

spray(1m) [opensolaris man page]

spray(1M)						  System Administration Commands						 spray(1M)

NAME
spray - spray packets SYNOPSIS
/usr/sbin/spray [-c count] [-d delay] [-l length] [-t nettype] host DESCRIPTION
spray sends a one-way stream of packets to host using RPC, and reports how many were received, as well as the transfer rate. The host argu- ment can be either a name or an Internet address. spray is not useful as a networking benchmark, as it uses unreliable connectionless transports, UDP for example. spray can report a large number of packets dropped when the drops were caused by spray sending packets faster than they can be buffered locally, that is, before the packets get to the network medium. OPTIONS
-c count Specify how many packets to send. The default value of count is the number of packets required to make the total stream size 100000 bytes. -d delay Specify how many microseconds to pause between sending each packet. The default is 0. -l length The length parameter is the numbers of bytes in the Ethernet packet that holds the RPC call message. Since the data is encoded using XDR, and XDR only deals with 32 bit quantities, not all values of length are possible, and spray rounds up to the nearest possible value. When length is greater than 1514, then the RPC call can no longer be encapsulated in one Ethernet packet, so the length field no longer has a simple correspondence to Ethernet packet size. The default value of length is 86 bytes, the size of the RPC and UDP headers. -t nettype Specify class of transports. Defaults to netpath. See rpc(3NSL) for a description of supported classes. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWrcmdc | +-----------------------------+-----------------------------+ SEE ALSO
rpc(3NSL), attributes(5) SunOS 5.11 6 Nov 2000 spray(1M)

Check Out this Related Man Page

spray(3SOCKET)						     Sockets Library Functions						    spray(3SOCKET)

NAME
spray - scatter data in order to test the network SYNOPSIS
cc [ flag ... ] file ... -lsocket -lnsl [ library ... ] #include <rpcsvc/spray.h> bool_t xdr_sprayarr(XDR *xdrs, sprayarr *objp); bool_t xdr_spraycumul(XDR *xdrs, spraycumul *objp); DESCRIPTION
The spray program sends packets to a given machine to test communications with that machine. The spray program is not a C function interface, per se, but it can be accessed using the generic remote procedure calling interface clnt_call(). See rpc_clnt_calls(3NSL). The program sends a packet to the called host. The host acknowledges receipt of the packet. The pro- gram counts the number of acknowledgments and can return that count. The spray program currently supports the following procedures, which should be called in the order given: SPRAYPROC_CLEAR This procedure clears the counter. SPRAYPROC_SPRAY This procedure sends the packet. SPRAYPROC_GET This procedure returns the count and the amount of time since the last SPRAYPROC_CLEAR. EXAMPLES
Example 1: Using spray() The following code fragment demonstrates how the spray program is used: #include <rpc/rpc.h> #include <rpcsvc/spray.h> . . . spraycumul spray_result; sprayarr spray_data; char buf[100]; /* arbitrary data */ int loop = 1000; CLIENT *clnt; struct timeval timeout0 = {0, 0}; struct timeval timeout25 = {25, 0}; spray_data.sprayarr_len = (uint_t)100; spray_data.sprayarr_val = buf; clnt = clnt_create("somehost", SPRAYPROG, SPRAYVERS, "netpath"); if (clnt == (CLIENT *)NULL) { /* handle this error */ } if (clnt_call(clnt, SPRAYPROC_CLEAR, xdr_void, NULL, xdr_void, NULL, timeout25)) { /* handle this error */ } while (loop- > 0) { if (clnt_call(clnt, SPRAYPROC_SPRAY, xdr_sprayarr, &spray_data, xdr_void, NULL, timeout0)) { /* handle this error */ } } if (clnt_call(clnt, SPRAYPROC_GET, xdr_void, NULL, xdr_spraycumul, &spray_result, timeout25)) { /* handle this error */ } printf("Acknowledged %ld of 1000 packets in %d secs %d usecs ", spray_result.counter, spray_result.clock.sec, spray_result.clock.usec); ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
spray(1M), rpc_clnt_calls(3NSL), attributes(5) NOTES
This interface is unsafe in multithreaded applications. Unsafe interfaces should be called only from the main thread. A spray program is not useful as a networking benchmark as it uses unreliable connectionless transports, for example, udp. It can report a large number of packets dropped, when the drops were caused by the program sending packets faster than they can be buffered locally, that is, before the packets get to the network medium. SunOS 5.10 30 Dec 1996 spray(3SOCKET)
Man Page