Thanks for your reply. 

I don't get the point of firing the timer between t/2 and t. Why not choose a 
time between 0 and t?

Regards
Islam



From: Omprakash Gnawali 
Sent: Monday, March 29, 2010 11:20 PM
To: Islam Hegazy 
Cc: TinyOS help 
Subject: Re: [Tinyos-help] CTP beacon intervals


2010/3/26 Islam Hegazy <[email protected]>:
> Hi,
>
> I am trying to understand the behaviour of CTP's beacon sending. I know that
> it is adaptable according to several factors as mentioned in the CTP paper.
> However, when I trace the implementation, I get lost. I know that CTP has no
> specific intervals to send the beacons. From the code, I see that it depends
> on the previous sending time and it calculates a new sending time. But what
> is the pattern or distribution used to generate these sending times. I'd
> appreciate it if someone can explain to me the purpose of each of the
> following functions:
> remainingInterval()
> decayInterval()
> resetInterval()
> chooseAdvertiseTime()

For each interval t, you set a timer to fire between t/2 and t
(chooseAdvertiseTime), and you wait until t (remainingInterval). Once
you are at t, you double the interval (decayInterval) if you haven't
reached the max. For reasons such as topological inconsistency, you
reset the timer to a small value (resetInterval).


> Also, in chooseAdvertiseTime() the following code exists
> beaconTimer.stop()
> beaconTimer.startOneshot( t )
>
> What is the purpose of stop() and startOneshot() already stops any running
> timer and start a new one.

This is a leftover from debugging.

> Also, in StdControl.start() in the CtpRoutingEngineP.nc it call
> beaconTimer.startOneshot(  ) through the call of resetInterval() and then in
> StdControl.startDone() beaconTimer.startOneshot(BEACON_INTERVAL) is called
> again. Doesn't the 2nd call cancel the timer set in the first call?

Another leftover code. Will clean.

- om_p 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to