Discussion:
[Ryu-devel] Flow statistics on each packet
Suhail Asif
2017-07-09 05:33:41 UTC
Permalink
Hi All,

At the moment I have modified my switch to use packet In for every packet
entering the switch. What i want to attain is to get flow statistics for
every packet.

Let me explain a bit. A flow keeps track of how many packets have passed in
a flow, also how many bytes have passed.

Now what my target is to get the bytes based on each packet.

For example, First packet comes in with 2 bytes, the second packet with 3
bytes, so my byte count goes to 5.

Third packet of 2 bytes and byte count goes to 7. Is there a way to track
byte count and other statistics like this?

Regards,
Fujimoto Satoshi
2017-07-10 02:06:53 UTC
Permalink
Hi, Suhail

Do you want to get the total bytes with the Packet In header, or without
the header?

If you want to get with the header, msg_len returns the bytes including
its header.
You can get this filed and add it to the total count:
@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def _packet_in_handler(self, ev):
print(ev.msg.msg_len)

Or if you want to get without the header, FlowStats may be enough to get
the total byte count.
The "byte_count" in OFPFlowStatsReply represents the total bytes in a flow.
If you want to know only the total byte count, it may be enough for you.
http://ryu.readthedocs.io/en/latest/ofproto_v1_3_ref.html#ryu.ofproto.ofproto_v1_3_parser.OFPFlowStatsReply


Thanks,
Fujimoto
Post by Suhail Asif
Hi All,
At the moment I have modified my switch to use packet In for every
packet entering the switch. What i want to attain is to get flow
statistics for every packet.
Let me explain a bit. A flow keeps track of how many packets have
passed in a flow, also how many bytes have passed.
Now what my target is to get the bytes based on each packet.
For example, First packet comes in with 2 bytes, the second packet
with 3 bytes, so my byte count goes to 5.
Third packet of 2 bytes and byte count goes to 7. Is there a way to
track byte count and other statistics like this?
Regards,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Loading...