[Click] Accurate timers with polling Tasks: Help a newbie?
g91d5350 at campus.ru.ac.za
g91d5350 at campus.ru.ac.za
Tue Sep 1 07:00:19 EDT 2009
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
More information about the click
mailing list