Openflow Configurations

Openflow Flows adding using ovs-ofctl controller

Scripts Variable values:

ip=10.37.79.63            port=6633       svlan=13         output=46       in_port=6            arp=0x0806                                         ipv4=0x0800               ipv6=0x86dd   auto=0x88b5   eth_dst=74:8E:F8:F9:68:80            eth_src=00:c0:94:00:00:01    vlan_pcp=4     mod_vlan=46            mod_dl_dst=00:00:11:00:00:80

L2 Mode:

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port  dl_vlan=$vlan dl_type=$ipv4 action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port  dl_vlan=$vlan eth_dst=$eth_dst action=output:$output”

#ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port  dl_vlan=$vlan eth_src=$eth_src eth_dst=$eth_dst action=output:$output”

L2 Modification of flow parameters

ovs-ofctl mod-flows tcp:$ip:$port -O OpenFlow13 –flow-format OXM in_port=$in_port dl_vlan=$vlan action=mod_vlan_vid=46,mod_vlan_pcp:5,output:$output”

ovs-ofctl mod-flows tcp:$ip:$port -O OpenFlow13 –flow-format OXM in_port=$in_port eth_src=$eth_src action=output:$output”

ovs-ofctl mod-flows tcp:$ip:$port -O OpenFlow13 –flow-format OXM in_port=$in_port eth_src=$eth_src action=mod_vlan_vid:$mod_vlan,mod_vlan_pcp:$vlan_pcp,output:$output”

ovs-ofctl mod-flows tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp eth_src=$eth_src eth_dst=$eth_dst action=mod_vlan_vid:46,mod_vlan_pcp:6,mod_dl_dst:$mod_dl_dst,output:$output”

L3 Mode:

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 nw_src=15.15.15.$start[255.255.255.0] nw_dst=$nw_dst[255.255.255.0] action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp nw_src=$nw_src nw_dst=$nw_dst action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port tp_src=$tp_src/0xffff tp_dst=$tp_dst/0xffff action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp nw_src=$nw_src nw_dst=$nw_dst action=mod_vlan_vid:47,mod_vlan_pcp:5,output:$output”

L3 Modifications

ovs-ofctl mod-flows tcp:$ip:$port -O OpenFlow13 –flow-format OXM in_port=$in_port dl_type=$ipv4 nw_src=$nw_src[255.255.255.0] nw_dst=$nw_dst[255.255.255.0] action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp eth_src=$eth_src eth_dst=$eth_dst action=mod_vlan_vid:46,mod_vlan_pcp:5,mod_dl_dst:74:00:00:00:00:80,output:$output”

L23 Mode:

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 dl_vlan=$vlan nw_dst=$nw_dst[255.255.255.255] action=output:normal”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 nw_src=15.15.15.10[255.255.255.0] nw_dst=$nw_dst[255.255.255.0] action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 nw_src=$nw_src[255.255.255.0] action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 nw_src=$nw_src action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_vlan=$vlan dl_type=$ipv4 action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_vlan=$vlan vlan_pcp=$vlan_pcp action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_vlan=$vlan eth_dst=$eth_dst action=output:normal”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp eth_src=$eth_src eth_dst=$eth_dst action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port action=output:$out_port”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp eth_src=$eth_src eth_dst=$eth_dst action=mod_vlan_vid:46,mod_vlan_pcp:5,mod_dl_dst:74:00:00:00:00:80,output:$output”

L23 Modifications

ovs-ofctl mod-flows tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 nw_src=$nw_src[255.255.255.0] nw_dst=$nw_dst[255.255.255.0] action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=$in_port dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp eth_src=$eth_src eth_dst=$eth_dst action=mod_vlan_vid:46,mod_vlan_pcp:5,mod_dl_dst:74:00:00:00:00:80,output:$output”

Generic Flow

#ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “dl_type=$ipv4 nw_src=$nw_src nw_dst=$nw_dst action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “dl_vlan=$vlan eth_src=$eth_src eth_dst=$eth_dst action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp eth_src=$eth_src eth_dst=$eth_dst action=output:$output”
Generic Modifications

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “dl_vlan=$vlan action=mod_vlan_vid=46,mod_vlan_pcp:5,output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “eth_src=$eth_src action=output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “eth_src=$eth_src action=mod_vlan_vid:$mod_vlan,mod_vlan_pcp:$vlan_pcp,output:$output”

ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “dl_type=$ipv4 dl_vlan=$vlan vlan_pcp=$vlan_pcp eth_src=$eth_src eth_dst=$eth_dst action=mod_vlan_vid:46,mod_vlan_pcp:6,mod_dl_dst:$mod_dl_dst,output:$output”

Untagged VLAN encode Is represented with “dl_vlan=65535”
ovs-ofctl add-flow tcp:$ip:$port -O OpenFlow13 –flow-format OXM “in_port=258 dl_vlan=65535 dl_type=0x800 action=output:1”

Advertisements