A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
IbssCapabilitiesTest Class Reference

Test transmissions in IBSS when peers have different capabilities. More...

Inheritance diagram for IbssCapabilitiesTest:
Collaboration diagram for IbssCapabilitiesTest:

Public Member Functions

 IbssCapabilitiesTest (WifiStandard txStandard, WifiStandard rxStandard, bool beaconing)
 Constructor.
Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 Caller graph was not generated because of its size.
virtual ~TestCase ()
 Destructor.
std::string GetName () const
TestCase & operator= (const TestCase &)=delete

Private Member Functions

void CheckResults ()
 Check that the simulation produced the expected results.
void DoRun () override
 Implementation to actually run this TestCase.
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
void Receive (Ptr< const Packet > pkt, const Address &addr)
 Callback invoked when a packet is received by the packet socket server.
void Transmit (WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower)
 Callback invoked when a FEM passes PSDUs to the PHY.
void TxDrop (Ptr< const Packet > packet)
 Callback invoked when a packet is dropped by the MAC prior to enqueueing.
void TxGenerated (Ptr< const Packet > pkt, const Address &addr)
 Callback invoked when a packet is generated by the packet socket client.

Private Attributes

bool m_beaconing
 flag whether beacon generation is enabled
std::vector< Ptr< const Packet > > m_droppedPackets
 dropped packets
std::vector< Ptr< const Packet > > m_generatedPackets
 generated packets
std::size_t m_nPackets
 number of packets to generate
std::vector< Ptr< const Packet > > m_rxPackets
 received packets
WifiStandard m_rxStandard
 the standard for the RX device
WifiStandard m_txStandard
 the standard for the TX device
std::vector< WifiTxVector > m_txVectors
 TXVECTOR of transmitted packets.

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...
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.
TestCase * GetParent () 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

Test transmissions in IBSS when peers have different capabilities.

Definition at line 209 of file wifi-p2p-test.cc.

Constructor & Destructor Documentation

◆ IbssCapabilitiesTest()

IbssCapabilitiesTest::IbssCapabilitiesTest ( WifiStandard txStandard,
WifiStandard rxStandard,
bool beaconing )

Constructor.

Parameters
txStandardthe standard supported by the TX device
rxStandardthe standard supported by the RX device
beaconingflag whether beaconing is used in IBSS

Definition at line 273 of file wifi-p2p-test.cc.

References ns3::TestCase::TestCase(), m_beaconing, m_nPackets, m_rxStandard, and m_txStandard.

Here is the call graph for this function:

Member Function Documentation

◆ CheckResults()

void IbssCapabilitiesTest::CheckResults ( )
private

Check that the simulation produced the expected results.

Definition at line 317 of file wifi-p2p-test.cc.

References m_beaconing, m_droppedPackets, m_generatedPackets, m_nPackets, m_rxPackets, m_rxStandard, m_txStandard, m_txVectors, NS_ABORT_MSG, NS_TEST_EXPECT_MSG_EQ, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_MOD_CLASS_VHT, ns3::WIFI_STANDARD_80211ac, and ns3::WIFI_STANDARD_80211ax.

Referenced by DoRun().

Here is the caller graph for this function:

◆ DoRun()

void IbssCapabilitiesTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 498 of file wifi-p2p-test.cc.

References CheckResults(), ns3::Simulator::Destroy(), ns3::Simulator::Run(), ns3::Seconds(), and ns3::Simulator::Stop().

Here is the call graph for this function:

◆ DoSetup()

void IbssCapabilitiesTest::DoSetup ( )
overrideprivatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.

Reimplemented from ns3::TestCase.

Definition at line 416 of file wifi-p2p-test.cc.

References ns3::Node::AddApplication(), ns3::WifiHelper::AssignStreams(), ns3::Config::ConnectWithoutContext(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::YansWifiChannelHelper::Default(), ns3::NodeContainer::Get(), ns3::PacketSocketHelper::Install(), m_beaconing, m_nPackets, m_rxStandard, m_txStandard, ns3::MakeCallback(), Receive(), ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), Transmit(), TxDrop(), and TxGenerated().

Here is the call graph for this function:

◆ Receive()

void IbssCapabilitiesTest::Receive ( Ptr< const Packet > pkt,
const Address & addr )
private

Callback invoked when a packet is received by the packet socket server.

Parameters
pktthe packet
addrthe address

Definition at line 310 of file wifi-p2p-test.cc.

References m_rxPackets, and NS_LOG_FUNCTION.

Referenced by DoSetup().

Here is the caller graph for this function:

◆ Transmit()

void IbssCapabilitiesTest::Transmit ( WifiConstPsduMap psduMap,
WifiTxVector txVector,
Watt_u txPower )
private

Callback invoked when a FEM passes PSDUs to the PHY.

Parameters
psduMapthe PSDU map
txVectorthe TX vector
txPowerthe TX power

Definition at line 285 of file wifi-p2p-test.cc.

References m_txVectors, and NS_LOG_FUNCTION.

Referenced by DoSetup().

Here is the caller graph for this function:

◆ TxDrop()

void IbssCapabilitiesTest::TxDrop ( Ptr< const Packet > packet)
private

Callback invoked when a packet is dropped by the MAC prior to enqueueing.

Parameters
Packetthe dropped packet

Definition at line 296 of file wifi-p2p-test.cc.

References m_droppedPackets, and NS_LOG_FUNCTION.

Referenced by DoSetup().

Here is the caller graph for this function:

◆ TxGenerated()

void IbssCapabilitiesTest::TxGenerated ( Ptr< const Packet > pkt,
const Address & addr )
private

Callback invoked when a packet is generated by the packet socket client.

Parameters
pktthe packet
addrthe address

Definition at line 303 of file wifi-p2p-test.cc.

References m_generatedPackets, and NS_LOG_FUNCTION.

Referenced by DoSetup().

Here is the caller graph for this function:

Member Data Documentation

◆ m_beaconing

bool IbssCapabilitiesTest::m_beaconing
private

flag whether beacon generation is enabled

Definition at line 263 of file wifi-p2p-test.cc.

Referenced by IbssCapabilitiesTest(), CheckResults(), and DoSetup().

◆ m_droppedPackets

std::vector<Ptr<const Packet> > IbssCapabilitiesTest::m_droppedPackets
private

dropped packets

Definition at line 268 of file wifi-p2p-test.cc.

Referenced by CheckResults(), and TxDrop().

◆ m_generatedPackets

std::vector<Ptr<const Packet> > IbssCapabilitiesTest::m_generatedPackets
private

generated packets

Definition at line 269 of file wifi-p2p-test.cc.

Referenced by CheckResults(), and TxGenerated().

◆ m_nPackets

std::size_t IbssCapabilitiesTest::m_nPackets
private

number of packets to generate

Definition at line 265 of file wifi-p2p-test.cc.

Referenced by IbssCapabilitiesTest(), CheckResults(), and DoSetup().

◆ m_rxPackets

std::vector<Ptr<const Packet> > IbssCapabilitiesTest::m_rxPackets
private

received packets

Definition at line 270 of file wifi-p2p-test.cc.

Referenced by CheckResults(), and Receive().

◆ m_rxStandard

WifiStandard IbssCapabilitiesTest::m_rxStandard
private

the standard for the RX device

Definition at line 262 of file wifi-p2p-test.cc.

Referenced by IbssCapabilitiesTest(), CheckResults(), and DoSetup().

◆ m_txStandard

WifiStandard IbssCapabilitiesTest::m_txStandard
private

the standard for the TX device

Definition at line 261 of file wifi-p2p-test.cc.

Referenced by IbssCapabilitiesTest(), CheckResults(), and DoSetup().

◆ m_txVectors

std::vector<WifiTxVector> IbssCapabilitiesTest::m_txVectors
private

TXVECTOR of transmitted packets.

Definition at line 267 of file wifi-p2p-test.cc.

Referenced by CheckResults(), and Transmit().


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