29 #include "ns3/tcp-congestion-ops.h"
30 #include "ns3/tcp-socket-base.h"
31 #include "ns3/tcp-illinois.h"
48 uint32_t segmentsAcked,
51 const std::string &name);
54 virtual void DoRun ();
85 uint32_t segmentsAcked,
88 const std::string & name)
91 m_ssThresh (ssThresh),
92 m_segmentSize (segmentSize),
95 m_segmentsAcked (segmentsAcked),
96 m_nextTxSeq (nextTxSeq),
97 m_lastAckedSeq (lastAckedSeq),
126 for (uint32_t count = 1; count <
m_cntRtt; ++count)
138 "CWnd has not updated correctly");
143 uint32_t ssThresh = cong->GetSsThresh (state,
m_cWnd);
146 "SsThresh has not updated correctly");
172 uint32_t oldCwnd = segCwnd;
185 if (segCwnd != oldCwnd)
199 cong->GetAttribute (
"AlphaBase", alphaBase);
201 cong->GetAttribute (
"WinThresh", winThresh);
205 NS_LOG_INFO (
"cWnd < winThresh, set alpha & beta to base values");
213 NS_LOG_INFO (
"Updated to dm = " << dm <<
" da = " << da);
236 cong->GetAttribute (
"AlphaMax", alphaMax);
238 cong->GetAttribute (
"Theta", theta);
240 cong->GetAttribute (
"AlphaMin", alphaMin);
242 double d1 = dm / 100;
262 m_alpha = (dm * alphaMax.
Get ()) / (dm + (da * (alphaMax.
Get () - alphaMin.
Get ())) / alphaMin.
Get ());
271 cong->GetAttribute (
"BetaMin", betaMin);
273 cong->GetAttribute (
"BetaMax", betaMax);
283 else if (da > d2 && da < d3)
285 m_beta = (betaMin.
Get () * d3 - betaMax.
Get () * d2 + (betaMax.
Get () - betaMin.
Get ()) * da) / (d3 - d2);
288 else if (da >= d3 || d3 <= d2)
301 NS_LOG_DEBUG (
"Calculated ssThresh (in segments) = " << ssThresh);
313 "Illinois test on cWnd and ssThresh when in slow start"),
316 "Illinois test on cWnd and ssThresh when avg queueing delay is at minimum"),
319 "Illinois test on cWnd and ssThresh when avg queueing delay is at maximum"),
322 "Illinois test on cWnd and ssThresh when avg queueing delay is in between its min & max"),
void CalculateBeta(Ptr< TcpIllinois > cong, double da, double dm)
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
virtual void DoRun()
Implementation to actually run this TestCase.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
void RecalcParam(Ptr< TcpIllinois > cong)
Hold an unsigned integer type.
#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.
void CalculateAlpha(Ptr< TcpIllinois > cong, double da, double dm)
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)
ns3::TcpIllinoisTestSuite g_tcpIllinoisTest
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void IncreaseWindow(Ptr< TcpIllinois > cong)
SequenceNumber32 m_nextTxSeq
SequenceNumber32 m_lastAckedSeq
This test suite implements a Unit Test.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Testing TcpIllinois C-AIMD algorithm.