GithubHelp home page GithubHelp logo

hewlettpackard / netperf Goto Github PK

View Code? Open in Web Editor NEW
847.0 44.0 186.0 15.57 MB

Netperf is a benchmark that can be used to measure the performance of many different types of networking. It provides tests for both unidirectional throughput, and end-to-end latency.

License: MIT License

Makefile 0.15% M4 2.92% Shell 1.96% C 94.97%

netperf's Introduction


BE SURE TO READ THE MANUAL. EVEN THOUGH IT MAY BE OUTDATED.

This is a brief readme file for the netperf TCP/UDP/sockets/etc
performance benchmark. This is here mostly as a boot-strap. The real
information is in the manual, which can be found in netperf.ps and
online from http://www.netperf.org/netperf/NetperfPage.html. The
sources, and a limited number of binaries, can be found from
ftp://ftp.cup.hp.com/dist/networking/benchmarks/netperf/ .

BE SURE TO READ THE MANUAL. EVEN THOUGH IT MAY BE OUTDATED.

This version of netperf has been opensourced by Hewlett Packard Enterprise
using the MIT license.


Feel free to report netperf results in public forums, but please be
excruciatingly complete in your description of the test envorinment.
The old netperf database at:

  http://www.netperf.org/netperf/NetperfPage.html

is no more - or rather the utilities for accessing it no longer run.
The data is still present in the tree, albeit _VERY_ old now.

There is an Internet mailing list devoted to netperf. It is called
netperf-talk and it is hosted on netperf.org. Subscription requests
should go to [email protected].

Please DO NOT SEND subscription requests to netperf-talk!

If you run into severe difficulties, or are just feeling chatty,
please feel free to drop some email to me - Rick Jones
<[email protected]>. Be sure to include a meaningful subject lines.

happy benchmarking,
rick jones

BE SURE TO READ THE MANUAL. EVEN THOUGH IT MAY BE OUTDATED.

Licenses updated.

netperf's People

Contributors

gallatin avatar gavinb-hpe avatar grundlerchromium avatar kirbychris avatar ldoktor avatar marceloleitner avatar qsn avatar teknoraver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netperf's Issues

netlib.c doesn't compile on Solaris 11: processor_affinity redeclared

Compiling git netperf on Solaris 11.4 Beta fails even after appying the fix for issue #17:

In file included from /vol/src/adm/netperf/netperf/src/netlib.c:2296:0:
/usr/include/sys/processor.h: In function 'bind_to_specific_processor':
/usr/include/sys/processor.h:128:12: error: 'processor_affinity' redeclared as different kind of symbol
 extern int processor_affinity(procset_t *, uint_t *, id_t *, uint32_t *);
            ^~~~~~~~~~~~~~~~~~
/vol/src/adm/netperf/netperf/src/netlib.c:2273:32: note: previous definition of 'processor_affinity' was here
 bind_to_specific_processor(int processor_affinity, int use_cpu_map)

processor_affinity(2) is a syscall here, introduced in some Solaris 11.x update. Renaming the netlib.c
symbol to proc_affinity allowed the compilation to succeed and the resulting binary to work just fine.

Unable to compile on Fedora 32

As the title states, I'm unable to compile netperf on Fedora 32. What I've done so far is run (without any apparent issues):

./autogen.sh
./configure --enable-demo

When I run make I get the following error:

[michael@localhost netperf]$ make
(CDPATH="${ZSH_VERSION+.}:" && cd . && autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: Entering directory '/home/michael/src/router_stuff/netperf'
Making all in src
make[2]: Entering directory '/home/michael/src/router_stuff/netperf/src'
Making all in missing
make[3]: Entering directory '/home/michael/src/router_stuff/netperf/src/missing'
Making all in m4
make[4]: Entering directory '/home/michael/src/router_stuff/netperf/src/missing/m4'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/michael/src/router_stuff/netperf/src/missing/m4'
make[4]: Entering directory '/home/michael/src/router_stuff/netperf/src/missing'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/michael/src/router_stuff/netperf/src/missing'
make[3]: Leaving directory '/home/michael/src/router_stuff/netperf/src/missing'
make[3]: Entering directory '/home/michael/src/router_stuff/netperf/src'
gcc -DHAVE_CONFIG_H -I. -I..      -MT netperf.o -MD -MP -MF .deps/netperf.Tpo -c -o netperf.o netperf.c
mv -f .deps/netperf.Tpo .deps/netperf.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT netlib.o -MD -MP -MF .deps/netlib.Tpo -c -o netlib.o netlib.c
netlib.c: In function ‘bind_to_specific_processor’:
netlib.c:2343:9: warning: implicit declaration of function ‘sched_setaffinity’; did you mean ‘SYS_sched_setaffinity’? [-Wimplicit-function-declaration]
 2343 |     if (sched_setaffinity(getpid(), len, &netperf_cpu_set)) {
      |         ^~~~~~~~~~~~~~~~~
      |         SYS_sched_setaffinity
mv -f .deps/netlib.Tpo .deps/netlib.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT netsh.o -MD -MP -MF .deps/netsh.Tpo -c -o netsh.o netsh.c
mv -f .deps/netsh.Tpo .deps/netsh.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_bsd.o -MD -MP -MF .deps/nettest_bsd.Tpo -c -o nettest_bsd.o nettest_bsd.c
mv -f .deps/nettest_bsd.Tpo .deps/nettest_bsd.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_dlpi.o -MD -MP -MF .deps/nettest_dlpi.Tpo -c -o nettest_dlpi.o nettest_dlpi.c
mv -f .deps/nettest_dlpi.Tpo .deps/nettest_dlpi.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_unix.o -MD -MP -MF .deps/nettest_unix.Tpo -c -o nettest_unix.o nettest_unix.c
mv -f .deps/nettest_unix.Tpo .deps/nettest_unix.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_xti.o -MD -MP -MF .deps/nettest_xti.Tpo -c -o nettest_xti.o nettest_xti.c
mv -f .deps/nettest_xti.Tpo .deps/nettest_xti.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_sctp.o -MD -MP -MF .deps/nettest_sctp.Tpo -c -o nettest_sctp.o nettest_sctp.c
mv -f .deps/nettest_sctp.Tpo .deps/nettest_sctp.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_sdp.o -MD -MP -MF .deps/nettest_sdp.Tpo -c -o nettest_sdp.o nettest_sdp.c
mv -f .deps/nettest_sdp.Tpo .deps/nettest_sdp.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_omni.o -MD -MP -MF .deps/nettest_omni.Tpo -c -o nettest_omni.o nettest_omni.c
nettest_omni.c: In function ‘recv_data_no_copy’:
nettest_omni.c:3140:19: warning: implicit declaration of function ‘splice’ [-Wimplicit-function-declaration]
 3140 |     bytes_recvd = splice(data_socket,
      |                   ^~~~~~
mv -f .deps/nettest_omni.Tpo .deps/nettest_omni.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT net_uuid.o -MD -MP -MF .deps/net_uuid.Tpo -c -o net_uuid.o net_uuid.c
mv -f .deps/net_uuid.Tpo .deps/net_uuid.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT dscp.o -MD -MP -MF .deps/dscp.Tpo -c -o dscp.o dscp.c
mv -f .deps/dscp.Tpo .deps/dscp.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT netcpu_procstat.o -MD -MP -MF .deps/netcpu_procstat.Tpo -c -o netcpu_procstat.o netcpu_procstat.c
mv -f .deps/netcpu_procstat.Tpo .deps/netcpu_procstat.Po
gcc     -o netperf netperf.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o nettest_omni.o net_uuid.o dscp.o netcpu_procstat.o  -lrt -lm 
/usr/bin/ld: nettest_omni.o:(.bss+0x208): multiple definition of `loc_nodelay'; nettest_bsd.o:(.bss+0x20): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x20c): multiple definition of `rem_nodelay'; nettest_bsd.o:(.bss+0x24): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x210): multiple definition of `loc_sndavoid'; nettest_bsd.o:(.bss+0x40): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x214): multiple definition of `loc_rcvavoid'; nettest_bsd.o:(.bss+0x44): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x218): multiple definition of `rem_sndavoid'; nettest_bsd.o:(.bss+0x48): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x21c): multiple definition of `rem_rcvavoid'; nettest_bsd.o:(.bss+0x4c): first defined here
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:419: netperf] Error 1
make[3]: Leaving directory '/home/michael/src/router_stuff/netperf/src'
make[2]: *** [Makefile:473: all-recursive] Error 1
make[2]: Leaving directory '/home/michael/src/router_stuff/netperf/src'
make[1]: *** [Makefile:374: all-recursive] Error 1
make[1]: Leaving directory '/home/michael/src/router_stuff/netperf'
make: *** [Makefile:313: all] Error 2

Behavior on version mismatch between netperf and netserver

I got the following error message when run netperf in my lab.

$ netperf  -H 172.20.110.227
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.20.110.227 () port 0 AF_INET
netperf: send_omni: connect_data_socket failed: Connection refused

At first, I checked netserver side iptables configuration etc., and
after some more analysis, I noticed that there was a version mismatch between
netperf (2.5.0) and netserver (2.7.0) while I was seeing strace log of netserver side.

$ ss -antp  | grep 12865
LISTEN      0        128                     *:12865                  *:*        users:(("netserver",pid=154671,fd=3))

$ sudo strace -p 154671 -f
strace: Process 154671 attached
select(4, [3], [], [], NULL)            = 1 (in [3])
accept(3, {sa_family=AF_INET6, sin6_port=htons(37730), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::ffff:172.20.105.106", &sin6_addr), sin6_scope_id=0}, [128->28]) = 6

(snip)

I noticed that there could be a version mismatch when I saw the trace line below.

[pid 158337] write(3, "unknown test number 0\n", 22) = 22
[pid 158337] sendto(6, "\0\0\0b\0\0\3\346\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\0\0\0\0\0\0"..., 256, 0, NULL, 0) = 256
[pid 158337] recvfrom(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256, 0, NULL, NULL) = 144
[pid 158337] recvfrom(6, 0x55deaa20e250, 112, 0, NULL, NULL) = -1 ECONNRESET (Connection reset by peer)
[pid 158337] write(3, "recv_request: error on recv  err"..., 39) = 39
[pid 158337] exit_group(1)              = ?
[pid 158337] +++ exited with 1 +++
^Cstrace: Process 154671 detached

I do understand that we should use the same version for both netserver and netperf,
but still this error message is hard to find out what is going on().

Here, my point is that this is a bit tricky, and I think it's better to output more information on the client (netperf) side.

What do you think about?

ios port?

is there an apple ios port for netperf? I now have it running on osx on the m1 (will supply patch), but haven't tried ios yet.

Netperf with SCTP doesn't send frames to the defined port number.

It looks like netperf with SCTP protocol doesn't send frames to the defined port number.
Host receives frames on some random port.

  1. I downloaded netperf sources v.2.7.0.
    and configured it on Fedora v.26 using command:
    CFLAGS="-std=gnu89" ./configure --enable-intervals=yes --enable-sctp=yes --enable-histogram=yes --enable-demo=yes
  2. Command on the client side:
    netperf -H -p 12865 -t SCTP_RR -l 15 -- -P 5001,5001
  3. Frames are not received on port 5001.

New version?

netperf-2.7.0...master shows ~40 commits since laste release which was in 2015.
IMO it would be good to flush all those changesa and release new version.

Do you have any plans to do that soon? 🤔

wrong "socket TOS:" output when -d 10 is used

Hello everyone,

I noticed that the output of the fields (when the -d 10 debug option is used):

Local socket TOS:
Remote socket TOS:

is not always correct. I have done the whole sequence of cases and this is the output.
However the traffic is generated with the correct value in the "tos" field.

This is netperf 2.7.0 compiled from sources with the following options:
configure --prefix=/usr --enable-demo --enable-histogram

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 0,0 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 4,4 -f m| grep TOS
Local socket TOS: reliability
Remote socket TOS: reliability

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 8,8 -f m| grep TOS
Local socket TOS: throughput
Remote socket TOS: throughput

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 12,12 -f m| grep TOS
Local socket TOS: 0x0c
Remote socket TOS: 0x0c

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 16,16 -f m| grep TOS
Local socket TOS: lowdelay
Remote socket TOS: lowdelay

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 32,32 -f m| grep TOS
Local socket TOS: cs1
Remote socket TOS: cs1

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 40,40 -f m| grep TOS
Local socket TOS: af11
Remote socket TOS: af11

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 48,48 -f m| grep TOS
Local socket TOS: af12
Remote socket TOS: af12

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 56,56 -f m| grep TOS
Local socket TOS: af13
Remote socket TOS: af13

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 64,64 -f m| grep TOS
Local socket TOS: cs2
Remote socket TOS: cs2

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 72,72 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 80,80 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 88,88 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 96,96 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 104,104 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 112,112 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 120,120 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 128,128 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 136,136 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 144,144 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 152,152 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 160,160 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 176,176 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 184,184 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 192,192 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

[root@pakito ~]# netperf -H 10.68.68.56 -d 10 -l 2 -v 2 -D 1 -Y 224,224 -f m| grep TOS
Local socket TOS: cs0
Remote socket TOS: cs0

powerpc: netperf2.7 make fails with gcc 11

netperf failing to compile on my powerpc box which has gcc version 11

gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_omni.o -MD -MP -MF .deps/nettest_omni.Tpo -c -o nettest_omni.o nettest_omni.c
nettest_omni.c: In function ‘recv_data_no_copy’:
nettest_omni.c:3030:19: warning: implicit declaration of function ‘splice’ [-Wimplicit-function-declaration]
 3030 |     bytes_recvd = splice(data_socket,
      |                   ^~~~~~
mv -f .deps/nettest_omni.Tpo .deps/nettest_omni.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT net_uuid.o -MD -MP -MF .deps/net_uuid.Tpo -c -o net_uuid.o net_uuid.c
net_uuid.c: In function ‘get_random_info’:
net_uuid.c:158:5: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
  158 |     read(fd, seed, 16);
      |     ^~~~
      |     fread
net_uuid.c:159:5: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
  159 |     close(fd);
      |     ^~~~~
      |     pclose
mv -f .deps/net_uuid.Tpo .deps/net_uuid.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT dscp.o -MD -MP -MF .deps/dscp.Tpo -c -o dscp.o dscp.c
mv -f .deps/dscp.Tpo .deps/dscp.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT netcpu_none.o -MD -MP -MF .deps/netcpu_none.Tpo -c -o netcpu_none.o netcpu_none.c
mv -f .deps/netcpu_none.Tpo .deps/netcpu_none.Po
gcc     -o netperf netperf.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o nettest_omni.o net_uuid.o dscp.o netcpu_none.o  -lm 
/usr/bin/ld: nettest_omni.o:(.bss+0x200): multiple definition of `loc_nodelay'; nettest_bsd.o:(.bss+0x28): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x204): multiple definition of `rem_nodelay'; nettest_bsd.o:(.bss+0x2c): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x208): multiple definition of `loc_sndavoid'; nettest_bsd.o:(.bss+0x38): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x20c): multiple definition of `loc_rcvavoid'; nettest_bsd.o:(.bss+0x3c): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x210): multiple definition of `rem_sndavoid'; nettest_bsd.o:(.bss+0x40): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x214): multiple definition of `rem_rcvavoid'; nettest_bsd.o:(.bss+0x44): first defined here
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:305: netperf] Error 1
make[3]: Leaving directory '/root/netperf-netperf-2.7.0/src'
make[2]: *** [Makefile:352: all-recursive] Error 1
make[2]: Leaving directory '/root/netperf-netperf-2.7.0/src'
make[1]: *** [Makefile:277: all-recursive] Error 1
make[1]: Leaving directory '/root/netperf-netperf-2.7.0'
make: *** [Makefile:215: all] Error 2

netperffulllogs.txt

Fail to compile netserver.c on Linux

I got the following error message when compiling it on RHEL7.4, please help check:
gcc -DHAVE_CONFIG_H -I. -I.. -MT netserver.o -MD -MP -MF .deps/netserver.Tpo -c -o netserver.o netserver.c
netserver.c: In function ‘open_debug_file’:
netserver.c:259:14: error: incompatible types when assigning to type ‘char[4096]’ from type ‘char *’
FileName = NETPERF_NULL;
^
netserver.c:260:19: error: ‘Filename’ undeclared (first use in this function)
where = fopen(Filename, "w");

netperf sends traffic with an address different from the one specified by the parameter "-L" on linux

Hello everyone,

I have compiled netperf-master on Slackware linux x86-64, with the following options:

sh configure --prefix=/usr --enable-demo --enable-histogram

If I run the following command:

netperf -L 1.1.1.1 -H 10.81.160.56 -d 10 -l 5 -v 2 -D 1 -f m

I can see on the remote host (10.81.160.56) that the tcp traffic source ip address is not the one specified with the '-L' parameters, but another ip address (host is multi homed).
Here is the output from netperf:

netperf -L 1.1.1.1 -H 10.81.160.56 -d 10 -l 5 -v 2 -D 1 -f m
resolve_host called with host '10.81.160.56' port '(null)' family AF_UNSPEC
getaddrinfo returned the following for host '10.81.160.56' port '(null)' family AF_UNSPEC
cannonical name: '10.81.160.56'
flags: 22 family: AF_INET: socktype: SOCK_STREAM protocol IPPROTO_TCP addrlen 16
sa_family: AF_INET sadata: 0 0 10 81 160 56 0 0 0 0 0 0 0 0 0 0
scan_omni_args called with the following argument vector
netperf -L 1.1.1.1 -H 10.81.160.56 -d -l 5 -v 2 -D 1 -f m 10
sizeof(omni_request_struct)=200/648
sizeof(omni_response_struct)=204/648
sizeof(omni_results_struct)=284/648
Program name: netperf
Local send alignment: 8
Local recv alignment: 8
Remote send alignment: 8
Remote recv alignment: 8
Local socket priority: -1
Remote socket priority: -1
Local socket TOS: cs0
Remote socket TOS: cs0
Report local CPU 0
Report remote CPU 0
Verbosity: 2
Debug: 1
Port: 12865
Test name: TCP_STREAM
Test bytes: 0 Test time: 5 Test trans: 0
Host name: 10.81.160.56

installing catcher for all signals
Could not install signal catcher for sig 32, errno 22
Could not install signal catcher for sig 33, errno 22
Could not install signal catcher for sig 65, errno 22
remotehost is 10.81.160.56 and port 12865
resolve_host called with host '10.81.160.56' port '12865' family AF_INET
getaddrinfo returned the following for host '10.81.160.56' port '12865' family AF_INET
cannonical name: '10.81.160.56'
flags: 22 family: AF_INET: socktype: SOCK_STREAM protocol IPPROTO_TCP addrlen 16
sa_family: AF_INET sadata: 50 65 10 81 160 56 0 0 0 0 0 0 0 0 0 0
resolve_host called with host '1.1.1.1' port '0' family AF_UNSPEC
getaddrinfo returned the following for host '1.1.1.1' port '0' family AF_UNSPEC
cannonical name: '1.1.1.1'
flags: 22 family: AF_INET: socktype: SOCK_STREAM protocol IPPROTO_TCP addrlen 16
sa_family: AF_INET sadata: 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0
establish_control called with host '10.81.160.56' port '12865' remfam AF_INET
local '1.1.1.1' port '0' locfam AF_UNSPEC
bound control socket to 1.1.1.1 and 0
successful connection to remote netserver at 10.81.160.56 and 12865
complete_addrinfo using hostname 10.81.160.56 port 0 family AF_INET type SOCK_STREAM prot IPPROTO_TCP flags 0x0
getaddrinfo returned the following for host '10.81.160.56' port '0' family AF_INET
cannonical name: '10.81.160.56'
flags: 22 family: AF_INET: socktype: SOCK_STREAM protocol IPPROTO_TCP addrlen 16
sa_family: AF_INET sadata: 0 0 10 81 160 56 0 0 0 0 0 0 0 0 0 0
local_data_address not set, using local_host_name of '1.1.1.1'
complete_addrinfo using hostname 1.1.1.1 port 0 family AF_UNSPEC type SOCK_STREAM prot IPPROTO_TCP flags 0x1
getaddrinfo returned the following for host '1.1.1.1' port '0' family AF_UNSPEC
cannonical name: '1.1.1.1'
flags: 23 family: AF_INET: socktype: SOCK_STREAM protocol IPPROTO_TCP addrlen 16
sa_family: AF_INET sadata: 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0
MIGRATED TCP STREAM TEST from 1.1.1.1 () port 0 AF_INET to 10.81.160.56 () port 0 AF_INET : histogram : demo
create_data_socket: socket 4 obtained...
netperf: get_sock_buffer: send socket size determined to be 131072
netperf: get_sock_buffer: receive socket size determined to be 131072
send_omni_inner: 2 entry send_ring obtained...
recv_response: received a 656 byte response
remote listen done.
remote port is 40275
About to start a timer for 5 seconds.
Interim result: 77.22 10^6bits/s over 1.032 seconds ending at 1611671064.064
Interim result: 74.05 10^6bits/s over 1.062 seconds ending at 1611671065.126
Interim result: 72.41 10^6bits/s over 1.014 seconds ending at 1611671066.139
Interim result: 71.36 10^6bits/s over 1.014 seconds ending at 1611671067.153
Interim result: 74.00 10^6bits/s over 0.879 seconds ending at 1611671068.032
netperf: get_sock_buffer: receive socket size determined to be 131072
netperf: get_sock_buffer: send socket size determined to be 1912320
disconnect_data_socket sock 4 init 1 do_close 1 protocol 6
Adjusting elapsed_time by 0 seconds
recv_response: received a 656 byte response
remote results obtained
calculate_confidence: itr 1; time 5.197987; res 71.192497
lcpu -1.000000; rcpu -1.000000
lsdm -1.000000; rsdm -1.000000
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec

131072 131072 131072 5.20 71.19

Alignment Offset Bytes Bytes Sends Bytes Recvs
Local Remote Local Remote Xfered Per Per
Send Recv Send Recv Send (avg) Recv (avg)
8 8 0 0 46137344 131072.00 352 1404.02 32861

Maximum
Segment
Size (bytes)
1349

Histogram of time spent in send() call.
UNIT_USEC : 0: 0: 0: 0: 0: 0: 0: 0: 0: 0
TEN_USEC : 0: 0: 216: 44: 3: 3: 2: 1: 0: 0
HUNDRED_USEC : 0: 0: 0: 0: 0: 0: 0: 0: 0: 0
UNIT_MSEC : 0: 0: 1: 0: 0: 0: 1: 0: 1: 0
TEN_MSEC : 0: 1: 7: 8: 3: 5: 2: 53: 0: 0
HUNDRED_MSEC : 0: 1: 0: 0: 0: 0: 0: 0: 0: 0
UNIT_SEC : 0: 0: 0: 0: 0: 0: 0: 0: 0: 0
TEN_SEC : 0: 0: 0: 0: 0: 0: 0: 0: 0: 0

100_SECS: 0
HIST_TOTAL: 352
sum 4990327, sumsquare 0.000000, limit 2 count 1
shutdown_control: shutdown of control connection requested.

and this is the "ip a li" output from the netperf box:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether fc:4d:d4:2e:dd:59 brd ff:ff:ff:ff:ff:ff
inet 10.68.64.254/22 brd 10.68.67.255 scope global eth0
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 00:1f:29:54:ac:0c brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:1f:29:54:ac:0d brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 00:15:17:f9:54:0f brd ff:ff:ff:ff:ff:ff
inet 1.1.1.1/28 scope global eth3
valid_lft forever preferred_lft forever
6: eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether a0:ce:c8:13:1e:f2 brd ff:ff:ff:ff:ff:ff

ip source address is always the 10.68.64.254 even though the '-L' parameter has been specified

Failed to compile netperf 2.7.0 using Cygwin

Not sure if this is the right place to ask this but I am having issue getting netperf 2.7.0 using Cygwin. Based on what I read, many people have success getting netperf to compile using Cygwin so I am hoping that I am missing some libraries that I forgot to install and hoping someone would shed me some light on this.

Here's the sequence of steps I took for compilation.

wget https://github.com/HewlettPackard/netperf/archive/netperf-2.7.0.tar.gz
tar -zxvf netperf-2.7.0.tar.gz
cd netperf-netperf-2.7.0
./configure
./make all

The following is a snippet of the error ouput

mv -f .deps/netcpu_none.Tpo .deps/netcpu_none.Po
gcc     -o netperf.exe netperf.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o nettest_omni.o net_uuid.o dscp.o netcpu_none.o  -lm
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: netlib.o:netlib.c:(.text+0x1b46): undefined reference to `__CPU_ZERO'
netlib.o:netlib.c:(.text+0x1b46): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__CPU_ZERO'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: netlib.o:netlib.c:(.text+0x1b57): undefined reference to `__CPU_SET'
netlib.o:netlib.c:(.text+0x1b57): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__CPU_SET'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:305: netperf.exe] Error 1
make[3]: Leaving directory '/home/David Chu/workspace/netperf-netperf-2.7.0/src'
make[2]: *** [Makefile:352: all-recursive] Error 1
make[2]: Leaving directory '/home/David Chu/workspace/netperf-netperf-2.7.0/src'
make[1]: *** [Makefile:277: all-recursive] Error 1
make[1]: Leaving directory '/home/David Chu/workspace/netperf-netperf-2.7.0'
make: *** [Makefile:215: all] Error 2

Attached is the full compilation log

compilation.log

Thanks in advance!

Buffer overflow vulnerability in netperf through 2.6.0

Netperf 2.6.0 s a benchmark tool than developed by Helett Packard that can be used to measure the performance of many different types of networking. It provides tests for both unidirectional troughput and end-to-end latency.
Stack-based buffer overflow vulnerability in function scan_cmd_line() allows local attackers to cause a denial of service(application crash) or get a system shell(by ROP when canary protection disabled).

POC:
root@iZp6mmjqib52f6Z:~# netperf -a `python -c 'print "A"*8220+"DCBA"'`
*** stack smashing detected ***: netperf terminated
Aborted (core dumped)

Vulnerability in src/netsh.c:
line 633 in function scan_cmd_line():
``

case 'a':

  /* set local alignments */

  break_args(optarg,arg1,arg2);

  if (arg1[0]) {

local_send_align = convert(arg1);

  }

  if (arg2[0])

local_recv_align = convert(arg2);

  break;

When command line argument starts with '-a', the string optarg is copied to arg1 and arg2 via function break_args(), causing a stack-based buffer overflow.
When attackers try to exploit the vulnerability, if __stack_chk_fail is enabled, the program checks stack canary and exits. Otherwise, the program returns to constructed RIP(shellcode address or ROP address) and attackers may get a shell via system('/bin/sh').

DOC: link to pkgs.org/download/netperf

A link to https://pkgs.org/download/netperf (which links to 3rd party packages for many operating systems) would be useful; in lieu of just uploading packages to the releases section of this gh project.

As would this for building from source:

sudo dnf install -y autoconf automake libtool gcc texinfo
# (are there additional packages that i already have installed?)
./autogen.sh
./configure --enable-demo --prefix=/usr/local
make CFLAGS="-fcommon"
sudo make install

Tagging release 2.7.1?

Hi

Would it be possible to tag release 2.7.1? There are some bugfixes in git that it would be useful to have in a release :)

Thanks!

segfaults on fork

As soon as there is some fork, netserver segfaults (using this version https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/applications/networking/netperf/default.nix):

juin 06 15:32:11 jedha kernel: netserver[26010]: segfault at ffffffffffffffff ip 00007f49ae943440 sp 00007ffedf9d5108 error 5 in libc-2.27.so[7f49ae8cf000+1aa000]
juin 06 15:32:44 jedha kernel: netserver[26121]: segfault at ffffffffffffffff ip 00007f8a80960440 sp 00007ffebe99e9e8 error 5 in libc-2.27.so[7f8a808ec000+1aa000]
juin 06 15:32:51 jedha kernel: netserver[26129]: segfault at ffffffffffffffff ip 00007f8a80960440 sp 00007ffebe99e9e8 error 5 in libc-2.27.so[7f8a808ec000+1aa000]
juin 06 15:33:01 jedha kernel: netserver[26141]: segfault at ffffffffffffffff ip 00007f8a80960440 sp 00007ffebe99e9e8 error 5 in libc-2.27.so[7f8a808ec000+1aa000]
juin 06 15:33:02 jedha kernel: netserver[26148]: segfault at ffffffffffffffff ip 00007f8a80960440 sp 00007ffebe99e9e8 error 5 in libc-2.27.so[7f8a808ec000+1aa000]

Here is an strace

27074 bind(3, {sa_family=AF_INET, sin_port=htons(12865), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
27074 listen(3, 1024)                   = 0
27074 write(1, "Starting netserver with host 'IN"..., 77) = 77
27074 write(1, "accept_connections: enter\n", 26) = 26
27074 write(1, "set_fdset: enter list 0x1f75700 "..., 54) = 54
27074 write(1, "setting 3 in fdset\n", 19) = 19
27074 select(4, [3], [], [], NULL)      = 1 (in [3])
27074 write(1, "accept_connection: enter\n", 25) = 25
27074 accept(3, {sa_family=AF_INET, sin_port=htons(37957), sin_addr=inet_addr("127.0.0.1")}, [128->16]) = 4
27074 setsockopt(4, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
27074 write(1, "spawn_child: enter\n", 19) = 19
27074 rt_sigaction(SIGCHLD, {sa_handler=SIG_IGN, sa_mask=[CHLD], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f4a0b93bc50}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
27074 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4a0c478e50) = 27077
27074 close(4)                          = 0
27077 set_robust_list(0x7f4a0c478e60, 24 <unfinished ...>
27074 write(1, "set_fdset: enter list 0x1f75700 "..., 54 <unfinished ...>
27077 <... set_robust_list resumed> )   = 0
27074 <... write resumed> )             = 54
27077 write(1, "close_listens: enter\n", 21 <unfinished ...>
27074 write(1, "setting 3 in fdset\n", 19 <unfinished ...>
27077 <... write resumed> )             = 21
27074 <... write resumed> )             = 19
27077 close(3 <unfinished ...>
27074 select(4, [3], [], [], NULL <unfinished ...>
27077 <... close resumed> )             = 0
27077 getpid()                          = 27077
27077 openat(AT_FDCWD, "/var/log//netserver.debug_LDE89I", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
27077 chmod("/var/log//netserver.debug_LDE89I", 0644) = 0
27077 openat(AT_FDCWD, "/dev/null", O_RDONLY) = 5
27077 close(0)                          = 0
27077 dup(5)                            = 0
27077 close(1)                          = 0
27077 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3} ---
27077 +++ killed by SIGSEGV +++
27074 <... select resumed> )            = ? ERESTARTNOHAND (To be restarted if no handler)
27074 --- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
27074 +++ killed by SIGINT +++

If I prevent fork via
sudo netserver -Ddf
then it works correctly. I am using netperf with flent, I am not sure I can run all tests with the -f flag but I hope so.

Intermittend send call failure

Once and again I get the error "send_response_n: send call failure" on my Linux system. This tracks down to the following line

if ((bytes_sent = send(server_sock,

where the code expects the send() call to always return the exact amount of data that was requested (sizeof(netperf_response)). In my opinion this assumption is wrong. At least on Linux a send() call may transfer lesser bytes as requested.

From https://linux.die.net/man/2/send

The only difference between send() and write(2) is the presence of flags. With a zero flags argument, send() is equivalent to write(2).

Looking on the man page of write() https://linux.die.net/man/2/write

The number of bytes written may be less than count if, for example, there is insufficient space on the underlying physical medium, or the RLIMIT_FSIZE resource limit is encountered (see setrlimit(2)), or the call was interrupted by a signal handler after having written less than count bytes. (See also pipe(7).)

I think its there is a need to loop over all data that should be sent, even when using blocking sockets. I agree that the description in send() is a little bit misleading, but if you check the kernel code for tcp_sendmsg() in tcp.c you can see that it can return when at least 1 octet was sent. It blocks only when no octet was written before (for blocking sockets).

What do you think?

Netperf OMNI Receive Test failing for SCTP

Hi All,

We are trying to use netperf to do SCTP receive using the below command:
netperf -c -C -t omni -H -L -l 60 -P 0 -- -m 1024,1024 -d receive -T SCTP -R 1 -o SOCKET_TYPE,PROTOCOL,DIRECTION,THROUGHPUT,THROUGHPUT_UNITS,MEAN_LATENCY -P 12866
The command is failing almost everytime in one environment. In other environment it's failing about 30-40% times.
When we looked at the tcpdump, it looks the server is trying to send some data even after the transport endpoint is closed
Below is the error message:
Cannot send after transport endpoint shutdown

When I looked at the sctptest_omni.c file I see below code

if ((test_time) || ((test_trans == 0) && (test_bytes == 0))) {
/* The user wanted to end the test after a period of time. if
we are a recv-only test, we need to protect ourself against
the remote going poof, but we want to make sure we don't
give-up before they finish, so we will add a PAD_TIME to the
timer.
if we are RR or XMIT, there should be no need for
padding */
times_up = 0;
units_remaining = 0;
if ((!no_control) &&
(NETPERF_RECV_ONLY(direction)) &&
((test_trans == 0) && (test_bytes == 0)))
pad_time = 0;
start_timer(test_time + pad_time);
}

By looking at the comment I believe we need to add the pad_time before closing the connection. However in the actual code the pad_time is set to 0. Because of this the we are getting the error.

To prove that I have change the code and replaced the line pad_time = 0; with pad_time = PAD_TIME;

And recompiled netperf and used the new binary for performing the tests.
After this change I don't see the issue anymore.

Please validate and take needed actions.

Thanks and regards,
Ramu

Any chance of adding a security string to client/server command line invocations?

Something like

/opt/netperf/netperf -H remotehost -p 2018 -k BANJO2018

And on the server side

netserver -p 2018 -k BANJO2018

And the server side would not interact with a client request unless the security strings match

I ask because of the use case of running on public networks and not wanting to open a server on a public IP address that would blast test packets all over the internet to any inbound netperf client request

This way you could restrict the server to just a subset of clients which know the security string

It does not have to be super secure or encrypted but as a simple security mechanism it seems to increase the security at least a little bit (you can configure iptables to allow inbound clients on a non standard port - i.e. something other than 12865) as a way to increase security also

The key matching thing would add another layer of protection

Thoughts?

Compilation error due to inline in netlib.c?

Description

Hi, I'm new to netperf, and encountered an error upon compiling it. I added more detail about how to reproduce this but basically:

  • I wanted to compile netperf with --enable-demo
  • So I downloaded the netperf-2.7.0 source package from GitHub, and tried to compile it on Amazon Linux 2 on Amazon EC2
  • However, I encountered the compilation error in the make step:
wget https://github.com/HewlettPackard/netperf/archive/netperf-2.7.0.tar.gz
tar xvf netperf-2.7.0.tar.gz
cd netperf-netperf-2.7.0
./configure --enable-demo

# Here I encountered the error
make

The error was undefined reference to demo_interval_xxx as follows:

...
...
gcc     -o netperf netperf.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o nettest_omni.o net_uuid.o dscp.o netcpu_procstat.o  -lm
netlib.o: In function `demo_interval_final':
netlib.c:(.text+0x3de3): undefined reference to `demo_interval_display'
netlib.o: In function `demo_stream_interval':
netlib.c:(.text+0x3e09): undefined reference to `demo_interval_tick'
netlib.o: In function `demo_rr_interval':
netlib.c:(.text+0x3e7f): undefined reference to `demo_interval_tick'
nettest_omni.o: In function `send_omni_inner':
nettest_omni.c:(.text+0x83f0): undefined reference to `demo_interval_tick'
nettest_omni.c:(.text+0x8407): undefined reference to `demo_interval_tick'
nettest_omni.c:(.text+0x8430): undefined reference to `demo_interval_tick'
nettest_omni.o:nettest_omni.c:(.text+0x843c): more undefined references to `demo_interval_tick' follow
collect2: error: ld returned 1 exit status

Seems like the issue is related to this

My workaround and suggestion

By removing inline from the two places in src/netlib.c (here, and here), I could compile the source successfully.

As I am new to netperf, I am not sure if this is a genuine issue and my solution is acceptable. I assume those inline's are used for a good reason, and the compilation error is just due to my environment. If so, please close this issue and I do my workaround on my end.

However, if it makes sense to remove inline from these two places, and those inlines don't add much value currently (inline for performance optimization?), I can submit a pull request.

Thanks

netperf porting to riscv

tried for port this benchmark to riscv,for this i fallowed bellow steps

  1. ./autogen.sh
    2)./configure
  2. make and make install
    But when i do make i got fallowing error..... can anyone solve this problem..

make all-recursive
make[1]: Entering directory '/home/root/kiran/netperf'
Making all in src
make[2]: Entering directory '/home/root/kiran/netperf/src'
Making all in missing
make[3]: Entering directory '/home/root/kiran/netperf/src/missing'
Making all in m4
make[4]: Entering directory '/home/root/kiran/netperf/src/missing/m4'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/root/kiran/netperf/src/missing/m4'
make[4]: Entering directory '/home/root/kiran/netperf/src/missing'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/root/kiran/netperf/src/missing'
make[3]: Leaving directory '/home/root/kiran/netperf/src/missing'
make[3]: Entering directory '/home/root/kiran/netperf/src'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/root/kiran/netperf/src'
make[2]: Leaving directory '/home/root/kiran/netperf/src'
Making all in doc
make[2]: Entering directory '/home/root/kiran/netperf/doc'
Making all in examples
make[3]: Entering directory '/home/root/kiran/netperf/doc/examples'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/root/kiran/netperf/doc/examples'
make[3]: Entering directory '/home/root/kiran/netperf/doc'
restore=: && backupdir=".am$$" &&
am__cwd=pwd && CDPATH="${ZSH_VERSION+.}:" && cd . &&
rm -rf $backupdir && mkdir $backupdir &&
if (makeinfo --version) >/dev/null 2>&1; then
for f in netperf.info netperf.info-[0-9] netperf.info-[0-9][0-9] netperf.i[0-9] netperf.i[0-9][0-9]; do
if test -f $f; then mv $f $backupdir; restore=mv; else :; fi;
done;
else :; fi &&
cd "$am__cwd";
if makeinfo -I .
-o netperf.info netperf.texi;
then
rc=0;
CDPATH="${ZSH_VERSION+.}:" && cd .;
else
rc=$?;
CDPATH="${ZSH_VERSION+.}:" && cd . &&
$restore $backupdir/* echo "./netperf.info" | sed 's|[^/]*$||';
fi;
rm -rf $backupdir; exit $rc
/bin/sh: line 9: makeinfo: command not found
make[3]: *** [Makefile:401: netperf.info] Error 127
make[3]: Leaving directory '/home/root/kiran/netperf/doc'
make[2]: *** [Makefile:588: all-recursive] Error 1
make[2]: Leaving directory '/home/root/kiran/netperf/doc'
make[1]: *** [Makefile:374: all-recursive] Error 1
make[1]: Leaving directory '/home/root/kiran/netperf'
make: *** [Makefile:313: all] Error 2

DOC: License terms; OSI compatibility; are package repos commercial use?

According to this thread, netperf cannot be packaged in fedora due to open source license incompatibility? https://bugzilla.redhat.com/show_bug.cgi?id=1729939#c6 ::

I may be misunderstanding the license terms as well, but:

This [1] reads:

The enclosed software and documentation includes copyrighted works
of Hewlett-Packard Co. For as long as you comply with the following
limitations, you are hereby authorized to (i) use, reproduce, and
modify the software and documentation, and to (ii) distribute the
software and documentation, including modifications, for
non-commercial purposes only.

This is not an OSI-approved license by any means, but in interpreting this clause:
"(ii) distribute the software and documentation, including modifications, for non-commercial purposes only"
I'm not sure that fedora distributing the package (and any patches, if necessary) is commercial use?

Does that mean that you cannot sell HP's netperf package, but you can include the package in free software repositories?

[1] https://github.com/HewlettPackard/netperf/blob/master/COPYING

Dear 1993 HP, what would it take to suppose an OSI license for consideration? https://choosealicense.com/appendix/

Netserver remove /dev/null in some cases, breaking many things

   This bug is hard to reproduce, as the condition that lead to

Netserver deleting /dev/null are quite mysterious. I was getting my
/dev/null removed over the years at very rare occurences, until
I managed to track it down to Netserver.

The issue is not present in the tarball for version 2.7.0. It

was introduced in commit :
5380b1f
In particular, this line :
+ FileName = NETPERF_NULL;
I already reported this bug in Debian :
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068490

A quick look at the source code show that the code is wrong in

very obvious way. The fix is quite simple and obvious, and I provide
a patch (included below).
Note that to compile Netperf in amodern distro, other things
need to be fixed :-( You may look at patches for Netperf in Debian
as a start...
Thanks in advance !

Jean

netperf_no_unlink_dev_null.diff.txt

Cannot run as normal user anymore

Merging pull request #10 broke running netserver as normal user because now it wants to save debug files into /var/log , as shown in #10 (comment) :

[pid 31801] openat(AT_FDCWD, "/var/log//netserver.debug_svJvSh", O_RDWR|O_CREAT|O_EXCL, 0600) = -1 EACCES (Permission denied)

I really don't think netserver should be saving such type of files under /var/log.

Cc'ing pull request owner, @grundlerchromium

netserver changes permissions on /dev/null by default

On non-Windows systems, if you run netserver without the -d parameter, it sets the debug output file 'FileName' to /dev/null

eg, see open_debug_file() in netserver.c:259

Later on in the same function, it then calls chmod(FileName,0644); (netserver.c:281). If the executing user has the right permissions (eg, is root), netserver will change the permissions on /dev/null which may then cause other issues on the machine, as many non-root processes assume they can write to /dev/null

Arguably, no one should be running netserver as root, but there are plenty of people who do.

I'm not entirely sure why the chmod call is needed - I suspect setting a better umask on netserver in general, or at least when opening the debug log file, would be better. The other improvement would be that instead of continuing to write debug logs to /dev/null, to just not write them out at all. But I've only just skimmed the source, I don't think I fully understand the way debug logging is implemented

cannot install

"configure" file is missing, so cannot install netperf on Ubuntu 16.04.

Elapsed time remain at 0.00

While running netperf client command, it seems LAN chip transmitting data properly in a expected speed.
However, even client had transmit data for 10 or 60 sec, the elapsed time remained at "0.00". Therefore, the computed result will be wrong.

I have tried administrator level to run command line, but the error is the same.

netperf builded with --enable-demo does not emit interim results during the run

Hello everyone,

I have compiled netperf-2.7.0 on linux x86-64, with the following options:

sh configure --prefix=/usr --enable-demo --enable-histogram

I have observed that sometimes the partial result is not printed. Here is an example of the output:

Interim result: 31.07 10^6bits/s over 1.042 seconds ending at 1610397003.583
Interim result: 7.67 10^6bits/s over 4.051 seconds ending at 1610397007.634
Interim result: 3.69 10^6bits/s over 2.098 seconds ending at 1610397009.732

Interim result: 4.79 10^6bits/s over 1.068 seconds ending at 1610397010.799

Interim result: 11.19 10^6bits/s over 1.921 seconds ending at 1610314342.506
Interim result: 10.26 10^6bits/s over 1.495 seconds ending at 1610314344.001
Interim result: 7.29 10^6bits/s over 1.402 seconds ending at 1610314345.403
Interim result: 6.45 10^6bits/s over 1.137 seconds ending at 1610314346.540
Interim result: 2.99 10^6bits/s over 2.148 seconds ending at 1610314348.688
Interim result: 19.20 10^6bits/s over 455.831 seconds ending at 1610314804.519
netperf: get_sock_buffer: receive socket size determined to be 87380
netperf: get_sock_buffer: send socket size determined to be 1726560

Interim result: 9.82 10^6bits/s over 1.175 seconds ending at 1610066611.657
Interim result: 5.63 10^6bits/s over 1.746 seconds ending at 1610066613.403
Interim result: 3.18 10^6bits/s over 1.775 seconds ending at 1610066615.178
Interim result: 17.87 10^6bits/s over 403.530 seconds ending at 1610067018.708
netperf: get_sock_buffer: receive socket size determined to be 87380
netperf: get_sock_buffer: send socket size determined to be 4194304

this is an example command I use to run the executable:

netperf -H 10.24.15.6 -d 10 -l 600 -v 2 -D 1 -Y 104,104 -f m

I have a feeling that this problem pops up when there is a network connectivity problem (congestion).

Let me know if you need any other information to better detect this problem.

Determine output format of results: ability to pass --output-format flag

Description

Netperf prints directly into stdout in raw format, such as the following:

"MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 20001
AF_INET to 104.154.50.86 () port 20001 AF_INET : +/-2.500% @ 99% conf.
: first burst 0",\n
Throughput,Throughput Units,Throughput Confidence Width (%),
Confidence Iterations Run,Stddev Latency Microseconds,
50th Percentile Latency Microseconds,90th Percentile Latency Microseconds,
99th Percentile Latency Microseconds,Minimum Latency Microseconds,
Maximum Latency Microseconds\n
1405.50,Trans/s,2.522,4,783.80,683,735,841,600,900\n

We can use output selectors to enrich the results, as you already know.

Motivation

Currently, we have to write a wrapper application that reads and scrapes netperf's raw output and converts to target format, so we can do further analyzes on the predefined spec.

By defining a spec, other apps or wrapping tools that depend on this project couldn't create different (inconsistent each other) custom output specs anymore.

Are there any performance benchmarking output spec definitions / organizations?

Related Works

Since we already have some related tools that covers this requirement, I'm not so sure whether we should built-in support for this. I think it's out-of-scope feature for this project. From the Unix philosophy perspective; do one thing and do it well, right?

I couldn't find any related issue, so I'm throwing here for further discussing.

Waiting your thoughts!

Netperf io_uring Support

Hey,

Recently i've came up with a need to test io_uring workloads.
As i've seen, current version of netperf does not support io-uring.

Do you think others may benefit from io uring support within Netperf?
If so, ill open a PR and start working on this.

Thank you

netserver.exe keeps stopping

On Windows 2k12R2, I keep having a problem where the netserver.exe service just stops it's self for no apparent reason. I can start it again, and then 5 minutes later it is gone again. Can't find anything in Windows logs. Been googling and binging this problem to no avail. The only troubleshooting I can ever seem to find is just for Linux.

I can not get windows binaries.

I want windows binary (i.e. netperf.exe and netserver.exe), but now the binary file is not distributed.

I tried to build on Windows 10 according to README.windows, but I couldn't.
I wonder if README.windows is too old because the latest update is in 2012.
(I cannot find "build /cD" command in the cmd for VS)

So could you distribute binary files or update README.windows?

ios port?

is there an apple ios port for netperf? I now have it running on osx on the m1 (will supply patch), but haven't tried ios yet.

Limiting UDP Bandwidth capped at 957 Mbits/sec

When trying to simulate UDP bandwidth limiting with -b and -w flags, trying to set a limit equivalent to 958 Mbits/sec or greater results in netperf sending at half of the desired bandwidth. My calculation for translating bandwidth to burst_size and wait_time is:

burst_size = Mbits/sec bandwidth * 10^6 / 8 / packet_size
wait_time = 1000ms (1 second)

Example:
burst_size = 957 Mbits/sec * 10^6 / 8 / 1470 = 81377
wait_time = 1000

This limits bandwidth at 957 Mbits/sec as expected for 1470B sized packets.
When doing the same calculation for 958 Mbits/sec, bandwidth is capped at 479 Mbits/sec.

I have tried this running on multiple platforms (that I verified can send at a faster rate than this without limiting bandwidth).

netperf compile error with "--enable-intervals=yes"

Netperf compile error with " --enable-intervals=yes"

/usr/bin/ld: nettest_omni.o:(.bss+0x0): multiple definition of interval_count'; nettest_bsd.o:(.bss+0x60): first defined here /usr/bin/ld: nettest_omni.o:(.bss+0x20): multiple definition of signal_set'; nettest_bsd.o:(.bss+0x80): first defined here

Unable to compile netperf on centos 10

# git clone https://github.com/HewlettPackard/netperf.git
Cloning into 'netperf'...
remote: Enumerating objects: 5252, done.
remote: Counting objects: 100% (324/324), done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 5252 (delta 234), reused 305 (delta 229), pack-reused 4928
Receiving objects: 100% (5252/5252), 16.75 MiB | 1.55 MiB/s, done.
Resolving deltas: 100% (3930/3930), done.
# cd netperf/
# ./autogen.sh 
configure.ac:28: installing './compile'
configure.ac:19: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:19: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:745: AM_CONFIG_HEADER is expanded from...
configure.ac:19: the top level
configure.ac:34: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:34: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:34: the top level
configure.ac:37: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:37: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:37: the top level
configure.ac:44: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:44: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:44: the top level
configure.ac:46: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:46: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:46: the top level
configure.ac:47: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:47: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:47: the top level
configure.ac:52: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:52: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:52: the top level
configure.ac:60: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:60: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
acinclude.m4:45: OLD_TYPE_SOCKLEN_T is expanded from...
configure.ac:60: the top level
configure.ac:65: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:65: You should run autoupdate.
./lib/autoconf/headers.m4:743: AC_HEADER_TIME is expanded from...
configure.ac:65: the top level
configure.ac:67: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:67: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
src/missing/m4/salen.m4:19: AC_CHECK_SA_LEN is expanded from...
configure.ac:67: the top level
configure.ac:76: warning: The macro `AC_TYPE_SIGNAL' is obsolete.
configure.ac:76: You should run autoupdate.
./lib/autoconf/types.m4:776: AC_TYPE_SIGNAL is expanded from...
configure.ac:76: the top level
configure.ac:479: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:479: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:479: the top level
configure.ac:638: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:638: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:638: the top level
configure.ac:652: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:652: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:652: the top level
configure.ac:657: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:657: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:657: the top level
configure.ac:689: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:689: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:689: the top level
configure.ac:696: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:696: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:696: the top level
configure.ac:703: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:703: You should run autoupdate.
./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from...
configure.ac:703: the top level
# ./configure --bu# make
make  all-recursive
make[1]: Entering directory '/root/netperf-2.7.1'
Making all in src
make[2]: Entering directory '/root/netperf-2.7.1/src'
Making all in missing
make[3]: Entering directory '/root/netperf-2.7.1/src/missing'
Making all in m4
make[4]: Entering directory '/root/netperf-2.7.1/src/missing/m4'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/root/netperf-2.7.1/src/missing/m4'
make[4]: Entering directory '/root/netperf-2.7.1/src/missing'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/root/netperf-2.7.1/src/missing'
make[3]: Leaving directory '/root/netperf-2.7.1/src/missing'
make[3]: Entering directory '/root/netperf-2.7.1/src'
gcc -DHAVE_CONFIG_H -I. -I..      -MT netlib.o -MD -MP -MF .deps/netlib.Tpo -c -o netlib.o netlib.c
netlib.c: In function ‘bind_to_specific_processor’:
netlib.c:2343:9: error: implicit declaration of function ‘sched_setaffinity’; did you mean ‘SYS_sched_setaffinity’? [-Wimplicit-function-declaration]
 2343 |     if (sched_setaffinity(getpid(), len, &netperf_cpu_set)) {
      |         ^~~~~~~~~~~~~~~~~
      |         SYS_sched_setaffinity
make[3]: *** [Makefile:454: netlib.o] Error 1
make[3]: Leaving directory '/root/netperf-2.7.1/src'
make[2]: *** [Makefile:474: all-recursive] Error 1
make[2]: Leaving directory '/root/netperf-2.7.1/src'
make[1]: *** [Makefile:376: all-recursive] Error 1
make[1]: Leaving directory '/root/netperf-2.7.1'
make: *** [Makefile:315: all] Error 2
ild=x86_64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.