Modifying rated source

Benjie Chen benjie at amsterdam.lcs.mit.edu
Tue Jul 3 11:24:39 EDT 2001


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



More information about the click mailing list