Mininet and Openflow Labs
Mininet and Openflow Labs
– Continue the exercise to completely install flow table for all hosts.
– Try the following:
• $dpctl add-flow tcp:127.0.0.1:6634 dl_dst=0:0:0:0:0:1,idle_timeout=1000,actions=output:1
• $dpctl add-flow tcp:127.0.0.1:6634 dl_dst=0:0:0:0:0:2,idle_timeout=1000,actions=output:2
• $dpctl add-flow tcp:127.0.0.1:6634 dl_dst=0:0:0:0:0:3,idle_timeout=1000,actions=output:3
• $dpctl dump-flows tcp:127.0.0.1:6634
• Mininet> pingall
Lab 2: Manually configure Openflow
switches with dpctl
– Try the following:
– $dpctl add-flow tcp:127.0.0.1:6634 idle_timeout=1000,actions=flood
– Mininet> pingall
• POX document
– https://openflow.stanford.edu/display/ONL/POX+Wiki
• See POX controller examples forwarding/hub.py at pox/forwarding/hub.py
– See the flow_mod message that add one flow table entry to flood all packets – turning each
connected switch to a hub.
– To use the controller:
• $ sudo mn --topo linear,4 --mac --switch ovsk --controller remote
– The default controller is at the same machine with port number 6633.
– Different switches are at tcp:127.0.0.1:6634{6635, 6636,…}
• $./pox.py forwarding.hub
– Create a controller running on local machine port 6633, will connect with the openflow
switches.
– Pay attention to how the flow table entries are created
– Pay attention to the connectionup event
• $dpctl dump-flows tcp:127.0.01:6634
• $dpctl dump-flows tcp:127.0.01:6635
• Mininet> pingall
Lab3: A naïve POX controller
• See lab3.py and lab3_controller.py
• Put lab3_controller.py under pox/ext
• Run lab3.py with ‘$sudo ./lab3.py’
• Use dpctl to see the flow-table on each switch.
h1 h2
s1 s2 s3
h3
Lab3 exercise: A naïve POX controller
• Modify lab3.py and lab3_controller.py to
setup the connectivity of the topology of hw1.
Lab4: Shortest path forwarding
• Try my_lab4.py (‘sudo ./my_lab4.py’)