Itishi -> No, ack mechanism in 802.11 DCF is used for unicast packets, in this 
code  we are faced to mac broadcast, and there is no ack mechanism for mac 
broadcast regardless of version of ns2.

M. Falahati -> i am also working on mac-802.11, the code is very complicated, 
as I understood :

About evolution of backoff timer:  as I see before calling 
"Mac802_11::transmit(Packet *p, double timeout)", in function 
"Mac802_11::check_pktTx()", we call setTxState(MAC_SEND), this will cause:

inline void
Mac802_11::setTxState(MacState newState)
{
        tx_state_ = newState;
        checkBackoffTimer();
}

which will call:

Mac802_11::checkBackoffTimer()
{
        if(is_idle() && mhBackoff_.paused())
                mhBackoff_.resume(phymib_.getDIFS());
        if(! is_idle() && mhBackoff_.busy() && ! mhBackoff_.paused())
                mhBackoff_.pause();
}

so by this call of checkBackoffTimer(), I think we're in the second "if" and 
therefore mhBackoff_.pause() is called and backoff timer is paused during 
transmission.

Then, once packet is transmitted in "Mac802_11::send_timer()", for broadcast 
packets we have:

case MAC_SEND:
                RetransmitDATA();
                break;
        
        ……
        ….

        }
        tx_resume();

so as you indicated in "RetransmitDATA()", we have:

  rst_cw();
        mhBackoff_.start(cw_, is_idle());

So  if  is_idle() == true, the call of "mhBackoff_.start" causes the backoff 
timer to start to count down; else it causes the timer to freeze. Here the 
state is still MAC_SEND so the timer will be still freezed.

Then in tx_resume() by call of setTxState(MAC_IDLE), we cause  
:"mhBackoff_.resume(phymib_.getDIFS());".

So I think what you said is true, by I also do not understand why we should 
call  mhBackoff_.start(cw_, is_idle()) in retransmit data since the backoff 
timer is already freezed for the transmission.

I also do not understand what happens if in "Mac802_11::check_pktTx()", the 
medium is always busy ? i mean do we backoff all the time as below?

                if(! is_idle()) {
                        sendRTS(ETHER_ADDR(mh->dh_ra));
                        inc_cw();
                        mhBackoff_.start(cw_, is_idle());
                        return 0;
                }
 Or is there a limit for the maximum number of back-off tries.

Hope this helps,
Best Regards,
Behnaz

 





On Dec 5, 2012, at 10:57 PM, itishi saxena <itish...@yahoo.com> wrote:

> 
> For each transmission MAC waits for its "ack" if ack did not receive on 
> time...it retransmit at time assigned by backoff time... in ns-2.34, MAC 
> tries 7 times before declaring link break.
> 
> "
> I don't know that why is the following highlight line used in *
> Mac802_11::RetransmitDATA()* function?
> 
> "
> 
> 
> It is the function responsible for that retransmission...I m talknig about 
> ns-2.34...I hope mechanism is similar for ns-2.35.
> 
> 
> ________________________________
> From: M Falahati <md.falah...@gmail.com>
> To: ns-users@ISI.EDU 
> Sent: Thursday, 6 December 2012 2:55 AM
> Subject: [ns] Schedule the backoff timer in mac-802_11
> 
> 
> Dear All,
> 
> I'm studying on implementation of mac-802_11 in ns-2.35.
> 
> I don't know that why is the following highlight line used in *
> Mac802_11::RetransmitDATA()* function?
> 
> ======================================================================
> *if((u_int32_t)ETHER_ADDR(mh->dh_ra) == MAC_BROADCAST)
> {
>         Packet::free(pktTx_);
>         pktTx_ = 0;
>         rst_cw();
>         mhBackoff_.start(cw_, is_idle());
>         return;
> }*
> ======================================================================
> 
> I think that line runs following steps:
> 1- it invokes *BackoffTimer::start()* that because of *idle* parameter is
> zero, then *pause*_ parameter will set to one.
> 2- *tx_resume()* in the *Mac802_11::send_timer()* invokes
> *setTxState()*and changes
> *tx_state*  to  *MAC_IDLE* , then invokes *checkBackoffTimer()*.
> 3- *checkBackoffTimer()* invokes *mhBackoff_.resume()* and backoff timer
> will schedule with [0-CWMin] + DIFS value.
> 
> Are above steps true?
> If answer is true,is it necessary to start backoff timer (with value
> between [0-CWMin] + DIFS) after sending a broadcast packet?
> 
> Sincerely Yours.

Reply via email to