Make sure that the channel width and the channel number can be changed at runtime. More...
Public Member Functions | |
Bug2831TestCase () | |
~Bug2831TestCase () override | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
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 | ChangeSupportedChannelWidth () |
Function called to change the supported channel width at runtime. | |
void | RxCallback (std::string context, Ptr< const Packet > p, RxPowerWattPerChannelBand rxPowersW) |
Callback triggered when a packet is received by the PHYs. | |
Private Attributes | |
Ptr< YansWifiPhy > | m_apPhy |
AP PHY. | |
uint16_t | m_assocReqCount |
count number of association requests | |
uint16_t | m_assocRespCount |
count number of association responses | |
uint16_t | m_countOperationalChannelWidth20 |
count number of beacon frames announcing a 20 MHz operating channel width | |
uint16_t | m_countOperationalChannelWidth40 |
count number of beacon frames announcing a 40 MHz operating channel width | |
Ptr< YansWifiPhy > | m_staPhy |
STA PHY. | |
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. | |
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 the association procedure is executed twice.
See Bug 2831
Definition at line 1730 of file wifi-test.cc.
Bug2831TestCase::Bug2831TestCase | ( | ) |
Definition at line 1761 of file wifi-test.cc.
|
override |
Definition at line 1770 of file wifi-test.cc.
|
private |
Function called to change the supported channel width at runtime.
Definition at line 1775 of file wifi-test.cc.
References m_apPhy, m_staPhy, ns3::WifiPhy::SetOperatingChannel(), and ns3::WIFI_PHY_BAND_5GHZ.
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 1814 of file wifi-test.cc.
References ns3::Mac48Address::Allocate(), ChangeSupportedChannelWidth(), ns3::WifiPhy::ConfigureStandard(), ns3::Config::Connect(), ns3::ObjectFactory::Create(), ns3::CreateObject(), ns3::CreateObjectWithAttributes(), ns3::Simulator::Destroy(), m_apPhy, m_assocReqCount, m_assocRespCount, m_countOperationalChannelWidth20, m_countOperationalChannelWidth40, m_staPhy, ns3::MakeCallback(), NS_TEST_ASSERT_MSG_EQ, ns3::Simulator::Run(), RxCallback(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::YansWifiPhy::SetChannel(), ns3::WifiMac::SetDevice(), ns3::WifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::YansWifiPhy::SetInterferenceHelper(), ns3::WifiPhy::SetMobility(), ns3::WifiPhy::SetOperatingChannel(), ns3::ObjectFactory::SetTypeId(), ns3::StaticCast(), ns3::Simulator::Stop(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.
|
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 1782 of file wifi-test.cc.
References ns3::WifiMacHeader::IsAssocReq(), ns3::WifiMacHeader::IsAssocResp(), ns3::WifiMacHeader::IsBeacon(), m_assocReqCount, m_assocRespCount, m_countOperationalChannelWidth20, and m_countOperationalChannelWidth40.
Referenced by DoRun().
|
private |
AP PHY.
Definition at line 1750 of file wifi-test.cc.
Referenced by ChangeSupportedChannelWidth(), and DoRun().
|
private |
count number of association requests
Definition at line 1753 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
count number of association responses
Definition at line 1754 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
count number of beacon frames announcing a 20 MHz operating channel width
Definition at line 1755 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 1757 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
STA PHY.
Definition at line 1751 of file wifi-test.cc.
Referenced by ChangeSupportedChannelWidth(), and DoRun().