Test transmission of broadcast and unicast frames with STAs in Power Save mode. More...
Classes | |
| struct | Events |
| Actions and checks to perform upon the transmission of each frame. More... | |
Public Member Functions | |
| WifiPsModeAttributesTest (bool enableEmlsr, bool staticSetup) | |
| Constructor. | |
| void | Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower) |
| Callback invoked when PHY receives a PSDU to transmit. | |
| Public Member Functions inherited from ns3::TestCase | |
| TestCase (const TestCase &)=delete | |
| Caller graph was not generated because of its size. | |
| 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. | |
| Ptr< PacketSocketClient > | GetApplication (WifiDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize, uint8_t priority=0) const |
| void | InsertEvents () |
| Insert elements in the list of expected events (transmitted frames). | |
| Protected Member Functions inherited from ns3::TestCase | |
| 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 Attributes | |
| Ptr< ApWifiMac > | m_apMac |
| AP wifi MAC. | |
| const std::array< std::string, N_LINKS > | m_channels |
| frequency channels for the two links | |
| bool | m_checkTxPsdus {false} |
| whether to check transmitted PSDUs against the inserted events | |
| std::vector< PacketSocketAddress > | m_dlSockets |
| packet socket addresses for DL traffic | |
| Time | m_duration {Seconds(0.5)} |
| simulation duration | |
| bool | m_enableEmlsr |
| whether to enable EMLSR on the DUT | |
| std::list< Events > | m_events |
| list of events for a test run | |
| const Time | m_listenAdvance {MicroSeconds(50)} |
| the value for the ListenAdvance attribute | |
| const std::string | m_otherChannel {"{100, 20, BAND_5GHZ, 0}"} |
| channel used to initialize the PHY of the DUT operating on the link that shall not be used for ML setup | |
| const Time | m_psmTimeout {MicroSeconds(100)} |
| the PSM timeout | |
| std::array< Ptr< StaWifiMac >, 2 > | m_staMacs |
| wifi MACs of the STAs | |
| bool | m_staticSetup |
| whether static setup helper is used to configure association | |
| const Time | m_switchDelay {MicroSeconds(64)} |
| channel switch, transition and padding delay | |
| std::vector< PacketSocketAddress > | m_ulSockets |
| packet socket addresses for UL traffic | |
Static Private Attributes | |
| static constexpr double | DUT_BEACON_JITTER = 0.6 |
| jitter for the initial Beacon frame sent on the link used by the DUT for association | |
| static constexpr std::size_t | DUT_INDEX = 0 |
| DUT index. | |
| static constexpr std::size_t | N_LINKS = 2 |
| number of links for ML devices | |
| static constexpr double | STA_BEACON_JITTER = 0.2 |
| jitter for the initial Beacon frame sent on the link used by the other STA for association | |
| static constexpr std::size_t | STA_INDEX = 1 |
| index of the other non-AP STA | |
| static constexpr double | WAIT_BEACON_SURPLUS = 0.1 |
| the time a STA listens for a Beacon is the percentage of the Beacon interval given by the sum of the beacon jitter and this surplus | |
Additional Inherited Members | |
| Public Types inherited from ns3::TestCase | |
| enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
| How long the test takes to execute. More... | |
Test transmission of broadcast and unicast frames with STAs in Power Save mode.
This test considers an AP MLD having two links and two devices: a device under test (DUT), which is a 2-link non-AP MLD, and a single-link non-AP STA. The DUT can have EMLSR mode enabled or disabled on both links and static setup helper can be used or not. Both STAs affiliated with the DUT are switched to powersave mode after completing ML setup or enabling EMLSR mode.
It is verified that:
1 frame queued
at DUT
│ channel access
┌───────────┐ granted, no TX, 1 frame queued
┌──────┐ │QoS Data to│ no channel request at DUT
[link 0] │Beacon│ │ other STA │ │ │
─────────┴──────┴────┴─────▼─────┴┬───┬─────────────────────────────────▼───────────────────────
│CCA │ACK│ │ │
non-AP STA |---sleep--│BUSY └───┘ │------sleep-------│ │---------
on link 0 │ │
non-AP STA -----sleep------│ │----│ │ │-
on link 1 │ │
│ PSM Listen PSM PSM
│ ┌───┐timeout Advance┌──────┐timeout ┌───┐timeout
[link 1] │ │ACK│------│ │------│Beacon│---X │ACK│------│
───────────────────────────▼─┬────────┬┴───┴──────────────────┴──────┴──▼┬────────┬┴───┴────────
│QoS Data│ │QoS Data│
│from DUT│ │from DUT│
└────────┘ └────────┘
Definition at line 2519 of file power-save-test.cc.
| WifiPsModeAttributesTest::WifiPsModeAttributesTest | ( | bool | enableEmlsr, |
| bool | staticSetup ) |
Constructor.
| enableEmlsr | whether to enable EMLSR on the DUT |
| staticSetup | whether static setup helper is used to configure association |
Definition at line 2622 of file power-save-test.cc.
References ns3::TestCase::TestCase(), m_enableEmlsr, and m_staticSetup.
|
overrideprotectedvirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 3195 of file power-save-test.cc.
References ns3::Simulator::Destroy(), DUT_INDEX, InsertEvents(), m_duration, m_events, m_staMacs, m_staticSetup, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), ns3::Simulator::Schedule(), 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 2652 of file power-save-test.cc.
References ns3::WifiHelper::AssignStreams(), ns3::WifiChannelConfig::Segment::band, ns3::NodeList::Begin(), ns3::CreateObject(), ns3::DEFAULT_BEACON_INTERVAL, ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, DUT_BEACON_JITTER, DUT_INDEX, ns3::DynamicCast(), ns3::NodeList::End(), ns3::WifiChannelConfig::FromString(), ns3::WifiChannelConfig::front(), ns3::GetFrequencyRange(), ns3::PacketSocketHelper::Install(), m_apMac, m_channels, m_dlSockets, m_duration, m_enableEmlsr, m_otherChannel, m_staMacs, m_staticSetup, m_switchDelay, m_ulSockets, ns3::MakeCallback(), N_LINKS, NS_TEST_ASSERT_MSG_NE, ns3::WifiPhyHelper::Set(), ns3::SpectrumWifiPhyHelper::SetChannel(), ns3::Config::SetDefault(), ns3::WifiPhyHelper::SetPcapDataLinkType(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::WifiStaticSetupHelper::SetStaticAssociation(), ns3::WifiStaticSetupHelper::SetStaticEmlsr(), STA_BEACON_JITTER, STA_INDEX, Transmit(), WAIT_BEACON_SURPLUS, and ns3::WIFI_STANDARD_80211be.
|
protected |
| dir | the traffic direction (downlink/uplink) |
| staId | the index of the non-AP MLD generating/receiving packets |
| count | the number of packets to generate |
| pktSize | the size of the packets to generate |
| priority | user priority for generated packets |
Definition at line 2632 of file power-save-test.cc.
References ns3::CreateObject(), dir, ns3::DOWNLINK, m_dlSockets, m_duration, m_ulSockets, ns3::MicroSeconds(), and ns3::Simulator::Now().
Referenced by InsertEvents().
|
protected |
Insert elements in the list of expected events (transmitted frames).
Definition at line 2882 of file power-save-test.cc.
References ns3::WifiPhy::CalculatePhyPreambleAndHeaderDuration(), ns3::WifiPhy::CalculateTxDuration(), ns3::CCA_BUSY, dir, ns3::DOWNLINK, DUT_INDEX, GetApplication(), ns3::IDLE, m_apMac, m_checkTxPsdus, m_enableEmlsr, m_events, m_listenAdvance, m_psmTimeout, m_staMacs, m_staticSetup, ns3::Simulator::Now(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Schedule(), ns3::WifiStaticSetupHelper::SetStaticBlockAckPostInit(), ns3::SINGLE_LINK_OP_ID, ns3::SLEEP, STA_INDEX, ns3::UPLINK, ns3::WIFI_MAC_CTL_ACK, ns3::WIFI_MAC_CTL_CTS, ns3::WIFI_MAC_CTL_END, ns3::WIFI_MAC_CTL_RTS, ns3::WIFI_MAC_CTL_TRIGGER, ns3::WIFI_MAC_DATA_NULL, ns3::WIFI_MAC_MGT_ACTION, ns3::WIFI_MAC_MGT_BEACON, ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PM_POWERSAVE.
Referenced by DoRun().
| void WifiPsModeAttributesTest::Transmit | ( | Ptr< WifiMac > | mac, |
| uint8_t | phyId, | ||
| WifiConstPsduMap | psduMap, | ||
| WifiTxVector | txVector, | ||
| Watt_u | txPower ) |
Callback invoked when PHY receives a PSDU to transmit.
| mac | the MAC transmitting the PSDUs |
| phyId | the ID of the PHY transmitting the PSDUs |
| psduMap | the PSDU map |
| txVector | the TX vector |
| txPower | the tx power |
Definition at line 2834 of file power-save-test.cc.
References ns3::WifiMacHeader::GetTypeString(), m_checkTxPsdus, m_events, ns3::Simulator::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, and ns3::Time::US.
Referenced by DoSetup().
|
staticconstexprprivate |
jitter for the initial Beacon frame sent on the link used by the DUT for association
Definition at line 2598 of file power-save-test.cc.
Referenced by DoSetup().
|
staticconstexprprivate |
DUT index.
Definition at line 2610 of file power-save-test.cc.
Referenced by DoRun(), DoSetup(), and InsertEvents().
AP wifi MAC.
Definition at line 2612 of file power-save-test.cc.
Referenced by DoSetup(), and InsertEvents().
|
private |
frequency channels for the two links
Definition at line 2592 of file power-save-test.cc.
Referenced by DoSetup().
|
private |
whether to check transmitted PSDUs against the inserted events
Definition at line 2617 of file power-save-test.cc.
Referenced by InsertEvents(), and Transmit().
|
private |
packet socket addresses for DL traffic
Definition at line 2614 of file power-save-test.cc.
Referenced by DoSetup(), and GetApplication().
simulation duration
Definition at line 2619 of file power-save-test.cc.
Referenced by DoRun(), DoSetup(), and GetApplication().
|
private |
whether to enable EMLSR on the DUT
Definition at line 2608 of file power-save-test.cc.
Referenced by WifiPsModeAttributesTest(), DoSetup(), and InsertEvents().
|
private |
list of events for a test run
Definition at line 2616 of file power-save-test.cc.
Referenced by DoRun(), InsertEvents(), and Transmit().
|
private |
the value for the ListenAdvance attribute
Definition at line 2606 of file power-save-test.cc.
Referenced by InsertEvents().
|
private |
channel used to initialize the PHY of the DUT operating on the link that shall not be used for ML setup
Definition at line 2596 of file power-save-test.cc.
Referenced by DoSetup().
|
private |
|
private |
wifi MACs of the STAs
Definition at line 2613 of file power-save-test.cc.
Referenced by DoRun(), DoSetup(), and InsertEvents().
|
private |
whether static setup helper is used to configure association
Definition at line 2609 of file power-save-test.cc.
Referenced by WifiPsModeAttributesTest(), DoRun(), DoSetup(), and InsertEvents().
|
private |
channel switch, transition and padding delay
Definition at line 2607 of file power-save-test.cc.
Referenced by DoSetup().
|
private |
packet socket addresses for UL traffic
Definition at line 2615 of file power-save-test.cc.
Referenced by DoSetup(), and GetApplication().
|
staticconstexprprivate |
number of links for ML devices
Definition at line 2590 of file power-save-test.cc.
Referenced by DoSetup().
|
staticconstexprprivate |
jitter for the initial Beacon frame sent on the link used by the other STA for association
Definition at line 2600 of file power-save-test.cc.
Referenced by DoSetup().
|
staticconstexprprivate |
index of the other non-AP STA
Definition at line 2611 of file power-save-test.cc.
Referenced by DoSetup(), and InsertEvents().
|
staticconstexprprivate |
the time a STA listens for a Beacon is the percentage of the Beacon interval given by the sum of the beacon jitter and this surplus
Definition at line 2603 of file power-save-test.cc.
Referenced by DoSetup().