8

I'm trying to find a utility that will allow me to generate a constant flow of random network traffic at a specified rate between 2 hosts. The utility needs to run on Windows and OSX. I've tried iperf but it seems to be more oriented toward short-term testing/statistics and it really taxes the CPU even at slower rates. I want something that will generate traffic for a few weeks at say 10Mbps while I use other tools to monitor the impact of that level of traffic on the network.

Andrew S
  • 498
  • 3
  • 7
  • 12

6 Answers6

5

Go for simplicity, Try netcat.

If you want to crank out a limited amount, you can generate a file and pipe it into NC

nc 192.168.0.1 3333 > file.dat

Alternatively if you want to saturate your network you can set up a connection that will flood A's and B's between each other

on computer A

yes AAAAAAAAAAAAAAAAAAAAAA | nc -v -v -l -p 2222 > /dev/null

on another Computer (We'll call B)

yes BBBBBBBBBBBBBBBBBBBBBB | nc othermachine 2222 > /dev/null

Theres a plethora of references to things you can do with netcat, I highly encourage you to do a google sometime.

zetavolt
  • 1,352
  • 1
  • 8
  • 12
  • Is it possible to set a transfer rate with netcat? – Zoredache May 28 '10 at 19:39
  • Throttle (http://klicman.org/throttle/) may be a way to limit netcat but I don't see any binaries for Windows however I was able to compile it on OS X (10.6). – Andrew S Jun 04 '10 at 16:43
4

Use ping. You can script it to run random floods, and do all kinda of cool stuff. I'm not a MacOS expert but I'm pretty sure it is very similar to the Linux CLI options...

So to push the ports to the link speed limit run a flood ping (note must be root to do this, I'm running mine for 100,000 packets here):
$ping -f -c 100000 <destination IP>

SDGuero
  • 228
  • 1
  • 2
  • 4
  • This seems to be the easiest way to generate the constant traffic. Not quite what I had in mind but it is pretty light on the processor and can be somewhat controlled via the -s and -i parameters to achieve the desired network activity. To get 7% utilization on a 100Mbps link: ping -q -s 500 -i .001 – Andrew S Jun 04 '10 at 16:41
3

Just wanted to say that Ostinato works both on Mac OS X and Windows.

On my 2.2GHz Core2Duo running Windows XP, Ostinato takes around 50% CPU. Speaking only for Ostinato - the reason it takes that much CPU even at low rates is to maintain an accurate (read constant inter packet delay) transmission rate in the presence of other contending applications.

You could also try tcpreplay

Disclosure: I'm the developer of Ostinato

Srivats P
  • 31
  • 2
1

Ostinato might do for Windows. I've not spent much time with it, but it looks interesting.

AndyN
  • 1,739
  • 12
  • 14
0

Unfortunately, I don't have first-hand experience with it, but MGEN could possibly fit. PackETH is nice, but it's mostly Linux (plus Windows port), so it's probably out of question.

If that doesn't suit you, the list at D-ITG website could be helpful.

Karol J. Piczak
  • 2,348
  • 1
  • 20
  • 22
  • I tried MGEN but it seems to be behave a lot like iperf and it nearly maxes out my 2.2GHz Core2Duo even at slow rates. – Andrew S Jun 01 '10 at 15:54
-1

Just run this script...

#!/bin/bash

while true;
do
  t=$(($RANDOM%2500 + 500))
  b=$(($RANDOM%150 + 50))
  ping -c 1 -s $b $1
  sleep $(($t/1000))                                            
done