POX>from pox.core import core
POX>import pox.openflow.libopenflow_01 as of
POX>from pox.lib.addresses import IPAddr
Add flows
POX>for connection in core.openflow.connections:
connection.send(of.ofp_flow_mod(action=of.ofp_action_output(port=2),priority=32,
match=of.ofp_match(dl_type=0x800,nw_src="10.0.0.1",nw_dst="10.0.0.2")))
Delete flows
POX>for connection in core.openflow.connections:
connection.send(of.ofp_flow_mod(command=of.OFPFC_DELETE_STRICT,
action=of.ofp_action_output(port=3),priority=32,
match=of.ofp_match(dl_type=0x800,nw_src="10.0.0.1",nw_dst="10.0.0.3")))
Dont forget to add
net.staticArp() after net.build() in mininet code
*make sure in for loops, intendent is there
For connection....
connection.send......
POX>import pox.openflow.libopenflow_01 as of
POX>from pox.lib.addresses import IPAddr
Add flows
POX>for connection in core.openflow.connections:
connection.send(of.ofp_flow_mod(action=of.ofp_action_output(port=2),priority=32,
match=of.ofp_match(dl_type=0x800,nw_src="10.0.0.1",nw_dst="10.0.0.2")))
Delete flows
POX>for connection in core.openflow.connections:
connection.send(of.ofp_flow_mod(command=of.OFPFC_DELETE_STRICT,
action=of.ofp_action_output(port=3),priority=32,
match=of.ofp_match(dl_type=0x800,nw_src="10.0.0.1",nw_dst="10.0.0.3")))
Dont forget to add
net.staticArp() after net.build() in mininet code
*make sure in for loops, intendent is there
For connection....
connection.send......
Your example code in this blog is cut off on the right side so I cannot see all of the parameters to your connection.send call for adding a flow. Can you somehow make all the parameters visible or email your examples to me at uvugdbrown@gmail.com? Thanks!
ReplyDeleteI hope now you can see all the parameters..
DeleteHello,
ReplyDeletei was going through your blog, call me dumb, but i couldnt understand where to add these flows.
connection.send(of.ofp_flow_mod(action=of.ofp_action_output(port=2),priority=32,
match=of.ofp_match(dl_type=0x800,nw_src="10.0.0.1",nw_dst="10.0.0.2")))
i mean are we supposed to add this code in a file in controller or some where else?
if in file then in which one, please?
i am using custom topology as shown in below how we add a flows in pox controller
ReplyDeletenet.addLink(Host1, Switch1, **linkopts )
net.addLink(Switch1, Switch2, **linkopts )
net.addLink(Switch1, Switch3, **linkopts )
net.addLink(Switch3, Switch4, **linkopts )
net.addLink(Switch2, Switch5, **linkopts )
net.addLink(Switch4, Switch5, **linkopts )
net.addLink(Switch4, Host2, **linkopts )