29 #include "ns3/tcp-congestion-ops.h" 30 #include "ns3/tcp-socket-base.h" 31 #include "ns3/tcp-illinois.h" 63 uint32_t segmentsAcked,
66 const std::string &name);
69 virtual void DoRun ();
84 Time CalculateMaxDelay ();
89 Time CalculateAvgDelay ();
128 uint32_t segmentSize,
131 uint32_t segmentsAcked,
134 const std::string & name)
137 m_ssThresh (ssThresh),
138 m_segmentSize (segmentSize),
141 m_segmentsAcked (segmentsAcked),
142 m_nextTxSeq (nextTxSeq),
143 m_lastAckedSeq (lastAckedSeq),
172 for (uint32_t count = 1; count <
m_cntRtt; ++count)
184 "CWnd has not updated correctly");
192 "SsThresh has not updated correctly");
218 uint32_t oldCwnd = segCwnd;
231 if (segCwnd != oldCwnd)
251 NS_LOG_INFO (
"cWnd < winThresh, set alpha & beta to base values");
259 NS_LOG_INFO (
"Updated to dm = " << dm <<
" da = " << da);
288 double d1 = dm / 100;
308 m_alpha = (dm * alphaMax.
Get ()) / (dm + (da * (alphaMax.
Get () - alphaMin.
Get ())) / alphaMin.
Get ());
329 else if (da > d2 && da < d3)
331 m_beta = (betaMin.
Get () * d3 - betaMax.
Get () * d2 + (betaMax.
Get () - betaMin.
Get ()) * da) / (d3 - d2);
334 else if (da >= d3 || d3 <= d2)
347 NS_LOG_DEBUG (
"Calculated ssThresh (in segments) = " << ssThresh);
366 "Illinois test on cWnd and ssThresh when in slow start"),
369 "Illinois test on cWnd and ssThresh when avg queueing delay is at minimum"),
372 "Illinois test on cWnd and ssThresh when avg queueing delay is at maximum"),
375 "Illinois test on cWnd and ssThresh when avg queueing delay is in between its min & max"),
double m_alpha
TCP Illinois alpha parameter.
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
void CalculateBeta(Ptr< TcpIllinois > cong, double da, double dm)
Calculate the TCP Illinois beta param.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold after congestion event.
uint32_t m_ackCnt
ACK counter.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Illinois congestion avoidance algorithm.
Time CalculateAvgDelay()
Calculate the average delay.
#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.
uint32_t m_segmentSize
Segment size.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t m_cWnd
Congestion window.
uint8_t m_rttLow
RTT low counter.
void RecalcParam(Ptr< TcpIllinois > cong)
Recalculate the internal TCP Illinois params.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
uint32_t m_segmentsAcked
Number of segments ACKed.
virtual void DoRun()
Implementation to actually run this TestCase.
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.
SequenceNumber32 m_lastAckedSeq
Last ACKed sequence number.
bool m_rttAbove
RTT above threshold.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
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.
Time m_sumRtt
Sum of all the RTTs.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void GetSsThresh()
brief Get and check the SSH threshold.
double m_beta
TCP Illinois beta parameter.
void CalculateAlpha(Ptr< TcpIllinois > cong, double da, double dm)
Calculate the TCP Illinois alpha param.
TracedValue< uint32_t > m_cWnd
Congestion window.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
T Get(void) const
Get the underlying value.
uint32_t m_cntRtt
RTT counter.
SequenceNumber32 m_nextTxSeq
Next Tx sequence number.
void IncreaseWindow(Ptr< TcpIllinois > cong)
Increases the TCP window.
uint32_t m_segmentSize
Segment size.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Measure RTT for each ACK Keep track of min and max RTT.
This test suite implements a Unit Test.
uint32_t m_ssThresh
Slow Start Threshold.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Time CalculateMaxDelay()
Calculate the maximum delay.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
static TcpIllinoisTestSuite g_tcpIllinoisTest
Static variable for test initialization.
TcpIllinois C-AIMD algorithm tests.