Test Cubic response. More...
Public Member Functions | |
Ns3TcpCubicTestCase (std::string testCase, std::string prefix, bool fastConvergence, bool tcpFriendliness, Time baseRtt, bool capacityIncrease) | |
Constructor. More... | |
~Ns3TcpCubicTestCase () override | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
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. More... | |
void | ConnectCwndTrace (uint32_t nodeId, uint32_t socketId) |
Connect TCP cwnd trace after socket is instantiated. More... | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
void | IncreaseBandwidth (Ptr< PointToPointNetDevice > device) |
Increases the device bandwidth to 100 Mbps. More... | |
Private Attributes | |
Time | m_baseRtt |
the base RTT to use More... | |
bool | m_capacityIncrease |
whether to trigger a capacity increase More... | |
Gnuplot2dDataset | m_cwndTimeSeries |
cwnd time series More... | |
bool | m_fastConvergence |
whether to enable fast convergence More... | |
std::string | m_prefix |
filename prefix if writing files More... | |
bool | m_tcpFriendliness |
whether to enable TCP friendliness More... | |
std::map< Time, double > | m_timeSeries |
time series to check More... | |
bool | m_writeGnuplot {WRITE_GNUPLOT} |
Whether to write gnuplot files. More... | |
bool | m_writeResults {WRITE_PCAP} |
Whether to write pcaps. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { 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. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
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. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
Test Cubic response.
Definition at line 106 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 165 of file ns3tcp-cubic-test-suite.cc.
|
override |
Definition at line 180 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 200 of file ns3tcp-cubic-test-suite.cc.
References m_timeSeries, NS_LOG_DEBUG, and two-ray-to-three-gpp-ch-calibration::start.
Referenced by DoRun().
|
private |
Connect TCP cwnd trace after socket is instantiated.
nodeId | node ID to connect to |
socketId | socket ID to connect to |
Definition at line 191 of file ns3tcp-cubic-test-suite.cc.
References ns3::Config::ConnectWithoutContext(), CubicCwndTracer(), m_cwndTimeSeries, m_timeSeries, ns3::MakeBoundCallback(), and nlohmann::to_string().
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 217 of file ns3tcp-cubic-test-suite.cc.
References ns3::Gnuplot::AddDataset(), CheckValues(), ConnectCwndTrace(), ns3::NodeContainer::Create(), ns3::AsciiTraceHelperForDevice::EnableAscii(), ns3::PcapHelperForDevice::EnablePcap(), ns3::Gnuplot::GenerateOutput(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Time::GetMilliSeconds(), i1i2, IncreaseBandwidth(), ns3::TrafficControlHelper::Install(), ns3::PointToPointHelper::Install(), ns3::BulkSendHelper::Install(), nsclick-simple-lan::internet, nsclick-simple-lan::ipv4, 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, port, ns3::Seconds(), ns3::BulkSendHelper::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(), stopTime, and nlohmann::to_string().
|
private |
Increases the device bandwidth to 100 Mbps.
device | device to modify |
Definition at line 185 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
the base RTT to use
Definition at line 161 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
whether to trigger a capacity increase
Definition at line 162 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
cwnd time series
Definition at line 156 of file ns3tcp-cubic-test-suite.cc.
Referenced by ConnectCwndTrace(), and DoRun().
|
private |
whether to enable fast convergence
Definition at line 159 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
filename prefix if writing files
Definition at line 158 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
whether to enable TCP friendliness
Definition at line 160 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
time series to check
Definition at line 157 of file ns3tcp-cubic-test-suite.cc.
Referenced by CheckValues(), and ConnectCwndTrace().
|
private |
Whether to write gnuplot files.
Definition at line 155 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().
|
private |
Whether to write pcaps.
Definition at line 154 of file ns3tcp-cubic-test-suite.cc.
Referenced by DoRun().