Test Cubic response. More...
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 |
TestCase & | operator= (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, double > | m_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. | |
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. | |
Test Cubic response.
Definition at line 94 of file ns3tcp-cubic-test-suite.cc.
Ns3TcpCubicTestCase::Ns3TcpCubicTestCase | ( | std::string | testCase, |
std::string | prefix, | ||
bool | fastConvergence, | ||
bool | tcpFriendliness, | ||
Time | baseRtt, | ||
bool | capacityIncrease ) |
Constructor.
testCase | testcase name |
prefix | filename prefix if writing output files |
fastConvergence | whether to enable fast convergence |
tcpFriendliness | whether to enable TCP friendliness |
baseRtt | base RTT to use for test case |
capacityIncrease | whether to trigger a sudden capacity increase |
Definition at line 153 of file ns3tcp-cubic-test-suite.cc.
|
override |
Definition at line 168 of file ns3tcp-cubic-test-suite.cc.
|
private |
Check that time series values within a time range are within a value range.
start | start of time range |
end | end of time range |
lowerBound | lower bound of acceptable values |
upperBound | upper bound of acceptable values |
Definition at line 188 of file ns3tcp-cubic-test-suite.cc.
References m_timeSeries, and NS_LOG_DEBUG.
Referenced by DoRun().
Connect TCP cwnd trace after socket is instantiated.
nodeId | node ID to connect to |
socketId | socket 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().
|
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.
|
private |
Increases the device bandwidth to 100 Mbps.
device | device to modify |
Definition at line 173 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
the base RTT to use
Definition at line 149 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
whether to trigger a capacity increase
Definition at line 150 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
cwnd time series
Definition at line 144 of file ns3tcp-cubic-test-suite.cc.
Referenced by ConnectCwndTrace(), and DoRun().
|
private |
whether to enable fast convergence
Definition at line 147 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
filename prefix if writing files
Definition at line 146 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
whether to enable TCP friendliness
Definition at line 148 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
time series to check
Definition at line 145 of file ns3tcp-cubic-test-suite.cc.
Referenced by CheckValues(), and ConnectCwndTrace().
|
private |
Whether to write gnuplot files.
Definition at line 143 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
Whether to write pcaps.
Definition at line 142 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().