A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
 ~WifiUseAvailBwTest () override
 
void CheckResults ()
 Check correctness of transmitted frames.
 
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.
 
void Transmit (uint8_t bss, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when a PHY receives a PSDU to transmit.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase.
 

Private Attributes

NetDeviceContainer m_apDevices
 container for AP's NetDevice
 
uint16_t m_bss0Width
 width (MHz) of the transmission in BSS 0 started when BSS 1 is transmitting
 
std::vector< std::string > m_channelStr
 channel setting strings
 
std::array< uint8_t, 2 > m_rcvPkts
 number of packets received by the stations
 
std::array< PacketSocketAddress, 2 > m_sockets
 packet sockets for the two BSSes
 
NetDeviceContainer m_staDevices
 container for stations' NetDevices
 
uint8_t m_txPkts
 TX packets per BSS (in addition to the two required to establish BA agreement)
 
std::vector< FrameInfom_txPsdus
 transmitted PSDUs
 

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...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto 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.
 
TestCaseGetParent () 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.
 

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, and NS_TEST_EXPECT_MSG_LT.

Referenced by DoRun().

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

◆ DoRun()

void WifiUseAvailBwTest::DoRun ( )
overrideprivatevirtual

◆ 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 m_rcvPkts, and NS_LOG_INFO.

Referenced by DoRun().

+ 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 ns3::WifiPhy::CalculateTxDuration(), ns3::NetDeviceContainer::Get(), m_apDevices, m_bss0Width, m_sockets, m_txPkts, m_txPsdus, ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::Simulator::Now(), NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Schedule(), 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: