A Discrete-Event Network Simulator
API
WifiChannelSwitchingTest Class Reference

This test verifies that communication between an AP and a STA resumes after that both switch channel and PHY band. More...

+ Inheritance diagram for WifiChannelSwitchingTest:
+ Collaboration diagram for WifiChannelSwitchingTest:

Public Member Functions

 WifiChannelSwitchingTest ()
 Constructor. More...
 
virtual ~WifiChannelSwitchingTest ()
 
void Associated (Mac48Address bssid)
 Callback invoked when a station associates with an AP. More...
 
void ChannelSwitch (void)
 Request channel switch on both AP and STA. More...
 
virtual void DoRun (void)
 Implementation to actually run this TestCase. More...
 
void L7Receive (Ptr< const Packet > p, const Address &addr)
 Function to trace packets received by the server application. More...
 
void SendPacket (void)
 Send a packet from the AP to the STA through a packet socket. More...
 
void StateChange (uint32_t nodeId, Time start, Time duration, WifiPhyState state)
 Callback invoked when the PHY on the given node changes state. More...
 
void Transmit (WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when PHY receives a PSDU to transmit from the MAC. 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 Attributes

NetDeviceContainer m_apDevice
 AP device container. More...
 
NodeContainer m_apNode
 AP node container. More...
 
uint8_t m_assocCount
 count of completed Assoc Request procedures More...
 
std::array< uint8_t, 2 > m_channelSwitchCount {0, 0}
 Per-node number of channel switch events. More...
 
uint32_t m_payloadSize
 payload size in bytes More...
 
uint64_t m_rxBytes
 RX bytes. More...
 
NetDeviceContainer m_staDevice
 STA device container. More...
 
NodeContainer m_staNode
 STA node container. More...
 
uint8_t m_txCount
 count of transmissions 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

This test verifies that communication between an AP and a STA resumes after that both switch channel and PHY band.

The channel switch is scheduled to happen during the transmission of a frame sent by the AP to the STA. STA discards the frame, associates with the AP again and finally receives the frame successfully.

Definition at line 52 of file wifi-channel-switching-test.cc.

Constructor & Destructor Documentation

◆ WifiChannelSwitchingTest()

WifiChannelSwitchingTest::WifiChannelSwitchingTest ( )

Constructor.

Definition at line 116 of file wifi-channel-switching-test.cc.

◆ ~WifiChannelSwitchingTest()

WifiChannelSwitchingTest::~WifiChannelSwitchingTest ( )
virtual

Definition at line 125 of file wifi-channel-switching-test.cc.

Member Function Documentation

◆ Associated()

void WifiChannelSwitchingTest::Associated ( Mac48Address  bssid)

Callback invoked when a station associates with an AP.

Tracks the number of times the association procedure is performed.

Parameters
bssidthe BSSID

Definition at line 130 of file wifi-channel-switching-test.cc.

References m_assocCount.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ ChannelSwitch()

void WifiChannelSwitchingTest::ChannelSwitch ( void  )

Request channel switch on both AP and STA.

Definition at line 202 of file wifi-channel-switching-test.cc.

References NS_LOG_INFO, and ns3::Config::Set().

Referenced by Transmit().

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

◆ DoRun()

void WifiChannelSwitchingTest::DoRun ( void  )
virtual

◆ L7Receive()

void WifiChannelSwitchingTest::L7Receive ( Ptr< const Packet p,
const Address addr 
)

Function to trace packets received by the server application.

Parameters
pthe packet
addrthe address

Definition at line 164 of file wifi-channel-switching-test.cc.

References ns3::Packet::GetSize(), m_payloadSize, and m_rxBytes.

Referenced by DoRun().

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

◆ SendPacket()

void WifiChannelSwitchingTest::SendPacket ( void  )

◆ StateChange()

void WifiChannelSwitchingTest::StateChange ( uint32_t  nodeId,
ns3::Time  start,
ns3::Time  duration,
WifiPhyState  state 
)

Callback invoked when the PHY on the given node changes state.

Parameters
nodeIdthe given node ID
startthe time state changes
durationthe time the PHY will stay in the new state
statethe new PHY state

Definition at line 210 of file wifi-channel-switching-test.cc.

References m_channelSwitchCount, and SWITCHING.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ Transmit()

void WifiChannelSwitchingTest::Transmit ( WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)

Callback invoked when PHY receives a PSDU to transmit from the MAC.

Tracks the number of times a QoS data frame is transmitted by the AP.

Parameters
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe tx power in Watts

Definition at line 136 of file wifi-channel-switching-test.cc.

References ChannelSwitch(), m_txCount, NS_LOG_INFO, 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:

Member Data Documentation

◆ m_apDevice

NetDeviceContainer WifiChannelSwitchingTest::m_apDevice
private

AP device container.

Definition at line 107 of file wifi-channel-switching-test.cc.

Referenced by DoRun(), and SendPacket().

◆ m_apNode

NodeContainer WifiChannelSwitchingTest::m_apNode
private

AP node container.

Definition at line 105 of file wifi-channel-switching-test.cc.

Referenced by DoRun(), and SendPacket().

◆ m_assocCount

uint8_t WifiChannelSwitchingTest::m_assocCount
private

count of completed Assoc Request procedures

Definition at line 109 of file wifi-channel-switching-test.cc.

Referenced by Associated(), and DoRun().

◆ m_channelSwitchCount

std::array<uint8_t, 2> WifiChannelSwitchingTest::m_channelSwitchCount {0, 0}
private

Per-node number of channel switch events.

Definition at line 113 of file wifi-channel-switching-test.cc.

Referenced by DoRun(), and StateChange().

◆ m_payloadSize

uint32_t WifiChannelSwitchingTest::m_payloadSize
private

payload size in bytes

Definition at line 112 of file wifi-channel-switching-test.cc.

Referenced by DoRun(), L7Receive(), and SendPacket().

◆ m_rxBytes

uint64_t WifiChannelSwitchingTest::m_rxBytes
private

RX bytes.

Definition at line 111 of file wifi-channel-switching-test.cc.

Referenced by DoRun(), and L7Receive().

◆ m_staDevice

NetDeviceContainer WifiChannelSwitchingTest::m_staDevice
private

STA device container.

Definition at line 108 of file wifi-channel-switching-test.cc.

Referenced by DoRun(), and SendPacket().

◆ m_staNode

NodeContainer WifiChannelSwitchingTest::m_staNode
private

STA node container.

Definition at line 106 of file wifi-channel-switching-test.cc.

Referenced by DoRun(), and SendPacket().

◆ m_txCount

uint8_t WifiChannelSwitchingTest::m_txCount
private

count of transmissions

Definition at line 110 of file wifi-channel-switching-test.cc.

Referenced by DoRun(), and Transmit().


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