wifi: Install an EMLSR Manager on non-AP MLD (if EMLSR is activated)
This commit is contained in:
committed by
Stefano Avallone
parent
750d8f242f
commit
bea2f385a4
@@ -20,6 +20,8 @@
|
||||
#include "wifi-mac-helper.h"
|
||||
|
||||
#include "ns3/boolean.h"
|
||||
#include "ns3/eht-configuration.h"
|
||||
#include "ns3/emlsr-manager.h"
|
||||
#include "ns3/frame-exchange-manager.h"
|
||||
#include "ns3/multi-user-scheduler.h"
|
||||
#include "ns3/wifi-ack-manager.h"
|
||||
@@ -40,6 +42,7 @@ WifiMacHelper::WifiMacHelper()
|
||||
m_queueScheduler.SetTypeId("ns3::FcfsWifiQueueScheduler");
|
||||
m_protectionManager.SetTypeId("ns3::WifiDefaultProtectionManager");
|
||||
m_ackManager.SetTypeId("ns3::WifiDefaultAckManager");
|
||||
m_emlsrManager.SetTypeId("ns3::DefaultEmlsrManager");
|
||||
}
|
||||
|
||||
WifiMacHelper::~WifiMacHelper()
|
||||
@@ -107,12 +110,23 @@ WifiMacHelper::Create(Ptr<WifiNetDevice> device, WifiStandard standard) const
|
||||
}
|
||||
|
||||
// create and install the Association Manager if this is a STA
|
||||
if (auto staMac = DynamicCast<StaWifiMac>(mac); staMac != nullptr)
|
||||
auto staMac = DynamicCast<StaWifiMac>(mac);
|
||||
if (staMac)
|
||||
{
|
||||
Ptr<WifiAssocManager> assocManager = m_assocManager.Create<WifiAssocManager>();
|
||||
staMac->SetAssocManager(assocManager);
|
||||
}
|
||||
|
||||
// create and install the EMLSR Manager if this is an EHT non-AP MLD with EMLSR activated
|
||||
if (BooleanValue emlsrActivated;
|
||||
standard >= WIFI_STANDARD_80211be && staMac && staMac->GetNLinks() > 1 &&
|
||||
device->GetEhtConfiguration()->GetAttributeFailSafe("EmlsrActivated", emlsrActivated) &&
|
||||
emlsrActivated.Get())
|
||||
{
|
||||
auto emlsrManager = m_emlsrManager.Create<EmlsrManager>();
|
||||
staMac->SetEmlsrManager(emlsrManager);
|
||||
}
|
||||
|
||||
return mac;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,16 @@ class WifiMacHelper
|
||||
template <typename... Args>
|
||||
void SetMultiUserScheduler(std::string type, Args&&... args);
|
||||
|
||||
/**
|
||||
* Helper function used to set the EMLSR Manager that can be installed on an EHT non-AP MLD.
|
||||
*
|
||||
* \tparam Args \deduced Template type parameter pack for the sequence of name-value pairs.
|
||||
* \param type the type of EMLSR Manager
|
||||
* \param args A sequence of name-value pairs of the attributes to set.
|
||||
*/
|
||||
template <typename... Args>
|
||||
void SetEmlsrManager(std::string type, Args&&... args);
|
||||
|
||||
/**
|
||||
* \param device the device within which the MAC object will reside
|
||||
* \param standard the standard to configure during installation
|
||||
@@ -135,6 +145,7 @@ class WifiMacHelper
|
||||
ObjectFactory m_protectionManager; ///< Factory to create a protection manager
|
||||
ObjectFactory m_ackManager; ///< Factory to create an acknowledgment manager
|
||||
ObjectFactory m_muScheduler; ///< Multi-user Scheduler object factory
|
||||
ObjectFactory m_emlsrManager; ///< EMLSR Manager object factory
|
||||
};
|
||||
|
||||
} // namespace ns3
|
||||
@@ -194,6 +205,14 @@ WifiMacHelper::SetMultiUserScheduler(std::string type, Args&&... args)
|
||||
m_muScheduler.Set(args...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void
|
||||
WifiMacHelper::SetEmlsrManager(std::string type, Args&&... args)
|
||||
{
|
||||
m_emlsrManager.SetTypeId(type);
|
||||
m_emlsrManager.Set(args...);
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* WIFI_MAC_HELPER_H */
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "wifi-net-device.h"
|
||||
#include "wifi-phy.h"
|
||||
|
||||
#include "ns3/emlsr-manager.h"
|
||||
#include "ns3/he-configuration.h"
|
||||
#include "ns3/ht-configuration.h"
|
||||
#include "ns3/log.h"
|
||||
@@ -153,6 +154,11 @@ StaWifiMac::DoDispose()
|
||||
m_assocManager->Dispose();
|
||||
}
|
||||
m_assocManager = nullptr;
|
||||
if (m_emlsrManager)
|
||||
{
|
||||
m_emlsrManager->Dispose();
|
||||
}
|
||||
m_emlsrManager = nullptr;
|
||||
WifiMac::DoDispose();
|
||||
}
|
||||
|
||||
@@ -194,6 +200,20 @@ StaWifiMac::SetAssocManager(Ptr<WifiAssocManager> assocManager)
|
||||
m_assocManager->SetStaWifiMac(this);
|
||||
}
|
||||
|
||||
void
|
||||
StaWifiMac::SetEmlsrManager(Ptr<EmlsrManager> emlsrManager)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << emlsrManager);
|
||||
m_emlsrManager = emlsrManager;
|
||||
m_emlsrManager->SetWifiMac(this);
|
||||
}
|
||||
|
||||
Ptr<EmlsrManager>
|
||||
StaWifiMac::GetEmlsrManager() const
|
||||
{
|
||||
return m_emlsrManager;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
StaWifiMac::GetAssociationId() const
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@ class SupportedRates;
|
||||
class CapabilityInformation;
|
||||
class RandomVariableStream;
|
||||
class WifiAssocManager;
|
||||
class EmlsrManager;
|
||||
|
||||
/**
|
||||
* \ingroup wifi
|
||||
@@ -190,6 +191,18 @@ class StaWifiMac : public WifiMac
|
||||
*/
|
||||
void SetAssocManager(Ptr<WifiAssocManager> assocManager);
|
||||
|
||||
/**
|
||||
* Set the EMLSR Manager.
|
||||
*
|
||||
* \param emlsrManager the EMLSR Manager
|
||||
*/
|
||||
void SetEmlsrManager(Ptr<EmlsrManager> emlsrManager);
|
||||
|
||||
/**
|
||||
* \return the EMLSR Manager
|
||||
*/
|
||||
Ptr<EmlsrManager> GetEmlsrManager() const;
|
||||
|
||||
/**
|
||||
* Enqueue a probe request packet for transmission on the given link.
|
||||
*
|
||||
@@ -492,6 +505,7 @@ class StaWifiMac : public WifiMac
|
||||
MacState m_state; ///< MAC state
|
||||
uint16_t m_aid; ///< Association AID
|
||||
Ptr<WifiAssocManager> m_assocManager; ///< Association Manager
|
||||
Ptr<EmlsrManager> m_emlsrManager; ///< EMLSR Manager
|
||||
Time m_waitBeaconTimeout; ///< wait beacon timeout
|
||||
Time m_probeRequestTimeout; ///< probe request timeout
|
||||
Time m_assocRequestTimeout; ///< association request timeout
|
||||
|
||||
Reference in New Issue
Block a user