TGax Video traffic test, check for the expected inter frame interval, bit rate and packets inter arrivals. More...
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 |
| TestCase & | operator= (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< Time > | m_generatedFrames |
| Store time at which each frame has been generated. | |
| std::vector< Time > | m_latencies |
| Store latency applied to each transmitted packet. | |
| TgaxVideoTraffic::TrafficModelClassIdentifier | m_model |
| Selected buffered video traffic model. | |
| std::optional< TgaxVideoTraffic::TrafficModelParameters > | m_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_t > | m_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. | |
| 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. | |
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.
| TgaxVideoTrafficTestCase::TgaxVideoTrafficTestCase | ( | TgaxVideoTraffic::TrafficModelClassIdentifier | model, |
| const std::string & | protocol, | ||
| double | expectedBitRate, | ||
| std::optional< TgaxVideoTraffic::TrafficModelParameters > | parameters = {}, | ||
| std::optional< uint32_t > | txBufferSizeLimit = {} ) |
Constructor.
| model | the traffic model to use for the test |
| protocol | the protocol to use for the test (Udp or Tcp) |
| expectedBitRate | the expected bit rate in Mbps at the end of the test |
| parameters | optional traffic model parameters (used for custom traffic model) |
| txBufferSizeLimit | optional 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().
|
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.
|
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 236 of file tgax-video-traffic-test-suite.cc.
References ns3::Ipv4ListRoutingHelper::Add(), ns3::Ipv4AddressHelper::Assign(), ns3::ApplicationHelper::AssignStreams(), ns3::Config::Connect(), ns3::Config::ConnectWithoutContext(), ns3::CreateObject(), FrameGenerated(), ns3::Ipv4Address::GetAny(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), ns3::TgaxVideoTraffic::GetTypeId(), ns3::ApplicationHelper::Install(), ns3::SimpleNetDeviceHelper::Install(), anonymous_namespace{tgax-video-traffic-test-suite.cc}::IsMulticast(), m_model, m_parameters, m_protocol, m_received, m_txBufferSizeLimit, ns3::MakeCallback(), nodes, NS_LOG_FUNCTION, PacketSent(), port, ReceiveRx(), ns3::Seconds(), ns3::ApplicationHelper::SetAttribute(), ns3::Ipv4AddressHelper::SetBase(), ns3::Config::SetDefault(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), anonymous_namespace{tgax-video-traffic-test-suite.cc}::simulationTime, and ns3::ApplicationContainer::Start().
|
private |
Record video frame generated.
| size | the 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().
Record a packets successfully sent.
| packet | the transmitted packet |
| latency | the 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().
|
private |
Record a packet successfully received.
| context | the context |
| p | the packet |
| addr | the 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().
|
private |
Expected video bit rate.
Definition at line 187 of file tgax-video-traffic-test-suite.cc.
Referenced by TgaxVideoTrafficTestCase(), and DoRun().
|
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().
|
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().
|
private |
Selected buffered video traffic model.
Definition at line 180 of file tgax-video-traffic-test-suite.cc.
Referenced by TgaxVideoTrafficTestCase(), DoRun(), and DoSetup().
|
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().
|
private |
Udp or Tcp protocol.
Definition at line 181 of file tgax-video-traffic-test-suite.cc.
Referenced by TgaxVideoTrafficTestCase(), and DoSetup().
|
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().
|
private |
number of bytes sent
Definition at line 189 of file tgax-video-traffic-test-suite.cc.
Referenced by DoRun(), and PacketSent().
|
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().