Base class for EMLSR Operations tests. More...
Classes | |
struct | FrameInfo |
Information about transmitted frames. More... | |
Public Types | |
enum | TrafficDirection : uint8_t { DOWNLINK = 0 , UPLINK } |
Enumeration for traffic directions. More... | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Public Member Functions | |
EmlsrOperationsTestBase (const std::string &name) | |
Constructor. | |
~EmlsrOperationsTestBase () override=default | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
Ptr< PacketSocketClient > | GetApplication (TrafficDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize) const |
virtual void | Transmit (uint8_t linkId, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback invoked when a FEM passes PSDUs to the PHY. | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () const |
Get the parent of this TestCase. | |
bool | IsStatusFailure () const |
Check if any tests failed. | |
bool | IsStatusSuccess () const |
Check if all tests passed. | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. | |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
Log the failure of this TestCase. | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. | |
Protected Attributes | |
Ptr< ApWifiMac > | m_apMac |
AP wifi MAC. | |
std::vector< PacketSocketAddress > | m_dlSockets |
packet socket address for DL traffic | |
Time | m_duration {0} |
simulation duration | |
bool | m_establishBaDl {false} |
whether BA needs to be established (for TID 0) with the AP as originator | |
bool | m_establishBaUl {false} |
whether BA needs to be established (for TID 0) with the AP as recipient | |
uint16_t | m_lastAid {0} |
AID of last associated station. | |
std::set< uint8_t > | m_linksToEnableEmlsrOn |
IDs of the links on which EMLSR mode has to be enabled. | |
std::size_t | m_nEmlsrStations {1} |
number of stations to create that activate EMLSR | |
std::size_t | m_nNonEmlsrStations {0} |
number of stations to create that do not activate EMLSR | |
std::vector< Time > | m_paddingDelay |
Padding Delay advertised by the non-AP MLD. | |
std::vector< Ptr< StaWifiMac > > | m_staMacs |
MACs of the non-AP MLDs. | |
std::vector< Time > | m_transitionDelay |
Transition Delay advertised by the non-AP MLD. | |
Time | m_transitionTimeout {MicroSeconds(128)} |
Transition Timeout advertised by the AP MLD. | |
std::vector< FrameInfo > | m_txPsdus |
transmitted PSDUs | |
std::vector< PacketSocketAddress > | m_ulSockets |
packet socket address for UL traffic | |
Private Member Functions | |
void | SetSsid (uint16_t aid, Mac48Address) |
Set the SSID on the next station that needs to start the association procedure. | |
virtual void | StartTraffic () |
Start the generation of traffic (needs to be overridden) | |
Base class for EMLSR Operations tests.
This base class setups and configures one AP MLD, a variable number of non-AP MLDs with EMLSR activated and a variable number of non-AP MLD with EMLSR deactivated. Every MLD has three links, each operating on a distinct PHY band (2.4 GHz, 5 GHz and 6 GHz). Therefore, it is expected that three links are setup by the non-AP MLD(s). The values for the Padding Delay, the Transition Delay and the Transition Timeout are provided as argument to the constructor of this class, along with the IDs of the links on which EMLSR mode must be enabled for the non-AP MLDs (this information is used to set the EmlsrLinkSet attribute of the DefaultEmlsrManager installed on the non-AP MLDs).
Definition at line 149 of file wifi-emlsr-test.cc.
enum EmlsrOperationsTestBase::TrafficDirection : uint8_t |
Enumeration for traffic directions.
Enumerator | |
---|---|
DOWNLINK | |
UPLINK |
Definition at line 161 of file wifi-emlsr-test.cc.
EmlsrOperationsTestBase::EmlsrOperationsTestBase | ( | const std::string & | name | ) |
Constructor.
name | The name of the new TestCase created |
Definition at line 247 of file wifi-emlsr-test.cc.
|
overridedefault |
|
overrideprotectedvirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.
Reimplemented from ns3::TestCase.
Reimplemented in EmlNotificationExchangeTest, and EmlsrDlTxopTest.
Definition at line 295 of file wifi-emlsr-test.cc.
References ns3::SpectrumWifiPhyHelper::AddChannel(), ns3::NodeList::Begin(), ns3::Config::Connect(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::NodeList::End(), ns3::NetDeviceContainer::Get(), ns3::WifiNetDevice::GetAddress(), ns3::WifiMac::GetDevice(), ns3::WifiNetDevice::GetIfIndex(), ns3::WifiMac::GetNLinks(), ns3::PacketSocketHelper::Install(), m_apMac, m_dlSockets, m_duration, m_linksToEnableEmlsrOn, m_nEmlsrStations, m_nNonEmlsrStations, m_paddingDelay, m_staMacs, m_transitionDelay, m_transitionTimeout, m_ulSockets, ns3::MakeCallback(), NS_ASSERT_MSG, NS_TEST_ASSERT_MSG_NE, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::WifiPhyHelper::Set(), ns3::WifiPhyHelper::SetPcapDataLinkType(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), SetSsid(), ns3::ObjectBase::TraceConnectWithoutContext(), Transmit(), ns3::WIFI_SPECTRUM_2_4_GHZ, ns3::WIFI_SPECTRUM_5_GHZ, ns3::WIFI_SPECTRUM_6_GHZ, and ns3::WIFI_STANDARD_80211be.
Referenced by EmlNotificationExchangeTest::DoSetup(), and EmlsrDlTxopTest::DoSetup().
|
protected |
dir | the traffic direction (downlink/uplink) |
staId | the index (starting at 0) of the non-AP MLD generating/receiving packets |
count | the number of packets to generate |
pktSize | the size of the packets to generate |
Definition at line 449 of file wifi-emlsr-test.cc.
References dir, DOWNLINK, m_dlSockets, m_duration, m_ulSockets, ns3::MicroSeconds(), ns3::Simulator::Now(), pktSize, and ns3::Seconds().
Referenced by EmlsrDlTxopTest::CheckQosFrames(), SetSsid(), and EmlsrDlTxopTest::StartTraffic().
|
private |
Set the SSID on the next station that needs to start the association procedure.
This method is connected to the ApWifiMac's AssociatedSta trace source. Start generating traffic (if needed) when all stations are associated.
aid | the AID assigned to the previous associated STA |
Definition at line 466 of file wifi-emlsr-test.cc.
References DOWNLINK, GetApplication(), ns3::WifiMac::GetDevice(), m_apMac, m_establishBaDl, m_establishBaUl, m_lastAid, m_nEmlsrStations, m_nNonEmlsrStations, m_staMacs, ns3::MilliSeconds(), ns3::Simulator::Schedule(), StartTraffic(), and UPLINK.
Referenced by DoSetup().
|
inlineprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented in EmlsrDlTxopTest.
Definition at line 242 of file wifi-emlsr-test.cc.
Referenced by SetSsid().
|
protectedvirtual |
Callback invoked when a FEM passes PSDUs to the PHY.
linkId | the ID of the link transmitting the PSDUs |
context | the context |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Reimplemented in EmlNotificationExchangeTest, and EmlsrDlTxopTest.
Definition at line 253 of file wifi-emlsr-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::WifiPhy::GetPhyBand(), ns3::WifiMac::GetWifiPhy(), m_apMac, m_txPsdus, ns3::Time::MS, ns3::Simulator::Now(), NS_LOG_INFO, ns3::PeekPointer(), and ns3::WifiActionHeader::Print().
Referenced by DoSetup(), EmlNotificationExchangeTest::Transmit(), and EmlsrDlTxopTest::Transmit().
AP wifi MAC.
Definition at line 222 of file wifi-emlsr-test.cc.
Referenced by EmlsrDlTxopTest::CheckBlockAck(), EmlsrDlTxopTest::CheckEmlNotificationFrame(), EmlsrDlTxopTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckQosFrames(), DoSetup(), EmlNotificationExchangeTest::DoSetup(), EmlsrDlTxopTest::DoSetup(), SetSsid(), EmlsrDlTxopTest::StartTraffic(), and Transmit().
|
protected |
packet socket address for DL traffic
Definition at line 224 of file wifi-emlsr-test.cc.
Referenced by DoSetup(), and GetApplication().
|
protected |
simulation duration
Definition at line 227 of file wifi-emlsr-test.cc.
Referenced by EmlNotificationExchangeTest::EmlNotificationExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlNotificationExchangeTest::DoRun(), EmlsrDlTxopTest::DoRun(), DoSetup(), and GetApplication().
|
protected |
whether BA needs to be established (for TID 0) with the AP as originator
Definition at line 217 of file wifi-emlsr-test.cc.
Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), and SetSsid().
|
protected |
whether BA needs to be established (for TID 0) with the AP as recipient
Definition at line 219 of file wifi-emlsr-test.cc.
Referenced by SetSsid().
|
protected |
AID of last associated station.
Definition at line 226 of file wifi-emlsr-test.cc.
Referenced by EmlsrDlTxopTest::EnableEmlsrMode(), SetSsid(), and EmlsrDlTxopTest::StartTraffic().
|
protected |
IDs of the links on which EMLSR mode has to be enabled.
Definition at line 207 of file wifi-emlsr-test.cc.
Referenced by EmlNotificationExchangeTest::EmlNotificationExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlNotificationExchangeTest::CheckEmlNotification(), EmlNotificationExchangeTest::CheckEmlsrLinks(), and DoSetup().
|
protected |
number of stations to create that activate EMLSR
Definition at line 209 of file wifi-emlsr-test.cc.
Referenced by EmlNotificationExchangeTest::EmlNotificationExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrDlTxopTest::CheckBlockAck(), EmlsrDlTxopTest::CheckEmlNotificationFrame(), EmlsrDlTxopTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckQosFrames(), EmlsrDlTxopTest::CheckResults(), DoSetup(), EmlsrDlTxopTest::DoSetup(), EmlsrDlTxopTest::EnableEmlsrMode(), SetSsid(), EmlsrDlTxopTest::StartTraffic(), and EmlsrDlTxopTest::Transmit().
|
protected |
number of stations to create that do not activate EMLSR
Definition at line 210 of file wifi-emlsr-test.cc.
Referenced by EmlNotificationExchangeTest::EmlNotificationExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckResults(), DoSetup(), EmlsrDlTxopTest::DoSetup(), SetSsid(), and EmlsrDlTxopTest::StartTraffic().
|
protected |
Padding Delay advertised by the non-AP MLD.
Definition at line 213 of file wifi-emlsr-test.cc.
Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlNotificationExchangeTest::CheckEmlCapabilitiesInAssocReq(), EmlsrDlTxopTest::CheckInitialControlFrame(), and DoSetup().
|
protected |
MACs of the non-AP MLDs.
Definition at line 223 of file wifi-emlsr-test.cc.
Referenced by EmlsrDlTxopTest::CheckBlockAck(), EmlNotificationExchangeTest::CheckEmlCapabilitiesInAssocResp(), EmlNotificationExchangeTest::CheckEmlNotification(), EmlsrDlTxopTest::CheckEmlNotificationFrame(), EmlNotificationExchangeTest::CheckEmlsrLinks(), EmlsrDlTxopTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckQosFrames(), EmlsrDlTxopTest::CheckResults(), DoSetup(), EmlNotificationExchangeTest::DoSetup(), EmlsrDlTxopTest::EnableEmlsrMode(), SetSsid(), EmlsrDlTxopTest::StartTraffic(), EmlNotificationExchangeTest::Transmit(), and EmlsrDlTxopTest::Transmit().
|
protected |
Transition Delay advertised by the non-AP MLD.
Definition at line 215 of file wifi-emlsr-test.cc.
Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrDlTxopTest::CheckBlockAck(), EmlNotificationExchangeTest::CheckEmlCapabilitiesInAssocReq(), EmlsrDlTxopTest::CheckQosFrames(), and DoSetup().
|
protected |
Transition Timeout advertised by the AP MLD.
Definition at line 212 of file wifi-emlsr-test.cc.
Referenced by EmlNotificationExchangeTest::EmlNotificationExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlNotificationExchangeTest::CheckEmlCapabilitiesInAssocResp(), DoSetup(), and EmlNotificationExchangeTest::TxOk().
|
protected |
transmitted PSDUs
Definition at line 221 of file wifi-emlsr-test.cc.
Referenced by EmlsrDlTxopTest::CheckResults(), and Transmit().
|
protected |
packet socket address for UL traffic
Definition at line 225 of file wifi-emlsr-test.cc.
Referenced by DoSetup(), and GetApplication().