Daniel Farrell
Software Engineer, Red Hat SDN Team
Algorithm:
pretend to be n switches (n=16 is default)
create n openflow sessions to the controller
if latency mode (default):
for each session:
1) send up a packet in
2) wait for a matching flow mod to come back
3) repeat
4) count how many times #1-3 happen per sec
<snip>
# Total number of lines in primary file
[~/oflops/cbench]$ cat cbench.c | wc -l
426
# Total number of comments
[~/oflops/cbench]$ cat cbench.c | grep '\/\*[^\*]\|\/\/' | wc -l
13
printf("RESULT: %d switches %d tests "
"min/max/avg/stdev = %.2lf/%.2lf/%.2lf/%.2lf responses/s\n",
i+1,
counted_tests,
min, max, avg, std_dev);
# Install CBench and OpenDaylight, make required config changes
[fedora@dfarrell-wcbench wcbench]$ ./wcbench.sh -ci
CBench is not installed
Installing CBench dependencies
Cloning CBench repo
Cloning openflow source code
Building oflops/configure file
Building CBench
CBench is installed
Successfully installed CBench
Installing OpenDaylight dependencies
Downloading last successful ODL build
Unzipping last successful ODL build
Downloading openflowplugin
Removing simpleforwarding plugin
Removing arphandler plugin
# Start OpenDaylight, issue required config
[fedora@dfarrell-wcbench wcbench]$ ./wcbench.sh -o
Starting OpenDaylight
Giving ODL 90 seconds to get up and running
80 seconds remaining
<snip>
0 seconds remaining
Installing telnet, as it's required for issuing ODL config.
Issuing `dropAllPacketsRpc on` command via telnet to localhost:2400
Trying ::1...
Connected to localhost.
Escape character is '^]'.
osgi> dropAllPacketsRpc on
DropAllFlows transitions to on
osgi> Connection closed by foreign host.
# Two minute CBench run
[fedora@dfarrell-wcbench wcbench]$ ./wcbench.sh -t 2 -r
Set MS_PER_TEST to 120000, TESTS_PER_SWITCH to 1, CBENCH_WARMUP to 0
Collecting pre-test stats
Running CBench against ODL on localhost:6633
Collecting post-test stats
Collecting time-irrelevant stats
Average responses/second: 22384.52
/home/fedora/results.csv not found or empty, building fresh one
Usage ./wcbench.sh [options]
Setup and/or run CBench and/or OpenDaylight.
OPTIONS:
-h Show this message
-c Install CBench
-t <time> Run CBench for given number of minutes
-r Run CBench against OpenDaylight
-i Install ODL from last successful build
-p <processors> Pin ODL to given number of processors
-o Run ODL from last successful build
-k Kill OpenDaylight
-d Delete local ODL and CBench code
# Two minute CBench run, restart OpenDaylight between runs
[fedora@dfarrell-wcbench wcbench]$ ./loop_wcbench.sh -t 2 -r
# I'm not going to let this run, you get the idea
Usage ./loop_wcbench.sh [options]
Run WCBench against OpenDaylight in a loop.
OPTIONS:
-h Show this help message
-l Loop WCBench runs without restarting ODL
-r Loop WCBench runs, restart ODL between runs
-t <time> Run WCBench for a given number of minutes
-p <processors> Pin ODL to given number of processors
# CBench flows/sec stats
./stats.py -s flows
{'flows': {'max': 15036,
'mean': 8958.426,
'min': 4981,
'relstddev': 32.032,
'stddev': 2869.584},
'sample_size': 115}
# Command for graphs of flows/sec and used RAM stats
./stats.py -g flows ram
[~/wcbench]$ ./bash8.py wcbench.sh loop_wcbench.sh
[~/wcbench]$ pep8 stats.py
# Total number of lines
[~/wcbench]$ cat wcbench.sh | wc -l
749
# Total number of lines that contain comments
[~/wcbench]$ cat wcbench.sh | grep "^# \| # " | wc -l
280
NUM_SWITCHES=16
./loop_cbench.sh -t 2 -r
{'cbench_relative_std_dev': 4.918,
'cbench_standard_deviation': 269.428}
NUM_SWITCHES=256
./loop_cbench.sh -p 2 -t 2 -r
{'cbench_relative_std_dev': 13.723,
'cbench_standard_deviation': 532.303}
./loop_cbench.sh -l
By Daniel Farrell
Presentation for LinuxCon+CloudOpen 2014, OpenDaylight Mini Summit.