Ex - 5 SDN Lab
Ex - 5 SDN Lab
AIM: To design and implement the ability to view read/write flow table rules using openflow
vswitch using in CLI is to start a Linux terminal.
SOFTWARE REQUIRED:
Ubuntu 23.0.3 version.
Mininet virtual OS
VMware
PROCEDURE:
Step 1:To start enter the command as sudo mn --topo=single,3 --controller=none --mac
Step 2:Enter the password
Step 3:To see how switch s1 ports map to OpenFlow Port (OFP) number command as
sh ovs-ofctl show s1
Step 4: To create the first flow entry enter the command as
sh ovs-ofctl add-flow s1 action=normal
Step 5: Enter pingall to check the packet reachability
Step 6: Now enter the command to check the flows sh ovs-ofctl dump-flows s1
Step 7: To delete the entry (the flow) using sh ovs-ofctl del-flows s1
Step 8: Again enter the command sh ovs-ofctl dump-flows s1
Step 9: Enter pingall to check the packet reachability
USING LAYER 1 DATA
Step 10:To check the switch s1 from OpenFlow Port 1 is sent out to OpenFlow Port 2 enter a
command
sh ovs-ofctl add-flow s1 priority=500,in_port=1,actions=output:2 and sh ovs-
ofctl add-flow s1 priority=500,in_port=2,actions=output:1
Step 11: Now enter the command to check the flows sh ovs-ofctl dump-flows s1
Step 12: To add another flow enter a command as
sh ovs-ofctl add-flow s1 priority=32768,action=drop
Step 13: Now eliminate such the command enter a command as
sh ovs-ofctl del-flows s1 –strict
Step 14: Enter pingall to check the packet reachability
USING LAYER 2 DATA
Step 15: To execute with MAC address enter a command as
sh ovs-ofctl add-flow s1 dl_src=00:00:00:00:00:01, dl_dst=00:00:00:00:00:02,
actions=output:2 and enter sh ovs-ofctl add-flow s1
dl_src=00:00:00:00:00:02,dl_dst=00:00:00:00:00:01,actions=output:1
Step 16: To ARP is a broadcast protocol so we need to add another rule
sh ovs-ofctl add-flow s1 dl_type=0x806,nw_proto=1,action=flood
Step 17: Enter pingall to check the packet reachability
USING LAYER 3 DATA
Step 18: To modify packet contents enter the command
sh ovs-ofctl add-flow s1
priority=500,dl_type=0x800,nw_src=10.0.0.0/24,nw_dst=10.0.0.0/24,actions=no
rmal sh ovs-ofctl add-flow s1
priority=800,dl_type=0x800,nw_src=10.0.0.3,nw_dst=10.0.0.0/24,actions=mod_
nw_tos:184,normal
Step 19: To enable ARP again enter the command as
sh ovs-ofctl add-flow s1 arp,nw_dst=10.0.0.1,actions=output:1 sh
ovs-ofctl add-flow s1 arp,nw_dst=10.0.0.2,actions=output:2 sh
ovs-ofctl add-flow s1 arp,nw_dst=10.0.0.3,actions=output:3
Step 20: Enter pingall to check the packet reachability.