Testing the additive increase and multiplicative decrease of TcpVeno. More...
Public Member Functions | |
TcpVenoTest (uint32_t cWnd, uint32_t segmentSize, uint32_t ssThresh, Time rtt, uint32_t segmentsAcked, uint32_t numRtt, const std::string &name) | |
Constructor. More... | |
Public Member Functions inherited from ns3::TestCase | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
Private Member Functions | |
void | AdditiveIncrease (Ptr< TcpSocketState > state, uint32_t diff, UintegerValue beta) |
TCP Veno additive increase formula. More... | |
virtual void | DoRun (void) |
Implementation to actually run this TestCase. More... | |
uint32_t | MultiplicativeDecrease (uint32_t diff, const UintegerValue &beta, uint32_t bytesInFlight) |
TCP Veno multiplicative decrease formula. More... | |
void | NewReno_CongestionAvoidance (Ptr< TcpSocketState > state, uint32_t segmentsAcked) |
Mimics the NewReno Congestion Avoidance algorithm. More... | |
void | NewReno_IncreaseWindow (Ptr< TcpSocketState > state, uint32_t segmentsAcked) |
Mimics the NewReno IncreaseWindow algorithm. More... | |
uint32_t | NewReno_SlowStart (Ptr< TcpSocketState > state, uint32_t segmentsAcked) |
Mimics the NewReno SlowStart algorithm. More... | |
Private Attributes | |
uint32_t | m_cWnd |
Congestion window. More... | |
bool | m_inc |
Internal flag to increase every other round. More... | |
uint32_t | m_numRtt |
Number of RTT (i.e., rounds) of the test. More... | |
Time | m_rtt |
RTT. More... | |
uint32_t | m_segmentsAcked |
Number of segments ACKed. More... | |
uint32_t | m_segmentSize |
Segment size. More... | |
uint32_t | m_ssThresh |
Slow Start Threshold. More... | |
Ptr< TcpSocketState > | m_state |
TCP socket state. 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 TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) 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 (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) 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... | |
Testing the additive increase and multiplicative decrease of TcpVeno.
Definition at line 43 of file tcp-veno-test.cc.
TcpVenoTest::TcpVenoTest | ( | uint32_t | cWnd, |
uint32_t | segmentSize, | ||
uint32_t | ssThresh, | ||
Time | rtt, | ||
uint32_t | segmentsAcked, | ||
uint32_t | numRtt, | ||
const std::string & | name | ||
) |
Constructor.
cWnd | Congestion window. |
segmentSize | Segment size. |
ssThresh | Slow Start Threshold. |
rtt | The RTT. |
segmentsAcked | Number of segments acked. |
numRtt | Number of RTTs (i.e., rounds) in the test. |
name | Test description. |
Definition at line 117 of file tcp-veno-test.cc.
|
private |
TCP Veno additive increase formula.
state | The congestion control state. |
diff | The difference between actual and expected throughput. |
beta | TCP Veno beta param. |
Definition at line 214 of file tcp-veno-test.cc.
References ns3::UintegerValue::Get(), m_cWnd, m_inc, m_ssThresh, NewReno_CongestionAvoidance(), and NewReno_SlowStart().
Referenced by DoRun().
|
privatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 136 of file tcp-veno-test.cc.
References AdditiveIncrease(), ns3::TcpVeno::CongestionStateSet(), ns3::TracedValue< T >::Get(), ns3::ObjectBase::GetAttribute(), ns3::Time::GetSeconds(), ns3::TcpVeno::GetSsThresh(), ns3::TcpVeno::IncreaseWindow(), m_cWnd, ns3::TcpSocketState::m_cWnd, ns3::TcpSocketState::m_minRtt, m_numRtt, m_rtt, m_segmentsAcked, m_segmentSize, ns3::TcpSocketState::m_segmentSize, m_ssThresh, ns3::TcpSocketState::m_ssThresh, m_state, ns3::MilliSeconds(), MultiplicativeDecrease(), NewReno_IncreaseWindow(), NS_TEST_ASSERT_MSG_EQ, and ns3::TcpVeno::PktsAcked().
|
private |
TCP Veno multiplicative decrease formula.
diff | The difference between actual and expected throughput. |
beta | TCP Veno beta param. |
bytesInFlight | Bytes in flight. |
Definition at line 242 of file tcp-veno-test.cc.
References ns3::UintegerValue::Get(), m_segmentSize, and max.
Referenced by DoRun().
|
private |
Mimics the NewReno Congestion Avoidance algorithm.
state | TCP socket state. |
segmentsAcked | Number of segments acked. |
Definition at line 285 of file tcp-veno-test.cc.
References ns3::TracedValue< T >::Get(), ns3::TcpSocketState::m_cWnd, ns3::TcpSocketState::m_segmentSize, and max.
Referenced by AdditiveIncrease(), and NewReno_IncreaseWindow().
|
private |
Mimics the NewReno IncreaseWindow algorithm.
state | TCP socket state. |
segmentsAcked | Number of segments acked. |
Definition at line 259 of file tcp-veno-test.cc.
References ns3::TcpSocketState::m_cWnd, ns3::TcpSocketState::m_ssThresh, NewReno_CongestionAvoidance(), and NewReno_SlowStart().
Referenced by DoRun().
|
private |
Mimics the NewReno SlowStart algorithm.
state | TCP socket state. |
segmentsAcked | Number of segments acked. |
Definition at line 273 of file tcp-veno-test.cc.
References ns3::TcpSocketState::m_cWnd, and ns3::TcpSocketState::m_segmentSize.
Referenced by AdditiveIncrease(), and NewReno_IncreaseWindow().
|
private |
Congestion window.
Definition at line 107 of file tcp-veno-test.cc.
Referenced by AdditiveIncrease(), and DoRun().
|
private |
Internal flag to increase every other round.
Definition at line 113 of file tcp-veno-test.cc.
Referenced by AdditiveIncrease().
|
private |
Number of RTT (i.e., rounds) of the test.
Definition at line 112 of file tcp-veno-test.cc.
Referenced by DoRun().
|
private |
|
private |
|
private |
Segment size.
Definition at line 108 of file tcp-veno-test.cc.
Referenced by DoRun(), and MultiplicativeDecrease().
|
private |
Slow Start Threshold.
Definition at line 109 of file tcp-veno-test.cc.
Referenced by AdditiveIncrease(), and DoRun().
|
private |