Cbench (Controller Benchmark) is a handy tool for benchmarking OpenFlow controllers. It can be installed from source using the below commands on Ubuntu 14.04.
* Installing the dependencines
$ sudo apt-get install autoconf automake libtool libsnmp-dev libpcap-dev libconfig8-dev
* Checking-out the source code of OpenFlow
$ git clone git://gitosis.stanford.edu/openflow.git
* Switch to released version 1.0.0
$ cd openflow; git checkout -b mybranch origin/release/1.0.0
* Checking-out the source code of Oflops
Oflops is a package that contains the OpenFlow debugging tools, Cbench and OFlops (OpenFLow Operations Per Second).
$ git clone git://gitosis.stanford.edu/oflops.git
* Build the source code
$ cd oflops ; sh ./boot.sh ; ./configure --with-openflow-src-dir=; make
In my case,
cd oflops ; sh ./boot.sh ; ./configure --with-openflow-src-dir=/home/pradeeban/openflow; make
$ cd oflops ; sudo make install
This will have installed Cbench inside the folder, /home/pradeeban/openflow/oflops/cbench.
* Execute Cbench
Change to Cbench directory
$ cd cbench/
Sample Execution
$ cbench -c localhost -p 6633 -m 10000 -l 10 -s 16 -M 1000 -t
cbench: controller benchmarking tool
running in mode 'throughput'
connecting to controller at localhost:6633
faking 16 switches offset 1 :: 10 tests each; 10000 ms per test
with 1000 unique source MACs per switch
learning destination mac addresses before the test
starting test with 0 ms delay after features_reply
ignoring first 1 "warmup" and last 0 "cooldown" loops
connection delay of 0ms per 1 switch(es)
debugging info is off
controller msgbuf_read() = 0: closed connection ... exiting
Note: Failing to install libconfig8-dev in the first step will produce the below error logs.
make[2]: Entering directory `/home/pradeeban/openflow/oflops'
gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -I/home/pradeeban/openflow/include -Wshadow `pkg-config --cflags libconfig` -MT oflops.o -MD -MP -MF .deps/oflops.Tpo -c -o oflops.o oflops.c
Package libconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `libconfig.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libconfig' found
In file included from oflops.c:11:0:
usage.h:4:23: fatal error: libconfig.h: No such file or directory
#include
^
gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -I/home/pradeeban/openflow/include -Wshadow `pkg-config --cflags libconfig` -MT oflops.o -MD -MP -MF .deps/oflops.Tpo -c -o oflops.o oflops.c
Package libconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `libconfig.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libconfig' found
In file included from oflops.c:11:0:
usage.h:4:23: fatal error: libconfig.h: No such file or directory
#include
^