I was preparing lab environment to test configuration of Source-Specific Multicast on Juniper SRX Equipment and needed a tool to generate and measure Source-Specific Multicast streams.
I was aware that Iperf is a good enough tool to generate and measure multicast and unicast traffic but support for SSM was missing from current version. Fortunately there are always some developers which are interested in networking so one of them developed a special Iperf version 2.0.5 with SSM support.
The idea here is to show how to make this version of Iperf work on your Cent OS or similar Linux machine.
Here are few steps that should work from your Cent OS 6.8 Linux Server and hopefully from other similar distributions to:
Install tools needed to download files from the internet and unzip them
[[email protected] ~]#yum install unzip [[email protected] ~]#yum install wget
Place yourself inside root directory where we will build our new Iperf version
[[email protected] ~]#cd /root
Download special SSM enabled Iperf version into /root directory
[[email protected] ~]#wget https://github.com/noushi/iperf-ssm/archive/master.zip
Remove currently existing Iperf installation if you have one. If you don’t have one, server will tell that to you when you hit enter.
[[email protected] ~]#sudo yum remove iperf
Extract downloaded file
[[email protected] ~]#unzip master.zip Archive: master.zip cad55aec69a9e39618b37818453155160252c2d6 creating: iperf-ssm-master/ inflating: iperf-ssm-master/AUTHORS inflating: iperf-ssm-master/COPYING .... .... inflating: iperf-ssm-master/src/stdio.c inflating: iperf-ssm-master/src/tcp_window_size.c
Check if you now have new “iperf-ssm-master” folder inside /root
[[email protected] ~]# ls master.zip iperf-ssm-master
Enter “iperf-ssm-master” directory
[[email protected] ~]# cd iperf-ssm-master/
Start building Iperf app with configure, make, make install commands:
[[email protected] iperf-ssm-master]# ./configure
[[email protected] iperf-ssm-master]# make
[[email protected] iperf-ssm-master]# sudo make install
Now you should be able to use new Iperf app. You can check if it is working by trying to see the output of Iperf help. Inside that help output you should now see new SSM specific attributes -X and -0 used for selecting out interface and source IP for multicast group.
[[email protected] iperf-ssm-master]# iperf -help Usage: iperf [-s|-c host] [options] iperf [-h|--help] [-v|--version] Client/Server: -f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes -i, --interval # seconds between periodic bandwidth reports -l, --len #[KM] length of buffer to read or write (default 8 KB) -m, --print_mss print TCP maximum segment size (MTU - TCP/IP header) -o, --output <filename> output the report or error message to this specified file -p, --port # server port to listen on/connect to -u, --udp use UDP rather than TCP -w, --window #[KM] TCP window size (socket buffer size) -B, --bind <host> bind to <host>, an interface or multicast address -C, --compatibility for use with older versions does not sent extra msgs -M, --mss # set TCP maximum segment size (MTU - 40 bytes) -N, --nodelay set TCP no delay, disabling Nagle's Algorithm -V, --IPv6Version Set the domain to IPv6 Server specific: -s, --server run in server mode -U, --single_udp run in single threaded UDP mode -D, --daemon run the server as a daemon -O, --source <address> specify source for Source Specific Multicast -X, --interface <interface> specify interface for Source Specific Multicast Client specific: -b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec (default 1 Mbit/sec, implies -u) -c, --client <host> run in client mode, connecting to <host> -d, --dualtest Do a bidirectional test simultaneously -n, --num #[KM] number of bytes to transmit (instead of -t) -r, --tradeoff Do a bidirectional test individually -t, --time # time in seconds to transmit for (default 10 secs) -F, --fileinput <name> input the data to be transmitted from a file -I, --stdin input the data to be transmitted from stdin -L, --listenport # port to receive bidirectional tests back on -P, --parallel # number of parallel client threads to run -T, --ttl # time-to-live, for multicast (default 1) -Z, --linux-congestion <algo> set TCP congestion control algorithm (Linux only) Miscellaneous: -x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports -y, --reportstyle C report as a Comma-Separated Values -h, --help print this message and quit -v, --version print version information and quit [KM] Indicates options that support a K or M suffix for kilo- or mega- The TCP window size option can be set by the environment variable TCP_WINDOW_SIZE. Most other options can be set by an environment variable IPERF_<long option name>, such as IPERF_BANDWIDTH. Report bugs to <[email protected]> [[email protected] iperf-ssm-master]#
Example of Iperf Source-Specific Multicast testing