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

RT mobile gaming traffic test. More...

Inheritance diagram for RtaTigMobileGamingTestCase:
Collaboration diagram for RtaTigMobileGamingTestCase:

Classes

struct  GamingParams
 Information about gaming parameters. More...
struct  TxInfo
 Information about transmitted packet. More...

Public Member Functions

 RtaTigMobileGamingTestCase (const std::string &name, const GamingParams &params)
 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
TestCaseoperator= (const TestCase &)=delete

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase.
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
void PacketTx (Ptr< const Packet > packet, RtaTigMobileGaming::TrafficModelStage stage)
 Record a packets successfully sent.
void ReceiveRx (std::string context, Ptr< const Packet > p, const Address &addr)
 Record a packet successfully received.

Private Attributes

GamingParams m_params
 parameters of the model
uint64_t m_received {0}
 number of bytes received
std::vector< TxInfom_sent
 transmitted gaming 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.
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

RT mobile gaming traffic test.

The test consider traffic values for the two models presented in IEEE 802.11 Real Time Applications TIG Report (Section 4.1.4: Traffic model) and for both downlink and uplink.

The test generates traffic between two nodes and keeps track of generated TX packets (size, timestamp and current stage). The test verifies the correct transition to stages, it checks the average sizes of generated packets for each stage match with the settings of the random variables, and it validates the average inter-arrival between generated gaming packets against the expected one based on the settings of the random variable.

Definition at line 58 of file rta-tig-mobile-gaming-test-suite.cc.

Constructor & Destructor Documentation

◆ RtaTigMobileGamingTestCase()

RtaTigMobileGamingTestCase::RtaTigMobileGamingTestCase ( const std::string & name,
const GamingParams & params )

Constructor.

Parameters
namethe name of the test to run
paramsthe VoIP parameters to use for the test, default parameters are used if not provided

Definition at line 121 of file rta-tig-mobile-gaming-test-suite.cc.

References ns3::TestCase::TestCase(), and m_params.

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void RtaTigMobileGamingTestCase::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 230 of file rta-tig-mobile-gaming-test-suite.cc.

References ns3::Simulator::Destroy(), ns3::RtaTigMobileGaming::ENDING, ns3::LargestExtremeValueRandomVariable::GetMean(), ns3::RtaTigMobileGaming::INITIAL, m_params, m_received, m_sent, NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_GT_OR_EQ, NS_TEST_ASSERT_MSG_LT_OR_EQ, NS_TEST_EXPECT_MSG_EQ_TOL, and ns3::Simulator::Run().

Here is the call graph for this function:

◆ DoSetup()

void RtaTigMobileGamingTestCase::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 145 of file rta-tig-mobile-gaming-test-suite.cc.

References ns3::Ipv4AddressHelper::Assign(), ns3::ApplicationHelper::AssignStreams(), ns3::Config::Connect(), ns3::Config::ConnectWithoutContext(), ns3::CreateObject(), ns3::CreateObjectWithAttributes(), ns3::Ipv4Address::GetAny(), ns3::RtaTigMobileGaming::GetTypeId(), ns3::ApplicationHelper::Install(), ns3::SimpleNetDeviceHelper::Install(), m_params, ns3::MakeCallback(), nodes, NS_LOG_FUNCTION, PacketTx(), port, ReceiveRx(), ns3::Seconds(), ns3::ApplicationHelper::SetAttribute(), ns3::Ipv4AddressHelper::SetBase(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and ns3::ApplicationContainer::Start().

Here is the call graph for this function:

◆ PacketTx()

void RtaTigMobileGamingTestCase::PacketTx ( Ptr< const Packet > packet,
RtaTigMobileGaming::TrafficModelStage stage )
private

Record a packets successfully sent.

Parameters
packetthe transmitted packet
stagethe gaming traffic model stage of the packet

Definition at line 129 of file rta-tig-mobile-gaming-test-suite.cc.

References m_sent, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by DoSetup().

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

◆ ReceiveRx()

void RtaTigMobileGamingTestCase::ReceiveRx ( std::string context,
Ptr< const Packet > p,
const Address & addr )
private

Record a packet successfully received.

Parameters
contextthe context
pthe packet
addrthe sender's address

Definition at line 138 of file rta-tig-mobile-gaming-test-suite.cc.

References m_received, and NS_LOG_FUNCTION.

Referenced by DoSetup().

Here is the caller graph for this function:

Member Data Documentation

◆ m_params

GamingParams RtaTigMobileGamingTestCase::m_params
private

parameters of the model

Definition at line 118 of file rta-tig-mobile-gaming-test-suite.cc.

Referenced by RtaTigMobileGamingTestCase(), DoRun(), and DoSetup().

◆ m_received

uint64_t RtaTigMobileGamingTestCase::m_received {0}
private

number of bytes received

Definition at line 116 of file rta-tig-mobile-gaming-test-suite.cc.

Referenced by DoRun(), and ReceiveRx().

◆ m_sent

std::vector<TxInfo> RtaTigMobileGamingTestCase::m_sent
private

transmitted gaming packets

Definition at line 115 of file rta-tig-mobile-gaming-test-suite.cc.

Referenced by DoRun(), and PacketTx().


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