TcpIllinois C-AIMD algorithm tests. More...
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 |
TestCase & | operator= (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. | |
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. | |
TcpIllinois C-AIMD algorithm tests.
Definition at line 30 of file tcp-illinois-test.cc.
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.
cWnd | Congestion window. |
ssThresh | Slow Start Threshold. |
segmentSize | Segment size. |
cntRtt | RTT counter. |
maxRtt | Max RTT. |
segmentsAcked | Number of segments ACKed. |
nextTxSeq | Next Tx sequence number. |
lastAckedSeq | Last ACKed sequence number. |
name | Test description. |
Definition at line 113 of file tcp-illinois-test.cc.
|
private |
Calculate the TCP Illinois alpha param.
cong | The congestion control. |
da | Average delay (in milliseconds). |
dm | Maximum 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().
|
private |
Calculate the average delay.
Definition at line 253 of file tcp-illinois-test.cc.
References m_baseRtt, m_cntRtt, and m_sumRtt.
Referenced by RecalcParam().
|
private |
Calculate the TCP Illinois beta param.
cong | The congestion control. |
da | Average delay (in milliseconds). |
dm | Maximum 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().
|
private |
Calculate the maximum delay.
Definition at line 247 of file tcp-illinois-test.cc.
References m_baseRtt, and m_maxRtt.
Referenced by RecalcParam().
|
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.
|
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().
|
private |
Increases the TCP window.
cong | The 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().
|
private |
Recalculate the internal TCP Illinois params.
cong | The 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().
|
private |
|
private |
TCP Illinois alpha parameter.
Definition at line 104 of file tcp-illinois-test.cc.
Referenced by CalculateAlpha(), IncreaseWindow(), and RecalcParam().
|
private |
Base RTT.
Definition at line 99 of file tcp-illinois-test.cc.
Referenced by CalculateAvgDelay(), CalculateMaxDelay(), and DoRun().
|
private |
TCP Illinois beta parameter.
Definition at line 105 of file tcp-illinois-test.cc.
Referenced by CalculateBeta(), and GetSsThresh().
|
private |
RTT counter.
Definition at line 106 of file tcp-illinois-test.cc.
Referenced by CalculateAvgDelay(), DoRun(), and RecalcParam().
|
private |
Congestion window.
Definition at line 96 of file tcp-illinois-test.cc.
Referenced by DoRun(), GetSsThresh(), IncreaseWindow(), and RecalcParam().
|
private |
Last ACKed sequence number.
Definition at line 103 of file tcp-illinois-test.cc.
Referenced by DoRun(), and IncreaseWindow().
|
private |
Max RTT.
Definition at line 100 of file tcp-illinois-test.cc.
Referenced by CalculateMaxDelay(), and DoRun().
|
private |
Next Tx sequence number.
Definition at line 102 of file tcp-illinois-test.cc.
Referenced by DoRun(), and IncreaseWindow().
|
private |
RTT above threshold.
Definition at line 108 of file tcp-illinois-test.cc.
Referenced by CalculateAlpha().
|
private |
RTT low counter.
Definition at line 109 of file tcp-illinois-test.cc.
Referenced by CalculateAlpha().
|
private |
Number of segments ACKed.
Definition at line 101 of file tcp-illinois-test.cc.
Referenced by DoRun(), and IncreaseWindow().
|
private |
Segment size.
Definition at line 98 of file tcp-illinois-test.cc.
Referenced by DoRun(), GetSsThresh(), and IncreaseWindow().
|
private |
Slow Start Threshold.
Definition at line 97 of file tcp-illinois-test.cc.
Referenced by DoRun(), GetSsThresh(), and IncreaseWindow().
|
private |
Sum of all the RTTs.
Definition at line 107 of file tcp-illinois-test.cc.
Referenced by CalculateAvgDelay(), and DoRun().