|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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 ();
131 uint32_t segmentsAcked,
134 const std::string & name)
137 m_ssThresh (ssThresh),
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"),
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_cntRtt
RTT counter.
uint32_t m_segmentSize
Segment size.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
T Get(void) const
Get the underlying value.
uint32_t m_cWnd
Congestion window.
uint8_t m_rttLow
RTT low counter.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold after congestion event.
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.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
uint32_t m_segmentSize
Segment size.
uint32_t m_segmentsAcked
Number of segments ACKed.
virtual void DoRun()
Implementation to actually run this TestCase.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
SequenceNumber32 m_nextTxSeq
Next Tx sequence number.
void IncreaseWindow(Ptr< TcpIllinois > cong)
Increases the TCP window.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Illinois congestion avoidance algorithm.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
uint32_t m_ackCnt
ACK 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.
Smart pointer class similar to boost::intrusive_ptr.
void CalculateAlpha(Ptr< TcpIllinois > cong, double da, double dm)
Calculate the TCP Illinois alpha param.
uint32_t m_ssThresh
Slow Start Threshold.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Measure RTT for each ACK Keep track of min and max RTT.
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time CalculateMaxDelay()
Calculate the maximum delay.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Simulation virtual time values and global simulation resolution.
void CalculateBeta(Ptr< TcpIllinois > cong, double da, double dm)
Calculate the TCP Illinois beta param.
Time CalculateAvgDelay()
Calculate the average delay.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
bool m_rttAbove
RTT above threshold.
#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 m_sumRtt
Sum of all the RTTs.
static TcpIllinoisTestSuite g_tcpIllinoisTest
Static variable for test initialization.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
@ UNIT
This test suite implements a Unit Test.
TcpIllinois C-AIMD algorithm tests.
TracedValue< uint32_t > m_cWnd
Congestion window.
double m_alpha
TCP Illinois alpha parameter.
void RecalcParam(Ptr< TcpIllinois > cong)
Recalculate the internal TCP Illinois params.
Hold an unsigned integer type.
SequenceNumber32 m_lastAckedSeq
Last ACKed sequence number.
Generic "sequence number" class.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.