Hi Matt,

Oops, sorry the snippet I wrote on the previous mail is not the official patch.
And currently, I don't have a plan to send it into the upstream.

If adding timestamps into upstream, I guess we need to take care about the
performance.
For example, with tons of Packet-In, we want to reduce the overhead of receiving
and parsing OpenFlow messages in "_recv_loop".
I think better to add the new options for taking timestamps.
e.g.) taking timestamps only when "--with-timestamp" option is specified.

Thanks,
Iwase


On 2017年07月11日 18:59, Matthew Hayes wrote:
Hi Iwase


Thank you for the really prompt reply. I will test your patch out with my 
project.

Will this patch make it into the main Ryu distribution at some stage?


Thanks,


Matt.


----------------------------------------------------------------------------------------------------
*From:* Iwase Yusuke <iwase.yusu...@gmail.com>
*Sent:* Tuesday, 11 July 2017 12:31 a.m.
*To:* matthew_john_ha...@hotmail.com
*Cc:* ryu-devel@lists.sourceforge.net
*Subject:* Re: [Ryu-devel] Event receive timestamps
Hi Matt,

Ryu handles the low level messages receiving at ryu/controller/controller.py, I 
guess we need to
get the timestamp here.
https://github.com/osrg/ryu/blob/master/ryu/controller/controller.py#L233


Then, how about the following?
I added the "timestamp" into "EventOFP***" events.

$ git diff
diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py
index 62bca5f..4c7259c 100644
--- a/ryu/controller/controller.py
+++ b/ryu/controller/controller.py
@@ -22,6 +22,7 @@ The main component of OpenFlow controller.

   """

+import time
   import contextlib
   from ryu import cfg
   import logging
@@ -266,11 +267,13 @@ class Datapath(ofproto_protocol.ProtocolDesc):
                       remaining_read_len = (msg_len - buf_len)
                       break

+                _received_time = time.time()
                   msg = ofproto_parser.msg(
                       self, version, msg_type, msg_len, xid, buf[:msg_len])
                   # LOG.debug('queue msg %s cls %s', msg, msg.__class__)
                   if msg:
                       ev = ofp_event.ofp_msg_to_ev(msg)
+                    ev.timestamp = _received_time
                       self.ofp_brick.send_event_to_observers(ev, self.state)

                       dispatchers = lambda x: 
x.callers[ev.__class__].dispatchers


Thanks,
Iwase


On 2017年07月10日 19:34, Matthew Hayes wrote:
Hi all,

Can Ryu present timestamps to applications detailing when it received 
particular OpenFlow events
(example: timestamp for when a Packet-In event was received by Ryu)?

I have a reactive SDN project built on Ryu (see: https://nmeta.readthedocs.io 
), and telemetry built
into the app records processing time for OpenFlow events, such as Packet-In.

I want to be able to access to the timestamp of when the OpenFlow event is 
received by the
controller, to enable tracking of the delay in the application receiving the 
event, which will vary
under load. This feature would also help with accuracy of algorithms that 
analyse packet arrival times.

Please advise if this data is available in Ryu, and if not, whether it would be 
possible to develop it?

Thanks,

Matt.



------------------------------------------------------------------------------
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel



------------------------------------------------------------------------------
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


------------------------------------------------------------------------------
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to