从 Pox 控制器停止切换

Stopping a switch from Pox controller

我正在尝试建立一个测试网络,其中我有一个交换机列表,并且一次只能激活其中一个。我已经在像这样工作的每个 ConnectionUp 事件上更新连接列表:

def _handle_ConnectionUp (event):    
  for switch in switchesList:
      ...
      if switch.dpid == str(event.dpid):
        switch.connection = event.connection
      ...
      if any other switch from switchesList is running
        stop that switch
      ...

据我所知,我可以使用 connection.send 向该交换机发送消息,但是我没有设法找到包含 "stop" 命令的 Openflow 消息。 每当在 mininet CLI 中我手动 运行:

开关 s1 开始

我想让POX达到类似运行ning的效果:

开关s2停止

来自 mininet CLI。

有没有办法发送此类消息或以其他方式访问开关引用?

在 flow-table 中设置流(例如 action = of.ofp_action_output(port = of.OFPP_DROP))以丢弃所述交换机不同端口的所有数据包可以提供想要的效果。