[ Home
> Software
> pingspray ]
pingspray - heavily load the network for evaluation purpose
Description
This program was mainly intended to load the LAN interface for EMC
(electromagnetic compatibility) tests, and it can generate both random and
periodic patterns of data as suggested in some EMC standards.
As far as the EUT (equipment under test) is configured to respond to ICMP echo request,
you don't have to run this program on the EUT itself,
but you can connect an another computer with the EUT via Ethernet usually through a hub
and specify the EUT's IP address as the target address.
It uses ICMP echo request (ping) to generate the traffic,
and when it works as intended, it will generate traffic in both directions
(transmit and receive).
It will try to very heavily load, or flood, the network with large
ICMP echo packets and can slowing down or even disabling the network,
so shouldn't be used in the networks in operation or to the other
person's computers.
This program is provided "as is" without warranty of any kind.
Background
In general, operating mode that produce the highest emissions should be selected
for emission tests.
In case of Ethernet interfaces,
unwanted emissions generated from the Ethernet interfaces
may depends to the traffic on the Ethernet lines,
that may make it necessary to operate the interfaces at the maximum possible data rate.
In case of CISPR 22:2008, clause 9.6.3 of the standard says:
In order to make reliable emission measurements representative of high LAN utilization it is
only necessary to create a condition of LAN utilization in excess of 10 % and sustain that level
for a minimum of 250 ms. The content of the test traffic should consist of both periodic and
pseudo-random messages in order to emulate realistic types of data transmission (e.g.
random: files compressed or encrypted; periodic: uncompressed graphic files, memory dumps,
screen updates, disk images). If the LAN maintains transmission during idle periods
measurements shall also be made during idle periods (see Clause E.3, [7]).
So, maybe it is useful to have a program which can make high LAN utilization conditions
with both of periodic and random data, and also low LAN utilization conditions.
Usage
pingspray [ -F pattern ] [ -P duration ]
[ -l preload ] [ -s packetsize ]
[ <ping options> ] <target>
- -F pattern
Specify type of data to fill the packets.
You can specify sequence of following characters with the -F option:
- s: silent - do not send packet
- 0: send packets filled with all-0 bytes (0x00)
- 1: send packets filled with all-1 bytes (0xff)
- r: send packets filled with random data
- a: send packets filled with 100 all-0 bytes (0x00) and 100 all-1
bytes (0xff) alternatively
- c: send packets filled with 256 bytes cyclic data
The default value is "ras" (random, alternative, silent)
- -P duration
Specify the duration in ms to send each of the specified data.
The default value is 300 (300 ms).
- -l preload
Specifies the number of preload packets,
so that ping sends that many packets not waiting for reply.
The default value is 3.
- -s packetsize
Specifies the number of data bytes in each packet.
The default value is 50000.
- ping options
See ping(8) manual page
for other ping options.
- Stop the program
Type Ctrl-C to stop the program.
Example
Here are some example how to run pingspray,
assuming that the destination IP address is 192.168.254.254
which must be modified accordingly.
- pingspray 192.168.254.254
-
To the specified target 192.168.254.254, (1) repeatedly send 50000
bytes of packets filled with random data for 300 ms, (2) repeatedly
send 50000 bytes of packets filled with 100 all-0 bytes (0x00) and
100 all-1 bytes (0xff) for 300 ms, (3) don't send packets for 300 ms,
and (4) repeat them.
- pingspray -P 1000 192.168.254.254
-
Similar to the above, but the duration is set to 1000 ms instead
of the default value of 300 ms.
- pingspray -s 1000 -F 01 192.168.254.254
-
(1) repeatedly send 1000 bytes of packets filled with all-0 bytes,
(2) repeatedly send 1000 bytes of packets filled with all-1 bytes,
and (3) repeat them.
- ping -f -l 3 -s 50000 192.168.254.254
-
If you don't need to specify data pattern, you can probably use
normal ping command instead, too.
Install
Install from Source
- Download pingspray-0.2.tar.gz
- tar xzf pingspray-0.3.tar.gz
- cd pingspray-0.3
- make
- make install
Install Linux Binary
- Download the Linux binary of pingspray on the computer
- Open a terminal window
- Go to the directory where the binary was downloaded (e.g., cd Downloads)
- su
- mv pingspray /usr/local/bin/
- chown root.root /usr/local/bin/pingspray
- chmod a+x,u+s /usr/local/bin/pingspray
Run without Install (Fedora Live, Ubuntu Live, etc.)
- Download the Linux binary of pingspray on the computer
- Open a terminal window
- Go to the directory where the binary was downloaded (e.g., cd Downloads)
- chmod a+x pingspray
- sudo ./pingspray 192.168.254.254
If you can't use sudo, you may need to run su - and then
./pingspray 192.168.254.254.
System Requirements
This program was tested on Fedora 14 (Linux 2.6),
Fedora 18 (Linux 3.6) and Ubuntu 12 (Linux 3.2).
This program requires privileges as root to operate as intended,
so the command should usually be setuid root or should explicitly
run as root user.
If you don't want to install Linux,
you can also run this program on Live Linux systems.
Again, you don't have to run this program on the EUT itself.
Troubleshooting
Transmit rate (TX) stays 0.0 Mbps
Maybe the destination IP address is not reachable
or the destination is refusing to respond to ICMP echo request.
In these cases,
I think the destination will not respond to normal ping either.
Possible reasons include: incorrect cabling,
incorrect network setting on either of the units,
wrong IP address specified when invoking the pingspray command,
or stringent firewall setting.
Receive rate (RX) is significantly smaller than transmit rate (TX)
pingspray usually use multiple preloading and large packet size for higher LAN utilization,
but maybe the size is too large in some situations.
In this case, specifying small preload with -f option and/or
specifying small packet size with -s option may help solve the problem.
See also Example section for how to use the -s option.
If the destination didn't respond to normal ping either,
check the network connection and setting first.
Low transmit rate with high speed interfaces such as 1000Base-T
For high speed interfaces such as 1000Base-T,
you may need to adjust preload (and maybe also packetsize)
to get higher transmit rate.
For example, on a system with Intel PRO/1000 (PCIe x1) 1000Base-T network adaptor,
transmit rate was 900 Mbps when preload was 6,
but almost half of that when preload was 3.
However, achievable transmit rate may be limited by the network adaptor,
driver and other factors.
For example, I could not go faster than 600 Mbps
on a system with Marvell Yukon 88E8057 chip and sky2 driver,
but sk98lin driver gives 800 Mbps on the same system.
Many dots dislpayed
Dots (.) will be displayed on packet loss.
0 - random ......................... (TX: 825.3 Mbps 0 errs RX: 804.1 Mbps 0 errs)
1 - 0x00/0xff .................... (TX: 835.6 Mbps 0 errs RX: 817.4 Mbps 0 errs)
If you see many dots, there are many packet loss probably due to too high transmission rate,
too large preload, too large packet size, or some other problem.
Reducing preload and/or packet size may solve this problem.
Fluctuating transmit and receive rate
Some Ethernet chips or drivers report statistical data once per second,
which make pingspray to report like this:
0 - random . (TX: 214.6 Mbps 0 errs RX: 213.2 Mbps 0 errs)
1 - 0x00/0xff (TX: 0.0 Mbps 0 errs RX: 0.0 Mbps 0 errs)
2 - silent (TX: 0.0 Mbps 0 errs RX: 0.0 Mbps 0 errs)
0 - random . (TX: 217.2 Mbps 0 errs RX: 217.1 Mbps 0 errs)
1 - 0x00/0xff (TX: 0.0 Mbps 0 errs RX: 0.0 Mbps 0 errs)
In the above example, data bytes for step 1 (0x00/0xff) are reported
as if they were transmitted / received in step 0 (random),
which made the transmit / receive rate reported for the step 0 almost twice the actual value.
This may not be a problem if you don't mind of the transmit and receive rate display.
If you want to reduce this influence,
you may need to increase the duration with -P option,
and remove silent period with -F option to get more stable output.
It didn't run on Microsoft Windows
pingspray is intended to run on Linux operating systems
as described in the System Requirements above,
and I am not going to transport it to other operating systems
especially to Microsoft Windows of any versions.
If you don't have Linux machines, maybe you can run it on Live Linux systems.
Please note that you don't have to run this program on the EUT itself.
Change Log
- Version 0.1 (2013-04-14)
-
- Version 0.2 (2013-05-06)
-
- Automatically reduces packet size down to 64 bytes and then disable flood mode if transmission errors persist
- Version 0.3 (2017-07-07)
-
- Accumulative packet loss will be displayed on the progress display.
- IP address of the machine will be displayed when the program started.
- The equivalent command line parameters will be displayed when the program terminated.
Related Software
Author
Tom Sato, http://t-sato.in.coocan.jp/,
e-mail: VEF00200@nifty.com.
The program is derived from
iputils (snapshot s20121221),
and distributed under the same conditions with the original
iputils.
The copyright notice can be found in ping.c in the source package.
Tom Sato, 2014-04-14