Daivid
Daivid

Reputation: 677

Netperf reporting zero throughput

I've installed netperf 2.6 in two sites and trying to run the netperf benchmark, but All I'm getting is zero Throughput... Does anyone knows how to use netperf properly? (I was following the official documentation)

I run this at a server:

 ./netserver -p xxxxx

the output is:

Starting netserver with host 'IN(6)ADDR_ANY' port 'xxxxx' and family AF_UNSPEC

In the other side I run:

./netperf -s 5 -H a.b.c.d -p xxxxx

The output is:

  MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to a.b.c.d () port 0 AF_INET : demo
  Recv   Send    Send
  Socket Socket  Message  Elapsed
  Size   Size    Size     Time     Throughput
  bytes  bytes   bytes    secs.    10^6bits/sec

  87380  16384  16384    10.00       0.00

any ideas?

Upvotes: 3

Views: 1567

Answers (2)

Rick Jones
Rick Jones

Reputation: 234

A netperf test has two "connections." The first is the "control connection" over which information about the test setup and result is exchanged. For the benchmarking itself a "data connection" is used. The control connection will use the control port you've specified with the global "-p" option. The data connection will by default use a port number chosen by the networking stack where the netserver runs.

Both have to be open through firewalls for a test to be successful.

If only the control port is open, you will see the test banners get displayed because the control connection is established. Since the data connection cannot be established, that will report zero.

You can specify an explicit port number for the data connection with a test-specific "-P" option. So, if you opened a second port number, 9992, you would start the netserver as before, and then your netperf command would become:

./netperf -s 5 -H a.b.c.d -p xxxxx -- -P ,9992

That comma is important. The test-specific -P option allows specifying both the local and remote port numbers for the data connection. The remote port number follows a comma.

Upvotes: 1

kangear
kangear

Reputation: 2603

terminal1:

$ sudo netserver -D -4 -L 0.0.0.0 -p 9991
Starting netserver with host '0.0.0.0' port '9991' and family AF_INET

terminal2:

$ sudo netperf -H 192.168.2.103 -l 60 -t TCP_STREAM
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.2.103 (192.168.2.103) port 0 AF_INET
Recv   Send    Send                          
Socket Socket  Message  Elapsed              
Size   Size    Size     Time     Throughput  
bytes  bytes   bytes    secs.    10^6bits/sec  

 87380 524288 524288    60.02      89.66 

Upvotes: 0

Related Questions