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

TGax Video traffic test, check for the expected inter frame interval, bit rate and packets inter arrivals. More...

Inheritance diagram for TgaxVideoTrafficTestCase:
Collaboration diagram for TgaxVideoTrafficTestCase:

Public Member Functions

 TgaxVideoTrafficTestCase (TgaxVideoTraffic::TrafficModelClassIdentifier model, const std::string &protocol, double expectedBitRate, std::optional< TgaxVideoTraffic::TrafficModelParameters > parameters={}, std::optional< uint32_t > txBufferSizeLimit={})
 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 FrameGenerated (uint32_t size)
 Record video frame generated.
void PacketSent (Ptr< const Packet > packet, Time latency)
 Record a packets successfully sent.
void ReceiveRx (std::string context, Ptr< const Packet > p, const Address &addr)
 Record a packet successfully received.

Private Attributes

double m_expectedBitRate
 Expected video bit rate.
std::vector< Timem_generatedFrames
 Store time at which each frame has been generated.
std::vector< Timem_latencies
 Store latency applied to each transmitted packet.
TgaxVideoTraffic::TrafficModelClassIdentifier m_model
 Selected buffered video traffic model.
std::optional< TgaxVideoTraffic::TrafficModelParametersm_parameters
 Optional traffic model parameters (used for custom traffic model).
std::string m_protocol
 Udp or Tcp protocol.
std::vector< uint64_t > m_received
 number of bytes received per receiver
uint64_t m_sent {0}
 number of bytes sent
std::optional< uint32_tm_txBufferSizeLimit
 Optional limit for the TX buffer size of the TCP socket.

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 Video traffic test, check for the expected inter frame interval, bit rate and packets inter arrivals.

Definition at line 135 of file tgax-video-traffic-test-suite.cc.

Constructor & Destructor Documentation

◆ TgaxVideoTrafficTestCase()

TgaxVideoTrafficTestCase::TgaxVideoTrafficTestCase ( TgaxVideoTraffic::TrafficModelClassIdentifier model,
const std::string & protocol,
double expectedBitRate,
std::optional< TgaxVideoTraffic::TrafficModelParameters > parameters = {},
std::optional< uint32_t > txBufferSizeLimit = {} )

Constructor.

Parameters
modelthe traffic model to use for the test
protocolthe protocol to use for the test (Udp or Tcp)
expectedBitRatethe expected bit rate in Mbps at the end of the test
parametersoptional traffic model parameters (used for custom traffic model)
txBufferSizeLimitoptional limit for the TX buffer size of the TCP socket

Definition at line 195 of file tgax-video-traffic-test-suite.cc.

References ns3::TestCase::TestCase(), anonymous_namespace{tgax-video-traffic-test-suite.cc}::IsMulticast(), m_expectedBitRate, m_model, m_parameters, m_protocol, m_received, m_txBufferSizeLimit, and anonymous_namespace{tgax-video-traffic-test-suite.cc}::ModelToString().

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void TgaxVideoTrafficTestCase::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 332 of file tgax-video-traffic-test-suite.cc.

References ns3::Simulator::Destroy(), anonymous_namespace{tgax-video-traffic-test-suite.cc}::GetAverageframeSize(), m_expectedBitRate, m_generatedFrames, m_latencies, m_model, m_parameters, m_received, m_sent, ns3::TgaxVideoTraffic::m_trafficModels, NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ_TOL, ns3::Simulator::Run(), and anonymous_namespace{tgax-video-traffic-test-suite.cc}::simulationTime.

Here is the call graph for this function:

◆ DoSetup()

◆ FrameGenerated()

void TgaxVideoTrafficTestCase::FrameGenerated ( uint32_t size)
private

Record video frame generated.

Parameters
sizethe size of the generated frame

Definition at line 221 of file tgax-video-traffic-test-suite.cc.

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

◆ PacketSent()

void TgaxVideoTrafficTestCase::PacketSent ( Ptr< const Packet > packet,
Time latency )
private

Record a packets successfully sent.

Parameters
packetthe transmitted packet
latencythe latency applied to the packet

Definition at line 213 of file tgax-video-traffic-test-suite.cc.

References m_latencies, m_sent, and NS_LOG_FUNCTION.

Referenced by DoSetup().

Here is the caller graph for this function:

◆ ReceiveRx()

void TgaxVideoTrafficTestCase::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 228 of file tgax-video-traffic-test-suite.cc.

References anonymous_namespace{tgax-video-traffic-test-suite.cc}::ConvertContextToNodeId(), m_received, 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_expectedBitRate

double TgaxVideoTrafficTestCase::m_expectedBitRate
private

Expected video bit rate.

Definition at line 187 of file tgax-video-traffic-test-suite.cc.

Referenced by TgaxVideoTrafficTestCase(), and DoRun().

◆ m_generatedFrames

std::vector<Time> TgaxVideoTrafficTestCase::m_generatedFrames
private

Store time at which each frame has been generated.

Definition at line 191 of file tgax-video-traffic-test-suite.cc.

Referenced by DoRun(), and FrameGenerated().

◆ m_latencies

std::vector<Time> TgaxVideoTrafficTestCase::m_latencies
private

Store latency applied to each transmitted packet.

Definition at line 192 of file tgax-video-traffic-test-suite.cc.

Referenced by DoRun(), and PacketSent().

◆ m_model

TgaxVideoTraffic::TrafficModelClassIdentifier TgaxVideoTrafficTestCase::m_model
private

Selected buffered video traffic model.

Definition at line 180 of file tgax-video-traffic-test-suite.cc.

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

◆ m_parameters

std::optional<TgaxVideoTraffic::TrafficModelParameters> TgaxVideoTrafficTestCase::m_parameters
private

Optional traffic model parameters (used for custom traffic model).

Definition at line 183 of file tgax-video-traffic-test-suite.cc.

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

◆ m_protocol

std::string TgaxVideoTrafficTestCase::m_protocol
private

Udp or Tcp protocol.

Definition at line 181 of file tgax-video-traffic-test-suite.cc.

Referenced by TgaxVideoTrafficTestCase(), and DoSetup().

◆ m_received

std::vector<uint64_t> TgaxVideoTrafficTestCase::m_received
private

number of bytes received per receiver

Definition at line 190 of file tgax-video-traffic-test-suite.cc.

Referenced by TgaxVideoTrafficTestCase(), DoRun(), DoSetup(), and ReceiveRx().

◆ m_sent

uint64_t TgaxVideoTrafficTestCase::m_sent {0}
private

number of bytes sent

Definition at line 189 of file tgax-video-traffic-test-suite.cc.

Referenced by DoRun(), and PacketSent().

◆ m_txBufferSizeLimit

std::optional<uint32_t> TgaxVideoTrafficTestCase::m_txBufferSizeLimit
private

Optional limit for the TX buffer size of the TCP socket.

Definition at line 185 of file tgax-video-traffic-test-suite.cc.

Referenced by TgaxVideoTrafficTestCase(), and DoSetup().


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