Flow mod delete matching

  • 2 Replies
  • 4520 Views
*

adammw

  • Newbie
  • *
  • 1
    • View Profile
Flow mod delete matching
« on: August 28, 2016, 06:17:48 PM »
I'm testing using a Zodiac FX SDN Switch as part of my final year project and have come across what seems to be a bug with the handling of OpenFlow flow deletion requests.

I've narrowed it down to a simple testcase using the Ryu controller:
Code: [Select]
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls

class L2Switch(app_manager.RyuApp):
    def __init__(self, *args, **kwargs):
        super(L2Switch, self).__init__(*args, **kwargs)

    @set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
    def switch_features_handler(self, ev):
        dp = ev.msg.datapath
        ofproto = dp.ofproto
        parser = dp.ofproto_parser

        match = parser.OFPMatch(in_port=1, eth_src="aa:aa:aa:aa:aa:aa", eth_dst="bb:bb:bb:bb:bb:bb")
        actions = [parser.OFPActionOutput(2)]
        inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]

        # Add the flow
        mod = parser.OFPFlowMod(datapath=dp, priority=1, match=match, instructions=inst)
        dp.send_msg(mod)
        self.logger.info("added flow %s %s", dp.id, match)

        # Delete the flow
        mod = parser.OFPFlowMod(datapath=dp, command=ofproto.OFPFC_DELETE,
                                out_port=ofproto.OFPP_ANY, out_group=ofproto.OFPG_ANY,
                                match=match)
        dp.send_msg(mod)
        self.logger.info("removed flow %s %s", dp.id, match)

The code should, upon connection of the switch to the controller, add a test flow, then use the OF Delete command to try and delete that flow. Testing on OpenVSwitch, the switch works as expected, dumping the flows lists no "aa:aa:aa:aa:aa:aa" -> "bb:bb:bb:bb:bb:bb" flow, whereas testing on the Zodiac FX with firmware version 0.65, still shows the the flow in the flow table.

*

Paul Zanna

  • Moderator
  • Sr. Member
  • *****
  • 370
    • View Profile
    • Northbound Networks
Re: Flow mod delete matching
« Reply #1 on: August 30, 2016, 05:44:05 PM »
Thanks for letting me know, I'll take a look and update you soon.

Regards,
Paul

*

Paul Zanna

  • Moderator
  • Sr. Member
  • *****
  • 370
    • View Profile
    • Northbound Networks
Re: Flow mod delete matching
« Reply #2 on: September 07, 2016, 09:57:21 AM »
This has been fixed in v0.66.

Regards,
Paul