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

TGax voice-over-IP traffic test. More...

Inheritance diagram for TgaxVoipTrafficTestCase:
Collaboration diagram for TgaxVoipTrafficTestCase:

Classes

struct  TxInfo
 Information about transmitted packet. More...
struct  VoipParams
 Information about VoIP parameters. More...

Public Member Functions

 TgaxVoipTrafficTestCase (const std::string &name, std::optional< VoipParams > 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 PacketSent (Ptr< const Packet > packet, Time jitter)
 Record a packets successfully sent.
void ReceiveRx (std::string context, Ptr< const Packet > p, const Address &addr)
 Record a packet successfully received.
void StateUpdated (TgaxVoipTraffic::VoiceActivityState state, Time duration)
 Record a change in VoIP voice activity state.

Private Attributes

std::optional< VoipParamsm_params
 VoIP parameters.
uint64_t m_received {0}
 number of bytes received
std::map< uint64_t, TxInfom_sent
 transmitted VoIP packets
std::vector< std::pair< TgaxVoipTraffic::VoiceActivityState, Time > > m_states
 Hold voice activity states and the time at which it started.

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

TGax voice-over-IP traffic test.

Definition at line 51 of file tgax-voip-traffic-test-suite.cc.

Constructor & Destructor Documentation

◆ TgaxVoipTrafficTestCase()

TgaxVoipTrafficTestCase::TgaxVoipTrafficTestCase ( const std::string & name,
std::optional< VoipParams > 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 130 of file tgax-voip-traffic-test-suite.cc.

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

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void TgaxVoipTrafficTestCase::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 238 of file tgax-voip-traffic-test-suite.cc.

References ns3::Simulator::Destroy(), ns3::TgaxVoipTraffic::INACTIVE_SILENCE, m_params, m_received, m_sent, m_states, ns3::MilliSeconds(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ_TOL, ns3::Simulator::Run(), anonymous_namespace{tgax-voip-traffic-test-suite.cc}::silencePayloadSize, anonymous_namespace{tgax-voip-traffic-test-suite.cc}::tol, and anonymous_namespace{tgax-voip-traffic-test-suite.cc}::voicePayloadSize.

Here is the call graph for this function:

◆ DoSetup()

◆ PacketSent()

void TgaxVoipTrafficTestCase::PacketSent ( Ptr< const Packet > packet,
Time jitter )
private

Record a packets successfully sent.

Parameters
packetthe transmitted packet
jitterthe delay jitter applied to the packet

Definition at line 138 of file tgax-voip-traffic-test-suite.cc.

References anonymous_namespace{tgax-voip-traffic-test-suite.cc}::compressedProtocolHeader, m_params, m_sent, ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoSetup().

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

◆ ReceiveRx()

void TgaxVoipTrafficTestCase::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 161 of file tgax-voip-traffic-test-suite.cc.

References anonymous_namespace{tgax-voip-traffic-test-suite.cc}::compressedProtocolHeader, m_received, and NS_LOG_FUNCTION.

Referenced by DoSetup().

Here is the caller graph for this function:

◆ StateUpdated()

void TgaxVoipTrafficTestCase::StateUpdated ( TgaxVoipTraffic::VoiceActivityState state,
Time duration )
private

Record a change in VoIP voice activity state.

Parameters
statethe new voice activity state
durationthe expected duration of the state

Definition at line 154 of file tgax-voip-traffic-test-suite.cc.

References m_states, 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:

Member Data Documentation

◆ m_params

std::optional<VoipParams> TgaxVoipTrafficTestCase::m_params
private

VoIP parameters.

Definition at line 127 of file tgax-voip-traffic-test-suite.cc.

Referenced by TgaxVoipTrafficTestCase(), DoRun(), DoSetup(), and PacketSent().

◆ m_received

uint64_t TgaxVoipTrafficTestCase::m_received {0}
private

number of bytes received

Definition at line 123 of file tgax-voip-traffic-test-suite.cc.

Referenced by DoRun(), and ReceiveRx().

◆ m_sent

std::map<uint64_t, TxInfo> TgaxVoipTrafficTestCase::m_sent
private

transmitted VoIP packets

Definition at line 122 of file tgax-voip-traffic-test-suite.cc.

Referenced by DoRun(), and PacketSent().

◆ m_states

std::vector<std::pair<TgaxVoipTraffic::VoiceActivityState, Time> > TgaxVoipTrafficTestCase::m_states
private

Hold voice activity states and the time at which it started.

Definition at line 125 of file tgax-voip-traffic-test-suite.cc.

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


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