Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - adammw

Pages: [1]
1
Zodiac FX General / 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.

Pages: [1]