A Discrete-Event Network Simulator
API
Bug2831TestCase Class Reference

Make sure that the channel width and the channel number can be changed at runtime. More...

+ Inheritance diagram for Bug2831TestCase:
+ Collaboration diagram for Bug2831TestCase:

Public Member Functions

 Bug2831TestCase ()
 
virtual ~Bug2831TestCase ()
 
void DoRun (void) override
 Implementation to actually run this TestCase. 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 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< YansWifiPhym_apPhy
 AP PHY. More...
 
uint16_t m_assocReqCount
 count number of association requests More...
 
uint16_t m_assocRespCount
 count number of association responses 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...
 
Ptr< YansWifiPhym_staPhy
 STA PHY. 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

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 1642 of file wifi-test.cc.

Constructor & Destructor Documentation

◆ Bug2831TestCase()

Bug2831TestCase::Bug2831TestCase ( )

Definition at line 1671 of file wifi-test.cc.

◆ ~Bug2831TestCase()

Bug2831TestCase::~Bug2831TestCase ( )
virtual

Definition at line 1680 of file wifi-test.cc.

Member Function Documentation

◆ ChangeSupportedChannelWidth()

void Bug2831TestCase::ChangeSupportedChannelWidth ( void  )
private

Function called to change the supported channel width at runtime.

Definition at line 1685 of file wifi-test.cc.

References m_apPhy, m_staPhy, ns3::WifiPhy::SetOperatingChannel(), and ns3::WIFI_PHY_BAND_5GHZ.

Referenced by DoRun().

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

◆ DoRun()

◆ RxCallback()

void Bug2831TestCase::RxCallback ( std::string  context,
Ptr< const Packet p,
RxPowerWattPerChannelBand  rxPowersW 
)
private

Callback triggered when a packet is received by the PHYs.

Parameters
contextthe context
pthe received packet
rxPowersWthe received power per channel band in watts

Definition at line 1692 of file wifi-test.cc.

References ns3::Packet::Copy(), ns3::MgtProbeResponseHeader::GetHtOperation(), ns3::HtOperation::GetStaChannelWidth(), ns3::WifiMacHeader::IsAssocReq(), ns3::WifiMacHeader::IsAssocResp(), ns3::WifiMacHeader::IsBeacon(), m_assocReqCount, m_assocRespCount, m_countOperationalChannelWidth20, m_countOperationalChannelWidth40, and ns3::Packet::RemoveHeader().

Referenced by DoRun().

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

Member Data Documentation

◆ m_apPhy

Ptr<YansWifiPhy> Bug2831TestCase::m_apPhy
private

AP PHY.

Definition at line 1662 of file wifi-test.cc.

Referenced by ChangeSupportedChannelWidth(), and DoRun().

◆ m_assocReqCount

uint16_t Bug2831TestCase::m_assocReqCount
private

count number of association requests

Definition at line 1665 of file wifi-test.cc.

Referenced by DoRun(), and RxCallback().

◆ m_assocRespCount

uint16_t Bug2831TestCase::m_assocRespCount
private

count number of association responses

Definition at line 1666 of file wifi-test.cc.

Referenced by DoRun(), and RxCallback().

◆ m_countOperationalChannelWidth20

uint16_t Bug2831TestCase::m_countOperationalChannelWidth20
private

count number of beacon frames announcing a 20 MHz operating channel width

Definition at line 1667 of file wifi-test.cc.

Referenced by DoRun(), and RxCallback().

◆ m_countOperationalChannelWidth40

uint16_t Bug2831TestCase::m_countOperationalChannelWidth40
private

count number of beacon frames announcing a 40 MHz operating channel width

Definition at line 1668 of file wifi-test.cc.

Referenced by DoRun(), and RxCallback().

◆ m_staPhy

Ptr<YansWifiPhy> Bug2831TestCase::m_staPhy
private

STA PHY.

Definition at line 1663 of file wifi-test.cc.

Referenced by ChangeSupportedChannelWidth(), and DoRun().


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