Two BSSes, each with one AP and one non-AP STA, are configured to operate on different channels. More...
Classes | |
struct | FrameInfo |
Information about transmitted frames. More... | |
Public Member Functions | |
WifiUseAvailBwTest (std::initializer_list< std::string > channelStr, uint16_t bss0Width) | |
Constructor. More... | |
~WifiUseAvailBwTest () override | |
void | CheckResults () |
Check correctness of transmitted frames. More... | |
void | L7Receive (uint8_t bss, Ptr< const Packet > p, const Address &addr) |
Function to trace packets received by the server application in the given BSS. More... | |
void | Transmit (uint8_t bss, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback invoked when a 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 () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
Private Attributes | |
NetDeviceContainer | m_apDevices |
container for AP's NetDevice More... | |
uint16_t | m_bss0Width |
width (MHz) of the transmission in BSS 0 started when BSS 1 is transmitting More... | |
std::vector< std::string > | m_channelStr |
channel setting strings More... | |
std::array< uint8_t, 2 > | m_rcvPkts |
number of packets received by the stations More... | |
std::array< PacketSocketAddress, 2 > | m_sockets |
packet sockets for the two BSSes More... | |
NetDeviceContainer | m_staDevices |
container for stations' NetDevices More... | |
uint8_t | m_txPkts |
TX packets per BSS (in addition to the two required to establish BA agreement) More... | |
std::vector< FrameInfo > | m_txPsdus |
transmitted PSDUs 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... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () 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 () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () 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... | |
Two BSSes, each with one AP and one non-AP STA, are configured to operate on different channels.
Specifically, the operating channel of BSS 1 is the secondary<X> channel of BSS 0, where X is half the width of the channel used by BSS 0. This test demonstrates that, if a transmission is ongoing on BSS 1, we can have a transmission on BSS 0 on its primary<X> channel.
Definition at line 50 of file wifi-dynamic-bw-op-test.cc.
WifiUseAvailBwTest::WifiUseAvailBwTest | ( | std::initializer_list< std::string > | channelStr, |
uint16_t | bss0Width | ||
) |
Constructor.
channelStr | channel setting strings for BSS 0 and BSS 1 |
bss0Width | width (MHz) of the transmission in BSS 0 started when BSS 1 is transmitting |
Definition at line 108 of file wifi-dynamic-bw-op-test.cc.
|
override |
Definition at line 118 of file wifi-dynamic-bw-op-test.cc.
void WifiUseAvailBwTest::CheckResults | ( | ) |
Check correctness of transmitted frames.
Definition at line 324 of file wifi-dynamic-bw-op-test.cc.
References ns3::NetDeviceContainer::Get(), m_apDevices, m_bss0Width, m_rcvPkts, m_txPkts, m_txPsdus, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_LT, and prev.
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 186 of file wifi-dynamic-bw-op-test.cc.
References ns3::NetDeviceContainer::Add(), ns3::Node::AddApplication(), CheckResults(), ns3::Config::ConnectWithoutContext(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Object::GetObject(), ns3::MobilityModel::GetPosition(), ns3::PacketSocketHelper::Install(), L7Receive(), m_apDevices, m_channelStr, m_sockets, m_staDevices, m_txPkts, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), third::mobility, NS_LOG_INFO, third::phy, ns3::Seconds(), brite-generic-example::server, ns3::WifiMacHelper::SetType(), nlohmann::to_string(), Transmit(), third::wifi, ns3::WIFI_STANDARD_80211ax, and third::wifiStaNodes.
Function to trace packets received by the server application in the given BSS.
bss | the given BSS |
p | the packet |
addr | the address |
Definition at line 123 of file wifi-dynamic-bw-op-test.cc.
References ns3::Packet::GetSize(), m_rcvPkts, and NS_LOG_INFO.
Referenced by DoRun().
void WifiUseAvailBwTest::Transmit | ( | uint8_t | bss, |
WifiConstPsduMap | psduMap, | ||
WifiTxVector | txVector, | ||
double | txPowerW | ||
) |
Callback invoked when a PHY receives a PSDU to transmit.
bss | the BSS the PSDU belongs to |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Definition at line 130 of file wifi-dynamic-bw-op-test.cc.
References brite-generic-example::client, ns3::NetDeviceContainer::Get(), m_apDevices, m_bss0Width, m_sockets, m_txPkts, m_txPsdus, third::mac, ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::Now(), NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, ns3::Seconds(), and ns3::WIFI_PHY_BAND_5GHZ.
Referenced by DoRun().
|
private |
container for AP's NetDevice
Definition at line 100 of file wifi-dynamic-bw-op-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
width (MHz) of the transmission in BSS 0 started when BSS 1 is transmitting
Definition at line 97 of file wifi-dynamic-bw-op-test.cc.
Referenced by CheckResults(), and Transmit().
|
private |
channel setting strings
Definition at line 96 of file wifi-dynamic-bw-op-test.cc.
Referenced by DoRun().
|
private |
number of packets received by the stations
Definition at line 105 of file wifi-dynamic-bw-op-test.cc.
Referenced by CheckResults(), and L7Receive().
|
private |
packet sockets for the two BSSes
Definition at line 101 of file wifi-dynamic-bw-op-test.cc.
Referenced by DoRun(), and Transmit().
|
private |
container for stations' NetDevices
Definition at line 99 of file wifi-dynamic-bw-op-test.cc.
Referenced by DoRun().
|
private |
TX packets per BSS (in addition to the two required to establish BA agreement)
Definition at line 103 of file wifi-dynamic-bw-op-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
transmitted PSDUs
Definition at line 102 of file wifi-dynamic-bw-op-test.cc.
Referenced by CheckResults(), and Transmit().