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

Javier Sánchez javier.recacha at gmail.com
Tue Sep 1 10:02:00 EDT 2009


Hi Kevin,

I think click is not the correct way to implement TDM over wireless.

You have to face multiple software delays per packet, and the worse,
they are variable.

receive : hardware - drivers (monitor mode) - linux kernel - click router.
send: the inverse.

May be there is 200-500 us variablility (not really sure).

Anyway, I think current click timers can have more than 1 ms
resolution. But the real problem i see is this "variable" delay
packets would have.

For example, if u send a control beacon that orders STA1 use slot 1 ,
STA2 use slot 2, may be STA1 sees this control beacon 200 us after
sta2 does.

If u decide to implement, maybe u can try to begin with something like this:

define ($IP_ADR, 6.0.0.1/8)
define ($MAC_ADR, 00:00:00:00:00:00)  //use u real hw mac
define ($STA, NODE1)

FromHost(fake, $IP_ADR, ETHER $MAC_ADR)
->Queue()
->[1]Custom_Unqueue[1]  //unqueue when a beacon is received on input port 2
->[1]Custom_Delay_Unqueue[1]  //read my timeslot from
Custom_readtimeslot element, delay Xms * my_timeslot
->etc..

FromDevice()
->cl :: Classifier(xxx)  //classifies between control beacon and data

//read beacons
cl[1]
->Custom_readtimeslot($STA) //read my timeslot
->[2]Custom_Unqueue

//process data
cl[2]
-> etc


You have to program the custom elements, and create another script for
sending the control beacons. But i think that somethink like this
should do the job.

Regards
Javier Sánchez

On Tue, Sep 1, 2009 at 1:00 PM, <g91d5350 at campus.ru.ac.za> wrote:
> 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