On Thu, 08 Nov 2018 00:30:32 +0900,
Rodriguez Felipe wrote:
> 
> [1  <multipart/alternative (7bit)>]
> [1.1  <text/plain; us-ascii (quoted-printable)>]
> Hi,
> 
> 
> In the del_flow function please assume command=ofproto.OFPFC_DELETE not 
> ofproto.OFPFC_DELETE_STRICT
> 
> 
> Thank you
> 
> ________________________________
> From: Rodriguez Felipe
> Sent: Wednesday, November 7, 2018 5:18:32 PM
> To: ryu-devel@lists.sourceforge.net
> Subject: Question - Flow Deletion
> 
> 
> Hi!
> 
> 
> I'm using Open Flow 1.3 and I'm trying to delete the flow from the attached 
> image with the matching fields tcp,in_port=1,nw_dst=10.0.1.21
> 
> 
> For deleting the flows I have the following functions:
> 
> def del_flow(self, datapath, match, cookie=DEFAULT_COOKIE):
>     ofproto = datapath.ofproto
>     parser = datapath.ofproto_parser
>     # construct flow_mod message and send it.
>     # TODO: Now using table_id=1 because rest_qos.py is done QoS stuff in 
> table_id=0
>     mod = parser.OFPFlowMod(datapath=datapath, match=match,
>                             command=ofproto.OFPFC_DELETE_STRICT, 
> out_port=ofproto.OFPP_ANY,
>                             out_group=ofproto.OFPG_ANY, 
> table_id=ofproto.OFPTT_ALL,
>                             cookie=cookie, cookie_mask=0xFFFFFFFFFFFFFFFF)
>     msg = datapath.send_msg(mod)
> 
> 
> def make_match(self, parser, in_port, match_args={}):
>     match_args['in_port'] = in_port
>     return parser.OFPMatch(**match_args)
> 
> 
> Which are called in the following way:
> 
> 
> qos_match_args = {'ip_proto': 6, 'in_port': 1, 'ipv4_dst': 
> str(ipaddress.IPv4Address(167772437))}
> match1 = self.make_match(self.datapaths[entry_dp].ofproto_parser, 
> edge_port_nr, qos_match_args)
> self.del_flow(self.datapaths[entry_dp], match1)
> 
> When I try to delete the flow by using only in_port as a match argument it 
> works, but when
> I try to add other matching fields then the flow doesn't get erased. I 
> receive absolutely no
> errors when running the code. I know the other fields "ip_proto" and 
> "ipv4_dst" are included
> in the ofproto_v1_3.py in ryu.

Please check the section 7.2.3.6 Flow Match Field Prerequisite of the
OpenFlow spec 1.3. Adding eth_type and etc might fix your problem.
I'm not sure why you didn't get an error message.
It may have been logged.

> For the record, when running ovs-ofctl del-flows "bridge name" 
> tcp,in_port=1,nw_dst=10.0.1.21
> in the command window the desired flow gets deleted.
> 

AFAIK ovs-ofctl automatically appends required prerequisites.

--
IWAMOTO Toshihiro


_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to