Modifying rated source

Douglas S. J. De Couto decouto at lcs.mit.edu
Tue Jul 3 14:22:17 EDT 2001


on a slightly related note, i had hacked up a small userlevel element
called PrintOld: it would print out any packets whose timestamp
annotation was more than THRESH time ago... i was using it for
debuggin some stuff in my protocol.  it is most useful if all the
From* elements, etc., set the timestamp annotation.


> Date: Tue, 3 Jul 2001 10:24:39 -0400
> From: Benjie Chen <benjie at amsterdam.lcs.mit.edu>
> Cc: Eddie Kohler <kohler at aciri.org>, click <click at amsterdam.lcs.mit.edu>,
>    Wei Kuan Young <wk.young.extern at icn.siemens.de>,
>    Peter Braun <peter-m.braun at icn.siemens.de>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> i think a good way to do this is to write a separate element that
> puts a timestamp into a particular offset into the packet, then
> have a element that reads it on the other end. then you would not
> need to modify RatedSource and can use the elements with other
> source generator as well...
> 
> for example,
> 
>  PollDevice(eth0) 
>    -> SetPacketTimestamp(34)  // sets time stamp at byte 34 of packet
>    -> Queue
>    -> ToDevice(eth1);
> 
>  PollDevice(eth1)
>    -> GetPacketTimestamp(34)  // read time stamp at byte 34 of packet
>    -> Discard;
> 
> i used 34 as ether hdr + ip hdr, but you can make it whatever you
> want. you can also make SetPacketTimestamp set timestamp at offset
> relative to end of IP or TCP header if you want to deal with variable
> size header sizes.
> 
> just a thought...
> 
> benjie
> 
> 
> 
> 
> On Tue, Jul 03, 2001 at 03:51:48PM +0200, Werner Raetscher wrote:
> > Hello Eddie,
> > 
> > I need for my measurements an UDP packet generator which is able to set
> > the current timestamp in the packet (not the click annotation) in order
> > to measure the delay between sender and receiver. Because there is no
> > such click element available yet I intend to modify the RatedSource
> > element and write the timestamp which I get with the
> > click_gettimeofday(&now) after a conversion to a string as a packet
> > payload instead of the default string data in RatedSource::configure().
> > My question: is this data string read for each new created packet? What
> > I mean: if I put the timestamp in the packet->data() is it updated for
> > each packet or do all packets have the same data string? What do you
> > think generally about this idea? What element could I use on the
> > receiver side for reading the packet stamp (e.g. Print)?
> > 
> > Regards,
> > Werner
> > 
> > 
> > 
> 
> -- 
> benjie chen
> benjie at lcs.mit.edu
> 


-- 
Douglas S. J. De Couto    decouto at lcs.mit.edu




More information about the click mailing list