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

TcpIllinois C-AIMD algorithm tests. More...

+ Inheritance 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. More...
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

void CalculateAlpha (Ptr< TcpIllinois > cong, double da, double dm)
 Calculate the TCP Illinois alpha param. More...
 
Time CalculateAvgDelay ()
 Calculate the average delay. More...
 
void CalculateBeta (Ptr< TcpIllinois > cong, double da, double dm)
 Calculate the TCP Illinois beta param. More...
 
Time CalculateMaxDelay ()
 Calculate the maximum delay. More...
 
virtual void DoRun ()
 Implementation to actually run this TestCase. More...
 
void GetSsThresh ()
 brief Get and check the SSH threshold. More...
 
void IncreaseWindow (Ptr< TcpIllinois > cong)
 Increases the TCP window. More...
 
void RecalcParam (Ptr< TcpIllinois > cong)
 Recalculate the internal TCP Illinois params. More...
 

Private Attributes

uint32_t m_ackCnt
 ACK counter. More...
 
double m_alpha
 TCP Illinois alpha parameter. More...
 
Time m_baseRtt
 Base RTT. More...
 
double m_beta
 TCP Illinois beta parameter. More...
 
uint32_t m_cntRtt
 RTT counter. More...
 
uint32_t m_cWnd
 Congestion window. More...
 
SequenceNumber32 m_lastAckedSeq
 Last ACKed sequence number. More...
 
Time m_maxRtt
 Max RTT. More...
 
SequenceNumber32 m_nextTxSeq
 Next Tx sequence number. More...
 
bool m_rttAbove
 RTT above threshold. More...
 
uint8_t m_rttLow
 RTT low counter. 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...
 
Time m_sumRtt
 Sum of all the RTTs. 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

TcpIllinois C-AIMD algorithm tests.

Definition at line 43 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 126 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 279 of file tcp-illinois-test.cc.

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

Referenced by RecalcParam().

◆ CalculateAvgDelay()

Time TcpIllinoisTest::CalculateAvgDelay ( )
private

Calculate the average delay.

Returns
The average delay.

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

References m_baseRtt, m_cntRtt, and m_sumRtt.

Referenced by RecalcParam().

◆ 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 314 of file tcp-illinois-test.cc.

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

Referenced by RecalcParam().

◆ CalculateMaxDelay()

Time TcpIllinoisTest::CalculateMaxDelay ( )
private

Calculate the maximum delay.

Returns
The maximum delay.

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

References m_baseRtt, and m_maxRtt.

Referenced by RecalcParam().

◆ DoRun()

void TcpIllinoisTest::DoRun ( )
privatevirtual

◆ GetSsThresh()

void TcpIllinoisTest::GetSsThresh ( )
private

brief Get and check the SSH threshold.

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

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

Referenced by DoRun().

◆ IncreaseWindow()

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

Increases the TCP window.

Parameters
congThe congestion control.

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

◆ RecalcParam()

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

Recalculate the internal TCP Illinois params.

Parameters
congThe congestion control.

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

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

Referenced by IncreaseWindow().

Member Data Documentation

◆ m_ackCnt

uint32_t TcpIllinoisTest::m_ackCnt
private

ACK counter.

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

Referenced by IncreaseWindow().

◆ m_alpha

double TcpIllinoisTest::m_alpha
private

TCP Illinois alpha parameter.

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

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

◆ m_baseRtt

Time TcpIllinoisTest::m_baseRtt
private

Base RTT.

Definition at line 112 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 118 of file tcp-illinois-test.cc.

Referenced by CalculateBeta(), and GetSsThresh().

◆ m_cntRtt

uint32_t TcpIllinoisTest::m_cntRtt
private

RTT counter.

Definition at line 119 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 109 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 116 of file tcp-illinois-test.cc.

Referenced by DoRun(), and IncreaseWindow().

◆ m_maxRtt

Time TcpIllinoisTest::m_maxRtt
private

Max RTT.

Definition at line 113 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 115 of file tcp-illinois-test.cc.

Referenced by DoRun(), and IncreaseWindow().

◆ m_rttAbove

bool TcpIllinoisTest::m_rttAbove
private

RTT above threshold.

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

Referenced by CalculateAlpha().

◆ m_rttLow

uint8_t TcpIllinoisTest::m_rttLow
private

RTT low counter.

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

Referenced by CalculateAlpha().

◆ m_segmentsAcked

uint32_t TcpIllinoisTest::m_segmentsAcked
private

Number of segments ACKed.

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

Referenced by DoRun(), and IncreaseWindow().

◆ m_segmentSize

uint32_t TcpIllinoisTest::m_segmentSize
private

Segment size.

Definition at line 111 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 110 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 120 of file tcp-illinois-test.cc.

Referenced by CalculateAvgDelay(), and DoRun().


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