Hi, answers below.
> > 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?
>
That's right. Both flows, my IP-level one and the wildcard are installed.
The wildcard entry has priority 0 and the other has higher priority.
> > 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, [])
>
Thanks. Indeed mine match was correct. I found out that the problem might
actually lie on the actions I defined. Since I wasn't interested on
forwarding the traffic, but only metering it (number of packets and bytes),
the action of my flow entry to match the flow was defined as "actions=[]"
(drop). Perhaps I overlooked this in the OpenFlow specification, but for
some reason when the action is drop, the packets that match my flow entry
receive the action of the wildcard entry and they are metered only in the
latter, while the packet and bytes counters of the former remain empty (0).
I changed the action to something like:
# actions = [parser.OFPActionOutput(ofproto.OFPP_IN_PORT,10)]
I'm not sure if this action is 100% correct. But even port 10 not being
connected to anything, at least packets are now metered in my flow entry
and not in the wildcard.
Therefore, I believe this issue is now solved.
Thanks a lot for your help.
Cheers,
Ricardo
------------------------------------------------------------------------------
"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