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

Test Cubic response. More...

+ Inheritance diagram for Ns3TcpCubicTestCase:
+ Collaboration diagram for Ns3TcpCubicTestCase:

Public Member Functions

 Ns3TcpCubicTestCase (std::string testCase, std::string prefix, bool fastConvergence, bool tcpFriendliness, Time baseRtt, bool capacityIncrease)
 Constructor.
 
 ~Ns3TcpCubicTestCase () override
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

bool CheckValues (Time start, Time end, double lowerBound, double upperBound)
 Check that time series values within a time range are within a value range.
 
void ConnectCwndTrace (uint32_t nodeId, uint32_t socketId)
 Connect TCP cwnd trace after socket is instantiated.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void IncreaseBandwidth (Ptr< PointToPointNetDevice > device)
 Increases the device bandwidth to 100 Mbps.
 

Private Attributes

Time m_baseRtt
 the base RTT to use
 
bool m_capacityIncrease
 whether to trigger a capacity increase
 
Gnuplot2dDataset m_cwndTimeSeries
 cwnd time series
 
bool m_fastConvergence
 whether to enable fast convergence
 
std::string m_prefix
 filename prefix if writing files
 
bool m_tcpFriendliness
 whether to enable TCP friendliness
 
std::map< Time, doublem_timeSeries
 time series to check
 
bool m_writeGnuplot {WRITE_GNUPLOT}
 Whether to write gnuplot files.
 
bool m_writeResults {WRITE_PCAP}
 Whether to write pcaps.
 

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
 
- 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

Test Cubic response.

Definition at line 94 of file ns3tcp-cubic-test-suite.cc.

Constructor & Destructor Documentation

◆ Ns3TcpCubicTestCase()

Ns3TcpCubicTestCase::Ns3TcpCubicTestCase ( std::string testCase,
std::string prefix,
bool fastConvergence,
bool tcpFriendliness,
Time baseRtt,
bool capacityIncrease )

Constructor.

Parameters
testCasetestcase name
prefixfilename prefix if writing output files
fastConvergencewhether to enable fast convergence
tcpFriendlinesswhether to enable TCP friendliness
baseRttbase RTT to use for test case
capacityIncreasewhether to trigger a sudden capacity increase

Definition at line 153 of file ns3tcp-cubic-test-suite.cc.

◆ ~Ns3TcpCubicTestCase()

Ns3TcpCubicTestCase::~Ns3TcpCubicTestCase ( )
override

Definition at line 168 of file ns3tcp-cubic-test-suite.cc.

Member Function Documentation

◆ CheckValues()

bool Ns3TcpCubicTestCase::CheckValues ( Time start,
Time end,
double lowerBound,
double upperBound )
private

Check that time series values within a time range are within a value range.

Parameters
startstart of time range
endend of time range
lowerBoundlower bound of acceptable values
upperBoundupper bound of acceptable values
Returns
true if values are within range

Definition at line 188 of file ns3tcp-cubic-test-suite.cc.

References m_timeSeries, and NS_LOG_DEBUG.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ ConnectCwndTrace()

void Ns3TcpCubicTestCase::ConnectCwndTrace ( uint32_t nodeId,
uint32_t socketId )
private

Connect TCP cwnd trace after socket is instantiated.

Parameters
nodeIdnode ID to connect to
socketIdsocket ID to connect to

Definition at line 179 of file ns3tcp-cubic-test-suite.cc.

References ns3::Config::ConnectWithoutContext(), CubicCwndTracer(), m_cwndTimeSeries, m_timeSeries, and ns3::MakeBoundCallback().

Referenced by DoRun().

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

◆ DoRun()

void Ns3TcpCubicTestCase::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 205 of file ns3tcp-cubic-test-suite.cc.

References ns3::Gnuplot::AddDataset(), CheckValues(), ConnectCwndTrace(), ns3::NodeContainer::Create(), ns3::Simulator::Destroy(), ns3::AsciiTraceHelperForDevice::EnableAscii(), ns3::PcapHelperForDevice::EnablePcap(), ns3::Gnuplot::GenerateOutput(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Ipv4Address::GetAny(), ns3::Time::GetMilliSeconds(), i1i2, IncreaseBandwidth(), ns3::ApplicationHelper::Install(), ns3::PointToPointHelper::Install(), ns3::TrafficControlHelper::Install(), m_baseRtt, m_capacityIncrease, m_cwndTimeSeries, m_fastConvergence, m_prefix, m_tcpFriendliness, m_writeGnuplot, m_writeResults, ns3::MilliSeconds(), NS_LOG_DEBUG, NS_TEST_ASSERT_MSG_EQ, ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables(), port, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::ApplicationHelper::SetAttribute(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::Config::SetDefault(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::Gnuplot::SetLegend(), ns3::PointToPointHelper::SetQueue(), ns3::TrafficControlHelper::SetQueueLimits(), ns3::TrafficControlHelper::SetRootQueueDisc(), ns3::Gnuplot::SetTerminal(), ns3::GnuplotDataset::SetTitle(), sink, ns3::ApplicationContainer::Start(), ns3::ApplicationContainer::Stop(), ns3::Simulator::Stop(), and stopTime.

+ Here is the call graph for this function:

◆ IncreaseBandwidth()

void Ns3TcpCubicTestCase::IncreaseBandwidth ( Ptr< PointToPointNetDevice > device)
private

Increases the device bandwidth to 100 Mbps.

Parameters
devicedevice to modify

Definition at line 173 of file ns3tcp-cubic-test-suite.cc.

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_baseRtt

Time Ns3TcpCubicTestCase::m_baseRtt
private

the base RTT to use

Definition at line 149 of file ns3tcp-cubic-test-suite.cc.

Referenced by DoRun().

◆ m_capacityIncrease

bool Ns3TcpCubicTestCase::m_capacityIncrease
private

whether to trigger a capacity increase

Definition at line 150 of file ns3tcp-cubic-test-suite.cc.

Referenced by DoRun().

◆ m_cwndTimeSeries

Gnuplot2dDataset Ns3TcpCubicTestCase::m_cwndTimeSeries
private

cwnd time series

Definition at line 144 of file ns3tcp-cubic-test-suite.cc.

Referenced by ConnectCwndTrace(), and DoRun().

◆ m_fastConvergence

bool Ns3TcpCubicTestCase::m_fastConvergence
private

whether to enable fast convergence

Definition at line 147 of file ns3tcp-cubic-test-suite.cc.

Referenced by DoRun().

◆ m_prefix

std::string Ns3TcpCubicTestCase::m_prefix
private

filename prefix if writing files

Definition at line 146 of file ns3tcp-cubic-test-suite.cc.

Referenced by DoRun().

◆ m_tcpFriendliness

bool Ns3TcpCubicTestCase::m_tcpFriendliness
private

whether to enable TCP friendliness

Definition at line 148 of file ns3tcp-cubic-test-suite.cc.

Referenced by DoRun().

◆ m_timeSeries

std::map<Time, double> Ns3TcpCubicTestCase::m_timeSeries
private

time series to check

Definition at line 145 of file ns3tcp-cubic-test-suite.cc.

Referenced by CheckValues(), and ConnectCwndTrace().

◆ m_writeGnuplot

bool Ns3TcpCubicTestCase::m_writeGnuplot {WRITE_GNUPLOT}
private

Whether to write gnuplot files.

Definition at line 143 of file ns3tcp-cubic-test-suite.cc.

Referenced by DoRun().

◆ m_writeResults

bool Ns3TcpCubicTestCase::m_writeResults {WRITE_PCAP}
private

Whether to write pcaps.

Definition at line 142 of file ns3tcp-cubic-test-suite.cc.

Referenced by DoRun().


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