wifi: AP EMLSR Manager decides when AP MLD considers EMLSR client switching to listening mode

This commit is contained in:
Stefano Avallone
2024-01-19 17:31:07 +01:00
parent b14ce3b2c0
commit fe2e24f0e6
4 changed files with 39 additions and 4 deletions

View File

@@ -21,13 +21,16 @@
#define AP_EMLSR_MANAGER_H
#include "ns3/object.h"
#include "ns3/wifi-phy-band.h"
namespace ns3
{
class ApWifiMac;
class EhtFrameExchangeManager;
class Time;
class WifiPsdu;
class WifiTxVector;
/**
* \ingroup wifi
@@ -69,6 +72,19 @@ class ApEmlsrManager : public Object
*/
virtual void NotifyPsduRxError(uint8_t linkId, Ptr<const WifiPsdu> psdu);
/**
* This method is intended to be called when the AP MLD starts transmitting an SU frame that
* is not addressed to EMLSR clients that were previously involved in the ongoing DL TXOP.
*
* \param psdu the PSDU being transmitted
* \param txVector the TXVECTOR used to transmit the PSDU
* \param band the PHY band in which the PSDU is being transmitted
* \return the delay after which the AP MLD starts the transition delay for the EMLSR client
*/
virtual Time GetDelayOnTxPsduNotForEmlsr(Ptr<const WifiPsdu> psdu,
const WifiTxVector& txVector,
WifiPhyBand band) = 0;
protected:
void DoDispose() override;

View File

@@ -20,6 +20,8 @@
#include "default-ap-emlsr-manager.h"
#include "ns3/log.h"
#include "ns3/wifi-phy.h"
#include "ns3/wifi-psdu.h"
namespace ns3
{
@@ -48,4 +50,14 @@ DefaultApEmlsrManager::~DefaultApEmlsrManager()
NS_LOG_FUNCTION_NOARGS();
}
Time
DefaultApEmlsrManager::GetDelayOnTxPsduNotForEmlsr(Ptr<const WifiPsdu> psdu,
const WifiTxVector& txVector,
WifiPhyBand band)
{
NS_LOG_FUNCTION(this << psdu << txVector << band);
// EMLSR clients switch back to listening operation at the end of the PPDU
return WifiPhy::CalculateTxDuration(psdu, txVector, band);
}
} // namespace ns3

View File

@@ -41,6 +41,10 @@ class DefaultApEmlsrManager : public ApEmlsrManager
DefaultApEmlsrManager();
~DefaultApEmlsrManager() override;
Time GetDelayOnTxPsduNotForEmlsr(Ptr<const WifiPsdu> psdu,
const WifiTxVector& txVector,
WifiPhyBand band) override;
};
} // namespace ns3

View File

@@ -428,10 +428,13 @@ EhtFrameExchangeManager::ForwardPsduDown(Ptr<const WifiPsdu> psdu, WifiTxVector&
HeFrameExchangeManager::ForwardPsduDown(psdu, txVector);
UpdateTxopEndOnTxStart(txDuration, psdu->GetDuration());
if (m_apMac)
if (m_apMac && m_apMac->GetApEmlsrManager())
{
// check if the EMLSR clients shall switch back to listening operation at the end of this
// PPDU
auto delay = m_apMac->GetApEmlsrManager()->GetDelayOnTxPsduNotForEmlsr(psdu,
txVector,
m_phy->GetPhyBand());
// check if the EMLSR clients shall switch back to listening operation
for (auto clientIt = m_protectedStas.begin(); clientIt != m_protectedStas.end();)
{
auto aid = GetWifiRemoteStationManager()->GetAssociationId(*clientIt);
@@ -439,7 +442,7 @@ EhtFrameExchangeManager::ForwardPsduDown(Ptr<const WifiPsdu> psdu, WifiTxVector&
if (GetWifiRemoteStationManager()->GetEmlsrEnabled(*clientIt) &&
GetEmlsrSwitchToListening(psdu, aid, *clientIt))
{
EmlsrSwitchToListening(*clientIt, txDuration);
EmlsrSwitchToListening(*clientIt, delay);
// this client is no longer involved in the current TXOP
clientIt = m_protectedStas.erase(clientIt);
}