SockPerf is a tool for network performance measurement written in C++.

1. SUMMARY

SockPerf is a network testing tool oriented to measure network latency and also spikes of network latency. Tool can create UDP/TCP data streams and measure the throughput and latency of a network that is carrying them. SockPerf allows the user to define different parameters that can be used for testing a network, or alternately for optimizing or tuning a network. Tool provides a client and server functionality, and can measure the throughput and latency between the two endpoints, either unidirectonally or bi-directionally. This utility can be used in Linux systems.

2. INTRODUCTION

People are often concerned about measuring the maximum data throughput rate of a communications link or network access. A typical method of performing a measurement is to transfer a 'large' file and measure the time taken to do so. The throughput is then calculated by dividing the file size by the time to get the throughput in megabits, kilobits, or bits per second. Unfortunately, the results of such an exercise will result in the goodput which is less than the maximum throughput, leading to people believing that their communications link is not operating correctly. In fact, there are many overheads accounted for in good case in addition to transmission overheads, including latency, TCP Receive Window size and machine limitations, which means the calculated goodput does not reflect the maximum achievable throughput.

Another important thing of tool capacity is latency measurement. Latency - is the time it takes packet to go from user space program on one machine to user space program on another machine. Being able to quantify latency in terms other than millisecond response time is important when determining the quality of a network. One of available tool that can help administrators do just that is sockperf.

SockPerf works as an on-demand client and server test. How this works is that one system runs the sockperf server over a specified port and another system functions as a client running the sockperf client. The binaries are the same, and there is an option to have the role of client or server, so the roles can easily be reversed if necessary.

3. OVERVIEW

sockperf tests UDP/TCP network connection and maintance following functionality:

features:

Initially the tool was developed to demonstrate advantages of VMA (Voltaire Messaging Accelerator). VMA is is a multicast-offload, dynamically linked, user space Linux library which serves to transparently enhance the performance of multicast networking heavy applications over the InfiniBand and 10 Gb Ethernet network. More interested user can read detail information at http://www.mellanox.com. Actually sockperf can be used natively, or with VMA accelartion and see the benefit of VMA.

SockPerf operates by sending packets from the client to the server, which then sends the packets back to the client. This measured roundtrip time is the route trip time (RTT) between the two machines on a specific network path. The average RTT is calculated by dividing the total number of packets that perform this round trip by some fixed period of time. The average latency for a given one-way path between the two machines is the average RTT divided by two.

SockPerf can work as server or execute under-load, ping-pong, playback and throughput tests and be a server or a client.

SockPerf can be launched in single point manner that is name as the first mode and using special formatted feed file named as the second mode.

Mode One:

$bin/sockperf server -i 224.18.7.81 -p 5001
sockperf:  == version #1.0.0 ==
sockperf: No VMA version info
sockperf: [SERVER] listen on: IP = 224.18.7.81 PORT = 5001
sockperf: Warmup stage (sending a few dummy packets)...
sockperf: [tid 14325] using recvfrom() to block on socket(s)

Mode Two:

$bin/sockperf server -f conf.file -F s
sockperf:  == version #2.5.1831 == 
sockperf: No VMA version info
sockperf: [SERVER] listen on:
[ 0] IP = 192.168.161.129 PORT =  7001 # TCP
[ 1] IP = 192.168.161.129 PORT =  7002 # TCP
[ 2] IP = 192.168.161.129 PORT =  7003 # TCP
[ 3] IP = 192.168.161.129 PORT =  7004 # TCP
sockperf: Warmup stage (sending a few dummy packets)...
sockperf: [tid 4857] using select() to block on socket(s)

Every line in feed file should have following format as [U|T]:address:port where

3.1 Available options

The following table describes sockperf options, and their possible values:

 -h,-?   --help,--usage         Show the help message and exit.
 -d      --debug                Print extra debug information.
 -i      --ip                   Listen on/send to ip <ip>.
 -p      --port                 Listen on/connect to port <port> (default 11111).
 -m      --msg-size             Use messages of size <size> bytes (minimum default 12).
 -f      --file                 Tread multiple ip+port combinations from file <file> 
                                (server uses select).
 -F      --io-hanlder-type      Type of multiple file descriptors handle 
                                [s|select|p|poll|e|epoll](default select).
 -a      --activity             Measure activity by printing a '.' for the last 
                                <N> packets processed.
 -A      --Activity             Measure activity by printing the duration for last 
                                <N> packets processed.
         --rx-mc-if             <ip> address of interface on which to receive mulitcast 
                                packets (can be other then route table).
         --tx-mc-if             <ip> address of interface on which to transmit mulitcast 
                                packets (can be other then route table).
         --timeout              Set select/poll/epoll timeout to <msec>, -1 for infinite 
                                (default is 10 msec).
         --mc-loopback-enable   Enables mc loopback (default disabled).
         --udp-buffer-size      Set udp buffer size to <size> bytes.
         --vmazcopyread         If possible use VMA's zero copy reads API (See VMA's readme).
         --daemonize            Run as daemon.
         --nonblocked           Open non-blocked sockets.
         --dontwarmup           Don't send warm up packets on start.
         --pre-warmup-wait      Time to wait before sending warm up packets (seconds).
         --no-rdtsc             Don't use register when taking time; instead use monotonic clock.
         --load-vma             Load VMA dynamically even when LD_PRELOAD was not used.

         --tcp                  Use TCP protocol (default UDP).
         --avoid-tcp-nodelay    Delivering TCP Messages Immediately (default ON).
         --mc-ttl               Limit the lifetime of the packet (default 2).

3.2 Server

Server options are:

         --threads-num          Run <N> threads on server side (requires '-f' option).
         --vmarxfiltercb        If possible use VMA's receive path packet filter 
                                callback API (See VMA's readme).
         --force-unicast-rep    Force server to reply via unicast.
 -g      --gap-detection        Enable gap-detection.

3.3 Client

sockperf supports different scenarios to run itself as a client. There are under-load, ping-pong, playback and throughput subcommands to select one of the scenarios.

General client options are:

 -t      --time                 Run for <sec> seconds (default 1, max = 36000000).
 -b      --burst                Control the client's number of a packets sent in every burst.
 -r      --range                comes with -m <size>, randomly change the messages size in range: <size> +- <N>.
         --data-integrity       Perform data integrity test.
         --srv_num              Set num of servers the client works with to N.
         --pps                  Set number of packets-per-second (default = 10000 - for under-load mode, or max - 
                                for ping-pong and throughput modes; for maximum use --pps=max).
         --sender-affinity      Set sender thread affinity to the given core id (see: cat /proc/cpuinfo).
         --receiver-affinity    Set receiver thread affinity to the given core id (see: cat /proc/cpuinfo).
         --full-log             Dump full log of all packets send/receive time to the given file in CSV format.

3.4 Tools

SockPerf package contains few scripts that allow to generate special formatted file to launch tool in different configurations.

   create playback file using gen1.awk > pfile
   generated file:
# ==== playback file for sockperf - generated by gen1.awk ====
#baseTime=1.000000; PPS=200000; runtime=1.000000; interval=0.000005; NUM_RECORDS=200000
# file contains 200000 records
1.000005000, 12
1.000010000, 12
1.000015000, 12
1.000020000, 12
1.000025000, 12
1.000030000, 12
1.000035000, 12
1.000040000, 12
...
1.999950000, 12
1.999955000, 12
1.999960000, 12
1.999965000, 12
1.999970000, 12
1.999975000, 12
1.999980000, 12
1.999985000, 12
1.999990000, 12
1.999995000, 12
2.000000000, 12
#200000 records were written successfuly   
   start server on ipX
   start client using: ./sockperf ping-pong -i <ip-address> -p <port> --playback=pfile

3.5 Usage

3.5.1 Running over IPoIB

3.5.2 Running over 1 Gb Ethernet

3.5.3 Running over VMA InfiniBand

4. LICENSING

Read "copying" file in the root place.

5. INSTALLATION

5.1 Requirements

What you will need to compile sockperf on Unix systems

5.2 Options to compile

5.3 How to install

Download sockperf-<version>.tar.gz.

Uncompress *.tar.gz file in Unix systems in the same folder with the file by runing the following command in the shell:

   tar -zxvf sockperf-<version>.tar.gz

or 2 command:

   gzip -d ./sockperf-<version>.tar.gz
   tar -xf ./sockperf-<version>.tar

The sockperf package uses the GNU autotools compilation and installation framework.

These are generic installation instructions.

The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure').

If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it.

The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'.

The simplest way to compile this package is:

1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself.

Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for.

    $ ./configure --prefix=<path to install>

There are several options to ./config (or ./Configure) to customize the build:

To enable test scripts

    $ ./configure --prefix=<path to install> --enable-test

To enable the documentation

    $ ./configure --prefix=<path to install> --enable-doc

To enable the special scripts

    $ ./configure --prefix=<path to install> --enable-tool

To compile with debug symbols and information:

    $ ./configure --prefix=<path to install> --enable-debug

This will define the _DEBUG variable at compile time.

Type './configure --help' for a list of all the configure options. Some of the options are generic autoconf options, while the SockPerf specific options are prefixed with "SOCKPERF:" in the help text.

2. Type `make' to compile the package.

    $ make

3. Optionally, type `make check' to run any self-tests that come with the package.

4. Type `make install' to install the programs and any data files and documentation.

    $ make install

5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution.


Generated on 8 Sep 2014 for sockperf by  doxygen 1.6.1