diff --git a/RELEASE_NOTES b/RELEASE_NOTES index c829e0320..715d2f102 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -26,6 +26,7 @@ Bugs fixed ---------- - Bug 2007 - uan: Remove deprecation on SetRxThresholdDb - Bug 2450 - LogDistancePropagationLossModel is not continuous +- Bug 2477 - DCF manager assert - Bug 2492 - uan: Make use of RxGain attribute in UanPhyGen class - Bug 2511 - HT Greenfield is not working - Bug 2521 - Include ipv6-option.h in wscript diff --git a/src/wifi/model/dcf-manager.cc b/src/wifi/model/dcf-manager.cc index 2b08323dc..f1ace9335 100644 --- a/src/wifi/model/dcf-manager.cc +++ b/src/wifi/model/dcf-manager.cc @@ -808,27 +808,13 @@ DcfManager::NotifyTxStartNow (Time duration) NS_LOG_FUNCTION (this << duration); if (m_rxing) { - if (Simulator::Now () - m_lastRxStart <= m_sifs) - { - //this may be caused if PHY has started to receive a packet - //inside SIFS, so, we check that lastRxStart was within a SIFS ago - m_lastRxEnd = Simulator::Now (); - m_lastRxDuration = m_lastRxEnd - m_lastRxStart; - m_lastRxReceivedOk = true; - m_rxing = false; - } - else - { - // Bug 2477: It is possible for the DCF to fall out of - // sync with the PHY state if there are problems - // receiving A-MPDUs. PHY will cancel the reception - // and start to transmit - NS_LOG_DEBUG ("Phy is transmitting despite DCF being in receive state"); - m_lastRxEnd = Simulator::Now (); - m_lastRxDuration = m_lastRxEnd - m_lastRxStart; - m_lastRxReceivedOk = false; - m_rxing = false; - } + //this may be caused only if PHY has started to receive a packet + //inside SIFS, so, we check that lastRxStart was maximum a SIFS ago + NS_ASSERT (Simulator::Now () - m_lastRxStart <= m_sifs); + m_lastRxEnd = Simulator::Now (); + m_lastRxDuration = m_lastRxEnd - m_lastRxStart; + m_lastRxReceivedOk = true; + m_rxing = false; } MY_DEBUG ("tx start for " << duration); UpdateBackoff (); diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index ad8cb5b88..42496c1b7 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -845,7 +845,7 @@ void MacLow::ReceiveError (Ptr packet, double rxSnr) { NS_LOG_FUNCTION (this << packet << rxSnr); - NS_LOG_DEBUG ("rx failed "); + NS_LOG_DEBUG ("rx failed"); if (m_txParams.MustWaitFastAck ()) { NS_ASSERT (m_fastAckFailedTimeoutEvent.IsExpired ()); @@ -1681,9 +1681,9 @@ MacLow::ForwardDown (Ptr packet, const WifiMacHeader* hdr, if (delay == Seconds (0)) { + NS_LOG_DEBUG ("Sending MPDU as part of A-MPDU"); if (!vhtSingleMpdu) { - NS_LOG_DEBUG ("Sending MPDU as part of A-MPDU"); mpdutype = MPDU_IN_AGGREGATE; } else @@ -2698,23 +2698,30 @@ MacLow::SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Addre void MacLow::SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration, WifiTxVector blockAckReqTxVector, double rxSnr) { - NS_LOG_FUNCTION (this << (uint16_t) tid << originator << duration.As (Time::S) << blockAckReqTxVector << rxSnr); - CtrlBAckResponseHeader blockAck; - uint16_t seqNumber = 0; - BlockAckCachesI i = m_bAckCaches.find (std::make_pair (originator, tid)); - NS_ASSERT (i != m_bAckCaches.end ()); - seqNumber = (*i).second.GetWinStart (); + if (!m_phy->IsStateTx () && !m_phy->IsStateRx ()) + { + NS_LOG_FUNCTION (this << (uint16_t) tid << originator << duration.As (Time::S) << blockAckReqTxVector << rxSnr); + CtrlBAckResponseHeader blockAck; + uint16_t seqNumber = 0; + BlockAckCachesI i = m_bAckCaches.find (std::make_pair (originator, tid)); + NS_ASSERT (i != m_bAckCaches.end ()); + seqNumber = (*i).second.GetWinStart (); - bool immediate = true; - AgreementsI it = m_bAckAgreements.find (std::make_pair (originator, tid)); - blockAck.SetStartingSequence (seqNumber); - blockAck.SetTidInfo (tid); - immediate = (*it).second.first.IsImmediateBlockAck (); - blockAck.SetType (COMPRESSED_BLOCK_ACK); - NS_LOG_DEBUG ("Got Implicit block Ack Req with seq " << seqNumber); - (*i).second.FillBlockAckBitmap (&blockAck); + bool immediate = true; + AgreementsI it = m_bAckAgreements.find (std::make_pair (originator, tid)); + blockAck.SetStartingSequence (seqNumber); + blockAck.SetTidInfo (tid); + immediate = (*it).second.first.IsImmediateBlockAck (); + blockAck.SetType (COMPRESSED_BLOCK_ACK); + NS_LOG_DEBUG ("Got Implicit block Ack Req with seq " << seqNumber); + (*i).second.FillBlockAckBitmap (&blockAck); - SendBlockAckResponse (&blockAck, originator, immediate, duration, blockAckReqTxVector.GetMode (), rxSnr); + SendBlockAckResponse (&blockAck, originator, immediate, duration, blockAckReqTxVector.GetMode (), rxSnr); + } + else + { + NS_LOG_DEBUG ("Skip block ack response!"); + } } void