hi,

> Hello,
> 
> I知 new to openvswitch and ryu and am trying to write a simple flow matcher 
> with openvswitch and ryu and I知 trying to match flows based on TCP 4 tuple. 
> And the open flow version I知 using is 1.2.
> 
> This is what my add_flow function looks like.
> 
> def add_tcp_flow(self, dp, in_port, out_port, actions,
>                  eth_src=None, eth_dst=None, ip_src=None, ip_dst=None,
>                  tcp_src=None, tcp_dst=None):
>     ofproto = dp.ofproto
> 
>     match = dp.ofproto_parser.OFPMatch(in_port=in_port, tcp_src=tcp_src,
>                                        tcp_dst=tcp_dst, ipv4_src=ip_src,
>                                        ipv4_dst=ip_dst)
>     inst = [dp.ofproto_parser.OFPInstructionActions(
>             ofproto.OFPIT_APPLY_ACTIONS, actions)]
> 
>     mod = dp.ofproto_parser.OFPFlowMod(datapath=dp, cookie=0,
>             cookie_mask=0, table_id=0, command=ofproto.OFPFC_ADD,
>             idle_timeout=0, hard_timeout=0, priority=0,
>             buffer_id=ofproto.OFP_NO_BUFFER, out_port=out_port,
>             out_group=ofproto.OFPG_ANY, flags=0, match=match,
>             instructions=inst)
>     dp.send_msg(mod)
> 
> When I run this code, however, I get an asynchronous error thrown from the 
> switch.
> 
> (Pdb) p ev.msg
> OFPErrorMsg(code=9,data="\x03\x0e\x00p`\xcb'\xa0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
> 00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xff\xff\xff\x00\x00\x00\x00\x00\x01\x00(\x80\x00\x00\x0
> 4\x00\x00\x00\x04\x80\x00\x16\x04",type=4)
> 
> I understand that this has an error type = 4 (OFPET_BAD_MATCH) and the code 
> is 9 (OFPBMC_BAD_PREREQ).
> 
> I知 not sure what prerequisite I知 missing in my flow add code. Can someone 
> help me find this piece of information in the docs.

it's about prereqs defined in the spec.
eg. you need eth_type=IPv4 match before matching ipv4_src, etc.
OpenFlow 1.2 spec p.37 has a table showing prereqs.

YAMAMOTO Takashi

> 
> Thanks,
> Srinath

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to