[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: packet generator



On  0, Arne Goetje <20020531antispam@gmx.net> wrote:
> Hi list,
> 
> I want to test how much bandwidth my machine can handle and use two PCs, 
> directly connected via gigabit ethernet. I'm looking for a packet generator 
> which can stress this connection with random packets for customizable 
> bandwidth rates. does anyone of you know such a tool?
> any suggestions?

The TCP transport includes congestion control that, over a long time,
automagically finds the available bandwidth of an end-to-end
connection.  I mean 'long time' in the engineering sense of 'the time
it takes for initial conditions to be forgotten' which is considerably
less than a second in a gigabit ethernet system.

Keep in mind that there is more to network performance than raw
bandwidth; there is latency, flow control and congestion control.  So
a large number of small TCP requests (eg. text web pages) will run
significantly slower than one large FTP request.

Keep in mind also that 'visible' bandwidth is dependant on the
transport protocol you are using; TCP has higher overheads than UDP,
so UDP will appear to have a higher overhead.  Also UDP does not
include transmission controls, so you can just fire packets away as
fast as you like, even if they are being dropped at the other end.
For this reason you can pump UDP packets into a link at an incredible
rate, and appear to have great bandwidth, but find that actually half
the packets are being dropped.

So to test out TCP bandwidth, start a large FTP transfer and see what
the average transfer rate is.  This should give you a reasonable
estimate of the available bandwidth of the link.

Another way of testing bandwidth is to use ping -f.  Note that you can
seriously piss off people if you try this on their machines; various
flavours of windows don't deal well with the buffer over-runs they get
when subject to a ping flood.  But combined with the 'time' command it
will give you some nice statistics.  For instance, to time how long it
takes to send one megabit to my lo interface:

# sudo time ping -f -c 1000 -s 117 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 117 data bytes
.
--- 127.0.0.1 ping statistics ---
1000 packets transmitted, 1000 packets received, 0% packet loss
round-trip min/avg/max = 0.0/0.2/1.7 ms
0.02user 0.08system 0:00.58elapsed 17%CPU (0avgtext+0avgdata
0maxresident)k 0inputs+0outputs (137major+17minor)pagefaults 0swaps

which shows you that the entire operation took 0.58 seconds, which
gives a bandwidth of 1.724 Mbit/s (1/0.58).  Be aware that this is not
the most accurate of measures; ping only sends another packet when it
receives the ICMP response from the other machine.  So the larger your
packets, the higher the reported bandwidth.  The example above has
packets of 1000 bits; this is calculated by adding the 8 byte ICMP
overhead to the 117 data bytes and multiplied by 8.  Using a packet
size of 10,000 bits gives me a bandwidth of about 14.5 Mbps, and a
packet size of 100,000 bits gives me a bandwidth of 46.5 Mbps and so
on.  Unfortunately ping prevents me from increasing the packet size by
another factor of ten, but a long time average of 10,000 bit pings
should be at least a place to start.

Well, that's enough rambling from me.

Tom
-- 
Tom Cook
Information Technology Services, The University of Adelaide

"If it weren't for electricity we'd all be watching television by candlelight."
	- George Gobol

Get my GPG public key: https://pinky.its.adelaide.edu.au/~tkcook/tom.cook-at-adelaide.edu.au

Attachment: pgpmFUUaOZ31N.pgp
Description: PGP signature


Reply to: