On Mon, 12 May 2014 15:28:45 +0200
Ricardo Schmidt <[email protected]> wrote:

> I believe the flow entry is correctly installed in the switch. When I run
> the "ovs-ofctl dump-flows" cmd, it returns me two entries, the wildcard and
> the one I created. However, the pkt and byte counters of mine rule are
> always empty. To test it I created a pcap file containing a single flow and
> forced my controller to create a flow entry with match fields to match
> exactly that flow. Strangely it creates the rule, the switch accepts it
> without sending back an error message, but all subsequent pkts are
> accounted for the wildcard rule.

The switch has both flows and your problem is that all subsequent
packets are accounted for the wildcard flow? The non wild card flow
has the higher priority than the wildcard one?


> Any other idea? Does someone have an example code where a flow entry is
> created with match fields containing ip addresses or transport protocol
> ports?

=
from ryu.base import app_manager
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.topology import api
from ryu.topology import event
from ryu.ofproto import ether

class ExampleApp(app_manager.RyuApp):
    OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]

    def __init__(self, *args, **kwargs):
        super(ExampleApp, self).__init__(*args, **kwargs)

    def _add_flow(self, datapath, priority, match, actions):
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser

        inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
                                             actions)]

        mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
                                match=match, instructions=inst)
        datapath.send_msg(mod)

    @set_ev_cls(event.EventSwitchEnter)
    def switch_features_handler(self, ev):
        proto = ev.switch.dp.ofproto
        parser = ev.switch.dp.ofproto_parser
        match = parser.OFPMatch(eth_type=ether.ETH_TYPE_IP,
                                ipv4_src='1.1.1.1')

        self._add_flow(ev.switch.dp, 1, match, [])

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to