Set-flow-counter-mode Command

ovs-vsctl set-flow-counter-mode <bytes|packets|both>

Set the flow counter type.
Example:

admin@PicOS-OVS$ovs-vsctl set-flow-counter-mode bytes  

  Please reboot for the change to take effect!

admin@PicOS-OVS$sudo systemctl restart picos
...............
admin@PicOS-OVS$ovs-ofctl add-meter br0 meter=1,kbps,band=type=drop,rate=50000
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=meter:1,output:14
admin@PicOS-OVS$ovs-vsctl show-flow-counter-mode
Flow Stats Counter Mode:
  Bytes mode is enabled
  Packets mode is disabled

admin@PicOS-OVS$ovs-ofctl dump-flows br0
OFPST_FLOW reply (OF1.4) (xid=0x2):
 cookie=0x0, duration=21.563s, table=0, n_packets=n/a, n_bytes=0, in_port=1 actions=meter:1,output:14
admin@PicOS-OVS$ovs-ofctl meter-stats br0
OFPST_METER reply (OF1.4) (xid=0x2):
meter:1 flow_count:1 packet_in_count:n/a byte_in_count:0 duration:27.266s bands:
0: packet_count:n/a byte_count:0 
admin@PicOS-OVS$ovs-ofctl meter-stats br0
OFPST_METER reply (OF1.4) (xid=0x2):
meter:1 flow_count:1 packet_in_count:n/a byte_in_count:151400 duration:33.138s bands:
0: packet_count:n/a byte_count:151400 
admin@PicOS-OVS$ovs-ofctl dump-flows br0
OFPST_FLOW reply (OF1.4) (xid=0x2):
 cookie=0x0, duration=34.288s, table=0, n_packets=n/a, n_bytes=151400, in_port=1 actions=meter:1,output:14
admin@PicOS-OVS$
 
admin@PicOS-OVS$ovs-vsctl set-flow-counter-mode packets

  Please reboot for the change to take effect!

admin@PicOS-OVS$sudo systemctl restart picos
...............
admin@PicOS-OVS$ovs-ofctl add-meter br0 meter=1,kbps,band=type=drop,rate=50000
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=meter:1,output:14
admin@PicOS-OVS$ovs-ofctl meter-stats br0
OFPST_METER reply (OF1.4) (xid=0x2):
meter:1 flow_count:1 packet_in_count:0 byte_in_count:n/a duration:12.306s bands:
0: packet_count:0 byte_count:n/a 
admin@PicOS-OVS$ovs-vsctl show-flow-counter-mode
Flow Stats Counter Mode:
  Bytes mode is disabled
  Packets mode is enabled

admin@PicOS-OVS$ovs-ofctl meter-stats br0
OFPST_METER reply (OF1.4) (xid=0x2):
meter:1 flow_count:1 packet_in_count:0 byte_in_count:n/a duration:24.705s bands:
0: packet_count:0 byte_count:n/a 
admin@PicOS-OVS$ovs-ofctl meter-stats br0
OFPST_METER reply (OF1.4) (xid=0x2):
meter:1 flow_count:1 packet_in_count:100 byte_in_count:n/a duration:29.904s bands:
0: packet_count:100 byte_count:n/a 
admin@PicOS-OVS$ovs-ofctl dump-flows br0
OFPST_FLOW reply (OF1.4) (xid=0x2):
 cookie=0x0, duration=38.496s, table=0, n_packets=100, n_bytes=n/a, in_port=1 actions=meter:1,output:14
admin@PicOS-OVS$
 
admin@PicOS-OVS$ovs-vsctl set-flow-counter-mode both   

  Please reboot for the change to take effect!
admin@PicOS-OVS$sudo systemctl restart picos

...............
admin@PicOS-OVS$ovs-vsctl show-flow-counter-mode
Flow Stats Counter Mode:
  Bytes mode is enabled
  Packets mode is enabled

admin@PicOS-OVS$ovs-ofctl add-meter br0 meter=1,kbps,band=type=drop,rate=50000
admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=1,actions=meter:1,output:14
admin@PicOS-OVS$ovs-ofctl meter-stats br0
OFPST_METER reply (OF1.4) (xid=0x2):
meter:1 flow_count:1 packet_in_count:0 byte_in_count:0 duration:11.138s bands:
0: packet_count:0 byte_count:0 
admin@PicOS-OVS$ovs-ofctl dump-flows br0
OFPST_FLOW reply (OF1.4) (xid=0x2):
 cookie=0x0, duration=12.808s, table=0, n_packets=0, n_bytes=0, in_port=1 actions=meter:1,output:14
admin@PicOS-OVS$ovs-ofctl dump-flows br0
OFPST_FLOW reply (OF1.4) (xid=0x2):
 cookie=0x0, duration=18.345s, table=0, n_packets=100, n_bytes=151400, in_port=1 actions=meter:1,output:14
admin@PicOS-OVS$ovs-ofctl meter-stats br0
OFPST_METER reply (OF1.4) (xid=0x2):
meter:1 flow_count:1 packet_in_count:100 byte_in_count:151400 duration:24.802s bands:
0: packet_count:100 byte_count:151400 
admin@PicOS-OVS$

Copyright © 2024 Pica8 Inc. All Rights Reserved.