Hi,

AFAIK, OpenFlow does not provide the feature for changing the priority without 
changing the other fields.
So, you need to delete the previous flow which has priority=1 first,
then you need to add the new flow with the new priority for changing the 
priority.

The following shows an image to implement it.

         # Add a flow with the first priority
         match = parser.OFPMatch(...)
         actions = [...]
         instructions = [...]
         priority = FIRST_PRIORITY
         mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
                                 command=ofproto.OFPFC_ADD,
                                 match=match, instructions=instructions)
         datapath.send_msg(mod)

         # Sleep

         # Delete the previous flow with the same priority and match
         mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
                                 command=ofproto.OFPFC_DELETE,
                                 match=match)
         datapath.send_msg(mod)
         
         # Then, add the new flow with the new priority
         priority = NEW_PRIORITY
         mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
                                 command=ofproto.OFPFC_ADD,
                                 match=match, instructions=instructions)
         datapath.send_msg(mod)

Thanks,
Iwase


On 2016年07月29日 20:41, [email protected] wrote:
> Hi
>
>
>
> I want to add a data flow with priority 1, and after passing 5 seconds I want 
> to change its priority to 10. I have used the following code to implement 
> this concept. But, it is not working :)
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>         match = parser.OFPMatch(eth_src='01:00:00:00:01:00', 
> eth_dst='02:00:00:00:02:00')
>         actions = [parser.OFPActionOutput(2)]
> priority1 = 1
> command=ofproto.OFPFC_ADD
> inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
>         self.add_flow(datapath, command, priority1, match, inst)
>
>
> time.sleep(5)
>
> flow_del = parser.OFPFlowMod(datapath=datapath, priority=10, match=match, 
> command=ofproto.OFPFC_MODIFY, buffer_id= ofproto.OFP_NO_BUFFER,  
> instructions=inst)
> datapath.send_msg(flow_del)
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> would you please show me the way to do it?
>
> Please note that  as far as I know that the priority changing is not possible 
> by using the "OPFActionsetfield" option. Because priority is not supported by 
> the "OFPMatch".
>
>
> Thanks in advance.
> -Tanvir
>
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to