[Click] Click timers

Bart Braem bart.braem at ua.ac.be
Sat May 6 09:00:01 EDT 2006


On Friday 05 May 2006 22:07, Ges wrote:
> I run Click at the same time on both the machines - such that on one the
> transmit element fires initially after 11 secs and on the other after 13
> secs. After that, these elements get rescheduled at an interval of 5 secs.
> But after the first trasmission on both the transmit elements, the
> transmissions start over lapping - for example. at time time + 11 secs -
> Machine 1 transmits
> at time time + 13secs - machine 2 transmits
>
> eveyrthing is fine, no corruption of packets.
>
> now, at time + (11+5) - machine 1 should transmit
> at time time + (13+5) - machine 2 should transmit
>
> but machine one and machine 2 trasmits at (almost) the same time causing
> packet corruption - i tried a larger time gap but that did not help.
>
> The current "time" is synced on both the machines - atleast to a second.
>
> For the initial firing of the timer i use schedule_after_sec(), for
> rescheduing I use reschedule_after_sec() function.
>
Click timers work (almost) perfectly. Most probably the error is in your code. 
(Believe me, I've had this kind of errors a lot)
You should try to debug your timers. A good way to do this is to look at your 
timer's expiry value. Preferably when scheduling it. I always use something 
like this:
click_gettimeofday(now);
click_chatter("At %.9f: timer scheduled in %.9f ms, will expire at %s", 
timeval2double(now), yourexpirylength, timeval2double(timer.expiry()));
(I did not do any syntax checking or compiling on this one)

This tricks will help you to debug those timers. Almost certainly the problem 
is located in your code...

Bart
-- 
Bart Braem
PATS research group
Dept. of Mathematics and Computer Sciences
University of Antwerp
G2.36, Building G
Middelheimlaan 1
2020 Antwerpen, Belgium
Phone: +32 (0)3 265.35.19.
Fax: +32 (0)3 265.37.77.
Web: www.pats.ua.ac.be
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 309 bytes
Desc: not available
Url : https://amsterdam.lcs.mit.edu/pipermail/click/attachments/20060506/a5dc4e2c/attachment.pgp


More information about the click mailing list