Make sure that the channel width and the channel number can be changed at runtime. More...
Public Member Functions | |
Bug2831TestCase () | |
virtual | ~Bug2831TestCase () |
void | DoRun (void) override |
Implementation to actually run this TestCase. More... | |
![]() | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
Private Member Functions | |
void | ChangeSupportedChannelWidth (void) |
Function called to change the supported channel width at runtime. More... | |
void | RxCallback (std::string context, Ptr< const Packet > p, RxPowerWattPerChannelBand rxPowersW) |
Callback triggered when a packet is received by the PHYs. More... | |
Private Attributes | |
Ptr< YansWifiPhy > | m_apPhy |
AP PHY. More... | |
uint16_t | m_countOperationalChannelWidth20 |
count number of beacon frames announcing a 20 MHz operating channel width More... | |
uint16_t | m_countOperationalChannelWidth40 |
count number of beacon frames announcing a 40 MHz operating channel width More... | |
uint16_t | m_reassocReqCount |
count number of reassociation requests More... | |
uint16_t | m_reassocRespCount |
count number of reassociation responses More... | |
Ptr< YansWifiPhy > | m_staPhy |
STA PHY. More... | |
Additional Inherited Members | |
![]() | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
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 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... | |
Make sure that the channel width and the channel number can be changed at runtime.
The scenario considers an access point and a station using a 20 MHz channel width. After 1s, we change the channel width and the channel number to use a 40 MHz channel. The tests checks the operational channel width sent in Beacon frames and verify that a reassociation procedure is executed.
See Bug 2831
Definition at line 1627 of file wifi-test.cc.
Bug2831TestCase::Bug2831TestCase | ( | ) |
Definition at line 1656 of file wifi-test.cc.
|
virtual |
Definition at line 1665 of file wifi-test.cc.
|
private |
Function called to change the supported channel width at runtime.
Definition at line 1670 of file wifi-test.cc.
References m_apPhy, m_staPhy, ns3::WifiPhy::SetChannelNumber(), and ns3::WifiPhy::SetChannelWidth().
Referenced by DoRun().
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 1709 of file wifi-test.cc.
References ns3::Node::AddDevice(), ns3::Object::AggregateObject(), ChangeSupportedChannelWidth(), third::channel, ns3::WifiPhy::ConfigureStandardAndBand(), ns3::Config::Connect(), ns3::ObjectFactory::Create(), m_apPhy, m_countOperationalChannelWidth20, m_countOperationalChannelWidth40, m_reassocReqCount, m_reassocRespCount, m_staPhy, third::mac, ns3::MakeCallback(), NS_TEST_ASSERT_MSG_EQ, RxCallback(), ns3::Seconds(), ns3::YansWifiPhy::SetChannel(), ns3::WifiPhy::SetChannelNumber(), ns3::WifiPhy::SetChannelWidth(), ns3::WifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiNetDevice::SetHtConfiguration(), ns3::WifiNetDevice::SetMac(), ns3::WifiPhy::SetMobility(), ns3::WifiNetDevice::SetPhy(), ns3::WifiNetDevice::SetRemoteStationManager(), ns3::ObjectFactory::SetTypeId(), ns3::WIFI_PHY_BAND_5GHZ, ns3::WIFI_PHY_STANDARD_80211ax, and ns3::WIFI_STANDARD_80211ax_5GHZ.
|
private |
Callback triggered when a packet is received by the PHYs.
context | the context |
p | the received packet |
rxPowersW | the received power per channel band in watts |
Definition at line 1679 of file wifi-test.cc.
References ns3::Packet::Copy(), ns3::MgtProbeResponseHeader::GetHtOperation(), ns3::HtOperation::GetStaChannelWidth(), ns3::WifiMacHeader::IsBeacon(), ns3::WifiMacHeader::IsReassocReq(), ns3::WifiMacHeader::IsReassocResp(), m_countOperationalChannelWidth20, m_countOperationalChannelWidth40, m_reassocReqCount, m_reassocRespCount, and ns3::Packet::RemoveHeader().
Referenced by DoRun().
|
private |
AP PHY.
Definition at line 1647 of file wifi-test.cc.
Referenced by ChangeSupportedChannelWidth(), and DoRun().
|
private |
count number of beacon frames announcing a 20 MHz operating channel width
Definition at line 1652 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
count number of beacon frames announcing a 40 MHz operating channel width
Definition at line 1653 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
count number of reassociation requests
Definition at line 1650 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
count number of reassociation responses
Definition at line 1651 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
STA PHY.
Definition at line 1648 of file wifi-test.cc.
Referenced by ChangeSupportedChannelWidth(), and DoRun().