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. 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... | |
TestCase * | GetParent () 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... | |
TcpIllinois C-AIMD algorithm tests.
Definition at line 43 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 126 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 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().
|
private |
Calculate the average delay.
Definition at line 273 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 314 of file tcp-illinois-test.cc.
References ns3::DoubleValue::Get(), ns3::ObjectBase::GetAttribute(), m_beta, and NS_LOG_INFO.
Referenced by RecalcParam().
|
private |
Calculate the maximum delay.
Definition at line 267 of file tcp-illinois-test.cc.
References m_baseRtt, and m_maxRtt.
Referenced by RecalcParam().
|
privatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 155 of file tcp-illinois-test.cc.
References ns3::TracedValue< T >::Get(), GetSsThresh(), ns3::TcpIllinois::GetSsThresh(), IncreaseWindow(), ns3::TcpIllinois::IncreaseWindow(), m_baseRtt, m_cntRtt, m_cWnd, ns3::TcpSocketState::m_cWnd, m_lastAckedSeq, ns3::TcpSocketState::m_lastAckedSeq, m_maxRtt, m_nextTxSeq, ns3::TcpSocketState::m_nextTxSequence, m_segmentsAcked, m_segmentSize, ns3::TcpSocketState::m_segmentSize, m_ssThresh, ns3::TcpSocketState::m_ssThresh, m_sumRtt, NS_TEST_ASSERT_MSG_EQ, and ns3::TcpIllinois::PktsAcked().
|
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().
|
private |
Increases the TCP window.
cong | The 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().
|
private |
Recalculate the internal TCP Illinois params.
cong | The 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().
|
private |
|
private |
TCP Illinois alpha parameter.
Definition at line 117 of file tcp-illinois-test.cc.
Referenced by CalculateAlpha(), IncreaseWindow(), and RecalcParam().
|
private |
Base RTT.
Definition at line 112 of file tcp-illinois-test.cc.
Referenced by CalculateAvgDelay(), CalculateMaxDelay(), and DoRun().
|
private |
TCP Illinois beta parameter.
Definition at line 118 of file tcp-illinois-test.cc.
Referenced by CalculateBeta(), and GetSsThresh().
|
private |
RTT counter.
Definition at line 119 of file tcp-illinois-test.cc.
Referenced by CalculateAvgDelay(), DoRun(), and RecalcParam().
|
private |
Congestion window.
Definition at line 109 of file tcp-illinois-test.cc.
Referenced by DoRun(), GetSsThresh(), IncreaseWindow(), and RecalcParam().
|
private |
Last ACKed sequence number.
Definition at line 116 of file tcp-illinois-test.cc.
Referenced by DoRun(), and IncreaseWindow().
|
private |
Max RTT.
Definition at line 113 of file tcp-illinois-test.cc.
Referenced by CalculateMaxDelay(), and DoRun().
|
private |
Next Tx sequence number.
Definition at line 115 of file tcp-illinois-test.cc.
Referenced by DoRun(), and IncreaseWindow().
|
private |
RTT above threshold.
Definition at line 121 of file tcp-illinois-test.cc.
Referenced by CalculateAlpha().
|
private |
RTT low counter.
Definition at line 122 of file tcp-illinois-test.cc.
Referenced by CalculateAlpha().
|
private |
Number of segments ACKed.
Definition at line 114 of file tcp-illinois-test.cc.
Referenced by DoRun(), and IncreaseWindow().
|
private |
Segment size.
Definition at line 111 of file tcp-illinois-test.cc.
Referenced by DoRun(), GetSsThresh(), and IncreaseWindow().
|
private |
Slow Start Threshold.
Definition at line 110 of file tcp-illinois-test.cc.
Referenced by DoRun(), GetSsThresh(), and IncreaseWindow().
|
private |
Sum of all the RTTs.
Definition at line 120 of file tcp-illinois-test.cc.
Referenced by CalculateAvgDelay(), and DoRun().