A Discrete-Event Network Simulator
API
WifiPrimaryChannelsTest Class Reference

Test transmissions under different primary channel settings. More...

+ Inheritance diagram for WifiPrimaryChannelsTest:
+ Collaboration diagram for WifiPrimaryChannelsTest:

Public Member Functions

 WifiPrimaryChannelsTest (uint16_t channelWidth, bool useDistinctBssColors)
 Constructor. More...
 
virtual ~WifiPrimaryChannelsTest ()
 
void CheckAssociation (void)
 Check that all stations associated with an AP. More...
 
void CheckReceivedMuPpdus (std::set< uint8_t > txBss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus, bool isDlMu)
 Check that (i) all stations/APs belonging to the given BSSes received the DL/UL MU PPDUs transmitted over the given channel width and RU width; and (ii) stations/APs belonging to the other BSSes did not receive any frame if BSS Color is set (due to BSS Color filtering) or if no transmission addressed to/from stations with the same AID was performed on a channel adjacent to the one they operate on, otherwise. More...
 
void CheckReceivedSuPpdus (std::set< uint8_t > txBss, uint16_t txChannelWidth)
 Check that (i) all stations belonging to the given BSSes received the SU PPDUs transmitted over the given channel width; and (ii) all stations belonging to the other BSSes did not receive any frame if BSS Color is set (due to BSS Color filtering) or if no transmission was performed on a channel adjacent to the one they operate on, otherwise. More...
 
void CheckReceivedTriggerFrames (std::set< uint8_t > txBss, uint16_t txChannelWidth)
 Check that (i) all stations belonging to the given BSSes received the transmitted Trigger Frame; and (ii) all stations belonging to the other BSSes did not receive any frame Trigger Frame (given that a Trigger Frame is transmitted on the primary20 channel and all the primary20 channels are distinct). More...
 
void DoSendHeTbPpdu (uint8_t bss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
 Have the STAs of the given BSS transmit an HE TB PPDU using the given transmission channel width and RU type. More...
 
void ReceiveDl (uint8_t bss, uint8_t station, Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
 Callback invoked when a station receives a DL PPDU. More...
 
void ReceiveUl (uint8_t bss, Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
 Callback invoked when an AP receives an UL PPDU. More...
 
void SendDlMuPpdu (uint8_t bss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
 Have the AP of the given BSS transmit a MU PPDU using the given transmission channel width and RU type. More...
 
void SendDlSuPpdu (uint8_t bss, uint16_t txChannelWidth)
 Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width. More...
 
void SendHeTbPpdu (uint8_t bss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
 Have the AP of the given BSS transmit a Basic Trigger Frame. More...
 
void Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when PHY receives a PSDU to transmit. More...
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun (void) override
 Implementation to actually run this TestCase. More...
 
void DoSetup (void) override
 Implementation to do any local setup required for this TestCase. More...
 

Private Attributes

NetDeviceContainer m_apDevices
 container for AP's NetDevice More...
 
uint16_t m_channelWidth
 operating channel width in MHz More...
 
uint8_t m_nBss
 number of BSSes More...
 
uint8_t m_nStationsPerBss
 number of stations per AP More...
 
std::vector< std::bitset< 74 > > m_processed
 whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was processed More...
 
std::vector< std::bitset< 74 > > m_received
 whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was received More...
 
std::vector< NetDeviceContainerm_staDevices
 containers for stations' NetDevices More...
 
Time m_time
 the time when the current action is executed More...
 
Ptr< WifiPsdum_trigger
 Basic Trigger Frame. More...
 
Time m_triggerTxDuration
 TX duration for Basic Trigger Frame. More...
 
WifiTxVector m_triggerTxVector
 TX vector for Basic Trigger Frame. More...
 
bool m_useDistinctBssColors
 true to set distinct BSS colors to BSSes More...
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { 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. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
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. More...
 
bool MustAssertOnFailure (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Detailed Description

Test transmissions under different primary channel settings.

This test can be repeated for different widths of the operating channel. We configure as many BSSes as the number of distinct 20 MHz subchannels in the operating channel, so that each BSS is assigned a distinct primary20 channel. For each BSS, we test the transmission of SU PPDUs, DL MU PPDUs and HE TB PPDUs of all the widths (20 MHz, 40 MHz, etc.) allowed by the operating channel. Transmissions of a given type take place simultaneously in BSSes that do not operate on adjacent primary channels of the considered width (so that transmissions do not interfere with each other). It is also possible to select whether BSSes should be assigned (distinct) BSS colors or not.

Definition at line 61 of file wifi-primary-channels-test.cc.

Constructor & Destructor Documentation

◆ WifiPrimaryChannelsTest()

WifiPrimaryChannelsTest::WifiPrimaryChannelsTest ( uint16_t  channelWidth,
bool  useDistinctBssColors 
)

Constructor.

Parameters
channelWidththe operating channel width (in MHz)
useDistinctBssColorswhether to set distinct BSS colors to BSSes

Definition at line 206 of file wifi-primary-channels-test.cc.

◆ ~WifiPrimaryChannelsTest()

WifiPrimaryChannelsTest::~WifiPrimaryChannelsTest ( )
virtual

Definition at line 213 of file wifi-primary-channels-test.cc.

Member Function Documentation

◆ CheckAssociation()

void WifiPrimaryChannelsTest::CheckAssociation ( void  )

Check that all stations associated with an AP.

Definition at line 796 of file wifi-primary-channels-test.cc.

References ns3::NetDeviceContainer::Get(), m_apDevices, m_nBss, m_nStationsPerBss, third::mac, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

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

◆ CheckReceivedMuPpdus()

void WifiPrimaryChannelsTest::CheckReceivedMuPpdus ( std::set< uint8_t >  txBss,
uint16_t  txChannelWidth,
HeRu::RuType  ruType,
std::size_t  nRus,
bool  isDlMu 
)

Check that (i) all stations/APs belonging to the given BSSes received the DL/UL MU PPDUs transmitted over the given channel width and RU width; and (ii) stations/APs belonging to the other BSSes did not receive any frame if BSS Color is set (due to BSS Color filtering) or if no transmission addressed to/from stations with the same AID was performed on a channel adjacent to the one they operate on, otherwise.

Parameters
txBssthe set of BSSes that transmitted an SU PPDU
txChannelWidththe given transmission channel width in MHz
ruTypethe given RU type
nRusthe number of RUs
isDlMutrue for DL MU PPDU, false for HE TB PPDU

Definition at line 870 of file wifi-primary-channels-test.cc.

References m_nBss, m_received, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckReceivedSuPpdus()

void WifiPrimaryChannelsTest::CheckReceivedSuPpdus ( std::set< uint8_t >  txBss,
uint16_t  txChannelWidth 
)

Check that (i) all stations belonging to the given BSSes received the SU PPDUs transmitted over the given channel width; and (ii) all stations belonging to the other BSSes did not receive any frame if BSS Color is set (due to BSS Color filtering) or if no transmission was performed on a channel adjacent to the one they operate on, otherwise.

Parameters
txBssthe set of BSSes that transmitted an SU PPDU
txChannelWidththe given transmission channel width in MHz

Definition at line 808 of file wifi-primary-channels-test.cc.

References m_nBss, m_nStationsPerBss, m_received, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckReceivedTriggerFrames()

void WifiPrimaryChannelsTest::CheckReceivedTriggerFrames ( std::set< uint8_t >  txBss,
uint16_t  txChannelWidth 
)

Check that (i) all stations belonging to the given BSSes received the transmitted Trigger Frame; and (ii) all stations belonging to the other BSSes did not receive any frame Trigger Frame (given that a Trigger Frame is transmitted on the primary20 channel and all the primary20 channels are distinct).

Parameters
txBssthe set of BSSes that transmitted a Trigger Frame
txChannelWidththe given transmission channel width in MHz

Definition at line 982 of file wifi-primary-channels-test.cc.

References m_nBss, m_nStationsPerBss, m_received, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void WifiPrimaryChannelsTest::DoRun ( void  )
overrideprivatevirtual

◆ DoSendHeTbPpdu()

void WifiPrimaryChannelsTest::DoSendHeTbPpdu ( uint8_t  bss,
uint16_t  txChannelWidth,
HeRu::RuType  ruType,
std::size_t  nRus 
)

Have the STAs of the given BSS transmit an HE TB PPDU using the given transmission channel width and RU type.

Parameters
bssthe given BSS
txChannelWidththe given transmission channel width in MHz
ruTypethe given RU type
nRusthe number of RUs

Definition at line 742 of file wifi-primary-channels-test.cc.

References ns3::NetDeviceContainer::Get(), ns3::WifiPsdu::GetSize(), ns3::Time::IsZero(), m_apDevices, m_staDevices, NS_LOG_INFO, ns3::Seconds(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiTxVector::SetLength(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, ns3::WIFI_MOD_CLASS_HE, and ns3::WIFI_PREAMBLE_HE_TB.

Referenced by SendHeTbPpdu().

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

◆ DoSetup()

◆ ReceiveDl()

void WifiPrimaryChannelsTest::ReceiveDl ( uint8_t  bss,
uint8_t  station,
Ptr< WifiPsdu psdu,
RxSignalInfo  rxSignalInfo,
WifiTxVector  txVector,
std::vector< bool >  perMpduStatus 
)

Callback invoked when a station receives a DL PPDU.

Parameters
bssthe BSS the receiving STA belongs to
stationthe receiving station
psduthe received PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorTxVector of the received PSDU
perMpduStatusper MPDU reception status

Definition at line 238 of file wifi-primary-channels-test.cc.

References ns3::WifiPsdu::GetHeader(), ns3::WifiPsdu::GetNMpdus(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsTrigger(), m_received, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

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

◆ ReceiveUl()

void WifiPrimaryChannelsTest::ReceiveUl ( uint8_t  bss,
Ptr< WifiPsdu psdu,
RxSignalInfo  rxSignalInfo,
WifiTxVector  txVector,
std::vector< bool >  perMpduStatus 
)

Callback invoked when an AP receives an UL PPDU.

Parameters
bssthe BSS the receiving AP belongs to
psduthe received PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorTxVector of the received PSDU
perMpduStatusper MPDU reception status

Definition at line 267 of file wifi-primary-channels-test.cc.

References ns3::NetDeviceContainer::Get(), ns3::WifiMacHeader::GetAddr3(), ns3::WifiPsdu::GetHeader(), ns3::WifiTxVector::GetHeMuUserInfoMap(), ns3::WifiPsdu::GetNMpdus(), ns3::WifiMacHeader::IsQosData(), ns3::WifiTxVector::IsUlMu(), m_apDevices, m_received, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

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

◆ SendDlMuPpdu()

void WifiPrimaryChannelsTest::SendDlMuPpdu ( uint8_t  bss,
uint16_t  txChannelWidth,
HeRu::RuType  ruType,
std::size_t  nRus 
)

Have the AP of the given BSS transmit a MU PPDU using the given transmission channel width and RU type.

Parameters
bssthe given BSS
txChannelWidththe given transmission channel width in MHz
ruTypethe given RU type
nRusthe number of RUs

Definition at line 691 of file wifi-primary-channels-test.cc.

References ns3::NetDeviceContainer::Get(), m_apDevices, m_staDevices, NS_LOG_INFO, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_MU.

Referenced by DoRun().

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

◆ SendDlSuPpdu()

void WifiPrimaryChannelsTest::SendDlSuPpdu ( uint8_t  bss,
uint16_t  txChannelWidth 
)

Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width.

Parameters
bssthe given BSS
txChannelWidththe given transmission channel width in MHz

Definition at line 670 of file wifi-primary-channels-test.cc.

References ns3::NetDeviceContainer::Get(), m_apDevices, m_staDevices, NS_LOG_INFO, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), SU_STA_ID, ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by DoRun().

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

◆ SendHeTbPpdu()

void WifiPrimaryChannelsTest::SendHeTbPpdu ( uint8_t  bss,
uint16_t  txChannelWidth,
HeRu::RuType  ruType,
std::size_t  nRus 
)

Have the AP of the given BSS transmit a Basic Trigger Frame.

This method calls DoSendHeTbPpdu to actually have STAs transmit HE TB PPDUs using the given transmission channel width and RU type

Parameters
bssthe given BSS
txChannelWidththe given transmission channel width in MHz
ruTypethe given RU type
nRusthe number of RUs

Definition at line 725 of file wifi-primary-channels-test.cc.

References DoSendHeTbPpdu(), ns3::NetDeviceContainer::Get(), ns3::WifiPsdu::GetHeader(), m_apDevices, m_trigger, m_triggerTxDuration, m_triggerTxVector, NS_LOG_INFO, and ns3::WifiMacHeader::SetAddr2().

Referenced by DoRun().

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

◆ Transmit()

void WifiPrimaryChannelsTest::Transmit ( std::string  context,
WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)

Callback invoked when PHY receives a PSDU to transmit.

Used to print transmitted PSDUs for debug purposes.

Parameters
contextthe context
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe tx power in Watts

Definition at line 218 of file wifi-primary-channels-test.cc.

References NS_LOG_INFO, and SU_STA_ID.

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_apDevices

NetDeviceContainer WifiPrimaryChannelsTest::m_apDevices
private

container for AP's NetDevice

Definition at line 195 of file wifi-primary-channels-test.cc.

Referenced by CheckAssociation(), DoRun(), DoSendHeTbPpdu(), DoSetup(), ReceiveUl(), SendDlMuPpdu(), SendDlSuPpdu(), and SendHeTbPpdu().

◆ m_channelWidth

uint16_t WifiPrimaryChannelsTest::m_channelWidth
private

operating channel width in MHz

Definition at line 190 of file wifi-primary-channels-test.cc.

Referenced by DoRun(), and DoSetup().

◆ m_nBss

uint8_t WifiPrimaryChannelsTest::m_nBss
private

◆ m_nStationsPerBss

uint8_t WifiPrimaryChannelsTest::m_nStationsPerBss
private

number of stations per AP

Definition at line 193 of file wifi-primary-channels-test.cc.

Referenced by CheckAssociation(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoRun(), and DoSetup().

◆ m_processed

std::vector<std::bitset<74> > WifiPrimaryChannelsTest::m_processed
private

whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was processed

Definition at line 198 of file wifi-primary-channels-test.cc.

Referenced by DoSetup().

◆ m_received

std::vector<std::bitset<74> > WifiPrimaryChannelsTest::m_received
private

whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was received

Definition at line 196 of file wifi-primary-channels-test.cc.

Referenced by CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoSetup(), ReceiveDl(), and ReceiveUl().

◆ m_staDevices

std::vector<NetDeviceContainer> WifiPrimaryChannelsTest::m_staDevices
private

containers for stations' NetDevices

Definition at line 194 of file wifi-primary-channels-test.cc.

Referenced by DoRun(), DoSendHeTbPpdu(), DoSetup(), SendDlMuPpdu(), and SendDlSuPpdu().

◆ m_time

Time WifiPrimaryChannelsTest::m_time
private

the time when the current action is executed

Definition at line 200 of file wifi-primary-channels-test.cc.

Referenced by DoRun().

◆ m_trigger

Ptr<WifiPsdu> WifiPrimaryChannelsTest::m_trigger
private

Basic Trigger Frame.

Definition at line 201 of file wifi-primary-channels-test.cc.

Referenced by DoSetup(), and SendHeTbPpdu().

◆ m_triggerTxDuration

Time WifiPrimaryChannelsTest::m_triggerTxDuration
private

TX duration for Basic Trigger Frame.

Definition at line 203 of file wifi-primary-channels-test.cc.

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

◆ m_triggerTxVector

WifiTxVector WifiPrimaryChannelsTest::m_triggerTxVector
private

TX vector for Basic Trigger Frame.

Definition at line 202 of file wifi-primary-channels-test.cc.

Referenced by DoSetup(), and SendHeTbPpdu().

◆ m_useDistinctBssColors

bool WifiPrimaryChannelsTest::m_useDistinctBssColors
private

true to set distinct BSS colors to BSSes

Definition at line 191 of file wifi-primary-channels-test.cc.

Referenced by DoSetup().


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