1)我正在尝试将2个流规则安装到多个交换机中 .
3)在交换机中安装第一条规则后,连接将重置,第二条规则无法安装在同一交换机中 .
4)代码片段如下:
对于Rules.values()中的x:
log.debug("Source Mac is %s",x['mac_0'])
log.debug("Destination Mac is %s",x['mac_1'])
match = of.ofp_match(dl_type = 0x800, nw_proto = pkt.ipv4.ICMP_PROTOCOL, dl_src = x['mac_0'], dl_dst = x['mac_1'])
msg = of.ofp_flow_mod()
msg.priority = 20
msg.match = match
self.connection.send(msg)
log.debug("Firewall rules installed on %s", dpidToStr(event.dpid))
5)错误消息如下:
DEBUG:misc.Custom_firewall_2:源Mac是00:00:00:00:00:01
DEBUG:misc.Custom_firewall_2:目的地Mac是00:00:00:00:00:02
DEBUG:misc.Custom_firewall_2:1 #ignore这是供我参考的
DEBUG:misc.Custom_firewall_2:2 #ignore这是供我参考的
DEBUG:misc.Custom_firewall_2:防火墙规则安装在00-00-00-00-00-09 -> First rule is installed
DEBUG:misc.Custom_firewall_2:来源Mac是00:00:00:00:00:04
DEBUG:misc.Custom_firewall_2:目的地Mac是00:00:00:00:00:03
DEBUG:misc.Custom_firewall_2:1 #ignore这是供我参考的
DEBUG:misc.Custom_firewall_2:2 #ignore这是供我参考的
DEBUG:openflow.of_01:[00-00-00--09-09 33]套接字错误:由对等方重置连接 -> Second rule fails to install
信息:openflow.of_01:[00-00-00--09-09 33]断开连接
DEBUG:misc.Custom_firewall_2:防火墙规则安装在00-00-00-00-00-09
错误:openflow.of_01:[00-00-00-00-00-0f 37] OpenFlow
错误:[00-00-00-00-00-0f 37]
错误: Headers :[00-00-00-00-00-0f 37]
错误:版本:1 [00-00-00--0-0 37]
错误:类型:1(OFPT_ERROR)
...
...
...
等......
5)我使用的是POX控制器0.2.0(鲤鱼) .
谁能建议我一个解决方案?