[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] bug in 802.11 MAC code



Hi-

I came across a bug with the modeling of the 802.11 MAC
(original code from CMU??).

Looking in Mac802_11::tx_resume()
a data packet defers for difs_ even following a RTS/CTS
exchange - as shown in the original code:
...
        else if(pktTx_) {

                if(mhBackoff_.busy() == 0)
                        mhDefer_.start(difs_);

        }
...
The correct behavior is to wait for sifs_ following a
RTS/CTS exchange; so the correct code might be:
...
        else if(pktTx_) {

                if(mhBackoff_.busy() == 0) {
                        if (((u_int32_t)HDR_CMN(pktTx_)->size() <
macmib_->RTSThreshold) ||
                               
((u_int32_t)ETHER_ADDR(HDR_MAC802_11(pktTx_)->dh_ra) == MAC_BROADCAST))
                                mhDefer_.start(difs_);
                        else
                                mhDefer_.start(sifs_);
                }

        }
...

:a