WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2008-May-14 07:38:01

valeriav
Member
Registered: 2008-May-14
Posts: 4

BACKOFF time "warpmac_setTimer(BACOFF);" function

As we can see, you set a BACKOFF time using the "warpmac_setTimer(BACKOFF);" command. On the other hand, when this timer reaches zero and generates an interrupt, you end up with the "timerExpire(..)" function. Within this function, you check the type of timer (i.e., timerType variable). When it is BACKOFF, you simply do carrier sensing. If the medium is sensed busy, you re-initiate the BACKOFF timer again. It seems that you are resembling a slotted CSMA/CA. You divide the time domain into successive slots and check the medium at the beginning of each slot while the size of each slot is BACKOFF. Is it the way you do carrier-sensing?

Offline

 

#2 2008-May-14 08:13:34

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: BACKOFF time "warpmac_setTimer(BACOFF);" function

It's not exactly slotted, since the size of the backoff windows are random and exponentially increasing. The randomness prevents contention in the case that two (or more) nodes, each with something to transmit, sense their shared medium has gone idle. Without some randomness, both nodes would begin transmitting immediately, guaranteeing a collision.

Offline

 

#3 2008-May-20 08:00:41

valeriav
Member
Registered: 2008-May-14
Posts: 4

Re: BACKOFF time "warpmac_setTimer(BACOFF);" function

Thanks for your prompt response. I have read the whole code carefully again and tried to understand it as precise as possible. Here, I wanna explain whatever I have found to check whether I have understood the whole idea correctly or not!

As I've noticed, you do not follow exactly the approach which is used in the original IEEE 802.11 standard. What I noticed is that: first, you load the Backoff counter by a randomly chosen value from an initial interval (i.e., initial contention window size). Then, you let the counter counts down without doing the carrier sensing while it is getting decremented. In other words, when the counter is counting down, PHY does not perform any carrier sensing. When the Backoff counter reaches zero, you do carrier sense. If the channel is found 'Idle', the MAC packet is transmitted on the radio channel; otherwise, you load the Backoff counter by a randomly chosen value which has been chosen from a larger interval (i.e., larger contention window). Subsequently, you repeat the above procedure until you reach the so-called maxBackoff.

To conclude: every time Backoff counter is loaded by a random integer value and then, it is simply decremented to zero without doing any carrier sensing in meanwhile. Only when the counter reaches zero, you do carrier sense.

I am looking forward to hearing from you and thanks in advance for your kind concern and support.

Offline

 

#4 2008-May-20 08:56:25

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: BACKOFF time "warpmac_setTimer(BACOFF);" function

Actually, the custom timer that we are using during the backoff periods does automatically pause and restart, depending upon the state of the medium. This process is transparent to the C-code, which is why it appeared that the backoff timer durations were independent of carrier sensing. If you have Matlab and System Generator, you can see the source of this timer hardware here: http://warp.rice.edu/trac/browser/Resea … /PHY/TIMER


Just to re-iterate, this is the process the system undergoes when it wants to send a packet:

- The code checks to see if the medium is free by checking warpmac_carrierSense(), which itself reads a register in the energy detector module to see if the medium has been free for a DIFS period.

    - If it's free, the packet is sent

    - If it's not, the warpmac_setTimer(BACKOFF) is called. If you look at the source code for warpmac_setTimer, you'll notice that, in the TIMEOUT/BACKOFF switch, either warpmac_startTimer(DISABLECSMA) or warpmac_startTimer(ENABLECSMA) is called. This lower-level driver call tells the custom timer hardware whether or not to do the automatic pausing based on energy in the medium. The timer will only count when the medium is free in the ENABLECSMA mode. The code, however, doesn't know when the timer is actually running; it only gets interrupted when the process is complete

- Once the timer expires, the medium is checked again and the process repeats (if necessary)

I hope that clears it up. Let me know if you have any other questions.


-Chris

Offline

 

#5 2010-May-10 15:15:30

cokid6
Member
Registered: 2010-May-07
Posts: 1

Re: BACKOFF time "warpmac_setTimer(BACOFF);" function

I am trying to modify MAC802_11.cc so that the contention window is random. I am confused as to where the contention window should be made random because am new in this. I'd really appreciate your help because am really pressed with time.
cokid6

Offline

 

#6 2010-May-10 15:37:32

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: BACKOFF time "warpmac_setTimer(BACOFF);" function

I believe MAC802_11.cc is part of the ns-2 codebase. If so, this is the wrong forum for your question.

Offline

 

Board footer