A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
MuRtsUnprotectedReceiverTest Class Reference

Test that a DL MU PPDU mixing protected and unprotected receivers gets an MU-RTS. More...

Inheritance diagram for MuRtsUnprotectedReceiverTest:
Collaboration diagram for MuRtsUnprotectedReceiverTest:

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.

Detailed Description

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.

Member Enumeration Documentation

◆ ExpectedStart

enum class MuRtsUnprotectedReceiverTest::ExpectedStart : uint8_t
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.

Constructor & Destructor Documentation

◆ MuRtsUnprotectedReceiverTest()

MuRtsUnprotectedReceiverTest::MuRtsUnprotectedReceiverTest ( )

Definition at line 192 of file wifi-protection-test.cc.

References ns3::TestCase::TestCase().

Here is the call graph for this function:

Member Function Documentation

◆ CheckDlMuPpdu()

void MuRtsUnprotectedReceiverTest::CheckDlMuPpdu ( const WifiConstPsduMap & psduMap,
const std::set< std::size_t > & staIds )
private

Check that the given PSDU map is a DL MU PPDU addressed to exactly the given stations.

Parameters
psduMapthe PSDU map
staIdsthe 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckMuRts()

void MuRtsUnprotectedReceiverTest::CheckMuRts ( Ptr< const WifiPsdu > psdu,
const std::set< std::size_t > & staIds )
private

Check that the given PSDU is an MU-RTS soliciting exactly the given stations.

Parameters
psduthe PSDU carrying the Trigger Frame
staIdsthe 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoRun()

void MuRtsUnprotectedReceiverTest::DoRun ( )
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().

Here is the call graph for this function:

◆ DoSetup()

void MuRtsUnprotectedReceiverTest::DoSetup ( )
overrideprivatevirtual

◆ GetApplication()

Ptr< PacketSocketClient > MuRtsUnprotectedReceiverTest::GetApplication ( std::size_t staId) const
private
Parameters
staIdthe index of the station the generated packets are destined to
Returns
an application generating one packet destined to the given station

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InsertEvents()

void MuRtsUnprotectedReceiverTest::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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Transmit()

void MuRtsUnprotectedReceiverTest::Transmit ( WifiConstPsduMap psduMap,
WifiTxVector txVector,
Watt_u txPower )

Callback invoked when a PHY passes a PSDU map to transmit.

Parameters
psduMapthe PSDU map
txVectorthe TX vector
txPowerthe 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().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_apMac

Ptr<ApWifiMac> MuRtsUnprotectedReceiverTest::m_apMac
private

AP wifi MAC.

Definition at line 182 of file wifi-protection-test.cc.

Referenced by DoRun(), DoSetup(), InsertEvents(), and Transmit().

◆ m_dlSockets

std::vector<PacketSocketAddress> MuRtsUnprotectedReceiverTest::m_dlSockets
private

packet socket addresses for DL traffic

Definition at line 184 of file wifi-protection-test.cc.

Referenced by DoSetup(), and GetApplication().

◆ m_duration

const Time MuRtsUnprotectedReceiverTest::m_duration {MilliSeconds(50)}
private

simulation duration

Definition at line 188 of file wifi-protection-test.cc.

Referenced by DoRun(), DoSetup(), and GetApplication().

◆ m_events

std::list<Events> MuRtsUnprotectedReceiverTest::m_events
private

list of events for the test run

Definition at line 185 of file wifi-protection-test.cc.

Referenced by DoRun(), InsertEvents(), and Transmit().

◆ m_prevTxEnd

Time MuRtsUnprotectedReceiverTest::m_prevTxEnd
private

end time of the previous frame

Definition at line 187 of file wifi-protection-test.cc.

Referenced by Transmit().

◆ m_prevTxStart

Time MuRtsUnprotectedReceiverTest::m_prevTxStart
private

start time of the previous frame

Definition at line 186 of file wifi-protection-test.cc.

Referenced by Transmit().

◆ m_staMacs

std::vector<Ptr<StaWifiMac> > MuRtsUnprotectedReceiverTest::m_staMacs
private

station wifi MACs

Definition at line 183 of file wifi-protection-test.cc.

Referenced by CheckDlMuPpdu(), CheckMuRts(), and DoSetup().

◆ m_txopLimit

const Time MuRtsUnprotectedReceiverTest::m_txopLimit {MicroSeconds(4800)}
private

TXOP limit for the AC of the DL traffic.

Definition at line 189 of file wifi-protection-test.cc.

Referenced by DoSetup().

◆ N_STAS

std::size_t MuRtsUnprotectedReceiverTest::N_STAS = 3
staticconstexprprivate

number of contending stations

Definition at line 180 of file wifi-protection-test.cc.

Referenced by DoSetup().


The documentation for this class was generated from the following file: