Hi again

> It's because of the MAC layer. The default CC2420 layer in T2 has an  
> initial backoff of approximately 1-10ms. So after you call send(),  
> the MAC layer waits 1-10ms before trying to send the packet.

am I correct in saing that one jiffy is something like ~0.03125 ms from the
32khz timer and that:
(from the code below the p.s.)
CC2420_BACKOFF_PERIOD = CC2420_MIN_BACKOFF = 10 jiffies or ~0.3125ms

so the initial backoff is
(call Random.rand16() % (0x1F * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF)
which is bounded by 10 and 319 jiffies, or 0.3125 and 9.96875 ms

and congestion backoff is
(call Random.rand16() % (0x7 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF)
which is bounded by 10 and 79 jiffies or 0.3125 and 2.46875 ms

...I'm sure I saw something increasing and then limiting the maximum number
of congestion backoff periods as well somewhere? Probably to three or four,
so the maximum total backoff before the radio gave up (assuming it
eventually gives up?) would be maybe (10 + 2.5 + 5 + 7.5 + 10 [...+n*10?])
about 35ms[...+n*10?]? or has my guessing/maths gone horribly wrong
somewhere? :-)

I assume this has something to do with the existence of the 100ms default
on-time timer in LPL when energy is detected?

regards,
Ben

p.s. code I am basing these guesses on...

I found the following in CC2420.h:

enum cc2420_enums {
  CC2420_TIME_ACK_TURNAROUND = 7, // jiffies
  CC2420_TIME_VREN = 20,          // jiffies
  CC2420_TIME_SYMBOL = 2,         // 2 symbols / jiffy
  CC2420_BACKOFF_PERIOD = ( 20 / CC2420_TIME_SYMBOL ), // symbols
  CC2420_MIN_BACKOFF = ( 20 / CC2420_TIME_SYMBOL ),  // platform specific?
  CC2420_ACK_WAIT_DELAY = 256,    // jiffies
};



and then this in CC2420CsmaP:

  /***************** SubBackoff Events ****************/
  async event void SubBackoff.requestInitialBackoff(message_t *msg) {
    call SubBackoff.setInitialBackoff ( call Random.rand16() 
        % (0x1F * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF);
        
    signal RadioBackoff.requestInitialBackoff[((cc2420_header_t*)(msg->data
- 
        sizeof(cc2420_header_t)))->type](msg);
  }

  async event void SubBackoff.requestCongestionBackoff(message_t *msg) {
    call SubBackoff.setCongestionBackoff( call Random.rand16() 
        % (0x7 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF);

    signal
RadioBackoff.requestCongestionBackoff[((cc2420_header_t*)(msg->data - 
        sizeof(cc2420_header_t)))->type](msg);
  }


---end---


*******************************************************************************
Please consider the environment before printing this email.
*******************************************************************************
This email and any files transmitted with it are intended solely for the use of
the individual or entity to whom they are addressed and may not be divulged to
any third party without the express permission of the originator.  Any views
expressed in this message are those of the individual sender, except where the
sender specifically states them to be the views of Thales Research & Technology
(UK) Limited.
*******************************************************************************

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

Reply via email to