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

Testing the additive increase and multiplicative decrease of TcpVeno. More...

+ Inheritance diagram for TcpVenoTest:
+ Collaboration diagram for TcpVenoTest:

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
 
TestCaseoperator= (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< TcpSocketStatem_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.
 
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

Testing the additive increase and multiplicative decrease of TcpVeno.

Definition at line 30 of file tcp-veno-test.cc.

Constructor & Destructor Documentation

◆ TcpVenoTest()

TcpVenoTest::TcpVenoTest ( uint32_t cWnd,
uint32_t segmentSize,
uint32_t ssThresh,
Time rtt,
uint32_t segmentsAcked,
uint32_t numRtt,
const std::string & name )

Constructor.

Parameters
cWndCongestion window.
segmentSizeSegment size.
ssThreshSlow Start Threshold.
rttThe RTT.
segmentsAckedNumber of segments acked.
numRttNumber of RTTs (i.e., rounds) in the test.
nameTest description.

Definition at line 105 of file tcp-veno-test.cc.

Member Function Documentation

◆ AdditiveIncrease()

void TcpVenoTest::AdditiveIncrease ( Ptr< TcpSocketState > state,
uint32_t diff,
UintegerValue beta )
private

TCP Veno additive increase formula.

Parameters
stateThe congestion control state.
diffThe difference between actual and expected throughput.
betaTCP 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().

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

◆ DoRun()

void TcpVenoTest::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.

+ Here is the call graph for this function:

◆ MultiplicativeDecrease()

uint32_t TcpVenoTest::MultiplicativeDecrease ( uint32_t diff,
const UintegerValue & beta,
uint32_t bytesInFlight ) const
private

TCP Veno multiplicative decrease formula.

Parameters
diffThe difference between actual and expected throughput.
betaTCP Veno beta param.
bytesInFlightBytes in flight.
Returns
The calculated SsThresh.

Definition at line 233 of file tcp-veno-test.cc.

References ns3::UintegerValue::Get(), and m_segmentSize.

Referenced by DoRun().

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

◆ NewReno_CongestionAvoidance()

void TcpVenoTest::NewReno_CongestionAvoidance ( Ptr< TcpSocketState > state,
uint32_t segmentsAcked )
private

Mimics the NewReno Congestion Avoidance algorithm.

Parameters
stateTCP socket state.
segmentsAckedNumber of segments acked.

Definition at line 278 of file tcp-veno-test.cc.

Referenced by AdditiveIncrease(), and NewReno_IncreaseWindow().

+ Here is the caller graph for this function:

◆ NewReno_IncreaseWindow()

void TcpVenoTest::NewReno_IncreaseWindow ( Ptr< TcpSocketState > state,
uint32_t segmentsAcked )
private

Mimics the NewReno IncreaseWindow algorithm.

Parameters
stateTCP socket state.
segmentsAckedNumber of segments acked.

Definition at line 252 of file tcp-veno-test.cc.

References NewReno_CongestionAvoidance(), and NewReno_SlowStart().

Referenced by DoRun().

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

◆ NewReno_SlowStart()

uint32_t TcpVenoTest::NewReno_SlowStart ( Ptr< TcpSocketState > state,
uint32_t segmentsAcked )
private

Mimics the NewReno SlowStart algorithm.

Parameters
stateTCP socket state.
segmentsAckedNumber of segments acked.
Returns
The number of segments that could be sent.

Definition at line 266 of file tcp-veno-test.cc.

Referenced by AdditiveIncrease(), and NewReno_IncreaseWindow().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cWnd

uint32_t TcpVenoTest::m_cWnd
private

Congestion window.

Definition at line 95 of file tcp-veno-test.cc.

Referenced by AdditiveIncrease(), and DoRun().

◆ m_inc

bool TcpVenoTest::m_inc
private

Internal flag to increase every other round.

Definition at line 101 of file tcp-veno-test.cc.

Referenced by AdditiveIncrease().

◆ m_numRtt

uint32_t TcpVenoTest::m_numRtt
private

Number of RTT (i.e., rounds) of the test.

Definition at line 100 of file tcp-veno-test.cc.

Referenced by DoRun().

◆ m_rtt

Time TcpVenoTest::m_rtt
private

RTT.

Definition at line 98 of file tcp-veno-test.cc.

Referenced by DoRun().

◆ m_segmentsAcked

uint32_t TcpVenoTest::m_segmentsAcked
private

Number of segments ACKed.

Definition at line 99 of file tcp-veno-test.cc.

Referenced by DoRun().

◆ m_segmentSize

uint32_t TcpVenoTest::m_segmentSize
private

Segment size.

Definition at line 96 of file tcp-veno-test.cc.

Referenced by DoRun(), and MultiplicativeDecrease().

◆ m_ssThresh

uint32_t TcpVenoTest::m_ssThresh
private

Slow Start Threshold.

Definition at line 97 of file tcp-veno-test.cc.

Referenced by AdditiveIncrease(), and DoRun().

◆ m_state

Ptr<TcpSocketState> TcpVenoTest::m_state
private

TCP socket state.

Definition at line 102 of file tcp-veno-test.cc.

Referenced by DoRun().


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