[netperf-talk] Netperf & iPerf

Rick Jones rick.jones2 at hp.com
Mon Jan 22 10:32:25 PST 2007


Andrew Gallatin wrote:
> Rick Jones writes:
>  > 
>  > BY default netperf accepts the system's default socket buffer and thus 
>  > window size.  Does iperf do that, or have its own default?
> 
> I believe that iperf also accepts the defaults.  However, iperf
> defaults to an 8KB read/write size, rather than defaulting to reading
> and writing the entire socket buffer, like netperf.  This leads to
> iperf making many more syscalls than netperf by default.  I think the
> 8KB default is due to iperf's ttcp roots.  Iperf will also call
> gettimeofday around each read/write operation, which can be expensive.

Indeed, netperf defaults to posting sends to the socket equal to the 
SO_SNDBUF size on the socket.  You can alter that with the test-specific 
(after the "--" -m option).  While it is true that netperf also by 
default posts an SO_RCVBUF sized buffer on the receiving end, 
(test-specific -M options) unless your receiver is slower than the 
network, typically it will actually pull-in one or two MSS-worth at a time.

You can get netperf to report the average bytes per send/recv call by 
adding a global (before the "--") "-v 2" option.

The added gettimeofday() calls in iperf could indeed be nasty.  If you 
really want, one can get netperf to do the same thing by enabling the 
histogram option at configure time --enable-histogram.  It will then 
bracket each send() call with a call to gettimeofday(), and your -v 2 
output will include time spent in each send() call (this assumes a 
TCP_STREAM test).  If the platform supports it, netperf will actually 
use gethrtime() rather than gettimeofday().  Netperf does not need to 
know actual time of day, only relative time, and gethrtime() has much 
lower overhead - on at least some platforms anyway.

Netperf will not make any "time" calls on the netserver side, only the 
netperf side.

happy benchmarking,

rick jones


More information about the netperf-talk mailing list