Check NAV and CCA in the last PIFS test. More...
#include "wifi-emlsr-link-switch-test.h"
Classes | |
struct | Events |
Actions and checks to perform upon the transmission of each frame. More... | |
Public Types | |
enum | TestScenario : uint8_t { BACKOFF_END_BEFORE_SWITCH_END = 0 , LESS_THAN_PIFS_UNTIL_BACKOFF_END , MORE_THAN_PIFS_UNTIL_BACKOFF_END , COUNT } |
Enumeration indicating the tested scenario. More... | |
![]() | |
enum | TrafficDirection : uint8_t { DOWNLINK = 0 , UPLINK } |
Enumeration for traffic directions. More... | |
![]() | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Public Member Functions | |
EmlsrCheckNavAndCcaLastPifsTest () | |
Constructor. | |
![]() | |
EmlsrOperationsTestBase (const std::string &name) | |
Constructor. | |
~EmlsrOperationsTestBase () override=default | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
void | RunOne () |
Runs a test case and invokes itself for the next test case. | |
void | Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) override |
Callback invoked when a FEM passes PSDUs to the PHY. | |
![]() | |
void | CheckAuxPhysSleepMode (Ptr< StaWifiMac > staMac, bool sleep) |
Check whether aux PHYs of the given device are in sleep mode/awake. | |
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. | |
void | CheckMainPhyTraceInfo (std::size_t index, std::string_view reason, const std::optional< uint8_t > &fromLinkId, uint8_t toLinkId, bool checkFromLinkId=true, bool checkToLinkId=true) |
Check information provided by the EMLSR Manager MainPhySwitch trace. | |
void | CheckMsdTimerRunning (Ptr< StaWifiMac > staMac, uint8_t linkId, bool isRunning, const std::string &msg) |
Check whether the MediumSyncDelay timer is running on the given link of the given device. | |
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, uint8_t priority=0) const |
virtual void | MainPhySwitchInfoCallback (std::size_t index, const EmlsrMainPhySwitchTrace &info) |
Callback connected to the EMLSR Manager MainPhySwitch trace source. | |
![]() | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, Duration duration=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. | |
Private Member Functions | |
void | StartTraffic () override |
Start the generation of traffic (needs to be overridden) | |
Private Attributes | |
const MHz_u | m_auxPhyWidth {20} |
aux PHY channel width | |
std::list< Events > | m_events |
list of events for a test run | |
Time | m_expectedTxStart |
expected start time for frame transmission | |
MHz_u | m_expectedWidth |
expected channel width for frame transmission | |
const uint8_t | m_linkIdForTid0 {2} |
ID of the link on which TID 0 is mapped. | |
const MHz_u | m_mainPhyWidth {40} |
main PHY channel width | |
const uint8_t | m_nSlotsLeft {4} |
value for the CAM NSlotsLeft attribute | |
std::size_t | m_processedEvents {0} |
number of processed events | |
bool | m_setupDone {false} |
whether association, BA, ... have been done | |
std::size_t | m_testIndex {0} |
index to iterate over test scenarios | |
Additional Inherited Members | |
![]() | |
static constexpr auto | QUICK = Duration::QUICK |
Deprecated test duration simple enums. | |
static constexpr auto | EXTENSIVE = Duration::EXTENSIVE |
static constexpr auto | TAKES_FOREVER = Duration::TAKES_FOREVER |
![]() | |
Ptr< ApWifiMac > | m_apMac |
AP wifi MAC. | |
std::array< std::string, 3 > | m_channelsStr |
array of strings defining the channels for the MLD links | |
std::vector< PacketSocketAddress > | m_dlSockets |
packet socket address for DL traffic | |
Time | m_duration {0} |
simulation duration | |
std::vector< uint8_t > | m_establishBaDl {} |
the TIDs for which BA needs to be established with the AP as originator | |
std::vector< uint8_t > | m_establishBaUl {} |
the TIDs for which BA needs to be established with the AP as recipient | |
const std::array< FrequencyRange, 3 > | m_freqRanges |
array of frequency ranges for MLD links | |
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. | |
uint8_t | m_mainPhyId {0} |
ID of the main PHY. | |
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::size_t | m_nPhysPerEmlsrDevice {3} |
number of PHYs per EMLSR client | |
std::vector< Time > | m_paddingDelay |
Padding Delay advertised by the non-AP MLD. | |
bool | m_putAuxPhyToSleep {false} |
whether aux PHYs are put to sleep during DL/UL TXOPs | |
uint64_t | m_rngRun {1} |
RNG run value. | |
uint32_t | m_rngSeed {1} |
RNG seed value. | |
std::vector< Ptr< StaWifiMac > > | m_staMacs |
MACs of the non-AP MLDs. | |
uint16_t | m_startAid {1} |
first AID to allocate to stations | |
int64_t | m_streamNo {5} |
RNG stream number. | |
std::map< std::size_t, std::shared_ptr< EmlsrMainPhySwitchTrace > > | m_traceInfo |
EMLSR client ID-indexed map of trace info from last main PHY switch. | |
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 | |
Check NAV and CCA in the last PIFS test.
An AP MLD and an EMLSR client, both having 3 links, are considered in this test. Aux PHYs are not TX capable, do not switch links and operate on 20 MHz channels; the main PHY operates on 40 MHz channels and the preferred link is link 1. In order to control link switches, a TID-to-Link mapping is configured so that TID 0 is mapped onto link 2 for both DL and UL. In this test, the main PHY switches to link 2 to start an UL TXOP a predefined number of slots before the backoff ends on link 2. We consider different durations of the channel switch delay to verify the time the data frame is transmitted by the EMLSR client on link 2 and the data frame TX width in various situations:
AuxPhyCca = false AuxPhyCca = true ┌────┐ ┌────┐ │QoS │40 │QoS │20 |--PIFS--│Data│MHz |--PIFS--│Data│MHz
──────┬─────────┬────────┴────┴──── ──────┬─────────┼────┴───────────── Backoff Switch Backoff Switch end end end end
AuxPhyCca = false AuxPhyCca = true ┌────┐ ┌────┐ │QoS │40 │QoS │20 |--PIFS--│Data│MHz |--PIFS--│Data│MHz
─────────┬──────┬─┴────┴─────────── ──────────┬─────┼────┴───────────── Switch Backoff Switch Backoff end end end end
AuxPhyCca = false/true ┌────┐ │QoS │40 |--PIFS--| │Data│MHz
─────────┬───────────┼────┴──────── Switch Backoff end end
In all the cases, it is verified that the EMLSR client transmits the data frame, at the expected time and on the expected channel width, and receives the acknowledgment.
Definition at line 614 of file wifi-emlsr-link-switch-test.h.
enum EmlsrCheckNavAndCcaLastPifsTest::TestScenario : uint8_t |
Enumeration indicating the tested scenario.
Enumerator | |
---|---|
BACKOFF_END_BEFORE_SWITCH_END | |
LESS_THAN_PIFS_UNTIL_BACKOFF_END | |
MORE_THAN_PIFS_UNTIL_BACKOFF_END | |
COUNT |
Definition at line 623 of file wifi-emlsr-link-switch-test.h.
EmlsrCheckNavAndCcaLastPifsTest::EmlsrCheckNavAndCcaLastPifsTest | ( | ) |
Constructor.
Definition at line 2227 of file wifi-emlsr-link-switch-test.cc.
References EmlsrOperationsTestBase::m_duration, EmlsrOperationsTestBase::m_establishBaDl, EmlsrOperationsTestBase::m_establishBaUl, EmlsrOperationsTestBase::m_linksToEnableEmlsrOn, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_nEmlsrStations, EmlsrOperationsTestBase::m_nNonEmlsrStations, EmlsrOperationsTestBase::m_paddingDelay, EmlsrOperationsTestBase::m_transitionDelay, ns3::MicroSeconds(), and ns3::Seconds().
|
overrideprotectedvirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 2312 of file wifi-emlsr-link-switch-test.cc.
References ns3::Simulator::Destroy(), EmlsrOperationsTestBase::m_duration, m_events, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), and ns3::Simulator::Stop().
|
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.
Definition at line 2243 of file wifi-emlsr-link-switch-test.cc.
References EmlsrOperationsTestBase::DoSetup(), EmlsrOperationsTestBase::m_channelsStr, m_linkIdForTid0, m_nSlotsLeft, and ns3::Config::SetDefault().
|
protected |
Runs a test case and invokes itself for the next test case.
Definition at line 2323 of file wifi-emlsr-link-switch-test.cc.
References ns3::AC_BE, BACKOFF_END_BEFORE_SWITCH_END, ns3::WifiPhy::CalculateTxDuration(), COUNT, ns3::Create(), EmlsrOperationsTestBase::GetApplication(), ns3::Mac48Address::GetBroadcast(), ns3::WifiTxVector::GetChannelWidth(), LESS_THAN_PIFS_UNTIL_BACKOFF_END, EmlsrOperationsTestBase::m_apMac, m_auxPhyWidth, m_events, m_expectedTxStart, m_expectedWidth, m_linkIdForTid0, EmlsrOperationsTestBase::m_mainPhyId, m_mainPhyWidth, m_nSlotsLeft, EmlsrOperationsTestBase::m_staMacs, m_testIndex, ns3::MilliSeconds(), MORE_THAN_PIFS_UNTIL_BACKOFF_END, ns3::Simulator::Now(), NS_ABORT_MSG, NS_LOG_INFO, NS_TEST_ASSERT_MSG_GT, NS_TEST_EXPECT_MSG_EQ, RunOne(), ns3::Simulator::Schedule(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetDsFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiMacHeader::SetQosTid(), EmlsrOperationsTestBase::UPLINK, ns3::WIFI_MAC_CTL_ACK, and ns3::WIFI_MAC_QOSDATA.
Referenced by RunOne(), and StartTraffic().
|
overrideprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented from EmlsrOperationsTestBase.
Definition at line 2303 of file wifi-emlsr-link-switch-test.cc.
References m_setupDone, ns3::MilliSeconds(), RunOne(), and ns3::Simulator::Schedule().
|
overrideprotectedvirtual |
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 from EmlsrOperationsTestBase.
Definition at line 2264 of file wifi-emlsr-link-switch-test.cc.
References m_events, m_processedEvents, m_setupDone, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, and EmlsrOperationsTestBase::Transmit().
|
private |
aux PHY channel width
Definition at line 674 of file wifi-emlsr-link-switch-test.h.
Referenced by RunOne().
|
private |
list of events for a test run
Definition at line 669 of file wifi-emlsr-link-switch-test.h.
Referenced by DoRun(), RunOne(), and Transmit().
|
private |
expected start time for frame transmission
Definition at line 675 of file wifi-emlsr-link-switch-test.h.
Referenced by RunOne().
|
private |
expected channel width for frame transmission
Definition at line 676 of file wifi-emlsr-link-switch-test.h.
Referenced by RunOne().
|
private |
ID of the link on which TID 0 is mapped.
Definition at line 671 of file wifi-emlsr-link-switch-test.h.
|
private |
main PHY channel width
Definition at line 673 of file wifi-emlsr-link-switch-test.h.
Referenced by RunOne().
|
private |
value for the CAM NSlotsLeft attribute
Definition at line 672 of file wifi-emlsr-link-switch-test.h.
|
private |
number of processed events
Definition at line 670 of file wifi-emlsr-link-switch-test.h.
Referenced by Transmit().
|
private |
whether association, BA, ... have been done
Definition at line 668 of file wifi-emlsr-link-switch-test.h.
Referenced by StartTraffic(), and Transmit().
|
private |
index to iterate over test scenarios
Definition at line 667 of file wifi-emlsr-link-switch-test.h.
Referenced by RunOne().