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. | |
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 | |
void | AdditiveIncrease (Ptr< TcpSocketState > state, uint32_t diff, UintegerValue beta) |
TCP Veno additive increase formula. | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
uint32_t | MultiplicativeDecrease (uint32_t diff, const UintegerValue &beta, uint32_t bytesInFlight) const |
TCP Veno multiplicative decrease formula. | |
void | NewReno_CongestionAvoidance (Ptr< TcpSocketState > state, uint32_t segmentsAcked) |
Mimics the NewReno Congestion Avoidance algorithm. | |
void | NewReno_IncreaseWindow (Ptr< TcpSocketState > state, uint32_t segmentsAcked) |
Mimics the NewReno IncreaseWindow algorithm. | |
uint32_t | NewReno_SlowStart (Ptr< TcpSocketState > state, uint32_t segmentsAcked) |
Mimics the NewReno SlowStart algorithm. | |
Private Attributes | |
uint32_t | m_cWnd |
Congestion window. | |
bool | m_inc |
Internal flag to increase every other round. | |
uint32_t | m_numRtt |
Number of RTT (i.e., rounds) of the test. | |
Time | m_rtt |
RTT. | |
uint32_t | m_segmentsAcked |
Number of segments ACKed. | |
uint32_t | m_segmentSize |
Segment size. | |
uint32_t | m_ssThresh |
Slow Start Threshold. | |
Ptr< TcpSocketState > | m_state |
TCP socket state. | |
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. | |
Testing the additive increase and multiplicative decrease of TcpVeno.
Definition at line 30 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 105 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 205 of file tcp-veno-test.cc.
References ns3::UintegerValue::Get(), m_cWnd, m_inc, m_ssThresh, NewReno_CongestionAvoidance(), and NewReno_SlowStart().
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 124 of file tcp-veno-test.cc.
References AdditiveIncrease(), ns3::TcpSocketState::CA_OPEN, ns3::CreateObject(), ns3::TracedValue< T >::Get(), ns3::UintegerValue::Get(), ns3::Time::GetSeconds(), ns3::TcpSocketState::m_cWnd, m_cWnd, m_numRtt, m_rtt, m_segmentsAcked, ns3::TcpSocketState::m_segmentSize, m_segmentSize, ns3::TcpSocketState::m_ssThresh, m_ssThresh, m_state, ns3::MilliSeconds(), MultiplicativeDecrease(), NewReno_IncreaseWindow(), and NS_TEST_ASSERT_MSG_EQ.
|
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 233 of file tcp-veno-test.cc.
References ns3::UintegerValue::Get(), and m_segmentSize.
Referenced by DoRun().
|
private |
Mimics the NewReno Congestion Avoidance algorithm.
state | TCP socket state. |
segmentsAcked | Number of segments acked. |
Definition at line 278 of file tcp-veno-test.cc.
Referenced by AdditiveIncrease(), and NewReno_IncreaseWindow().
|
private |
Mimics the NewReno IncreaseWindow algorithm.
state | TCP socket state. |
segmentsAcked | Number of segments acked. |
Definition at line 252 of file tcp-veno-test.cc.
References 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 266 of file tcp-veno-test.cc.
Referenced by AdditiveIncrease(), and NewReno_IncreaseWindow().
|
private |
Congestion window.
Definition at line 95 of file tcp-veno-test.cc.
Referenced by AdditiveIncrease(), and DoRun().
|
private |
Internal flag to increase every other round.
Definition at line 101 of file tcp-veno-test.cc.
Referenced by AdditiveIncrease().
|
private |
Number of RTT (i.e., rounds) of the test.
Definition at line 100 of file tcp-veno-test.cc.
Referenced by DoRun().
|
private |
|
private |
|
private |
Segment size.
Definition at line 96 of file tcp-veno-test.cc.
Referenced by DoRun(), and MultiplicativeDecrease().
|
private |
Slow Start Threshold.
Definition at line 97 of file tcp-veno-test.cc.
Referenced by AdditiveIncrease(), and DoRun().
|
private |