Test that a DL MU PPDU mixing protected and unprotected receivers gets an MU-RTS. More...
Classes | |
| struct | Events |
| Actions and checks to perform upon the transmission of each frame. More... | |
Public Member Functions | |
| MuRtsUnprotectedReceiverTest () | |
| void | Transmit (WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower) |
| Callback invoked when a PHY passes a PSDU map 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 |
Private Types | |
| enum class | ExpectedStart : uint8_t { ANY , AFTER_SIFS , SAME_TIME } |
| Expected start time of a frame relative to the previous frame in the sequence. More... | |
Private Member Functions | |
| void | CheckDlMuPpdu (const WifiConstPsduMap &psduMap, const std::set< std::size_t > &staIds) |
| Check that the given PSDU map is a DL MU PPDU addressed to exactly the given stations. | |
| void | CheckMuRts (Ptr< const WifiPsdu > psdu, const std::set< std::size_t > &staIds) |
| Check that the given PSDU is an MU-RTS soliciting exactly the given stations. | |
| 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 (std::size_t staId) const |
| void | InsertEvents () |
| Insert elements in the list of expected events (transmitted frames). | |
Private Attributes | |
| Ptr< ApWifiMac > | m_apMac |
| AP wifi MAC. | |
| std::vector< PacketSocketAddress > | m_dlSockets |
| packet socket addresses for DL traffic | |
| const Time | m_duration {MilliSeconds(50)} |
| simulation duration | |
| std::list< Events > | m_events |
| list of events for the test run | |
| Time | m_prevTxEnd |
| end time of the previous frame | |
| Time | m_prevTxStart |
| start time of the previous frame | |
| std::vector< Ptr< StaWifiMac > > | m_staMacs |
| station wifi MACs | |
| const Time | m_txopLimit {MicroSeconds(4800)} |
| TXOP limit for the AC of the DL traffic. | |
Static Private Attributes | |
| static constexpr std::size_t | N_STAS = 3 |
| number of contending stations | |
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... | |
| 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. | |
Test that a DL MU PPDU mixing protected and unprotected receivers gets an MU-RTS.
With a non-zero TXOP limit, stations that responded to the AP earlier in a TXOP are recorded as protected for the remainder of that TXOP, so a DL MU PPDU prepared for a non-initial frame exchange of the TXOP can mix protected and unprotected receivers. The MU-RTS decision is a property of the PPDU's receiver set (send an MU-RTS if any receiver is unprotected), not of the single MPDU being aggregated.
An AP transmits two DL MU PPDUs to three stations within the same TXOP. Packets for the first DL MU PPDU (to STA 1 and STA 2) are generated at the beginning of the simulation; packets for the second DL MU PPDU (to STA 2 and STA 3) are generated as soon as the first DL MU PPDU is transmitted. The first MU-RTS/CTS exchange protects STA 1 and STA 2 only, hence the second DL MU PPDU mixes a protected receiver (STA 2) with an unprotected one (STA 3) and must be preceded by another MU-RTS.
The expected frame exchange sequence is (all frames within one TXOP, hence SIFS-separated; the second MU-RTS is required because STA 3 is not protected yet; the CF-End truncates the TXOP once all queues are empty):
* * packets to STA 1, STA 2 packets to STA 2, STA 3 * queued at the AP queued at this point * │ │ * ▼ ▼ * ┌──────┐ ┌──────────┐ ┌──────┐ * [AP] │MU-RTS│ │DL MU PPDU│ │MU-BAR│ * ───────┴──────┴─┬───┬─┴──────────┴──┴──────┴─┬──┬ ─ ─ ─ * STA 1 │CTS│ │BA│ * └───┘ └──┘ * STA 2 │CTS│ │BA│ * └───┘ └──┘ * * (the TXOP continues: the second MU-RTS follows a SIFS after the BlockAcks) * * ┌──────┐ ┌──────────┐ ┌──────┐ ┌──────┐ * [AP] │MU-RTS│ │DL MU PPDU│ │MU-BAR│ │CF-End│ * ───────┴──────┴─┬───┬─┴──────────┴──┴──────┴─┬──┬─┴──────┴──── * STA 2 │CTS│ │BA│ * └───┘ └──┘ * STA 3 │CTS│ │BA│ * └───┘ └──┘ * *
Association and Block Ack agreement establishment are performed through the static setup helper and UL OFDMA is disabled on the multi-user scheduler, so that the frames above are the only ones transmitted. The test checks the type of every transmitted frame against this sequence, that both MU-RTS frames solicit both receivers of the respective PPDU, and that all expected frames have been transmitted by the end of the simulation.
Definition at line 102 of file wifi-protection-test.cc.
|
strongprivate |
Expected start time of a frame relative to the previous frame in the sequence.
| Enumerator | |
|---|---|
| ANY | no expectation (first frame of the sequence) |
| AFTER_SIFS | a SIFS after the end of the previous frame |
| SAME_TIME | at the same time as the previous frame (simultaneous responses) |
Definition at line 118 of file wifi-protection-test.cc.
| MuRtsUnprotectedReceiverTest::MuRtsUnprotectedReceiverTest | ( | ) |
Definition at line 192 of file wifi-protection-test.cc.
References ns3::TestCase::TestCase().
|
private |
Check that the given PSDU map is a DL MU PPDU addressed to exactly the given stations.
| psduMap | the PSDU map |
| staIds | the indices of the receiver stations |
Definition at line 336 of file wifi-protection-test.cc.
References m_staMacs, ns3::Simulator::Now(), NS_TEST_EXPECT_MSG_EQ, and ns3::Time::US.
Referenced by InsertEvents().
|
private |
Check that the given PSDU is an MU-RTS soliciting exactly the given stations.
| psdu | the PSDU carrying the Trigger Frame |
| staIds | the indices of the solicited stations |
Definition at line 310 of file wifi-protection-test.cc.
References ns3::CtrlTriggerHeader::IsMuRts(), m_staMacs, ns3::Simulator::Now(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, and ns3::Time::US.
Referenced by InsertEvents().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 496 of file wifi-protection-test.cc.
References ns3::Simulator::Destroy(), GetApplication(), InsertEvents(), m_apMac, m_duration, m_events, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), and ns3::Simulator::Stop().
|
overrideprivatevirtual |
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 212 of file wifi-protection-test.cc.
References ns3::AC_BE, ns3::Node::AddApplication(), ns3::WifiHelper::AssignStreams(), ns3::NodeList::Begin(), ns3::CreateObject(), ns3::WifiAcknowledgment::DL_MU_TF_MU_BAR, ns3::DynamicCast(), ns3::NodeList::End(), ns3::NodeContainer::Get(), ns3::Node::GetDevice(), ns3::PacketSocketHelper::Install(), m_apMac, m_dlSockets, m_duration, m_staMacs, m_txopLimit, ns3::MakeCallback(), N_STAS, ns3::Config::SetDefault(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::WifiStaticSetupHelper::SetStaticAssociation(), ns3::WifiStaticSetupHelper::SetStaticBlockAck(), Transmit(), and ns3::WIFI_STANDARD_80211ax.
|
private |
| staId | the index of the station the generated packets are destined to |
Definition at line 198 of file wifi-protection-test.cc.
References ns3::CreateObject(), m_dlSockets, m_duration, ns3::MicroSeconds(), and ns3::Simulator::Now().
Referenced by DoRun(), and InsertEvents().
|
private |
Insert elements in the list of expected events (transmitted frames).
Definition at line 356 of file wifi-protection-test.cc.
References AFTER_SIFS, ANY, CheckDlMuPpdu(), CheckMuRts(), GetApplication(), ns3::CtrlTriggerHeader::IsMuBar(), m_apMac, m_events, ns3::Simulator::Now(), NS_TEST_EXPECT_MSG_EQ, SAME_TIME, ns3::Time::US, ns3::WIFI_MAC_CTL_BACKRESP, ns3::WIFI_MAC_CTL_CTS, ns3::WIFI_MAC_CTL_END, ns3::WIFI_MAC_CTL_TRIGGER, and ns3::WIFI_MAC_QOSDATA.
Referenced by DoRun().
| void MuRtsUnprotectedReceiverTest::Transmit | ( | WifiConstPsduMap | psduMap, |
| WifiTxVector | txVector, | ||
| Watt_u | txPower ) |
Callback invoked when a PHY passes a PSDU map to transmit.
| psduMap | the PSDU map |
| txVector | the TX vector |
| txPower | the TX power |
Definition at line 424 of file wifi-protection-test.cc.
References AFTER_SIFS, ANY, ns3::WifiPhy::CalculateTxDuration(), ns3::WifiMacHeader::GetTypeString(), m_apMac, m_events, m_prevTxEnd, m_prevTxStart, ns3::Simulator::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, SAME_TIME, and ns3::Time::US.
Referenced by DoSetup().
AP wifi MAC.
Definition at line 182 of file wifi-protection-test.cc.
Referenced by DoRun(), DoSetup(), InsertEvents(), and Transmit().
|
private |
packet socket addresses for DL traffic
Definition at line 184 of file wifi-protection-test.cc.
Referenced by DoSetup(), and GetApplication().
|
private |
simulation duration
Definition at line 188 of file wifi-protection-test.cc.
Referenced by DoRun(), DoSetup(), and GetApplication().
|
private |
list of events for the test run
Definition at line 185 of file wifi-protection-test.cc.
Referenced by DoRun(), InsertEvents(), and Transmit().
|
private |
end time of the previous frame
Definition at line 187 of file wifi-protection-test.cc.
Referenced by Transmit().
|
private |
start time of the previous frame
Definition at line 186 of file wifi-protection-test.cc.
Referenced by Transmit().
|
private |
station wifi MACs
Definition at line 183 of file wifi-protection-test.cc.
Referenced by CheckDlMuPpdu(), CheckMuRts(), and DoSetup().
|
private |
TXOP limit for the AC of the DL traffic.
Definition at line 189 of file wifi-protection-test.cc.
Referenced by DoSetup().
|
staticconstexprprivate |
number of contending stations
Definition at line 180 of file wifi-protection-test.cc.
Referenced by DoSetup().