9#ifndef WIFI_EMLSR_LINK_SWITCH_TEST_H
10#define WIFI_EMLSR_LINK_SWITCH_TEST_H
17using namespace std::string_literals;
74 void DoRun()
override;
79 double txPowerW)
override;
170 void DoRun()
override;
233 void DoRun()
override;
239 double txPowerW)
override;
343 void DoRun()
override;
348 double txPowerW)
override;
520 void DoRun()
override;
525 double txPowerW)
override;
633 void DoRun()
override;
638 double txPowerW)
override;
Test CCA busy notifications on EMLSR clients.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
uint8_t m_nextMainPhyLinkId
the ID of the link the main PHY switches to
uint8_t m_currMainPhyLinkId
the ID of the link the main PHY switches from
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
MHz_u m_auxPhyMaxChWidth
max channel width supported by aux PHYs
~EmlsrCcaBusyTest() override=default
void TransmitPacketToAp(uint8_t linkId)
Make the other MLD transmit a packet to the AP on the given link.
void DoRun() override
Implementation to actually run this TestCase.
Time m_channelSwitchDelay
the PHY channel switch delay
void CheckPoint1()
Perform checks after that the preamble of the first PPDU has been received.
void CheckPoint3()
Perform checks after that the aux PHY completed the link switch.
EmlsrCcaBusyTest(MHz_u auxPhyMaxChWidth)
Constructor.
void CheckPoint2()
Perform checks after that the main PHY completed the link switch.
Check NAV and CCA in the last PIFS test.
const uint8_t m_nSlotsLeft
value for the CAM NSlotsLeft attribute
void DoRun() override
Implementation to actually run this TestCase.
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
const uint8_t m_linkIdForTid0
ID of the link on which TID 0 is mapped.
std::size_t m_testIndex
index to iterate over test scenarios
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.
TestScenario
Enumeration indicating the tested scenario.
@ LESS_THAN_PIFS_UNTIL_BACKOFF_END
@ MORE_THAN_PIFS_UNTIL_BACKOFF_END
@ BACKOFF_END_BEFORE_SWITCH_END
bool m_setupDone
whether association, BA, ... have been done
void RunOne()
Runs a test case and invokes itself for the next test case.
Time m_expectedTxStart
expected start time for frame transmission
std::list< Events > m_events
list of events for a test run
MHz_u m_expectedWidth
expected channel width for frame transmission
EmlsrCheckNavAndCcaLastPifsTest()
Constructor.
std::size_t m_processedEvents
number of processed events
const MHz_u m_auxPhyWidth
aux PHY channel width
void DoSetup() override
Implementation to do any local setup required for this TestCase.
const MHz_u m_mainPhyWidth
main PHY channel width
Check ICF reception while main PHY is switching.
ChannelSwitchEnd m_csdIndex
index to iterate over channel switch durations
EmlsrIcfSentDuringMainPhySwitchTest()
Constructor.
void CheckInDeviceInterference(const std::string &testStr, uint8_t linkId, Time duration)
Check that the in-device interference generated by a transmission of the given duration on the given ...
const uint8_t m_linkIdForTid3
ID of the link on which TID 3 is mapped.
void RunOne()
Runs a test case and invokes itself for the next test case.
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
bool m_setupDone
whether association, BA, ... have been done
std::array< WifiSpectrumBandInfo, 3 > m_bands
bands of the 3 frequency channels
void DoRun() override
Implementation to actually run this TestCase.
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.
uint8_t m_testIndex
index to iterate over test scenarios
void GenerateNoiseOnAllLinks(Ptr< WifiMac > mac, Time duration)
Generate noise on all the links of the given MAC for the given time duration.
void EmlsrLinkSwitchCb(uint8_t linkId, Ptr< WifiPhy > phy, bool connected)
Callback connected to the EmlsrLinkSwitch trace source of the StaWifiMac of the EMLSR client.
std::size_t m_processedEvents
number of processed events
std::optional< MainPhySwitchInfo > m_switchFrom
info for main PHY leaving a link
std::list< Events > m_events
list of events for a test run
ChannelSwitchEnd
Enumeration indicating the duration of a main PHY channel switch compared to the ICF fields.
@ DURING_PREAMBLE_DETECTION
void DoSetup() override
Implementation to do any local setup required for this TestCase.
std::optional< MainPhySwitchInfo > m_switchTo
info for main PHY connected to a link
std::string m_testStr
test scenario description
Test the switching of PHYs on EMLSR clients.
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.
bool m_resetCamStateAndInterruptSwitch
whether to reset the state of the ChannelAccessManager associated with the link on which the main PHY...
void DoRun() override
Implementation to actually run this TestCase.
void CheckResults()
Check that the simulation produced the expected results.
void CheckRtsFrame(const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken by the EMLSR client transmitting a PPDU containing an RTS fr...
void CheckInitialControlFrame(const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId)
Check that the Main PHY (and possibly the Aux PHY) correctly switches channel when the reception of a...
void DoSetup() override
Implementation to do any local setup required for this TestCase.
std::size_t m_countRtsFrames
counter for RTS frames
std::size_t m_countIcfFrames
counter for ICF frames
Ptr< ListErrorModel > m_errorModel
error rate model to corrupt packets at AP MLD
~EmlsrLinkSwitchTest() override=default
std::size_t m_countQoSframes
counter for QoS data frames
std::size_t m_txPsdusPos
position in the vector of TX PSDUs of the first ICF
void CheckQosFrames(const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken by the AP MLD transmitting a PPDU containing QoS data frames...
EmlsrLinkSwitchTest(const Params ¶ms)
Constructor.
MHz_u m_auxPhyMaxChWidth
max channel width supported by aux PHYs
bool m_switchAuxPhy
whether AUX PHY should switch channel to operate on the link on which the Main PHY was operating befo...
Base class for EMLSR Operations tests.
Switch main PHY back timer test.
void DoRun() override
Implementation to actually run this TestCase.
const uint8_t m_linkIdForTid4
ID of the link on which TID 4 is mapped.
Ptr< WifiMpdu > m_bcastFrame
the broadcast frame sent by the AP MLD
void InsertEventsForQosTid4()
Insert events corresponding to the UL TXOP to transmit the QoS Data frame with TID 4.
std::size_t m_processedEvents
number of processed events
void MainPhySwitchInfoCallback(std::size_t index, const EmlsrMainPhySwitchTrace &info) override
Callback connected to the EMLSR Manager MainPhySwitch trace source.
bool m_dlPktDone
whether the DL packet has been generated
bool m_setupDone
whether association, BA, ... have been done
void DoSetup() override
Implementation to do any local setup required for this TestCase.
std::list< Events > m_events
list of events for a test run
EmlsrSwitchMainPhyBackTest()
Constructor.
Time m_expectedMainPhySwitchBackTime
expected main PHY switch back time
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.
uint8_t m_testIndex
index to iterate over test scenarios
void RunOne()
Runs a test case and invokes itself for the next test case.
TestScenario
Enumeration indicating the tested scenario.
@ RXSTART_AFTER_SWITCH_HT_PPDU
@ NON_HT_PPDU_USE_MAC_HDR
@ NON_HT_PPDU_DONT_USE_MAC_HDR
@ RXSTART_WHILE_SWITCH_INTERRUPT
@ LONG_SWITCH_BACK_DELAY_USE_MAC_HDR
@ RXSTART_WHILE_SWITCH_NO_INTERRUPT
@ LONG_SWITCH_BACK_DELAY_DONT_USE_MAC_HDR
Time m_switchMainPhyBackDelay
the switch main PHY back delay
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
const uint8_t m_linkIdForTid0
ID of the link on which TID 0 is mapped.
Test ML setup and data exchange between an AP MLD and a single link EMLSR client.
bool m_auxPhyTxCapable
whether aux PHYs are TX capable
std::list< Events > m_events
list of events for a test run
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 DoRun() override
Implementation to actually run this TestCase.
bool m_switchAuxPhy
whether aux PHYs switch link
void DoSetup() override
Implementation to do any local setup required for this TestCase.
SingleLinkEmlsrTest(bool switchAuxPhy, bool auxPhyTxCapable)
Constructor.
std::list< Events >::const_iterator m_eventIt
iterator over the list of events
wifi EMLSR suite to test link switch operations
WifiEmlsrLinkSwitchTestSuite()
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiMacType
Combination of valid MAC header type/subtype.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Actions and checks to perform upon the transmission of each frame.
std::function< void(Ptr< const WifiPsdu >, const WifiTxVector &, uint8_t)> func
function to perform actions and checks
Events(WifiMacType type, std::function< void(Ptr< const WifiPsdu >, const WifiTxVector &, uint8_t)> &&f={})
Constructor.
WifiMacType hdrType
MAC header type of frame being transmitted.
Actions and checks to perform upon the transmission of each frame.
std::function< void(Ptr< const WifiPsdu >, const WifiTxVector &, uint8_t)> func
function to perform actions and checks
Events(WifiMacType type, std::function< void(Ptr< const WifiPsdu >, const WifiTxVector &, uint8_t)> &&f={})
Constructor.
WifiMacType hdrType
MAC header type of frame being transmitted.
Store information about a main PHY switch.
Time time
the time the main PHY left/was connected to a link
uint8_t linkId
the ID of the link the main PHY switched from/to
Parameters for the EMLSR link switching test.
bool switchAuxPhy
whether AUX PHY should switch channel to operate on the link on which the Main PHY was operating befo...
bool resetCamStateAndInterruptSwitch
this variable controls two boolean values that are either both set to true or both set to false; the ...
MHz_u auxPhyMaxChWidth
max channel width supported by aux PHYs
Actions and checks to perform upon the transmission of each frame.
Events(WifiMacType type, std::function< void(Ptr< const WifiPsdu >, const WifiTxVector &, uint8_t)> &&f={})
Constructor.
std::function< void(Ptr< const WifiPsdu >, const WifiTxVector &, uint8_t)> func
function to perform actions and checks
WifiMacType hdrType
MAC header type of frame being transmitted.
Actions and checks to perform upon the transmission of each frame.
Events(WifiMacType type, std::function< void(Ptr< const WifiPsdu >, const WifiTxVector &)> &&f={})
Constructor.
std::function< void(Ptr< const WifiPsdu >, const WifiTxVector &)> func
function to perform actions and checks
WifiMacType hdrType
MAC header type of frame being transmitted.
Base struct for EMLSR Main PHY switch traces.