脚本宝典收集整理的这篇文章主要介绍了实验5:开源控制器实践——POX,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
sudo mn --topo=single,3 --mac --controller=remote,ip=127.0.0.1,port=6633 --swITch ovsk,PRotocols=OpenFlow10
dpctl del-flows
SendFlowInSingle3.py
:向交换机S1下发流表规则From pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.addresses import IPAddr
class SendFlowInSingle3(object):
def __init__ (self):
core.openflow.addListeners(self)
def _handle_ConnectionUp(self,event):
msg = of.ofp_flow_mod()
msg.priority = 1
msg.idle_timeout=0
msg.match.in_port = 1
msg.actions.append(of.ofp_action_output(port = of.OFPP_ALL))
event.connection.send(msg)
msg = of.ofp_flow_mod()
msg.priority = 1
msg.idle_timeout=0
msg.match.in_port = 2
msg.actions.append(of.ofp_action_output(port = of.OFPP_ALL))
event.connection.send(msg)
msg = of.ofp_flow_mod()
msg.priority = 1
msg.idle_timeout=0
msg.match.in_port = 3
msg.actions.append(of.ofp_action_output(port = of.OFPP_ALL))
event.connection.send(msg)
def launch ():
core.registerNew(SendFlowInSingle3)
以上是脚本宝典为你收集整理的实验5:开源控制器实践——POX全部内容,希望文章能够帮你解决实验5:开源控制器实践——POX所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。