[ovs-discuss] Dropping Packets Counter
blp at nicira.com
Mon Oct 6 20:00:19 UTC 2014
On Wed, Oct 01, 2014 at 04:36:01PM -0300, Pedro Henrique wrote:
> I'm doing some experiments here and I would like to know if there is a way
> to drop the packets using the switch's interfaces. I'm currently dropping
> the packets using traffic shaping (tc command), however it seems that the
> dropping happens in the kernel and therefore I can't see the dropped
> packets statistics increasing on "dpctl dump-ports" or ifconfig (it's
> always 0). I know that I can see the dropped packets typing something
> similar to "sh tc -s -d -p qdisc show dev s1-eth1", but the problem with
> this approach is that I can't get the dropped packets using an openflow
> controller. I don't know how to make this dropping counter increase and
> would like to know how can I achieve this.
Q: How do I make a flow drop packets?
A: To drop a packet is to receive it without forwarding it. OpenFlow
explicitly specifies forwarding actions. Thus, a flow with an
empty set of actions does not forward packets anywhere, causing
them to be dropped. You can specify an empty set of actions with
"actions=" on the ovs-ofctl command line. For example:
ovs-ofctl add-flow br0 priority=65535,actions=
would cause every packet entering switch br0 to be dropped.
You can write "drop" explicitly if you like. The effect is the
same. Thus, the following command also causes every packet
entering switch br0 to be dropped:
ovs-ofctl add-flow br0 priority=65535,actions=drop
"drop" is not an action, either in OpenFlow or Open vSwitch.
Rather, it is only a way to say that there are no actions.
More information about the discuss