I am using ryu controller (3.22) to monitor switches (Open vSwitch 2.0.2, supporting Open Flow 1.3), which are a part of virtual network created using mininet (2.1.0). It is a tree topology with depth = 2, and fanout = 5. I am using switch_monitor.py
With the help of controller, I can get port statistics using the EventOFPPortStatsReply
decorator. I can get values of rx_packets
, rx_bytes
, rx_errors
, tx_packets
, tx_bytes
, tx_errors
, rx_dropped
, tx_dropped
etc.
But the values of rx_dropped
, tx_dropped
come out to be zero always, even when the switches are actually dropping packets, as reported by qdisc (linux command).
How to get packet loss statistics from an Open Flow switch?
a. How to get a non zero value?
b. Is there any alternate way?
I believe that
dropped
only cares about packets that are dropped due to actualdrop
rules or due to buffer overflows.Another way to calculate packet loss is to compare the packet counts for the two switches on the edge of a link. Suppose you have
A <--> B
and want to calculate the packet loss rate from A to B. Then you take:Beware though that sometimes the counters are reset leading to
rx_packets
being higher thattx_packets
. I am facing this behavior in my SDN software and tend to invalidate the results, if there are strange combinations.