Test transmissions under different primary channel settings. More...
Public Member Functions | |
WifiPrimaryChannelsTest (MHz_u channelWidth, bool useDistinctBssColors) | |
Constructor. | |
~WifiPrimaryChannelsTest () override | |
void | CheckAssociation () |
Check that all stations associated with an AP. | |
void | CheckReceivedMuPpdus (std::set< uint8_t > txBss, MHz_u 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. | |
void | CheckReceivedSuPpdus (std::set< uint8_t > txBss, MHz_u 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. | |
void | CheckReceivedTriggerFrames (std::set< uint8_t > txBss, MHz_u 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). | |
void | DoSendHeTbPpdu (uint8_t bss, MHz_u 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. | |
void | ReceiveDl (uint8_t bss, uint8_t station, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus) |
Callback invoked when a station receives a DL PPDU. | |
void | ReceiveUl (uint8_t bss, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus) |
Callback invoked when an AP receives an UL PPDU. | |
void | SendDlMuPpdu (uint8_t bss, MHz_u 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. | |
void | SendDlSuPpdu (uint8_t bss, MHz_u txChannelWidth) |
Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width. | |
void | SendHeTbPpdu (uint8_t bss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus) |
Have the AP of the given BSS transmit a Basic Trigger Frame. | |
void | Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback invoked when PHY receives a PSDU to transmit. | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
Private Attributes | |
NetDeviceContainer | m_apDevices |
container for AP's NetDevice | |
MHz_u | m_channelWidth |
operating channel width | |
uint8_t | m_nBss |
number of BSSes | |
uint8_t | m_nStationsPerBss |
number of stations per AP | |
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 | |
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 | |
std::vector< NetDeviceContainer > | m_staDevices |
containers for stations' NetDevices | |
Time | m_time |
the time when the current action is executed | |
Ptr< WifiPsdu > | m_trigger |
Basic Trigger Frame. | |
Time | m_triggerTxDuration |
TX duration for Basic Trigger Frame. | |
WifiTxVector | m_triggerTxVector |
TX vector for Basic Trigger Frame. | |
bool | m_useDistinctBssColors |
true to set distinct BSS colors to BSSes | |
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... | |
Static Public Attributes inherited from ns3::TestCase | |
static constexpr auto | QUICK = Duration::QUICK |
Deprecated test duration simple enums. | |
static constexpr auto | EXTENSIVE = Duration::EXTENSIVE |
static constexpr auto | TAKES_FOREVER = Duration::TAKES_FOREVER |
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 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 51 of file wifi-primary-channels-test.cc.
WifiPrimaryChannelsTest::WifiPrimaryChannelsTest | ( | MHz_u | channelWidth, |
bool | useDistinctBssColors ) |
Constructor.
channelWidth | the operating channel width |
useDistinctBssColors | whether to set distinct BSS colors to BSSes |
Definition at line 209 of file wifi-primary-channels-test.cc.
|
override |
Definition at line 216 of file wifi-primary-channels-test.cc.
void WifiPrimaryChannelsTest::CheckAssociation | ( | ) |
Check that all stations associated with an AP.
Definition at line 952 of file wifi-primary-channels-test.cc.
References ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), m_apDevices, m_nBss, m_nStationsPerBss, NS_TEST_EXPECT_MSG_EQ, and ns3::SINGLE_LINK_OP_ID.
Referenced by DoRun().
void WifiPrimaryChannelsTest::CheckReceivedMuPpdus | ( | std::set< uint8_t > | txBss, |
MHz_u | 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.
txBss | the set of BSSes that transmitted an SU PPDU |
txChannelWidth | the given transmission channel width |
ruType | the given RU type |
nRus | the number of RUs |
isDlMu | true for DL MU PPDU, false for HE TB PPDU |
Definition at line 1043 of file wifi-primary-channels-test.cc.
References m_nBss, m_nStationsPerBss, m_processed, m_received, m_useDistinctBssColors, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
void WifiPrimaryChannelsTest::CheckReceivedSuPpdus | ( | std::set< uint8_t > | txBss, |
MHz_u | 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.
txBss | the set of BSSes that transmitted an SU PPDU |
txChannelWidth | the given transmission channel width |
Definition at line 965 of file wifi-primary-channels-test.cc.
References m_nBss, m_nStationsPerBss, m_processed, m_received, m_useDistinctBssColors, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
void WifiPrimaryChannelsTest::CheckReceivedTriggerFrames | ( | std::set< uint8_t > | txBss, |
MHz_u | 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).
txBss | the set of BSSes that transmitted a Trigger Frame |
txChannelWidth | the given transmission channel width |
Definition at line 1166 of file wifi-primary-channels-test.cc.
References m_nBss, m_nStationsPerBss, m_processed, m_received, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 478 of file wifi-primary-channels-test.cc.
References CheckAssociation(), CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), ns3::Config::Connect(), ns3::Simulator::Destroy(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::HeRu::GetNRus(), m_apDevices, m_channelWidth, m_nBss, m_nStationsPerBss, m_staDevices, m_time, m_triggerTxDuration, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), ReceiveDl(), ReceiveUl(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), SendDlMuPpdu(), SendDlSuPpdu(), SendHeTbPpdu(), ns3::ApWifiMac::SetBeaconInterval(), ns3::WifiPhy::SetReceiveOkCallback(), ns3::WifiMac::SetSsid(), ns3::Simulator::Stop(), and Transmit().
void WifiPrimaryChannelsTest::DoSendHeTbPpdu | ( | uint8_t | bss, |
MHz_u | 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.
bss | the given BSS |
txChannelWidth | the given transmission channel width |
ruType | the given RU type |
nRus | the number of RUs |
Definition at line 868 of file wifi-primary-channels-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::Create(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::HePhy::GetHeMcs8(), ns3::Time::IsZero(), m_apDevices, m_staDevices, ns3::NanoSeconds(), 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::StaticCast(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_TB.
Referenced by SendHeTbPpdu().
|
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 314 of file wifi-primary-channels-test.cc.
References ns3::NetDeviceContainer::Add(), ns3::WifiHelper::AssignStreams(), ns3::WifiPhy::CalculateTxDuration(), ns3::Create(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Mac48Address::GetBroadcast(), ns3::OfdmPhy::GetOfdmRate6Mbps(), ns3::WifiPsdu::GetSize(), m_apDevices, m_channelWidth, m_nBss, m_nStationsPerBss, m_processed, m_received, m_staDevices, m_trigger, m_triggerTxDuration, m_triggerTxVector, m_useDistinctBssColors, ns3::MicroSeconds(), ns3::NanoSeconds(), NS_ABORT_MSG, ns3::AttributeContainerValue< A, Sep, C >::Set(), ns3::WifiMacHeader::SetAddr1(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::CtrlTriggerHeader::SetType(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_CTL_TRIGGER, ns3::WIFI_PHY_BAND_5GHZ, ns3::WIFI_PREAMBLE_LONG, and ns3::WIFI_STANDARD_80211ax.
void WifiPrimaryChannelsTest::ReceiveDl | ( | uint8_t | bss, |
uint8_t | station, | ||
Ptr< const WifiPsdu > | psdu, | ||
RxSignalInfo | rxSignalInfo, | ||
WifiTxVector | txVector, | ||
std::vector< bool > | perMpduStatus ) |
Callback invoked when a station receives a DL PPDU.
bss | the BSS the receiving STA belongs to |
station | the receiving station |
psdu | the received PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | TxVector of the received PSDU |
perMpduStatus | per MPDU reception status |
Definition at line 243 of file wifi-primary-channels-test.cc.
References ns3::DynamicCast(), ns3::WifiMacHeader::GetAddr1(), ns3::Mac48Address::GetBroadcast(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsTrigger(), m_processed, m_received, m_staDevices, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
void WifiPrimaryChannelsTest::ReceiveUl | ( | uint8_t | bss, |
Ptr< const WifiPsdu > | psdu, | ||
RxSignalInfo | rxSignalInfo, | ||
WifiTxVector | txVector, | ||
std::vector< bool > | perMpduStatus ) |
Callback invoked when an AP receives an UL PPDU.
bss | the BSS the receiving AP belongs to |
psdu | the received PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | TxVector of the received PSDU |
perMpduStatus | per MPDU reception status |
Definition at line 279 of file wifi-primary-channels-test.cc.
References ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::WifiTxVector::GetHeMuUserInfoMap(), ns3::WifiTxVector::IsUlMu(), m_apDevices, m_processed, m_received, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
void WifiPrimaryChannelsTest::SendDlMuPpdu | ( | uint8_t | bss, |
MHz_u | 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.
bss | the given BSS |
txChannelWidth | the given transmission channel width |
ruType | the given RU type |
nRus | the number of RUs |
Definition at line 787 of file wifi-primary-channels-test.cc.
References ns3::Create(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::HeRu::GetEqualizedRuAllocation(), ns3::HePhy::GetHeMcs8(), ns3::VhtPhy::GetVhtMcs5(), m_apDevices, m_staDevices, ns3::NanoSeconds(), NS_LOG_INFO, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiTxVector::SetRuAllocation(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiTxVector::SetSigBMode(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_MU.
Referenced by DoRun().
void WifiPrimaryChannelsTest::SendDlSuPpdu | ( | uint8_t | bss, |
MHz_u | txChannelWidth ) |
Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width.
bss | the given BSS |
txChannelWidth | the given transmission channel width |
Definition at line 755 of file wifi-primary-channels-test.cc.
References ns3::Create(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::HePhy::GetHeMcs8(), m_apDevices, m_staDevices, ns3::NanoSeconds(), NS_LOG_INFO, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), ns3::SU_STA_ID, ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by DoRun().
void WifiPrimaryChannelsTest::SendHeTbPpdu | ( | uint8_t | bss, |
MHz_u | 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
bss | the given BSS |
txChannelWidth | the given transmission channel width |
ruType | the given RU type |
nRus | the number of RUs |
Definition at line 844 of file wifi-primary-channels-test.cc.
References DoSendHeTbPpdu(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::WifiPsdu::GetHeader(), m_apDevices, m_trigger, m_triggerTxDuration, m_triggerTxVector, NS_LOG_INFO, ns3::Simulator::Schedule(), and ns3::WifiMacHeader::SetAddr2().
Referenced by DoRun().
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.
context | the context |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Definition at line 221 of file wifi-primary-channels-test.cc.
References NS_LOG_INFO, and ns3::SU_STA_ID.
Referenced by DoRun().
|
private |
container for AP's NetDevice
Definition at line 198 of file wifi-primary-channels-test.cc.
Referenced by CheckAssociation(), DoRun(), DoSendHeTbPpdu(), DoSetup(), ReceiveUl(), SendDlMuPpdu(), SendDlSuPpdu(), and SendHeTbPpdu().
|
private |
operating channel width
Definition at line 193 of file wifi-primary-channels-test.cc.
|
private |
number of BSSes
Definition at line 195 of file wifi-primary-channels-test.cc.
Referenced by CheckAssociation(), CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoRun(), and DoSetup().
|
private |
number of stations per AP
Definition at line 196 of file wifi-primary-channels-test.cc.
Referenced by CheckAssociation(), CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoRun(), and DoSetup().
|
private |
whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was processed
Definition at line 201 of file wifi-primary-channels-test.cc.
Referenced by CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoSetup(), ReceiveDl(), and ReceiveUl().
|
private |
whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was received
Definition at line 199 of file wifi-primary-channels-test.cc.
Referenced by CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoSetup(), ReceiveDl(), and ReceiveUl().
|
private |
containers for stations' NetDevices
Definition at line 197 of file wifi-primary-channels-test.cc.
Referenced by DoRun(), DoSendHeTbPpdu(), DoSetup(), ReceiveDl(), SendDlMuPpdu(), and SendDlSuPpdu().
|
private |
the time when the current action is executed
Definition at line 203 of file wifi-primary-channels-test.cc.
Referenced by DoRun().
Basic Trigger Frame.
Definition at line 204 of file wifi-primary-channels-test.cc.
Referenced by DoSetup(), and SendHeTbPpdu().
|
private |
TX duration for Basic Trigger Frame.
Definition at line 206 of file wifi-primary-channels-test.cc.
Referenced by DoRun(), DoSetup(), and SendHeTbPpdu().
|
private |
TX vector for Basic Trigger Frame.
Definition at line 205 of file wifi-primary-channels-test.cc.
Referenced by DoSetup(), and SendHeTbPpdu().
|
private |
true to set distinct BSS colors to BSSes
Definition at line 194 of file wifi-primary-channels-test.cc.
Referenced by CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), and DoSetup().