<p dir="ltr">Fetching aggregate statistics would be better. I believe your problem of negative count happens when some flows expire and thus are removed from the table. Other option would be to remember both old and new flow stats and count only ones which did not expire inbetween </p>
<p dir="ltr">Peter<br>
(sent from android device)</p>
<div class="gmail_quote">On May 11, 2015 1:24 AM, "博威张" <<a href="mailto:zbw921124@gmail.com">zbw921124@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I'm trying to fetch some statistics such as bytes_count of a certain switch.</div><div><br></div><div>I use <i>ofp_flow_stats_request()</i> to send the request and handle it this way:</div><div>for f in event.stats : bytes += f.byte_count<br></div><div><br></div><div>In order to get the byte_count of a certain interval, I send it periodically and use <i>current_byte_count - former_byte_count </i>to get the byte_count of the last interval.</div><div><br></div><div>However, sometimes I got some negative values.</div><div><br></div><div>I want to know what's the meaning of the byte_count in <i>ofp_flow_stats.</i></div><div>Or do I need to use other request bodies such as <i>ofp_aggregate_stats_request </i>to fetch the byte_count of a certain period of a certain switch?</div><div><br></div><div>Thank you.</div><div>Bowei</div></div>
</blockquote></div>