Sunteți pe pagina 1din 3

HOW TO RUN MULTIPLE FLOODLIGHT CONTROLLERS WITH FLOWVISOR

As I personally was really stuck in this and finally found the solution. I am going to document everything
here that will make it happen. Follow all the steps and you will have them running. Start by making
copies of floodlight directory equal to number of controllers you want to run. So I have two namely
floodlight1 and floodlight2. I will provide solutions to floodlight1, you do all the same in floodlight2 but
with different port numbers and that will make all the difference.

Step # 1: Restart you machine to clean up any previously used ports.


Step # 2: Type in terminal: netstat -ntlp

Make note of the ports that are used by default by your VM or Machine. Mine are

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 10.0.3.1:53 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp6 0 0 fe80::c0be:46ff:fe58:53 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 ::1:631 :::* LISTEN -

Step # 3: Now run the mininet topology on a new terminal using the command:

sudo mn --custom ~/onstutorial/flowvisor_scripts/flowvisor_topo.py --topo fvtopo --link tc --controller


remote --mac --arp

Step # 4: Make note of the new ports that have been consumed using netstat -ntlp again. I got four new
switches. Output adds these additional lines along with the previous one.

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6634 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:6635 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:6636 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:6637 0.0.0.0:* LISTEN -

Step # 4: Using FlowVisor tutorial present at GitHub, slice network and stop when you define the final
flowspace.I mean don't run the beacon controller. It will consume some ports that will create headache.
Using following commands separating each one by

sudo -u flowvisor fvconfig generate /etc/flowvisor/config.json


sudo /etc/init.d/flowvisor start
fvctl -f /dev/null set-config --enable-topo-ctrl
sudo /etc/init.d/flowvisor restart
fvctl -f /dev/null add-slice upper tcp:localhost:10001 admin@upperslice
fvctl -f /dev/null add-slice lower tcp:localhost:10002 admin@lowerslice

Simple copy remaining code as it is in terminal and make sure "9" Request ID's are formed.

fvctl -f /dev/null add-flowspace dpid1-port1 1 1 in_port=1 upper=7 && fvctl -f /dev/null add-flowspace
dpid1-port3 1 1 in_port=3 upper=7 && fvctl -f /dev/null add-flowspace dpid2 2 1 any upper=7 && fvctl -f
/dev/null add-flowspace dpid4-port1 4 1 in_port=1 upper=7 && fvctl -f /dev/null add-flowspace dpid4-
port3 4 1 in_port=3 upper=7 && fvctl -f /dev/null add-flowspace dpid1-port2 1 1 in_port=2 lower=7 &&
fvctl -f /dev/null add-flowspace dpid1-port4 1 1 in_port=4 lower=7 && fvctl -f /dev/null add-flowspace
dpid3 3 1 any lower=7 && fvctl -f /dev/null add-flowspace dpid4-port2 4 1 in_port=2 lower=7 && fvctl -f
/dev/null add-flowspace dpid4-port4 4 1 in_port=4 lower=7

Step # 5: Now again make note of the new ports that have been consumed. In my case I got port 8080,
8081, 6633. The Output has additional lines now.

tcp6 0 0 :::6633 :::* LISTEN -


tcp6 0 0 :::8080 :::* LISTEN -
tcp6 0 0 :::8081 :::* LISTEN -

Step # 6: Now comes the time to make changes in our file named : FallbackCCProvider.java at changing
the hardbinded code 6642 to anyother that is not consumed. This file can be found in the following
location

floodlight1/src/main/java/org/sdnplatform/sync/internal/config

in my case, as I have renamed floodlight to floodlight1 and everything else just works fine. Do the same
with other floodlight controller that you want to run along with it. And yes don't forget the Million dollar
step that most people forget, go back to your original floodlight directory, in my case floodlight1 and
type:

sudo ant; in order to compile this newly edited file in floodlight.jar

Step # 7: Here comes the part to make changes in all the ports of learningswitch.properties file. You will
find it in

foodlight1/src/main/resources/learningswitch.properties

Make sure, you do this with your other controller directory as well.

Step # 8: Wait a second, things are not done yet. Now remember another 2 Million dollar step.
Everytime you want to run any instance of floodlight controller, make sure you use -cf option along with
it and pointing to the file learningswitch.properties. So in my case it becomes

sudo java -jar target/floodlight.jar –cf


/home/asad/floodlight1/src/main/resources/learningswitch.properties
Do same with other controller accordingly !

Step # 9: I hope you run netstat -ntlp again to see which new ports have been added. In my case final
one is

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6634 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:6635 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:6636 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:6637 0.0.0.0:* LISTEN -
tcp 0 0 10.0.3.1:53 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp6 0 0 :::6633 :::* LISTEN -
tcp6 0 0 :::8080 :::* LISTEN -
tcp6 0 0 :::10001 :::* LISTEN -
tcp6 0 0 :::8081 :::* LISTEN -
tcp6 0 0 :::10002 :::* LISTEN -
tcp6 0 0 :::8082 :::* LISTEN -
tcp6 0 0 :::8083 :::* LISTEN -
tcp6 0 0 127.0.0.1:6643 :::* LISTEN -
tcp6 0 0 :::6677 :::* LISTEN -
tcp6 0 0 fe80::c0be:46ff:fe58:53 :::* LISTEN -
tcp6 0 0 :::6678 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 ::1:631 :::* LISTEN -
tcp6 0 0 127.0.0.1:6650 :::* LISTEN -

Which has both controllers running without any conflict. Remember, if its not working with you, take my
word, its a port conflict most probably ! So that why I guided you to use netstat -ntlp throughout. I hope
this post could be shared with anybody who want to run multiple Floodlight controllers on same VM for
use with FlowVisor.

By:
Asad Irfan

S-ar putea să vă placă și