[Click] Accurate timers with polling Tasks: Help a newbie?

g91d5350 at campus.ru.ac.za g91d5350 at campus.ru.ac.za
Tue Sep 1 09:45:34 EDT 2009


Hello again

I've done more homework since I posted earlier.  I discovered the  
Linkunqueue element, which does some microsecond timing.  It ought not  
be difficult to modify the Linkunqueue code to create something like a  
Timedunqueue which pulls a packet off a queue at regular intervals and  
pushes it out to a device...

So hopefully I've solved my problem now!  Once I get the code to work  
I'll be able to measure how accurate the timing is.

ciao
- Kevin

Quoting g91d5350 at campus.ru.ac.za:

> Hi Clickers
>
> I'm working on a TDM-style multi-hop MAC.  I know that a number of
> other people have done similar stuff, so hopefully there will be an
> easy answer to my question.
>
> I'm hoping to achieve a TDM slot size of around 1ms.  In order to do
> this, I'll need to be able to time packet transmissions, and measure
> their arrival times, to microsecond-accuracy.
>
>  From what I understand, Click timers are based on the Linux clock
> which ticks at about 1Khz in 2.6 kernels (giving a resolution of about
> 1ms) which is not accurate enough for my needs.
>
> The documentation for the timer class tells me:
> "..there can be a significant delay between a Timer's nominal
> expiration time and the actual time it runs. Elements that desire
> extremely precise timings should combine a Timer with a Task. The
> Timer is set to go off a bit before the true expiration time (see
> Timer::adjustment()), after which the Task polls the CPU until the
> actual expiration time arrives."
> ... which sounds like just the sort of thing I need.
>
> But I am a newbie to Click, and I'm daunted by the thought of having
> to write the Task polling code.
>
> I want:
> * Code to transmit a packet at a regular interval (say every 1ms, to
> accuracy of 100us or better)
> * Code to read the arrival time of a packet to us accuracy (I'm not
> there yet, but I think this should be easy...)
>
> Can anybody help me with some sample code?  This must have been done, surely?
>
> Thanks
> - Kevin Duff
> PhD Candidate, Rhodes University
> Wireless Mesh Researcher, Meraka Institute
>
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>





More information about the click mailing list