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
h1 h3
s1 s2 s3
h2 h4
Lab 3: a naïve POX controller
• Objectives
– Moving commands from dpctl to a POX controller
– Understand how the POX controller interacts with switches
• 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: A naïve POX controller
• Modify lab3.py and lab3_controller.py to
setup the network with the following topology
H5(10.0.0.5)
H1 (10.0.0.1) H3(10.0.0.3)
s1 s2 s3
H2(10.0.0.2)
H4 (10.0.0.4)
s4
H5(10.0.0.6)
Lab4: Shortest path forwarding
• Try my_lab4.py (‘sudo ./my_lab4.py’)
h1 h2
s1 s2 s3
h3