wifi: Clear TXOP holder when NAV is reset or counts down to zero
This commit is contained in:
@@ -1465,7 +1465,7 @@ HeFrameExchangeManager::SendQosNullFramesInTbPpdu(const CtrlTriggerHeader& trigg
|
||||
if (trigger.GetCsRequired() && hdr.GetAddr2() != m_txopHolder && m_navEnd > Simulator::Now())
|
||||
{
|
||||
NS_LOG_DEBUG("Carrier Sensing required and channel busy (TA="
|
||||
<< hdr.GetAddr2() << ", TxopHolder=" << m_txopHolder
|
||||
<< hdr.GetAddr2() << ", TxopHolder=" << (m_txopHolder ? *m_txopHolder : "")
|
||||
<< ", NAV end=" << m_navEnd.As(Time::S) << "), do nothing");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -664,6 +664,13 @@ QosFrameExchangeManager::PreProcessFrame(Ptr<const WifiPsdu> psdu, const WifiTxV
|
||||
}
|
||||
}
|
||||
|
||||
// before updating the NAV, check if the NAV counted down to zero. In such a
|
||||
// case, clear the saved TXOP holder address.
|
||||
if (m_navEnd <= Simulator::Now())
|
||||
{
|
||||
m_txopHolder.reset();
|
||||
}
|
||||
|
||||
FrameExchangeManager::PreProcessFrame(psdu, txVector);
|
||||
}
|
||||
|
||||
@@ -698,6 +705,14 @@ QosFrameExchangeManager::SetTxopHolder(Ptr<const WifiPsdu> psdu, const WifiTxVec
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
QosFrameExchangeManager::NavResetTimeout()
|
||||
{
|
||||
NS_LOG_FUNCTION(this);
|
||||
m_txopHolder.reset();
|
||||
FrameExchangeManager::NavResetTimeout();
|
||||
}
|
||||
|
||||
void
|
||||
QosFrameExchangeManager::ReceiveMpdu(Ptr<const WifiMpdu> mpdu,
|
||||
RxSignalInfo rxSignalInfo,
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "frame-exchange-manager.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
@@ -111,6 +113,7 @@ class QosFrameExchangeManager : public FrameExchangeManager
|
||||
bool inAmpdu) override;
|
||||
void PreProcessFrame(Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector) override;
|
||||
void PostProcessFrame(Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector) override;
|
||||
void NavResetTimeout() override;
|
||||
Time GetFrameDurationId(const WifiMacHeader& header,
|
||||
uint32_t size,
|
||||
const WifiTxParameters& txParams,
|
||||
@@ -174,10 +177,10 @@ class QosFrameExchangeManager : public FrameExchangeManager
|
||||
*/
|
||||
virtual void SetTxopHolder(Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector);
|
||||
|
||||
Ptr<QosTxop> m_edca; //!< the EDCAF that gained channel access
|
||||
Mac48Address m_txopHolder; //!< MAC address of the TXOP holder
|
||||
bool m_setQosQueueSize; /**< whether to set the Queue Size subfield of the
|
||||
QoS Control field of QoS data frames */
|
||||
Ptr<QosTxop> m_edca; //!< the EDCAF that gained channel access
|
||||
std::optional<Mac48Address> m_txopHolder; //!< MAC address of the TXOP holder
|
||||
bool m_setQosQueueSize; /**< whether to set the Queue Size subfield of the
|
||||
QoS Control field of QoS data frames */
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user