Development for testing Layer2 flows per second was successful! The goals were the following:
- get a controller to generate X number of flows (currently L2 flows) to see how many flows a switch could handle
- 2nd, get a controller to generate X number of flows per second
Both were successful thanks to mininet. http://mininet.org/
Mininet creates virtual hosts, controllers, and switches in an instant. This was developed by people that wanted create a tool to help with openflow/SDN development.
It was pretty easy to get setup by just following their directions on their website. Once I downloaded the mininet VM, installed it… it was up and running.
The entire testing setup consisted:
- a Mininet VM, which had an openflow switch and two hosts
- a POX openflow controller on my local machine
All I had to do to get mininet to connect to the controller on my local machine was to point it to my actual network interface that go me outside of my machine on to our production network.
sudo mn --controller=remote,ip=10.180.0.207,port=6633
I tried from mininet to have it use my loopback address and the nat’d gateway address, but neither worked until I used my local computers prodcuction network NIC.
Once I did that, mininet connected to my machines POX controller…
INFO:openflow.of_01:[00-00-00-00-00-01 1] connected DEBUG:forwarding.ryan_l2:Switch 00-00-00-00-00-01 has come up.
Here is the code that is used for Flows per second testing…
http://sites.duke.edu/dukesdn/2013/11/06/pox-l2-flow-generator-code/
The default for the code is 100 flows total, 10 per second. This can be changed by edit a couple of the numbers commented in the code.
In mininet, in order to see the flows you type the following…
mininet> dpctl dump-flows
*** s1 ------------------------------------------------------------------------ NXST_FLOW reply (xid=0x4): cookie=0x0, duration=31.849s, table=0, n_packets=0, n_bytes=0, idle_age=31, dl_dst=01:23:45:d6:52:a3 actions=output:2 cookie=0x0, duration=34.973s, table=0, n_packets=0, n_bytes=0, idle_age=34, dl_dst=01:23:45:98:8d:f4 actions=output:2 cookie=0x0, duration=33.935s, table=0, n_packets=0, n_bytes=0, idle_age=33, dl_dst=01:23:45:2f:8d:55 actions=output:4 cookie=0x0, duration=36.006s, table=0, n_packets=0, n_bytes=0, idle_age=36, dl_dst=01:23:45:d5:1a:2e actions=output:4 cookie=0x0, duration=32.899s, table=0, n_packets=0, n_bytes=0, idle_age=32, dl_dst=01:23:45:db:89:8d actions=output:4
Since each line is a flow (except the first line) we can just use the wc (word count) command to see the number…
The output will be:
# of lines, # of words, and # of characters
mininet> dpctl dump-flows | wc *** s1 ------------------------------------------------------------------------ 101 803 12107
So we have 101 lines, or 100 flows.