Hi Mayur,
1. What should be the minimum and the maximum value of the back-off
period
timer(backoffTime) in the initial backoff event which I would handle in the
app?
That depends on the properties of your app. On some of my apps, I send a
stream of data packets that need to get through very quickly. Anytime a
data packet is sent I set its backoff to a static value - 0 or 1 - to make
them go as fast as possible while ignoring other transmitters (or just
disable CCA completely). Other apps may want a more randomized backoff,
which is the right way to do it if there are other transmitters in the area
trying to share the channel. The shorter the backoff, the more likely your
node is to hog the channel. If you look at CC2420CsmaP, you'll see a few
suggestions:
Initial backoff is a large delay between messages
Min backoff = 10
Max backoff = 319
call SubBackoff.setInitialBackoff ( call Random.rand16()
% (0x1F * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF);
Congestion backoff is a shorter delay between messages
Min backoff = 10
Max backoff = 79
call SubBackoff.setCongestionBackoff( call Random.rand16()
% (0x7 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF);
LPL backoff is the shortest delay between messages defined in the CC2420
stack
Min backoff = 0 (set to 1 once you call the function since a timer can
never be set to 0)
Max backoff = 9
call SubBackoff.setLplBackoff(call Random.rand16() % 10);
2. Since, I need a small backoff period for a few packets and the rest will
go through the normal routine i.e. I wish to prioritize few of the packets
and they should be sent as early as possible. Do I still, need to handle
both the initial and the congestion back-off events?
For the packet you are redefining backoffs for, yes, both the initial and
congestion backoffs play a part in prioritizing your packet on the channel.
You can set them to call back with the same backoff value if you want,
that's what I usually do if I'm trying to prioritize a packet. Also,
because the interface is parameterized by AM type, the act of wiring your
application to the parameterized interface you're interested in will prevent
you from having to define all of those backoffs for other AM types. If you
haven't defined your own backoff functions for other AM types, then those
other packets will use the default backoffs defined in the stack.
3. How will the randomization of the initial backoff timer be handled
if the
channel is not found clear on subsequent assessments?
The initial backoff is only used once - the first time the packet is
attempted to be transmitted. If the channel is found to be in use, then the
congestion backoff kicks in for every other attempt. Both of these will play
into prioritizing the packet you're trying to transmit.
-David
_____
From: Mayur Maheshwari [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 29, 2007 10:45 PM
To: David Moss
Subject: usage of RadioBackoff in apps
Hi David
I wish to use the radiobackoff interface in one of my apps which sends few
packets with the backoff timer set to a small value and the rest with the
default backoff timer setting of the radio stack. However, I am not able to
comprehend a few things:
1. What should be the minimum and the maximum value of the back-off period
timer(backoffTime) in the initial backoff event which I would handle in the
app?
event void requestInitialBackoff(message_t *msg){
call setInitialBackoff(uint16_t backoffTime);
}
2. Since, I need a small backoff period for a few packets and the rest will
go through the normal routine i.e. I wish to prioritize few of the packets
and they should be sent as early as possible. Do I still, need to handle
both the initial and the congestion back-off events?
Also, since many of the packets will go with the default radio setting,
therefore is it correct to say that the event of backoff will be handled but
the backoffTime not being set for them and eventually they will use the
default back-off timer in the radio stack.
event void requestInitialBackoff(message_t *msg){
if(some conditions) {
call setInitialBackoff(uint16_t backoffTime);
}
}
3. How will the randomization of the initial backoff timer be handled if the
channel is not found clear on subsequent assessments?
Regards
--
Mayur Maheshwari([EMAIL PROTECTED])
"Karmanye Vadhikaraste Ma Phaleshu Kadachana,
Ma Karma Phala Hetur Bhurmatey Sangostva Akarmani"
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help