0

1) I am trying to install 2 flow rules into multiple switches.

3) Once the first rule is installed in a switch, connection will reset and second rule fails to install in the same switch.

4) Code snippet is as following:

for x in Rules.values():

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) Error messages are as following:

DEBUG:misc.Custom_firewall_2:Source Mac is 00:00:00:00:00:01

DEBUG:misc.Custom_firewall_2:Destination Mac is 00:00:00:00:00:02

DEBUG:misc.Custom_firewall_2:1 #ignore this it is for my reference

DEBUG:misc.Custom_firewall_2:2 #ignore this it is for my reference

DEBUG:misc.Custom_firewall_2:Firewall rules installed on 00-00-00-00-00-09 -> First rule is installed

DEBUG:misc.Custom_firewall_2:Source Mac is 00:00:00:00:00:04

DEBUG:misc.Custom_firewall_2:Destination Mac is 00:00:00:00:00:03

DEBUG:misc.Custom_firewall_2:1 #ignore this it is for my reference

DEBUG:misc.Custom_firewall_2:2 #ignore this it is for my reference

DEBUG:openflow.of_01:[00-00-00-00-00-09 33] Socket error: Connection reset by peer -> Second rule fails to install

INFO:openflow.of_01:[00-00-00-00-00-09 33] disconnected

DEBUG:misc.Custom_firewall_2:Firewall rules installed on 00-00-00-00-00-09

ERROR:openflow.of_01:[00-00-00-00-00-0f 37] OpenFlow

Error: [00-00-00-00-00-0f 37]

Error: header: [00-00-00-00-00-0f 37]

Error: version: 1 [00-00-00-00-00-0f 37]

Error: type: 1 (OFPT_ERROR)

...

...

...

so on...

5) I am using POX controller 0.2.0 (carp).

Can anyone suggest me a solution?

Explore_SDN
  • 217
  • 1
  • 3
  • 10
  • Are you sure you are using the right `connection` object? I used POX couple of months ago and [here is how I used it](https://github.com/Ehsan70/SDN/blob/master/l2_learning_modified.py). – Ehsan Ab Aug 25 '15 at 19:38
  • if i use self.connection.send(fm) i get : self.connection.send(fm) AttributeError: 'CustomFirewall' object has no attribute 'connection'. if i use event.connection.send(fm) i get connection reset issue. – Explore_SDN Aug 26 '15 at 01:10
  • Could you post your code? It seems that your connections object is not right. – Ehsan Ab Aug 26 '15 at 18:36

0 Answers0