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

TcpIllinois C-AIMD algorithm tests. More...

+ Inheritance diagram for TcpIllinoisTest:
+ Collaboration diagram for TcpIllinoisTest:

Public Member Functions

 TcpIllinoisTest (uint32_t cWnd, uint32_t ssThresh, uint32_t segmentSize, uint32_t cntRtt, Time maxRtt, uint32_t segmentsAcked, SequenceNumber32 nextTxSeq, SequenceNumber32 lastAckedSeq, 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 CalculateAlpha (Ptr< TcpIllinois > cong, double da, double dm)
 Calculate the TCP Illinois alpha param.
 
Time CalculateAvgDelay ()
 Calculate the average delay.
 
void CalculateBeta (Ptr< TcpIllinois > cong, double da, double dm)
 Calculate the TCP Illinois beta param.
 
Time CalculateMaxDelay ()
 Calculate the maximum delay.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void GetSsThresh ()
 brief Get and check the SSH threshold.
 
void IncreaseWindow (Ptr< TcpIllinois > cong)
 Increases the TCP window.
 
void RecalcParam (Ptr< TcpIllinois > cong)
 Recalculate the internal TCP Illinois params.
 

Private Attributes

uint32_t m_ackCnt
 ACK counter.
 
double m_alpha
 TCP Illinois alpha parameter.
 
Time m_baseRtt
 Base RTT.
 
double m_beta
 TCP Illinois beta parameter.
 
uint32_t m_cntRtt
 RTT counter.
 
uint32_t m_cWnd
 Congestion window.
 
SequenceNumber32 m_lastAckedSeq
 Last ACKed sequence number.
 
Time m_maxRtt
 Max RTT.
 
SequenceNumber32 m_nextTxSeq
 Next Tx sequence number.
 
bool m_rttAbove
 RTT above threshold.
 
uint8_t m_rttLow
 RTT low counter.
 
uint32_t m_segmentsAcked
 Number of segments ACKed.
 
uint32_t m_segmentSize
 Segment size.
 
uint32_t m_ssThresh
 Slow Start Threshold.
 
Time m_sumRtt
 Sum of all the RTTs.
 

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

TcpIllinois C-AIMD algorithm tests.

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

Constructor & Destructor Documentation

◆ TcpIllinoisTest()

TcpIllinoisTest::TcpIllinoisTest ( uint32_t cWnd,
uint32_t ssThresh,
uint32_t segmentSize,
uint32_t cntRtt,
Time maxRtt,
uint32_t segmentsAcked,
SequenceNumber32 nextTxSeq,
SequenceNumber32 lastAckedSeq,
const std::string & name )

Constructor.

Parameters
cWndCongestion window.
ssThreshSlow Start Threshold.
segmentSizeSegment size.
cntRttRTT counter.
maxRttMax RTT.
segmentsAckedNumber of segments ACKed.
nextTxSeqNext Tx sequence number.
lastAckedSeqLast ACKed sequence number.
nameTest description.

Definition at line 113 of file tcp-illinois-test.cc.

Member Function Documentation

◆ CalculateAlpha()

void TcpIllinoisTest::CalculateAlpha ( Ptr< TcpIllinois > cong,
double da,
double dm )
private

Calculate the TCP Illinois alpha param.

Parameters
congThe congestion control.
daAverage delay (in milliseconds).
dmMaximum delay (in milliseconds).

Definition at line 259 of file tcp-illinois-test.cc.

References ns3::DoubleValue::Get(), ns3::UintegerValue::Get(), m_alpha, m_rttAbove, m_rttLow, and NS_LOG_INFO.

Referenced by RecalcParam().

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

◆ CalculateAvgDelay()

Time TcpIllinoisTest::CalculateAvgDelay ( )
private

Calculate the average delay.

Returns
The average delay.

Definition at line 253 of file tcp-illinois-test.cc.

References m_baseRtt, m_cntRtt, and m_sumRtt.

Referenced by RecalcParam().

+ Here is the caller graph for this function:

◆ CalculateBeta()

void TcpIllinoisTest::CalculateBeta ( Ptr< TcpIllinois > cong,
double da,
double dm )
private

Calculate the TCP Illinois beta param.

Parameters
congThe congestion control.
daAverage delay (in milliseconds).
dmMaximum delay (in milliseconds).

Definition at line 295 of file tcp-illinois-test.cc.

References ns3::DoubleValue::Get(), m_beta, and NS_LOG_INFO.

Referenced by RecalcParam().

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

◆ CalculateMaxDelay()

Time TcpIllinoisTest::CalculateMaxDelay ( )
private

Calculate the maximum delay.

Returns
The maximum delay.

Definition at line 247 of file tcp-illinois-test.cc.

References m_baseRtt, and m_maxRtt.

Referenced by RecalcParam().

+ Here is the caller graph for this function:

◆ DoRun()

void TcpIllinoisTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 142 of file tcp-illinois-test.cc.

References ns3::CreateObject(), GetSsThresh(), IncreaseWindow(), m_baseRtt, m_cntRtt, m_cWnd, m_lastAckedSeq, m_maxRtt, m_nextTxSeq, m_segmentsAcked, m_segmentSize, m_ssThresh, m_sumRtt, and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ GetSsThresh()

void TcpIllinoisTest::GetSsThresh ( )
private

brief Get and check the SSH threshold.

Definition at line 325 of file tcp-illinois-test.cc.

References m_beta, m_cWnd, m_segmentSize, m_ssThresh, and NS_LOG_DEBUG.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ IncreaseWindow()

void TcpIllinoisTest::IncreaseWindow ( Ptr< TcpIllinois > cong)
private

Increases the TCP window.

Parameters
congThe congestion control.

Definition at line 181 of file tcp-illinois-test.cc.

References m_ackCnt, m_alpha, m_cWnd, m_lastAckedSeq, m_nextTxSeq, m_segmentsAcked, m_segmentSize, m_ssThresh, NS_LOG_INFO, and RecalcParam().

Referenced by DoRun().

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

◆ RecalcParam()

void TcpIllinoisTest::RecalcParam ( Ptr< TcpIllinois > cong)
private

Recalculate the internal TCP Illinois params.

Parameters
congThe congestion control.

Definition at line 222 of file tcp-illinois-test.cc.

References CalculateAlpha(), CalculateAvgDelay(), CalculateBeta(), CalculateMaxDelay(), ns3::DoubleValue::Get(), ns3::UintegerValue::Get(), ns3::Time::GetMilliSeconds(), m_alpha, m_cntRtt, m_cWnd, and NS_LOG_INFO.

Referenced by IncreaseWindow().

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

Member Data Documentation

◆ m_ackCnt

uint32_t TcpIllinoisTest::m_ackCnt
private

ACK counter.

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

Referenced by IncreaseWindow().

◆ m_alpha

double TcpIllinoisTest::m_alpha
private

TCP Illinois alpha parameter.

Definition at line 104 of file tcp-illinois-test.cc.

Referenced by CalculateAlpha(), IncreaseWindow(), and RecalcParam().

◆ m_baseRtt

Time TcpIllinoisTest::m_baseRtt
private

Base RTT.

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

Referenced by CalculateAvgDelay(), CalculateMaxDelay(), and DoRun().

◆ m_beta

double TcpIllinoisTest::m_beta
private

TCP Illinois beta parameter.

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

Referenced by CalculateBeta(), and GetSsThresh().

◆ m_cntRtt

uint32_t TcpIllinoisTest::m_cntRtt
private

RTT counter.

Definition at line 106 of file tcp-illinois-test.cc.

Referenced by CalculateAvgDelay(), DoRun(), and RecalcParam().

◆ m_cWnd

uint32_t TcpIllinoisTest::m_cWnd
private

Congestion window.

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

Referenced by DoRun(), GetSsThresh(), IncreaseWindow(), and RecalcParam().

◆ m_lastAckedSeq

SequenceNumber32 TcpIllinoisTest::m_lastAckedSeq
private

Last ACKed sequence number.

Definition at line 103 of file tcp-illinois-test.cc.

Referenced by DoRun(), and IncreaseWindow().

◆ m_maxRtt

Time TcpIllinoisTest::m_maxRtt
private

Max RTT.

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

Referenced by CalculateMaxDelay(), and DoRun().

◆ m_nextTxSeq

SequenceNumber32 TcpIllinoisTest::m_nextTxSeq
private

Next Tx sequence number.

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

Referenced by DoRun(), and IncreaseWindow().

◆ m_rttAbove

bool TcpIllinoisTest::m_rttAbove
private

RTT above threshold.

Definition at line 108 of file tcp-illinois-test.cc.

Referenced by CalculateAlpha().

◆ m_rttLow

uint8_t TcpIllinoisTest::m_rttLow
private

RTT low counter.

Definition at line 109 of file tcp-illinois-test.cc.

Referenced by CalculateAlpha().

◆ m_segmentsAcked

uint32_t TcpIllinoisTest::m_segmentsAcked
private

Number of segments ACKed.

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

Referenced by DoRun(), and IncreaseWindow().

◆ m_segmentSize

uint32_t TcpIllinoisTest::m_segmentSize
private

Segment size.

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

Referenced by DoRun(), GetSsThresh(), and IncreaseWindow().

◆ m_ssThresh

uint32_t TcpIllinoisTest::m_ssThresh
private

Slow Start Threshold.

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

Referenced by DoRun(), GetSsThresh(), and IncreaseWindow().

◆ m_sumRtt

Time TcpIllinoisTest::m_sumRtt
private

Sum of all the RTTs.

Definition at line 107 of file tcp-illinois-test.cc.

Referenced by CalculateAvgDelay(), and DoRun().


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