Skip to content
Hiroya Kaneko edited this page Jul 4, 2016 · 8 revisions

##Exercise1.To run a learning switch example

cd odenos/apps/mininet_examples/single_network_control
./start_odenos.sh restart
./start_mininet.py

##Exercise2.Controlling an single openflow switch ###Start an ODENOS core system

cd ~/odenos ; 
./odenos start -c  ~/odenos/apps/mininet_examples/single_node_control/odenos.conf
./apps/mininet_examples/single_node_control/start_mininet.py

###Making components

curl -w "$FORMAT" http://localhost:10080/systemmanager/components/network1 -X PUT -d '{"type": "Network", "id": "network1"}'
curl -w "$FORMAT" http://localhost:10080/systemmanager/components/ofd -X PUT -d '{"type": "OpenFlowDriver", "id": "ofd"}'
curl -w "$FORMAT" http://localhost:10080/systemmanager/connections -X POST -d '{"id": "conn3", "type": "LogicAndNetwork", "connection_type":"original", "logic_id": "ofd", "network_id":"network1"}'

###Setup flows

curl -w "$FORMAT" http://localhost:10080/network1/flows -X POST -d '{"owner":"logic","enabled":true,"attributes":null,"type":"BasicFlow",
"matches":[
{"type":"BasicFlowMatch","in_node":"node0x1","in_port":"port1@0x1"}],"path":[],
"edge_actions":{
"node0x1":[{"type":"FlowActionOutput","output":"port2@0x1"}]
}}'

curl -w "$FORMAT" http://localhost:10080/network1/flows -X POST -d '{"owner":"logic","enabled":true,"attributes":null,"type":"BasicFlow",
"matches":[
{"type":"BasicFlowMatch","in_node":"node0x1","in_port":"port2@0x1"}],"path":[],
"edge_actions":
{"node0x1":[{"type":"FlowActionOutput","output":"port1@0x1"}]
}}'

##Exercise3.Controlling an network with aggregator component ###Start an ODENOS core system

cd ~/odenos ; 
./odenos start -c  ~/odenos/apps/mininet_examples/single_network_control/odenos.conf
./apps/mininet_examples/single_network_control/start_mininet.py

###Making components

curl -w "$FORMAT" http://localhost:10080/systemmanager/components/network2 -X PUT -d '{"type": "Network", "id": "network2"}'

curl -w "$FORMAT" http://localhost:10080/systemmanager/components/network1 -X PUT -d '{"type": "Network", "id": "network1"}'

curl -w "$FORMAT" http://localhost:10080/systemmanager/components/agg -X PUT -d '{"type": "Aggregator", "id": "agg"}'

curl -w "$FORMAT" http://localhost:10080/systemmanager/components/ofd -X PUT -d '{"type": "OpenFlowDriver", "id": "ofd"}'

###Making connections

curl -w "$FORMAT" http://localhost:10080/systemmanager/connections -X POST -d '{"id": "conn3", "type": "LogicAndNetwork", "connection_type":"aggregated", "logic_id": "agg", "network_id":"network2"}'

curl -w "$FORMAT" http://localhost:10080/systemmanager/connections -X POST -d '{"id": "conn2", "type": "LogicAndNetwork", "connection_type":"original", "logic_id": "agg", "network_id":"network1"}'

curl -w "$FORMAT" http://localhost:10080/systemmanager/connections -X POST -d '{"id": "conn1", "type": "LogicAndNetwork", "connection_type":"original", "logic_id": "ofd", "network_id":"network1"}'

###Setup flows

curl -w "$FORMAT" http://localhost:10080/network2/flows -X POST -d '{"owner":"logic","enabled":true,"attributes":null,"type":"BasicFlow","matches":[{"type":"BasicFlowMatch","in_node":"agg","in_port":"node0x3_port3@0x3"}],"path":[],"edge_actions":{"agg":[{"type":"FlowActionOutput","output":"node0x1_port3@0x1"}]}}'

curl -w "$FORMAT" http://localhost:10080/network2/flows -X POST -d '{"owner":"logic","enabled":true,"attributes":null,"type":"BasicFlow","matches":[{"type":"BasicFlowMatch","in_node":"agg","in_port":"node0x1_port3@0x1"}],"path":[],"edge_actions":{"agg":[{"type":"FlowActionOutput","output":"node0x3_port3@0x3"}]}}'
Clone this wiki locally