OpenNF: Enabling Innovation in Network Function Control
Control Application Demo
These instructions demonstrate how to use OpenNF to move an active TCP flow from one SDN middlebox to another. These instructions were developed using Ubuntu 14.04.1 (LTS) 64-bit although could work on any Linux distribution with a few modifications.
1. Set up your development environment
- Follow steps 1-4 described /OptMB/README under "Development Environment Setup"
2. Install mininet on your host system
3. Compile and configure the demo.
- For this particular demo, we'll show how to move an active instance of prads from one middlebox to another.
- We need to update the class path for the controller application. Open the ~/OptMB/apps/build.xml file and update the following line:
<attribute name="Class-Path" value=".:./bin/" />
- Now compile the demo controller:
- Open the ~/OptMB/apps/testTimedMoveAll.prop file and update the following lines:
edu.wisc.cs.wisdom.sdmbn.apps.testing.TestTimedMoveAll.TraceReplaySwitchPort = 1
edu.wisc.cs.wisdom.sdmbn.apps.testing.TestTimedMoveAll.TraceReplayHost = 192.168.0.1
- We need to generate a large packet capture file which we can playback for the demo. An easy way to do this is to start watching a video in Youtube. Run the following commands, and hit Ctrl-C to exit tcpdump after capturing ~25,000 packets:
tcpdump -i <your active interface, ie. eth0> -s 1000 -w largeflows.pcap -v
- Update the prads configuration by opening the /usr/local/etc/sdmbn.conf file and update the following lines:
ctrl_ip = 192.168.0.254
ctrl_port_state = 7690
ctrl_port_event = 7691
- Update the mininet configuration by opening the ~/OptMB/demo/scripts/demo.py file and update the line which defines the remote controller:
c0 = RemoteController('c0', ip='192.168.0.254', port=6601)
- Make sure tcpreplay is installed:
sudo apt-get install tcpreplay
- Lastly, disable any networking managers that are running on your system. Turn off any wired or wireless connections that are active from the system tray (next to the clock). Check for the network-manager service; if this exists, stop it:
sudo service network-manager stop
Any active network managers will interfere with the mininet switches and prevent them from working correctly.
4. Run the demo
- In one terminal window, start the controller application:
java -jar SDMBNapps.jar -cf testTimedMoveAll.prop
- In another terminal window, start the mininet network:
sudo python demo.py
- Once you start the mininet network, you should notice some activity in the controller window as the OF switches connect to the controller. Once this connection happens, you have a very limited amount of time to execute the next few instructions before the switch deactivates. Type quickly!
- From the mininet window, open an xterm window for three hosts:
mininet> xterm h1 h2 h3
- In the h1 xterm window, start the traceload server:
apps/scripts/traceload_server.sh h1-eth0 apps 192.168.0.1 8080
- In the h2 xterm window, start prads:
prads -i h2-eth0
- In the h3 xterm window, start prads:
prads -i h3-eth0
- At this point, assuming everything is running correctly and you typed quickly enough, you will see the following sequence of events:
- The controller window acknowledges the prads connections from h2 and h3
- The controller sends a command to start the traceload replay on h1
- In h1, the traceload server starts replaying packets, and the prads application in h2 has a burst of activity as packets start coming in
- A few seconds later, the controller initiates a move
- The activity on h2 stops and then picks up again on h3
- When the packet file finishes replaying, the pkts_received values in h2 and h3 should add up roughly to the total number of packets indicated in h1
5. All done!
At the end of the demo, your screen should look something like this.