Drop counter
Pica8 has added support for drop counter from PicOS version 2.7.2. This feature is useful in cases where we need to count the dropped packets. For this counter, we use rdbgc4 register to count the dropped packets.
  The command is:
ovs-vsctl set-rdbgc4 [TYPE]
TYPE value: rfldr; ripd4; ripd6; riphe6; vlandr
Default value: rfldr
Use the command below to display rdbgc4 setting.
 ovs-vsctl show-rdbgc4
Â
The command below is used get drop statistics on a given port.
ovs-ofctl dump-drop br0 [PORT]
Â
1. rdbgc4 drop counter values:
1)ovs-vsctl set-rdbgc4 rfldr
Setting the rdbgc4 value to rfldr will count the packets which are dropped by a drop action (actions=drop) flow in TCAM. Packets matching this flow are dropped and drop statistics are recorded in the drop counter.
Example:
ovs-vsctl add-br br0 ovs-vsctl add-port br0 te-1/1/9 vlan_mode=trunk tag=1 Â -- set Interface te-1/1/9 type=pica8 ovs-vsctl add-port br0 te-1/1/10 vlan_mode=trunk tag=1 Â -- set Interface te-1/1/10 type=pica8
Packets will match default drop flow without configuring flows.
admin@PicOS-OVS$ovs-ofctl dump-drop br0 9 PXST_DROP_STATS reply (OF1.4) (xid=0x2): 1 interfaces  te-1/1/9(port 9):      Statistics type in rdbgc4: rfldr Discarded Packets.................10000 Statistics type : ingress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : ingress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : egress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : egress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : ingress drop caused by flow-match (packets) Discarded Packets.................10000
Â
2) ovs-vsctl set-rdbgc4 vlandr
Count the packets whose tag doesn't match the ingress port’s VLAN ID.
Example:
ovs-vsctl add-port br0 te-1/1/9 vlan_mode=access tag=10 Â -- set Interface te-1/1/9 type=pica8 ovs-vsctl add-port br0 te-1/1/10 vlan_mode=trunk tag=1 Â -- set Interface te-1/1/10 type=pica8
add flow:
ovs-ofctl add-flow br0 in_port=9,actions=10
Send packets with vlan=199 to port 10 and check drop counter.
admin@PicOS-OVS$ovs-ofctl dump-drop br0 9 PXST_DROP_STATS reply (OF1.4) (xid=0x2): 1 interfaces  te-1/1/9(port 9): Statistics type in rdbgc4: vlandr Discarded Packets.................10000 Statistics type : ingress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : ingress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : egress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : egress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : ingress drop caused by flow-match (packets) Discarded Packets.................0
If modify flow actions=drop,after above steps,  ingress drop caused by flow-match will have  discarded packets statistics 10000.
3) ovs-vsctl set-rdbgc4 ripd4
Count the ipv4 packets which send to route table with VLANÂ CFI=set or TTL=0.
Example:
ovs-vsctl set-l2-mode true ovs-vsctl set-l3-mode true ovs-ofctl add-flow br0 table=251, dl_vlan=199,dl_dst=22:22:22:22:22:22,actions=normal ovs-ofctl add-flow br0 table=252, ip,nw_dst=2.2.2.2,actions=set_field: 00:00:00:00:22:22-\>dl_dst,set_field:1999-\>vlan_vid,10
Send packets with dl_dst=22:22:22:22:22:22, dl_dst=22:11:11:11:11:11,dl_vlan=199,CFI=SET, nw_dst=2.2.2.2, nw_src=1.1.1.1 to port 10.
Check drop counter:
admin@PicOS-OVS$ovs-ofctl dump-drop br0 9 PXST_DROP_STATS reply (OF1.4) (xid=0x2): 1 interfaces  te-1/1/9(port 9):    Statistics type in rdbgc4: ripd4 Discarded Packets.................10000 Statistics type : ingress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : ingress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : egress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : egress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : ingress drop caused by flow-match (packets) Discarded Packets.................0
Â
4) ovs-vsctl set-rdbgc4 ripd6
Count the ipv6 packets which send to route table with VLANÂ CFI=set or Hop=0.
Example:
ovs-vsctl set-l2-mode true ovs-vsctl set-l3-mode true ovs-ofctl add-flow br0 table=251,dl_vlan=199,dl_dst=22:22:22:22:22:22,actions=normal ovs-ofctl add-flow br0 table=252,ipv6,ipv6_dst=2001::1,actions=set_field: 00:00:00:00:22:22-\>dl_dst,set_field:1999-\>vlan_vid,10
Send packets with dl_dst=22:22:22:22:22:22, dl_dst=22:11:11:11:11:11,dl_vlan=199,CFI=RESET, hop=0, ipv6_dst=2001::1,ipv6_src=2002::1 to port 10:
Check drop counter:
admin@PicOS-OVS$ovs-ofctl dump-drop br0 9 PXST_DROP_STATS reply (OF1.4) (xid=0x2): 1 interfaces  te-1/1/9(port 9):     Statistics type in rdbgc4: ripd6 Discarded Packets.................10000 Statistics type : ingress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : ingress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : egress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : egress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : ingress drop caused by flow-match (packets) Discarded Packets.................0
Â
5) ovs-vsctl set-rdbgc4 riphe6
Count the ipv6 packets which send to route table with ipv6_dst=::
Example:
ovs-vsctl set-l2-mode true ovs-vsctl set-l3-mode true ovs-ofctl add-flow br0 table=251,dl_vlan=199,dl_dst=22:22:22:22:22:22,actions=normal ovs-ofctl add-flow br0 table=252,ipv6,ipv6_dst=2001::1,actions=set_field:00:00:00:00:22:22-\>dl_dst,set_field:1999-\>vlan_vid,10
Send packets with dl_dst=22:22:22:22:22:22,dl_dst=22:11:11:11:11:11,dl_vlan=199, ipv6_dst=0::0,ipv6_src=2002::1
Check drop counter:
admin@PicOS-OVS$ovs-ofctl dump-drop br0 9 PXST_DROP_STATS reply (OF1.4) (xid=0x2): 1 interfaces  te-1/1/9(port 9):     Statistics type in rdbgc4: riphe6 Discarded Packets.................10000 Statistics type : ingress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : ingress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : egress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : egress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : ingress drop caused by flow-match (packets) Discarded Packets.................0
Â
2.Congest drop counter:
Count packets which dropped because of congestion.
admin@PicOS-OVS$ovs-ofctl dump-drop br0 9 PXST_DROP_STATS reply (OF1.4) (xid=0x2): 1 interfaces  te-1/1/9(port 9): Statistics type in rdbgc4: rfldr Discarded Packets.................0 Statistics type : ingress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : ingress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : egress drop caused by congestion (bytes) Discarded Octets..................22567715016 Statistics type : egress drop caused by congestion (packets) Discarded Packets.................331876187 Statistics type : ingress drop caused by flow-match (packets) Discarded Packets.................0
Â
3.ingress drop counter:
the packets which dropped by the actions=drop flow in tcam.
Example:
ovs-ofctl add-flow br0 in_port=9,ip,dl_vlan=199,nw_dst=192.168.100.100,actions=drop
Send packets to match this flow and check drop counter:
admin@PicOS-OVS$ovs-ofctl dump-drop br0 9 PXST_DROP_STATS reply (OF1.4) (xid=0x2): 1 interfaces  te-1/1/9(port 9): Statistics type in rdbgc4: vlandr Discarded Packets.................0 Statistics type : ingress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : ingress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : egress drop caused by congestion (bytes) Discarded Octets..................0 Statistics type : egress drop caused by congestion (packets) Discarded Packets.................0 Statistics type : ingress drop caused by flow-match (packets) Discarded Packets.................10000
1.Drop counter only works in ingress,but when congest statistics is in egress.
2.User can use following command to clear statistics:
ovs-appctl bridge/clear-counts br0
Â
Â
Â
Copyright © 2024 Pica8 Inc. All Rights Reserved.