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

It's a base class with some utility methods for other test cases in this file. More...

+ Inheritance diagram for WifiCoTraceHelperBaseTestCase:
+ Collaboration diagram for WifiCoTraceHelperBaseTestCase:

Public Member Functions

 WifiCoTraceHelperBaseTestCase (const std::string &testName)
 Constructor.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Protected Member Functions

void ConfigureTidToLinkMapping (const std::string &mapping)
 A helper function that sets tid-to-link mapping.
 
void DisableAggregation ()
 A helper function that disables frame aggregation.
 
const std::map< WifiPhyState, Time > & GetChannelOccupancy (size_t nodeId, size_t linkId, WifiCoTraceHelper &coHelper)
 It gets the channel occupancy of a link on a node measured by WifiCoTraceHelper.
 
Ptr< PacketSocketClientInstallPacketSocketClient (Ptr< Node > client, Ptr< Node > server, size_t prot, Time startAfter, size_t numPkts, size_t pktLen, size_t tid)
 A helper function that installs PacketSocketClient application on a node.
 
void InstallPacketSocketServer (Ptr< Node > node, Time startAfter, size_t prot)
 A helper function that installs PacketSocketServer on a node.
 
void SchedulePackets (Ptr< Node > from, Ptr< Node > to, Time startAfter, size_t numPkts, size_t pktLen, size_t tid)
 A helper function that schedules to send given number of packets from one node to another.
 
- 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.
 

Protected Attributes

NetDeviceContainer m_devices
 Container of all devices instantiated in this test case.
 
NodeContainer m_nodes
 Container of all nodes instantiated in this test case.
 
Time m_simulationStop {Seconds(5.0)}
 Instant at which simulation should stop.
 
size_t protocol
 A unique Protocol used in each PacketSocketClient and PacketSocketServer pair.
 

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...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER
 

Detailed Description

It's a base class with some utility methods for other test cases in this file.

Definition at line 46 of file wifi-co-trace-helper-test.cc.

Constructor & Destructor Documentation

◆ WifiCoTraceHelperBaseTestCase()

WifiCoTraceHelperBaseTestCase::WifiCoTraceHelperBaseTestCase ( const std::string & testName)
inline

Constructor.

Parameters
testNameName of a test.

Definition at line 54 of file wifi-co-trace-helper-test.cc.

Member Function Documentation

◆ ConfigureTidToLinkMapping()

void WifiCoTraceHelperBaseTestCase::ConfigureTidToLinkMapping ( const std::string & mapping)
protected

A helper function that sets tid-to-link mapping.

Parameters
mappingA string that configure tid-to-link mapping.

Definition at line 159 of file wifi-co-trace-helper-test.cc.

References ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), and m_devices.

Referenced by MLOTestCase::DoRun().

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

◆ DisableAggregation()

void WifiCoTraceHelperBaseTestCase::DisableAggregation ( )
protected

A helper function that disables frame aggregation.

Definition at line 241 of file wifi-co-trace-helper-test.cc.

References ns3::DynamicCast(), ns3::NodeContainer::Get(), ns3::Node::GetDevice(), ns3::NodeContainer::GetN(), and m_nodes.

Referenced by MLOTestCase::DoSetup(), and SendOnePacketTestCase::DoSetup().

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

◆ GetChannelOccupancy()

const std::map< WifiPhyState, Time > & WifiCoTraceHelperBaseTestCase::GetChannelOccupancy ( size_t nodeId,
size_t linkId,
WifiCoTraceHelper & coHelper )
protected

It gets the channel occupancy of a link on a node measured by WifiCoTraceHelper.

Parameters
nodeIdId of a node.
linkIdId of link.
coHelperHelper to obtain channel occupancy
Returns
Statistics measured by WifiCoTraceHelper corresponding to nodeId,linkId.

Definition at line 139 of file wifi-co-trace-helper-test.cc.

References ns3::WifiCoTraceHelper::GetDeviceRecords(), and NS_ASSERT_MSG.

Referenced by MLOTestCase::DoRun(), and SendOnePacketTestCase::DoRun().

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

◆ InstallPacketSocketClient()

Ptr< PacketSocketClient > WifiCoTraceHelperBaseTestCase::InstallPacketSocketClient ( Ptr< Node > client,
Ptr< Node > server,
size_t prot,
Time startAfter,
size_t numPkts,
size_t pktLen,
size_t tid )
protected

A helper function that installs PacketSocketClient application on a node.

Install packet socket client that generates an uplink flow on a node.

Parameters
clientThe node on which the client is installed.
serverA node on which PacketSocketServer is installed and to whom the client sends requests.
protThe protocol number used by both the client and the server.
startAfterThe client starts after a delay of "startAfter" duration.
numPktsThe client sends these many packets to server immediately.
pktLenThe length of each packet in bytes.
tidThe tid of each packet.
Returns
A pointer to the installed PacketSocketClient application.

Definition at line 196 of file wifi-co-trace-helper-test.cc.

References ns3::CreateObject(), ns3::DynamicCast(), ns3::Simulator::Now(), NS_LOG_INFO, ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), and ns3::PacketSocketAddress::SetSingleDevice().

Referenced by SchedulePackets().

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

◆ InstallPacketSocketServer()

void WifiCoTraceHelperBaseTestCase::InstallPacketSocketServer ( Ptr< Node > node,
Time startAfter,
size_t prot )
protected

A helper function that installs PacketSocketServer on a node.

Install Packet Socket Server on a node.

Parameters
nodeThe node on which the server is installed.
startAfterThe server starts after a delay of "startAfter" duration.
protThe PacketSocketAddress of the server uses "prot" as its protocol number.

A Packet Socket client generates an uplink flow and sends it to the server.

Definition at line 178 of file wifi-co-trace-helper-test.cc.

References ns3::CreateObject(), ns3::DynamicCast(), ns3::PacketSocketAddress::SetProtocol(), and ns3::PacketSocketAddress::SetSingleDevice().

Referenced by SchedulePackets().

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

◆ SchedulePackets()

void WifiCoTraceHelperBaseTestCase::SchedulePackets ( Ptr< Node > from,
Ptr< Node > to,
Time startAfter,
size_t numPkts,
size_t pktLen,
size_t tid = 0 )
protected

A helper function that schedules to send given number of packets from one node to another.

Parameters
fromThe node which sends the packets.
toThe node which receives the packets.
startAfterThe packets are scheduled to send after this much duration.
numPktsThe number of packets.
pktLenThe length of each packet in bytes.
tidThe optional tid of each packet. The default value is "0".

Definition at line 226 of file wifi-co-trace-helper-test.cc.

References InstallPacketSocketClient(), InstallPacketSocketServer(), and protocol.

Referenced by LinkRenameTestCase::DoRun(), MLOTestCase::DoRun(), and SendOnePacketTestCase::DoRun().

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

Member Data Documentation

◆ m_devices

NetDeviceContainer WifiCoTraceHelperBaseTestCase::m_devices
protected

Container of all devices instantiated in this test case.

Definition at line 133 of file wifi-co-trace-helper-test.cc.

Referenced by ConfigureTidToLinkMapping(), LinkRenameTestCase::DoSetup(), MLOTestCase::DoSetup(), and SendOnePacketTestCase::DoSetup().

◆ m_nodes

NodeContainer WifiCoTraceHelperBaseTestCase::m_nodes
protected

◆ m_simulationStop

Time WifiCoTraceHelperBaseTestCase::m_simulationStop {Seconds(5.0)}
protected

Instant at which simulation should stop.

Definition at line 131 of file wifi-co-trace-helper-test.cc.

Referenced by LinkRenameTestCase::DoRun(), and LinkRenameTestCase::DoSetup().

◆ protocol

size_t WifiCoTraceHelperBaseTestCase::protocol
protected
Initial value:
=
1

A unique Protocol used in each PacketSocketClient and PacketSocketServer pair.

Definition at line 134 of file wifi-co-trace-helper-test.cc.

Referenced by SchedulePackets().


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