[Tinyos-help] where to define backoff value???

Deeksha G Rao Sahib ecedeek at ece.iisc.ernet.in
Tue Nov 30 21:11:00 PST 2010


Hi,

I was looking upon the Initial and the congestion backoff values and found
the piece of related code in two places. Can anyone please explain the
difference between the two and also the significance of the values 0x1F,
0x7, 0x4 and 0x3??

In CC2420CsmaP.nc (lines 216 to 229)

 /***************** 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(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(msg);
  }


In DefaultLplP.nc (lines 316 to 330)
  /***************** RadioBackoff Events ****************/
  async event void RadioBackoff.requestInitialBackoff(message_t *msg) {
 //[am_id_t amId](message_t *msg) {
    if((call CC2420PacketBody.getMetadata(msg))->rxInterval
        > ONE_MESSAGE) {
      call RadioBackoff.setInitialBackoff( call Random.rand16()
/*[amId]( call Random.rand16() */
          % (0x4 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF);
    }
  }

  async event void RadioBackoff.requestCongestionBackoff(message_t *msg) {
    //[am_id_t amId](message_t *msg) {
    if((call CC2420PacketBody.getMetadata(msg))->rxInterval
        > ONE_MESSAGE) {
      call RadioBackoff.setCongestionBackoff ( call Random.rand16()
/**[amId]( call Random.rand16()*/
          % (0x3 * CC2420_BACKOFF_PERIOD) + CC2420_MIN_BACKOFF);
    }
  }




--Deeksha

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the Tinyos-help mailing list