16#include "ns3/tcp-congestion-ops.h"
17#include "ns3/tcp-illinois.h"
18#include "ns3/tcp-socket-base.h"
53 const std::string& name);
56 void DoRun()
override;
121 const std::string& name)
124 m_ssThresh(ssThresh),
128 m_segmentsAcked(segmentsAcked),
129 m_nextTxSeq(nextTxSeq),
130 m_lastAckedSeq(lastAckedSeq),
213 if (segCwnd != oldCwnd)
225 cong->GetAttribute(
"AlphaBase", alphaBase);
227 cong->GetAttribute(
"WinThresh", winThresh);
231 NS_LOG_INFO(
"cWnd < winThresh, set alpha & beta to base values");
239 NS_LOG_INFO(
"Updated to dm = " << dm <<
" da = " << da);
262 cong->GetAttribute(
"AlphaMax", alphaMax);
264 cong->GetAttribute(
"Theta", theta);
266 cong->GetAttribute(
"AlphaMin", alphaMin);
268 double d1 = dm / 100;
289 (dm + (da * (alphaMax.
Get() - alphaMin.
Get())) / alphaMin.
Get());
298 cong->GetAttribute(
"BetaMin", betaMin);
300 cong->GetAttribute(
"BetaMax", betaMax);
311 else if (da > d2 && da < d3)
313 m_beta = (betaMin.
Get() * d3 - betaMax.
Get() * d2 + (betaMax.
Get() - betaMin.
Get()) * da) /
317 else if (da >= d3 || d3 <= d2)
330 NS_LOG_DEBUG(
"Calculated ssThresh (in segments) = " << ssThresh);
354 "Illinois test on cWnd and ssThresh when in slow start"),
355 TestCase::Duration::QUICK);
365 "Illinois test on cWnd and ssThresh when avg queueing delay is at minimum"),
366 TestCase::Duration::QUICK);
376 "Illinois test on cWnd and ssThresh when avg queueing delay is at maximum"),
377 TestCase::Duration::QUICK);
386 "Illinois test on cWnd and ssThresh when avg queueing "
387 "delay is in between its min & max"),
388 TestCase::Duration::QUICK);
TcpIllinois C-AIMD algorithm tests.
Time CalculateAvgDelay()
Calculate the average delay.
Time CalculateMaxDelay()
Calculate the maximum delay.
void CalculateAlpha(Ptr< TcpIllinois > cong, double da, double dm)
Calculate the TCP Illinois alpha param.
SequenceNumber32 m_lastAckedSeq
Last ACKed sequence number.
void RecalcParam(Ptr< TcpIllinois > cong)
Recalculate the internal TCP Illinois params.
uint32_t m_ackCnt
ACK counter.
void IncreaseWindow(Ptr< TcpIllinois > cong)
Increases the TCP window.
SequenceNumber32 m_nextTxSeq
Next Tx sequence number.
uint8_t m_rttLow
RTT low counter.
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.
uint32_t m_cntRtt
RTT counter.
uint32_t m_cWnd
Congestion window.
bool m_rttAbove
RTT above threshold.
void CalculateBeta(Ptr< TcpIllinois > cong, double da, double dm)
Calculate the TCP Illinois beta param.
Time m_sumRtt
Sum of all the RTTs.
void GetSsThresh()
brief Get and check the SSH threshold.
void DoRun() override
Implementation to actually run this TestCase.
double m_alpha
TCP Illinois alpha parameter.
uint32_t m_ssThresh
Slow Start Threshold.
double m_beta
TCP Illinois beta parameter.
uint32_t m_segmentSize
Segment size.
uint32_t m_segmentsAcked
Number of segments ACKed.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Smart pointer class similar to boost::intrusive_ptr.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
Simulation virtual time values and global simulation resolution.
int64_t GetMilliSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpIllinoisTestSuite g_tcpIllinoisTest
Static variable for test initialization.