Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


Command to delete a specific flow on ovs switch (mininet) ?

asked 2016-04-19 13:48:41 -0800

saisujithreddy gravatar image

I would like to know how to delete one of the below mentioned specific flow (NOT all flows) installed on mininet ?

I am aware of how to delete a flow through restconf. I am looking for command to delete a flow something like "ovs-ofctl del-flow ...."

mininet> sh ovs-ofctl dump-flows s1 -O OpenFlow13 OFPSTFLOW reply (OF1.3) (xid=0x2): cookie=0x2b00000000000001, duration=278.695s, table=0, npackets=159, nbytes=24158, priority=2,inport=1 actions=output:2 cookie=0x2b00000000000000, duration=278.695s, table=0, npackets=159, nbytes=25246, priority=2,inport=2 actions=output:1 cookie=0x2b00000000000001, duration=282.518s, table=0, npackets=114, nbytes=9690, priority=100,dltype=0x88cc actions=CONTROLLER:65535 cookie=0x2b00000000000003, duration=282.454s, table=0, npackets=36, nbytes=6258, priority=0 actions=drop

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2016-04-20 01:21:10 -0800

updated 2016-04-21 01:19:04 -0800

You can delete the flow by specifying the flow rule in del-flows command. From the ovs command documentation:

   [--bundle] del-flows switch
   [--bundle] [--strict] del-flows switch [flow]
   [--bundle] [--strict] del-flows switch - < file

For example let's say we have flows:

$ sudo ovs-ofctl dump-flows test
NXST_FLOW reply (xid=0x4): 
cookie=0x0, duration=23.490s, table=0, n_packets=0, n_bytes=0, idle_age=23, actions=CONTROLLER:65535  (flow I) 
cookie=0x0, duration=216.741s, table=0, n_packets=0, n_bytes=0, idle_age=216, priority=0 actions=NORMAL (flow II)   
cookie=0x0, duration=12.296s, table=0,n_packets=0, n_bytes=0, idle_age=12,in_port=1 actions=CONTROLLER:65535 (flow III)

to delete the flow III we have do to execute following command in terminal:

$ sudo ovs-ofctl del-flows test "in_port=1"

to delete the flow I

 $ sudo ovs-ofctl del-flows test "" --strict  (all fields are wild carded with strict match)

to delete the flow II

 $ sudo ovs-ofctl del-flows test "priority=0"
edit flag offensive delete publish link more

answered 2016-04-19 23:56:01 -0800

karthik330 gravatar image

Hi ,

sudo ovs-ofctl -O OpenFlow13 del-flows s1 this command will delete the Flow of s1 device (openflow:1). Change the device name if you want to delete some other device(s2 ).

Thanks, -Karthik

edit flag offensive delete publish link more


Thanks Karthik, but my question was to delete a specific flow on a device.

saisujithreddy ( 2016-04-20 10:34:50 -0800 )edit

ok ok fine.

karthik330 ( 2016-04-20 22:18:27 -0800 )edit

answered 2016-04-21 01:12:43 -0800

azhark gravatar image

The above answer was very helpful to me as I was able to delete my flow "in_port=1" successfully. But what if I want to delete the flow numbered I or II in your given example. What should I write in " ??? " here as there is no input port mentioned in these flows?

edit flag offensive delete publish link more


@azhark I have updated the answer, I havn't tried the command, please let me know whether it worked for you or not.

subhash ( 2016-04-21 01:20:06 -0800 )edit

"priority=0" doesn't work. "' --strict is accepted but nothing deleted. However, "table=0" work fine.

azhark ( 2016-04-21 04:44:08 -0800 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-04-19 13:48:41 -0800

Seen: 12,254 times

Last updated: Apr 21 '16