A Discrete-Event Network Simulator
API
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TcpVenoTest Class Reference

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

+ Inheritance 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. 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< TcpSocketStatem_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...
 
TestCaseGetParent () 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...
 

Detailed Description

Testing the additive increase and multiplicative decrease of TcpVeno.

Definition at line 43 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 117 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 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().

◆ DoRun()

void TcpVenoTest::DoRun ( void  )
privatevirtual

◆ MultiplicativeDecrease()

uint32_t TcpVenoTest::MultiplicativeDecrease ( uint32_t  diff,
const UintegerValue beta,
uint32_t  bytesInFlight 
)
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 242 of file tcp-veno-test.cc.

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

Referenced by DoRun().

◆ 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 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().

◆ 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 259 of file tcp-veno-test.cc.

References ns3::TcpSocketState::m_cWnd, ns3::TcpSocketState::m_ssThresh, NewReno_CongestionAvoidance(), and NewReno_SlowStart().

Referenced by DoRun().

◆ 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 273 of file tcp-veno-test.cc.

References ns3::TcpSocketState::m_cWnd, and ns3::TcpSocketState::m_segmentSize.

Referenced by AdditiveIncrease(), and NewReno_IncreaseWindow().

Member Data Documentation

◆ m_cWnd

uint32_t TcpVenoTest::m_cWnd
private

Congestion window.

Definition at line 107 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 113 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 112 of file tcp-veno-test.cc.

Referenced by DoRun().

◆ m_rtt

Time TcpVenoTest::m_rtt
private

RTT.

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

Referenced by DoRun().

◆ m_segmentsAcked

uint32_t TcpVenoTest::m_segmentsAcked
private

Number of segments ACKed.

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

Referenced by DoRun().

◆ m_segmentSize

uint32_t TcpVenoTest::m_segmentSize
private

Segment size.

Definition at line 108 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 109 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 114 of file tcp-veno-test.cc.

Referenced by DoRun().


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