A Discrete-Event Network Simulator
API
WifiTxopTest Class Reference

Test TXOP rules. More...

+ Inheritance diagram for WifiTxopTest:
+ Collaboration diagram for WifiTxopTest:

Classes

struct  FrameInfo
 Information about transmitted frames. More...
 

Public Member Functions

 WifiTxopTest (bool pifsRecovery)
 Constructor. More...
 
virtual ~WifiTxopTest ()
 
void CheckResults (void)
 Check correctness of transmitted frames. More...
 
void L7Receive (std::string context, Ptr< const Packet > p, const Address &addr)
 Function to trace packets received by the server application. More...
 
void Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when 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 (void) const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

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

Private Attributes

uint8_t m_aifsn
 AIFSN for BE. More...
 
NetDeviceContainer m_apDevices
 container for AP's NetDevice More...
 
uint32_t m_cwMin
 CWmin for BE. More...
 
uint16_t m_nStations
 number of stations More...
 
bool m_pifsRecovery
 whether to use PIFS recovery More...
 
uint16_t m_received
 number of packets received by the stations More...
 
NetDeviceContainer m_staDevices
 container for stations' NetDevices More...
 
Time m_txopLimit
 TXOP limit. 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 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

Test TXOP rules.

Definition at line 53 of file wifi-txop-test.cc.

Constructor & Destructor Documentation

◆ WifiTxopTest()

WifiTxopTest::WifiTxopTest ( bool  pifsRecovery)

Constructor.

Parameters
pifsRecoverywhether PIFS recovery is used after failure of a non-initial frame

Definition at line 106 of file wifi-txop-test.cc.

◆ ~WifiTxopTest()

WifiTxopTest::~WifiTxopTest ( )
virtual

Definition at line 115 of file wifi-txop-test.cc.

Member Function Documentation

◆ CheckResults()

void WifiTxopTest::CheckResults ( void  )

Check correctness of transmitted frames.

Definition at line 321 of file wifi-txop-test.cc.

References ns3::NetDeviceContainer::Get(), m_aifsn, m_apDevices, m_cwMin, m_pifsRecovery, m_received, m_staDevices, m_txopLimit, m_txPsdus, ns3::MicroSeconds(), ns3::NanoSeconds(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_GT_OR_EQ, NS_TEST_ASSERT_MSG_LT, NS_TEST_ASSERT_MSG_LT_OR_EQ, and ns3::Seconds().

Referenced by DoRun().

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

◆ DoRun()

◆ L7Receive()

void WifiTxopTest::L7Receive ( std::string  context,
Ptr< const Packet p,
const Address addr 
)

Function to trace packets received by the server application.

Parameters
contextthe context
pthe packet
addrthe address

Definition at line 120 of file wifi-txop-test.cc.

References ns3::Packet::GetSize(), and m_received.

Referenced by DoRun().

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

◆ Transmit()

void WifiTxopTest::Transmit ( std::string  context,
WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)

Callback invoked when PHY receives a PSDU to transmit.

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

Definition at line 129 of file wifi-txop-test.cc.

References m_txPsdus, ns3::MilliSeconds(), ns3::Now(), SU_STA_ID, 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_aifsn

uint8_t WifiTxopTest::m_aifsn
private

AIFSN for BE.

Definition at line 100 of file wifi-txop-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_apDevices

NetDeviceContainer WifiTxopTest::m_apDevices
private

container for AP's NetDevice

Definition at line 97 of file wifi-txop-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_cwMin

uint32_t WifiTxopTest::m_cwMin
private

CWmin for BE.

Definition at line 101 of file wifi-txop-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_nStations

uint16_t WifiTxopTest::m_nStations
private

number of stations

Definition at line 95 of file wifi-txop-test.cc.

Referenced by DoRun().

◆ m_pifsRecovery

bool WifiTxopTest::m_pifsRecovery
private

whether to use PIFS recovery

Definition at line 103 of file wifi-txop-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_received

uint16_t WifiTxopTest::m_received
private

number of packets received by the stations

Definition at line 102 of file wifi-txop-test.cc.

Referenced by CheckResults(), and L7Receive().

◆ m_staDevices

NetDeviceContainer WifiTxopTest::m_staDevices
private

container for stations' NetDevices

Definition at line 96 of file wifi-txop-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_txopLimit

Time WifiTxopTest::m_txopLimit
private

TXOP limit.

Definition at line 99 of file wifi-txop-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_txPsdus

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

transmitted PSDUs

Definition at line 98 of file wifi-txop-test.cc.

Referenced by CheckResults(), and Transmit().


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