A Discrete-Event Network Simulator
API
WifiUseAvailBwTest Class Reference

Two BSSes, each with one AP and one non-AP STA, are configured to operate on different channels. More...

+ Inheritance diagram for WifiUseAvailBwTest:
+ Collaboration diagram for WifiUseAvailBwTest:

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
 
TestCaseoperator= (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< FrameInfom_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...
 
TestCaseGetParent () 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ WifiUseAvailBwTest()

WifiUseAvailBwTest::WifiUseAvailBwTest ( std::initializer_list< std::string >  channelStr,
uint16_t  bss0Width 
)

Constructor.

Parameters
channelStrchannel setting strings for BSS 0 and BSS 1
bss0Widthwidth (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.

◆ ~WifiUseAvailBwTest()

WifiUseAvailBwTest::~WifiUseAvailBwTest ( )
override

Definition at line 118 of file wifi-dynamic-bw-op-test.cc.

Member Function Documentation

◆ CheckResults()

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().

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

◆ DoRun()

◆ L7Receive()

void WifiUseAvailBwTest::L7Receive ( uint8_t  bss,
Ptr< const Packet p,
const Address addr 
)

Function to trace packets received by the server application in the given BSS.

Parameters
bssthe given BSS
pthe packet
addrthe 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().

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

◆ Transmit()

void WifiUseAvailBwTest::Transmit ( uint8_t  bss,
WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)

Callback invoked when a PHY receives a PSDU to transmit.

Parameters
bssthe BSS the PSDU belongs to
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe 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().

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

Member Data Documentation

◆ m_apDevices

NetDeviceContainer WifiUseAvailBwTest::m_apDevices
private

container for AP's NetDevice

Definition at line 100 of file wifi-dynamic-bw-op-test.cc.

Referenced by CheckResults(), DoRun(), and Transmit().

◆ m_bss0Width

uint16_t WifiUseAvailBwTest::m_bss0Width
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().

◆ m_channelStr

std::vector<std::string> WifiUseAvailBwTest::m_channelStr
private

channel setting strings

Definition at line 96 of file wifi-dynamic-bw-op-test.cc.

Referenced by DoRun().

◆ m_rcvPkts

std::array<uint8_t, 2> WifiUseAvailBwTest::m_rcvPkts
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().

◆ m_sockets

std::array<PacketSocketAddress, 2> WifiUseAvailBwTest::m_sockets
private

packet sockets for the two BSSes

Definition at line 101 of file wifi-dynamic-bw-op-test.cc.

Referenced by DoRun(), and Transmit().

◆ m_staDevices

NetDeviceContainer WifiUseAvailBwTest::m_staDevices
private

container for stations' NetDevices

Definition at line 99 of file wifi-dynamic-bw-op-test.cc.

Referenced by DoRun().

◆ m_txPkts

uint8_t WifiUseAvailBwTest::m_txPkts
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().

◆ m_txPsdus

std::vector<FrameInfo> WifiUseAvailBwTest::m_txPsdus
private

transmitted PSDUs

Definition at line 102 of file wifi-dynamic-bw-op-test.cc.

Referenced by CheckResults(), and Transmit().


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