wifi: Advanced AP EMLSR Manager may assume clients switch to listening mode after MAC header RX

This commit is contained in:
Stefano Avallone
2024-01-19 22:34:58 +01:00
parent fe2e24f0e6
commit 69aa538451
2 changed files with 37 additions and 3 deletions

View File

@@ -25,6 +25,7 @@
#include "ns3/boolean.h"
#include "ns3/log.h"
#include "ns3/wifi-phy.h"
#include "ns3/wifi-psdu.h"
namespace ns3
{
@@ -47,6 +48,13 @@ AdvancedApEmlsrManager::GetTypeId()
BooleanValue(true),
MakeBooleanAccessor(&AdvancedApEmlsrManager::m_useNotifiedMacHdr),
MakeBooleanChecker())
.AddAttribute("EarlySwitchToListening",
"Whether the AP MLD assumes that an EMLSR client is able to detect at "
"the end of the MAC header that a PSDU is not addressed to it and "
"immediately starts switching to listening mode.",
BooleanValue(false),
MakeBooleanAccessor(&AdvancedApEmlsrManager::m_earlySwitchToListening),
MakeBooleanChecker())
.AddAttribute(
"WaitTransDelayOnPsduRxError",
"If true, the AP MLD waits for a response timeout after a PSDU reception "
@@ -166,4 +174,23 @@ AdvancedApEmlsrManager::NotifyPsduRxError(uint8_t linkId, Ptr<const WifiPsdu> ps
linkIds);
}
Time
AdvancedApEmlsrManager::GetDelayOnTxPsduNotForEmlsr(Ptr<const WifiPsdu> psdu,
const WifiTxVector& txVector,
WifiPhyBand band)
{
NS_LOG_FUNCTION(this << psdu << txVector << band);
if (!m_earlySwitchToListening)
{
return DefaultApEmlsrManager::GetDelayOnTxPsduNotForEmlsr(psdu, txVector, band);
}
// EMLSR clients switch back to listening operation at the end of MAC header RX
auto macHdrSize = (*psdu->begin())->GetHeader().GetSerializedSize() +
((psdu->GetNMpdus() > 1 || psdu->IsSingle()) ? 4 : 0);
// return the duration of the MAC header TX
return DataRate(txVector.GetMode().GetDataRate(txVector)).CalculateBytesTxTime(macHdrSize);
}
} // namespace ns3

View File

@@ -53,6 +53,9 @@ class AdvancedApEmlsrManager : public DefaultApEmlsrManager
void NotifyPsduRxOk(uint8_t linkId, Ptr<const WifiPsdu> psdu) override;
void NotifyPsduRxError(uint8_t linkId, Ptr<const WifiPsdu> psdu) override;
Time GetDelayOnTxPsduNotForEmlsr(Ptr<const WifiPsdu> psdu,
const WifiTxVector& txVector,
WifiPhyBand band) override;
protected:
void DoDispose() override;
@@ -73,9 +76,13 @@ class AdvancedApEmlsrManager : public DefaultApEmlsrManager
private:
std::set<uint8_t>
m_blockedLinksOnMacHdrRx; //!< links that have been blocked upon receiving a MAC header
bool m_useNotifiedMacHdr; //!< whether to use the information about the MAC header of
//!< the MPDU being received (if notified by the PHY)
m_blockedLinksOnMacHdrRx; //!< links that have been blocked upon receiving a MAC header
bool m_useNotifiedMacHdr; //!< whether to use the information about the MAC header of
//!< the MPDU being received (if notified by the PHY)
bool m_earlySwitchToListening; //!< Whether the AP MLD assumes that an EMLSR client is able to
//!< detect at the end of the MAC header that a PSDU is not
//!< addressed to it and immediately starts switching to
//!< listening mode
bool m_waitTransDelayOnPsduRxError; //!< Whether the AP MLD waits for a response timeout after a
//!< PSDU reception error before starting the transition
//!< delay