Wednesday, October 1, 2014

Building Cbench on Ubuntu - 14.04 LTS

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
                       ^

10 comments:

  1. Cloning into 'openflow'...
    fatal: Could not read from remote repository.
    :(

    ReplyDelete
  2. hello
    thanks for your guide
    but when i want to execute this line i have faced this problem
    sh ./boot.sh ; ./configure --with-openflow-src-dir=openflow/; make

    problems are :
    1-configure: error: Could not find appropriate OFPT_FLOW_EXPIRED substitute in openflow.h

    2- make: *** No targets specified and no makefile found. Stop.

    can i have your kind assistance to solve this thanks

    ReplyDelete
  3. hello
    i am finding error while i am executing the command ./configure --with...
    i am attaching the error lines also.
    undefined reference to `time_diff'
    collect2: error: ld returned 1 exit status
    Makefile:576: recipe for target 'oflops' failed
    make[1]: *** [oflops] Error 1
    make[1]: Leaving directory '/home/madhukrishna/jperf2.0.0/openflow/oflops'
    Makefile:641: recipe for target 'install-recursive' failed
    make: *** [install-recursive] Error 1

    Please assist me. I need your help

    ReplyDelete
  4. Hello
    I am getting error while i am executing the command ./configure --with..
    I am attaching the error lines.
    undefined reference to `time_diff'
    collect2: error: ld returned 1 exit status
    Makefile:576: recipe for target 'oflops' failed
    make[1]: *** [oflops] Error 1
    make[1]: Leaving directory '/home/madhukrishna/jperf2.0.0/openflow/oflops'
    Makefile:641: recipe for target 'install-recursive' failed
    make: *** [install-recursive] Error 1
    Please assist me. I need your help.

    ReplyDelete
  5. how can we work on cbench ? can you please help me? i don't know how to use cBench .. i have installed cbench. but i dont know how to use it.. reply me as soon as possible..

    ReplyDelete
    Replies
    1. Dear Zainab, I am not sure what are you trying to do with CBench. Probably their site will help you - https://github.com/mininet/oflops/tree/master/cbench

      Delete
  6. is it possible if I test 2 sdn controller at a time? Do i have to use -c and -p twice? thank you

    ReplyDelete
  7. Dear Pradeeban
    i want to read more about cbench. i went through some citation but i didn't get it. you have some link regarding it please send me. as cbench:An openflow controller benchmark.
    Thank You
    Abha

    ReplyDelete
  8. How can we plot the output of cbench tool

    ReplyDelete

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.