Skip to content
okinawaopenlabs edited this page Jul 14, 2015 · 2 revisions

##Network Configuration

Note:
If you use prepared VM image, this page is not necessary.

##Install mininet

You need mininet to use OpenFlow controller.

cd /tmp  
git clone git://github.com/mininet/mininet  
sudo mininet/util/install.sh -a

##Run mininet

You will start the mininet with the following command.

mkdir ~/mininet
mv /tmp/of-patch-openflow-controller/ofp_ofc_ryu/tools/mininet_3sw4host_topo.py ~/mininet
cd ~/mininet  
sudo python mininet_3sw4host_topo.py  

Check the following message is output:

*** Configuring hosts
host1 host2 host3 host4 
*** Starting controller
*** Starting 3 switches
spine1 leaf1 leaf2 
Dumping node connections
spine1 lo:  spine1-eth1:leaf1-eth1 spine1-eth2:leaf2-eth1
leaf1 lo:  leaf1-eth1:spine1-eth1 leaf1-eth2:host1-eth0 leaf1-eth3:host2-eth0
leaf2 lo:  leaf2-eth1:spine1-eth2 leaf2-eth2:host3-eth0 leaf2-eth3:host4-eth0
host1 host1-eth0:leaf1-eth2
host2 host2-eth0:leaf1-eth3
host3 host3-eth0:leaf2-eth2
host4 host4-eth0:leaf2-eth3
*** Starting CLI:
mininet> 

##Database settings

Register the device information in the database by the REST API.
Use the following script file:

cd /tmp/of-patch-openflow-controller/ofp_ofc_ryu/tools/

####Register Device

We will register the devices information as a previous figure.

./register_devices.sh

Note:
The content was as follows.
See Device_mng for more information.

curl -X POST -H "Content-Type:application/json" -d "{'deviceName':'spine1','deviceType':'Spine','datapathId':'0000001432086945','ofcIp':'localhost:28080'}" "http://localhost:18080/ofpm/device_mng/"  
curl -X POST -H "Content-Type:application/json" -d "{'deviceName':'leaf1','deviceType':'Leaf','datapathId':'0000d6611643814c','ofcIp':'localhost:28080'}" "http://localhost:18080/ofpm/device_mng/"  
curl -X POST -H "Content-Type:application/json" -d "{'deviceName':'leaf2','deviceType':'Leaf','datapathId':'0000463203ebe642','ofcIp':'localhost:28080'}" "http://localhost:18080/ofpm/device_mng/"  
curl -X POST -H "Content-Type:application/json" -d "{'deviceName':'host1','deviceType':'Server','datapathId':'','ofcIp':''}" "http://localhost:18080/ofpm/device_mng/"  
curl -X POST -H "Content-Type:application/json" -d "{'deviceName':'host2','deviceType':'Server','datapathId':'','ofcIp':''}" "http://localhost:18080/ofpm/device_mng/"  
curl -X POST -H "Content-Type:application/json" -d "{'deviceName':'host3','deviceType':'Server','datapathId':'','ofcIp':''}" "http://localhost:18080/ofpm/device_mng/"  
curl -X POST -H "Content-Type:application/json" -d "{'deviceName':'host4','deviceType':'Server','datapathId':'','ofcIp':''}" "http://localhost:18080/ofpm/device_mng/"  

####Register Port

./register_ports.sh

Note:
The content was as follows.
See Port for more information.

curl -X POST -H "Content-Type:application/json" -d "{'portName':'spine1-eth1','portNumber':1,'band':'10Gbps'}" "http://localhost:18080/ofpm/device_mng/port/spine1"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'spine1-eth2','portNumber':2,'band':'10Gbps'}" "http://localhost:18080/ofpm/device_mng/port/spine1"  

curl -X POST -H "Content-Type:application/json" -d "{'portName':'leaf1-eth1','portNumber':1,'band':'10Gbps'}" "http://localhost:18080/ofpm/device_mng/port/leaf1"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'leaf1-eth2','portNumber':2,'band':'1Gbps'}" "http://localhost:18080/ofpm/device_mng/port/leaf1"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'leaf1-eth3','portNumber':3,'band':'1Gbps'}" "http://localhost:18080/ofpm/device_mng/port/leaf1"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'leaf2-eth1','portNumber':1,'band':'10Gbps'}" "http://localhost:18080/ofpm/device_mng/port/leaf2"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'leaf2-eth2','portNumber':2,'band':'1Gbps'}" "http://localhost:18080/ofpm/device_mng/port/leaf2"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'leaf2-eth3','portNumber':3,'band':'1Gbps'}" "http://localhost:18080/ofpm/device_mng/port/leaf2"  

curl -X POST -H "Content-Type:application/json" -d "{'portName':'host1-eth0','portNumber':1,'band':'1Gbps'}" "http://localhost:18080/ofpm/device_mng/port/host1"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'host2-eth0','portNumber':1,'band':'1Gbps'}" "http://localhost:18080/ofpm/device_mng/port/host2"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'host3-eth0','portNumber':1,'band':'1Gbps'}" "http://localhost:18080/ofpm/device_mng/port/host3"  
curl -X POST -H "Content-Type:application/json" -d "{'portName':'host4-eth0','portNumber':1,'band':'1Gbps'}" "http://localhost:18080/ofpm/device_mng/port/host4"  

####Register Connection Information

We will register the connection information for the port of the registered device.  

./register_connection_information.sh

Note:
The content was as follows.
See Connect for more information.

curl -X POST -H "Content-Type:application/json" -d "{'links':[{'band':'10240','link':[{'deviceName':'leaf1','portName':'leaf1-eth1'},{'deviceName':'spine1','portName':'spine1-eth1'}]}]}" "http://localhost:18080/ofpm/physical_topology/connect"  
curl -X POST -H "Content-Type:application/json" -d "{'links':[{'band':'10240','link':[{'deviceName':'leaf2','portName':'leaf2-eth1'},{'deviceName':'spine1','portName':'spine1-eth2'}]}]}" "http://localhost:18080/ofpm/physical_topology/connect"  
curl -X POST -H "Content-Type:application/json" -d "{'links':[{'band':'1024','link':[{'deviceName':'host1','portName':'host1-eth0'},{'deviceName':'leaf1','portName':'leaf1-eth2'}]}]}" "http://localhost:18080/ofpm/physical_topology/connect"  
curl -X POST -H "Content-Type:application/json" -d "{'links':[{'band':'1024','link':[{'deviceName':'host2','portName':'host2-eth0'},{'deviceName':'leaf1','portName':'leaf1-eth3'}]}]}" "http://localhost:18080/ofpm/physical_topology/connect"  
curl -X POST -H "Content-Type:application/json" -d "{'links':[{'band':'1024','link':[{'deviceName':'host3','portName':'host3-eth0'},{'deviceName':'leaf2','portName':'leaf2-eth2'}]}]}" "http://localhost:18080/ofpm/physical_topology/connect"  
curl -X POST -H "Content-Type:application/json" -d "{'links':[{'band':'1024','link':[{'deviceName':'host4','portName':'host4-eth0'},{'deviceName':'leaf2','portName':'leaf2-eth3'}]}]}" "http://localhost:18080/ofpm/physical_topology/connect"  

Database setting is now complete.

Clone this wiki locally