Base class for EMLSR Operations tests. More...
#include "wifi-emlsr-test.h"
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. More... | |
~EmlsrOperationsTestBase () override=default | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
void | CheckBlockedLink (Ptr< WifiMac > mac, Mac48Address dest, uint8_t linkId, WifiQueueBlockedReason reason, bool blocked, std::string description, bool testUnblockedForOtherReasons=true) |
Check whether QoS data unicast transmissions addressed to the given destination on the given link are blocked or unblocked for the given reason on the given device. More... | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. More... | |
Ptr< PacketSocketClient > | GetApplication (TrafficDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize) const |
virtual void | Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback invoked when a FEM passes PSDUs to the PHY. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
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. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
Protected Attributes | |
Ptr< ApWifiMac > | m_apMac |
AP wifi MAC. More... | |
std::vector< PacketSocketAddress > | m_dlSockets |
packet socket address for DL traffic More... | |
Time | m_duration {0} |
simulation duration More... | |
bool | m_establishBaDl {false} |
whether BA needs to be established (for TID 0) with the AP as originator More... | |
bool | m_establishBaUl {false} |
whether BA needs to be established (for TID 0) with the AP as recipient More... | |
uint16_t | m_lastAid {0} |
AID of last associated station. More... | |
std::set< uint8_t > | m_linksToEnableEmlsrOn |
IDs of the links on which EMLSR mode has to be enabled. More... | |
uint8_t | m_mainPhyId {0} |
ID of the main PHY. More... | |
std::size_t | m_nEmlsrStations {1} |
number of stations to create that activate EMLSR More... | |
std::size_t | m_nNonEmlsrStations {0} |
number of stations to create that do not activate EMLSR More... | |
std::vector< Time > | m_paddingDelay |
Padding Delay advertised by the non-AP MLD. More... | |
std::vector< Ptr< StaWifiMac > > | m_staMacs |
MACs of the non-AP MLDs. More... | |
std::vector< Time > | m_transitionDelay |
Transition Delay advertised by the non-AP MLD. More... | |
Time | m_transitionTimeout {MicroSeconds(128)} |
Transition Timeout advertised by the AP MLD. More... | |
std::vector< FrameInfo > | m_txPsdus |
transmitted PSDUs More... | |
std::vector< PacketSocketAddress > | m_ulSockets |
packet socket address for UL traffic More... | |
Private Member Functions | |
void | SetSsid (uint16_t aid, Mac48Address) |
Set the SSID on the next station that needs to start the association procedure. More... | |
virtual void | StartTraffic () |
Start the generation of traffic (needs to be overridden) More... | |
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 71 of file wifi-emlsr-test.h.
enum EmlsrOperationsTestBase::TrafficDirection : uint8_t |
Enumeration for traffic directions.
Enumerator | |
---|---|
DOWNLINK | |
UPLINK |
Definition at line 83 of file wifi-emlsr-test.h.
EmlsrOperationsTestBase::EmlsrOperationsTestBase | ( | const std::string & | name | ) |
Constructor.
name | The name of the new TestCase created |
Definition at line 102 of file wifi-emlsr-test.cc.
|
overridedefault |
|
protected |
Check whether QoS data unicast transmissions addressed to the given destination on the given link are blocked or unblocked for the given reason on the given device.
mac | the MAC of the given device |
dest | the MAC address of the given destination |
linkId | the ID of the given link |
reason | the reason for blocking transmissions to test |
blocked | whether transmissions are blocked for the given reason |
description | text indicating when this check is performed |
testUnblockedForOtherReasons | whether to test if transmissions are unblocked for all the reasons other than the one provided |
Definition at line 386 of file wifi-emlsr-test.cc.
References ns3::AC_BE, third::mac, NS_TEST_EXPECT_MSG_EQ, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.
Referenced by EmlsrDlTxopTest::CheckBlockAck(), EmlsrDlTxopTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckQosFrames(), and EmlsrUlTxopTest::CheckQosFrames().
|
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 EmlsrLinkSwitchTest, EmlsrUlTxopTest, EmlsrDlTxopTest, and EmlOmnExchangeTest.
Definition at line 153 of file wifi-emlsr-test.cc.
References ns3::SpectrumWifiPhyHelper::AddChannel(), ns3::Config::ConnectWithoutContext(), ns3::NetDeviceContainer::Get(), ns3::WifiNetDevice::GetAddress(), ns3::WifiMac::GetDevice(), ns3::WifiNetDevice::GetIfIndex(), ns3::PacketSocketHelper::Install(), m_apMac, m_dlSockets, m_duration, m_linksToEnableEmlsrOn, m_mainPhyId, m_nEmlsrStations, m_nNonEmlsrStations, m_paddingDelay, m_staMacs, m_transitionDelay, m_transitionTimeout, m_ulSockets, third::mac, ns3::MakeCallback(), third::mobility, NS_ASSERT_MSG, NS_TEST_ASSERT_MSG_NE, ns3::Seconds(), brite-generic-example::server, ns3::WifiPhyHelper::Set(), ns3::Config::SetDefault(), ns3::WifiPhyHelper::SetPcapDataLinkType(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), SetSsid(), third::staDevices, nlohmann::to_string(), ns3::ObjectBase::TraceConnectWithoutContext(), Transmit(), third::wifi, ns3::WIFI_SPECTRUM_2_4_GHZ, ns3::WIFI_SPECTRUM_5_GHZ, ns3::WIFI_SPECTRUM_6_GHZ, ns3::WIFI_STANDARD_80211be, third::wifiApNode, and third::wifiStaNodes.
Referenced by EmlOmnExchangeTest::DoSetup(), EmlsrDlTxopTest::DoSetup(), EmlsrUlTxopTest::DoSetup(), and EmlsrLinkSwitchTest::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 322 of file wifi-emlsr-test.cc.
References brite-generic-example::client, dir, DOWNLINK, m_dlSockets, m_duration, m_ulSockets, ns3::MicroSeconds(), ns3::Now(), pktSize, and ns3::Seconds().
Referenced by EmlsrUlTxopTest::CheckBlockAck(), EmlsrDlTxopTest::CheckQosFrames(), EmlsrUlTxopTest::CheckQosFrames(), EmlsrLinkSwitchTest::CheckQosFrames(), SetSsid(), EmlsrDlTxopTest::StartTraffic(), and EmlsrUlTxopTest::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 339 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(), StartTraffic(), and UPLINK.
Referenced by DoSetup().
|
inlineprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented in EmlsrUlTxopTest, and EmlsrDlTxopTest.
Definition at line 187 of file wifi-emlsr-test.h.
Referenced by SetSsid().
|
protectedvirtual |
Callback invoked when a FEM passes PSDUs to the PHY.
mac | the MAC transmitting the PSDUs |
phyId | the ID of the PHY transmitting the PSDUs |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Reimplemented in EmlsrLinkSwitchTest, EmlsrUlTxopTest, EmlsrDlTxopTest, and EmlOmnExchangeTest.
Definition at line 108 of file wifi-emlsr-test.cc.
References m_txPsdus, third::mac, ns3::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, ns3::PeekPointer(), and ns3::WifiActionHeader::Print().
Referenced by DoSetup(), EmlOmnExchangeTest::Transmit(), EmlsrDlTxopTest::Transmit(), EmlsrUlTxopTest::Transmit(), and EmlsrLinkSwitchTest::Transmit().
AP wifi MAC.
Definition at line 167 of file wifi-emlsr-test.h.
Referenced by EmlsrUlTxopTest::CheckBlockAck(), EmlsrDlTxopTest::CheckBlockAck(), EmlsrUlTxopTest::CheckCtsFrames(), EmlsrDlTxopTest::CheckEmlNotificationFrame(), EmlsrLinkSwitchTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckQosFrames(), EmlsrUlTxopTest::CheckQosFrames(), EmlsrLinkSwitchTest::CheckQosFrames(), DoSetup(), EmlOmnExchangeTest::DoSetup(), EmlsrDlTxopTest::DoSetup(), EmlsrUlTxopTest::DoSetup(), EmlsrLinkSwitchTest::DoSetup(), SetSsid(), EmlsrDlTxopTest::StartTraffic(), EmlsrUlTxopTest::StartTraffic(), and EmlsrLinkSwitchTest::Transmit().
|
protected |
packet socket address for DL traffic
Definition at line 169 of file wifi-emlsr-test.h.
Referenced by DoSetup(), and GetApplication().
|
protected |
simulation duration
Definition at line 172 of file wifi-emlsr-test.h.
Referenced by EmlOmnExchangeTest::EmlOmnExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrLinkSwitchTest::EmlsrLinkSwitchTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), EmlOmnExchangeTest::DoRun(), EmlsrDlTxopTest::DoRun(), EmlsrUlTxopTest::DoRun(), EmlsrLinkSwitchTest::DoRun(), DoSetup(), and GetApplication().
|
protected |
whether BA needs to be established (for TID 0) with the AP as originator
Definition at line 162 of file wifi-emlsr-test.h.
Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrLinkSwitchTest::EmlsrLinkSwitchTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), and SetSsid().
|
protected |
whether BA needs to be established (for TID 0) with the AP as recipient
Definition at line 164 of file wifi-emlsr-test.h.
Referenced by EmlsrUlTxopTest::EmlsrUlTxopTest(), and SetSsid().
|
protected |
AID of last associated station.
Definition at line 171 of file wifi-emlsr-test.h.
Referenced by EmlsrDlTxopTest::EnableEmlsrMode(), SetSsid(), and EmlsrDlTxopTest::StartTraffic().
|
protected |
IDs of the links on which EMLSR mode has to be enabled.
Definition at line 152 of file wifi-emlsr-test.h.
Referenced by EmlOmnExchangeTest::EmlOmnExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrLinkSwitchTest::EmlsrLinkSwitchTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), EmlOmnExchangeTest::CheckEmlNotification(), EmlOmnExchangeTest::CheckEmlsrLinks(), and DoSetup().
|
protected |
ID of the main PHY.
Definition at line 151 of file wifi-emlsr-test.h.
Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrLinkSwitchTest::EmlsrLinkSwitchTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), EmlsrUlTxopTest::BackoffGenerated(), EmlsrUlTxopTest::CheckBlockAck(), EmlsrUlTxopTest::CheckCtsFrames(), EmlOmnExchangeTest::CheckEmlNotification(), EmlsrLinkSwitchTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrUlTxopTest::CheckQosFrames(), EmlsrDlTxopTest::CheckResults(), EmlsrUlTxopTest::CheckResults(), EmlsrUlTxopTest::CheckRtsFrames(), DoSetup(), EmlsrUlTxopTest::DoSetup(), EmlsrUlTxopTest::StartTraffic(), EmlOmnExchangeTest::Transmit(), EmlsrDlTxopTest::Transmit(), EmlsrUlTxopTest::Transmit(), and EmlsrLinkSwitchTest::Transmit().
|
protected |
number of stations to create that activate EMLSR
Definition at line 154 of file wifi-emlsr-test.h.
Referenced by EmlOmnExchangeTest::EmlOmnExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrLinkSwitchTest::EmlsrLinkSwitchTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), 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 155 of file wifi-emlsr-test.h.
Referenced by EmlOmnExchangeTest::EmlOmnExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrLinkSwitchTest::EmlsrLinkSwitchTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckResults(), DoSetup(), EmlsrDlTxopTest::DoSetup(), SetSsid(), and EmlsrDlTxopTest::StartTraffic().
|
protected |
Padding Delay advertised by the non-AP MLD.
Definition at line 158 of file wifi-emlsr-test.h.
Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocReq(), EmlsrDlTxopTest::CheckInitialControlFrame(), and DoSetup().
|
protected |
MACs of the non-AP MLDs.
Definition at line 168 of file wifi-emlsr-test.h.
Referenced by EmlsrUlTxopTest::BackoffGenerated(), EmlsrUlTxopTest::CheckBlockAck(), EmlsrDlTxopTest::CheckBlockAck(), EmlsrUlTxopTest::CheckCtsFrames(), EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocResp(), EmlOmnExchangeTest::CheckEmlNotification(), EmlsrDlTxopTest::CheckEmlNotificationFrame(), EmlOmnExchangeTest::CheckEmlsrLinks(), EmlsrLinkSwitchTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckQosFrames(), EmlsrUlTxopTest::CheckQosFrames(), EmlsrLinkSwitchTest::CheckQosFrames(), EmlsrDlTxopTest::CheckResults(), EmlsrUlTxopTest::CheckResults(), EmlsrUlTxopTest::CheckRtsFrames(), DoSetup(), EmlOmnExchangeTest::DoSetup(), EmlsrUlTxopTest::DoSetup(), EmlsrLinkSwitchTest::DoSetup(), EmlsrDlTxopTest::EnableEmlsrMode(), SetSsid(), EmlsrDlTxopTest::StartTraffic(), EmlsrUlTxopTest::StartTraffic(), EmlOmnExchangeTest::Transmit(), EmlsrDlTxopTest::Transmit(), and EmlsrLinkSwitchTest::Transmit().
|
protected |
Transition Delay advertised by the non-AP MLD.
Definition at line 160 of file wifi-emlsr-test.h.
Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrLinkSwitchTest::EmlsrLinkSwitchTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), EmlsrDlTxopTest::CheckBlockAck(), EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocReq(), EmlsrDlTxopTest::CheckQosFrames(), and DoSetup().
|
protected |
Transition Timeout advertised by the AP MLD.
Definition at line 157 of file wifi-emlsr-test.h.
Referenced by EmlOmnExchangeTest::EmlOmnExchangeTest(), EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocResp(), DoSetup(), and EmlOmnExchangeTest::TxOk().
|
protected |
transmitted PSDUs
Definition at line 166 of file wifi-emlsr-test.h.
Referenced by EmlsrDlTxopTest::CheckResults(), EmlsrUlTxopTest::CheckResults(), EmlsrLinkSwitchTest::CheckResults(), Transmit(), EmlOmnExchangeTest::Transmit(), EmlsrDlTxopTest::Transmit(), EmlsrUlTxopTest::Transmit(), and EmlsrLinkSwitchTest::Transmit().
|
protected |
packet socket address for UL traffic
Definition at line 170 of file wifi-emlsr-test.h.
Referenced by DoSetup(), and GetApplication().