A Discrete-Event Network Simulator
API
ns3::TcpIllinois Class Reference

An implementation of TCP Illinois algorithm. More...

#include "tcp-illinois.h"

+ Inheritance diagram for ns3::TcpIllinois:
+ Collaboration diagram for ns3::TcpIllinois:

Public Member Functions

 TcpIllinois ()
 Create an unbound tcp socket. More...
 
 TcpIllinois (const TcpIllinois &sock)
 Copy constructor. More...
 
 ~TcpIllinois () override
 
void CongestionStateSet (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override
 Reset Illinois parameters to default values upon a loss. More...
 
Ptr< TcpCongestionOpsFork () override
 Copy the congestion control algorithm across sockets. More...
 
std::string GetName () const override
 Get the name of the congestion control algorithm. More...
 
uint32_t GetSsThresh (Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
 Get slow start threshold after congestion event. More...
 
void IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
 Adjust cwnd following Illinois congestion avoidance algorithm. More...
 
void PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
 Measure RTT for each ACK Keep track of min and max RTT. More...
 
- Public Member Functions inherited from ns3::TcpNewReno
 TcpNewReno ()
 
 TcpNewReno (const TcpNewReno &sock)
 Copy constructor. More...
 
 ~TcpNewReno () override
 
- Public Member Functions inherited from ns3::TcpCongestionOps
 TcpCongestionOps ()
 
 TcpCongestionOps (const TcpCongestionOps &other)
 Copy constructor. More...
 
 ~TcpCongestionOps () override
 
virtual void CongControl (Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateConnection &rc, const TcpRateOps::TcpRateSample &rs)
 Called when packets are delivered to update cwnd and pacing rate. More...
 
virtual void CwndEvent (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
 Trigger events/calculations on occurrence of congestion window event. More...
 
virtual bool HasCongControl () const
 Returns true when Congestion Control Algorithm implements CongControl. More...
 
virtual void Init (Ptr< TcpSocketState > tcb[[maybe_unused]])
 Set configuration required by congestion control algorithm. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::TcpNewReno
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::TcpCongestionOps
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Private Member Functions

void CalculateAlpha (double da, double dm)
 Calculate additive increase factor alpha. More...
 
Time CalculateAvgDelay () const
 Calculate average queueing delay. More...
 
void CalculateBeta (double da, double dm)
 Calculate multiplicative decrease factor beta. More...
 
Time CalculateMaxDelay () const
 Calculate maximum queueing delay. More...
 
void RecalcParam (uint32_t cWnd)
 Recalculate alpha and beta every RTT. More...
 
void Reset (const SequenceNumber32 &nextTxSequence)
 Reset Illinois parameters. More...
 

Private Attributes

uint32_t m_ackCnt
 Number of received ACK. More...
 
double m_alpha
 Additive increase factor. More...
 
double m_alphaBase
 Base value of alpha for standard AIMD. More...
 
double m_alphaMax
 Maximum alpha threshold. More...
 
double m_alphaMin
 Minimum alpha threshold. More...
 
Time m_baseRtt
 Minimum of all RTT measurements. More...
 
double m_beta
 Multiplicative decrease factor. More...
 
double m_betaBase
 Base value of beta for standard AIMD. More...
 
double m_betaMax
 Maximum beta threshold. More...
 
double m_betaMin
 Minimum beta threshold. More...
 
uint32_t m_cntRtt
 Number of RTT measurements during last RTT. More...
 
SequenceNumber32 m_endSeq
 Right edge of current RTT. More...
 
Time m_maxRtt
 Maximum of all RTT measurements. More...
 
bool m_rttAbove
 True when da > d1. More...
 
uint8_t m_rttLow
 Number of RTTs da has stayed below d1. More...
 
Time m_sumRtt
 Sum of all RTT measurements during last RTT. More...
 
uint32_t m_theta
 Number of RTTs required before setting alpha to its max. More...
 
uint32_t m_winThresh
 Window threshold for adaptive sizing. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::TcpNewReno
virtual void CongestionAvoidance (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
 NewReno congestion avoidance. More...
 
virtual uint32_t SlowStart (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
 Tcp NewReno slow start algorithm. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoDispose ()
 Destructor implementation. More...
 
virtual void DoInitialize ()
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

An implementation of TCP Illinois algorithm.

TCP Illinois is a hybrid congestion control algorithm designed for high-speed networks. Illinois implements a Concave-AIMD (or C-AIMD) algorithm that uses packet loss as the primary congestion signal to determine the direction of window update and queueing delay as the secondary congestion signal to determine the amount of change.

The additive increase and multiplicative decrease factors (denoted as alpha and beta, respectively) are functions of the current average queueing delay da as shown in Equations (1) and (2). To improve the protocol robustness against sudden fluctuations in its delay sampling, Illinois allows the increment of alpha to alphaMax only if da stays below d1 for a some (theta) amount of time.

                         / alphaMax          if da <= d1
                 alpha =                                         (1)
                         \ k1 / (k2 + da)    otherwise

                        / betaMin            if da <= d2
                 beta =   k3 + k4da          if d2 < da < d3      (2)
                        \ betaMax            otherwise

where the calculations of k1, k2, k3, and k4 are shown in Equations (3), (4), (5), and (6).

     k1 = (dm - d1)(alphaMin)alphaMax / (alphaMax - alphaMin)    (3)

     k2 = ((dm - d1)alphaMin / (alphaMax - alphaMin)) - d1       (4)

     k3 = ((alphaMin)d3 - (alphaMax)d2) / (d3 - d2)              (5)

     k4 = (alphaMax - alphaMin) / (d3 - d2)                      (6)

with da the current average queueing delay calculated in Equation (7) where: Ta is the average RTT (sumRtt / cntRtt in the implementation) and Tmin (baseRtt in the implementation) is the minimum RTT ever seen dm the maximum (average) queueing delay calculated in Equation (8) where Tmax (maxRtt in the implementation) is the maximum RTT ever seen

     da = Ta - Tmin          (7)

     dm = Tmax - Tmin         (8)

di (i = 1,2,3) are calculated in Equation (9) (0 <= eta_1 < 1, and 0 <= eta_2 <= eta_3 <=1)

      di = (eta_i)dm            (9)

Illinois only executes its adaptation of alpha and beta when cwnd exceeds a threshold called winThresh. Otherwise, it sets alpha and beta to the base values of 1 and 0.5, respectively.

Following the implementation of Illinois in the Linux kernel, we use the following default parameter settings:

  alphaMin = 0.3      (0.1 in the Illinois paper)
  alphaMax = 10.0
  betaMin = 0.125
  betaMax = 0.5
  winThresh = 15      (10 in the Illinois paper)
  theta = 5
  eta1 = 0.01
  eta2 = 0.1
  eta3 = 0.8

More information: http://www.doi.org/10.1145/1190095.1190166

Definition at line 108 of file tcp-illinois.h.

Constructor & Destructor Documentation

◆ TcpIllinois() [1/2]

ns3::TcpIllinois::TcpIllinois ( )

Create an unbound tcp socket.

Definition at line 89 of file tcp-illinois.cc.

References NS_LOG_FUNCTION.

◆ TcpIllinois() [2/2]

ns3::TcpIllinois::TcpIllinois ( const TcpIllinois sock)

Copy constructor.

Parameters
sockthe object to copy

Definition at line 113 of file tcp-illinois.cc.

References NS_LOG_FUNCTION.

◆ ~TcpIllinois()

ns3::TcpIllinois::~TcpIllinois ( )
override

Definition at line 137 of file tcp-illinois.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ CalculateAlpha()

void ns3::TcpIllinois::CalculateAlpha ( double  da,
double  dm 
)
private

Calculate additive increase factor alpha.

If average queueing delay is at minimum, then alpha is set to alphaMax. Otherwise, alpha is a decreasing function of average queueing delay.

Parameters
dacurrent average queueing delay
dmmaximum average queueing delay

Definition at line 261 of file tcp-illinois.cc.

References m_alpha, m_alphaMax, m_alphaMin, m_rttAbove, m_rttLow, m_theta, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by RecalcParam().

+ Here is the caller graph for this function:

◆ CalculateAvgDelay()

Time ns3::TcpIllinois::CalculateAvgDelay ( ) const
private

Calculate average queueing delay.

Returns
average queueing delay da

Definition at line 348 of file tcp-illinois.cc.

References m_baseRtt, m_cntRtt, m_sumRtt, and NS_LOG_FUNCTION.

Referenced by RecalcParam().

+ Here is the caller graph for this function:

◆ CalculateBeta()

void ns3::TcpIllinois::CalculateBeta ( double  da,
double  dm 
)
private

Calculate multiplicative decrease factor beta.

If the current average queueing delay is <= 10% of max. (average) queueing delay, beta is set to betaMin, which equals to 1/8 by default. If the current average queueing delay is >= 80% of max. (average) queueing delay, beta is set to betaMax, which equals to 1/2 by default. Otherwise, beta is an increasing function of average queueing delay.

Parameters
dacurrent average queueing delay
dmmaximum average queueing delay

Definition at line 308 of file tcp-illinois.cc.

References m_beta, m_betaMax, m_betaMin, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by RecalcParam().

+ Here is the caller graph for this function:

◆ CalculateMaxDelay()

Time ns3::TcpIllinois::CalculateMaxDelay ( ) const
private

Calculate maximum queueing delay.

Returns
maximum average queueing delay dm

Definition at line 356 of file tcp-illinois.cc.

References m_baseRtt, m_maxRtt, and NS_LOG_FUNCTION.

Referenced by RecalcParam().

+ Here is the caller graph for this function:

◆ CongestionStateSet()

void ns3::TcpIllinois::CongestionStateSet ( Ptr< TcpSocketState tcb,
const TcpSocketState::TcpCongState_t  newState 
)
overridevirtual

Reset Illinois parameters to default values upon a loss.

Parameters
tcbinternal congestion state
newStatenew congestion state to which the TCP is going to switch

Reimplemented from ns3::TcpCongestionOps.

Definition at line 167 of file tcp-illinois.cc.

References ns3::TcpSocketState::CA_LOSS, m_alpha, m_alphaBase, m_beta, m_betaBase, ns3::TcpSocketState::m_nextTxSequence, m_rttAbove, m_rttLow, NS_LOG_FUNCTION, and Reset().

+ Here is the call graph for this function:

◆ Fork()

Ptr< TcpCongestionOps > ns3::TcpIllinois::Fork ( )
overridevirtual

Copy the congestion control algorithm across sockets.

Returns
a pointer of the copied object

Reimplemented from ns3::TcpNewReno.

Definition at line 374 of file tcp-illinois.cc.

References NS_LOG_FUNCTION.

◆ GetName()

std::string ns3::TcpIllinois::GetName ( ) const
overridevirtual

Get the name of the congestion control algorithm.

Returns
A string identifying the name

Reimplemented from ns3::TcpNewReno.

Definition at line 382 of file tcp-illinois.cc.

References NS_LOG_FUNCTION.

◆ GetSsThresh()

uint32_t ns3::TcpIllinois::GetSsThresh ( Ptr< const TcpSocketState tcb,
uint32_t  bytesInFlight 
)
overridevirtual

Get slow start threshold after congestion event.

Parameters
tcbinternal congestion state
bytesInFlightbytes in flight
Returns
the slow start threshold value

Reimplemented from ns3::TcpNewReno.

Definition at line 248 of file tcp-illinois.cc.

References m_beta, max, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::TcpIllinois::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 40 of file tcp-illinois.cc.

References m_alphaBase, m_alphaMax, m_alphaMin, m_betaBase, m_betaMax, m_betaMin, m_theta, m_winThresh, ns3::MakeDoubleAccessor(), ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IncreaseWindow()

void ns3::TcpIllinois::IncreaseWindow ( Ptr< TcpSocketState tcb,
uint32_t  segmentsAcked 
)
overridevirtual

Adjust cwnd following Illinois congestion avoidance algorithm.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed

Reimplemented from ns3::TcpNewReno.

Definition at line 183 of file tcp-illinois.cc.

References ns3::TcpSocketState::GetCwndInSegments(), m_ackCnt, m_alpha, ns3::TcpSocketState::m_cWnd, m_endSeq, ns3::TcpSocketState::m_lastAckedSeq, ns3::TcpSocketState::m_nextTxSequence, ns3::TcpSocketState::m_segmentSize, ns3::TcpSocketState::m_ssThresh, NS_LOG_FUNCTION, NS_LOG_INFO, RecalcParam(), Reset(), and ns3::TcpNewReno::SlowStart().

+ Here is the call graph for this function:

◆ PktsAcked()

void ns3::TcpIllinois::PktsAcked ( Ptr< TcpSocketState tcb,
uint32_t  segmentsAcked,
const Time rtt 
)
overridevirtual

Measure RTT for each ACK Keep track of min and max RTT.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed
rttlast RTT

Reimplemented from ns3::TcpCongestionOps.

Definition at line 225 of file tcp-illinois.cc.

References ns3::Time::IsZero(), m_baseRtt, m_cntRtt, m_maxRtt, m_sumRtt, max, min, NS_LOG_FUNCTION, and NS_LOG_INFO.

+ Here is the call graph for this function:

◆ RecalcParam()

void ns3::TcpIllinois::RecalcParam ( uint32_t  cWnd)
private

Recalculate alpha and beta every RTT.

Parameters
cWndcurrent Cwnd (in bytes)

Definition at line 143 of file tcp-illinois.cc.

References CalculateAlpha(), CalculateAvgDelay(), CalculateBeta(), CalculateMaxDelay(), ns3::Time::GetMilliSeconds(), m_alpha, m_alphaBase, m_beta, m_betaBase, m_cntRtt, m_winThresh, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by IncreaseWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Reset()

void ns3::TcpIllinois::Reset ( const SequenceNumber32 nextTxSequence)
private

Reset Illinois parameters.

Parameters
nextTxSequenceNext sequence to transmit

Definition at line 364 of file tcp-illinois.cc.

References m_cntRtt, m_endSeq, m_sumRtt, and NS_LOG_FUNCTION.

Referenced by CongestionStateSet(), and IncreaseWindow().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ackCnt

uint32_t ns3::TcpIllinois::m_ackCnt
private

Number of received ACK.

Definition at line 245 of file tcp-illinois.h.

Referenced by IncreaseWindow().

◆ m_alpha

double ns3::TcpIllinois::m_alpha
private

Additive increase factor.

Definition at line 238 of file tcp-illinois.h.

Referenced by CalculateAlpha(), CongestionStateSet(), IncreaseWindow(), and RecalcParam().

◆ m_alphaBase

double ns3::TcpIllinois::m_alphaBase
private

Base value of alpha for standard AIMD.

Definition at line 237 of file tcp-illinois.h.

Referenced by CongestionStateSet(), GetTypeId(), and RecalcParam().

◆ m_alphaMax

double ns3::TcpIllinois::m_alphaMax
private

Maximum alpha threshold.

Definition at line 236 of file tcp-illinois.h.

Referenced by CalculateAlpha(), and GetTypeId().

◆ m_alphaMin

double ns3::TcpIllinois::m_alphaMin
private

Minimum alpha threshold.

Definition at line 235 of file tcp-illinois.h.

Referenced by CalculateAlpha(), and GetTypeId().

◆ m_baseRtt

Time ns3::TcpIllinois::m_baseRtt
private

Minimum of all RTT measurements.

Definition at line 230 of file tcp-illinois.h.

Referenced by CalculateAvgDelay(), CalculateMaxDelay(), and PktsAcked().

◆ m_beta

double ns3::TcpIllinois::m_beta
private

Multiplicative decrease factor.

Definition at line 242 of file tcp-illinois.h.

Referenced by CalculateBeta(), CongestionStateSet(), GetSsThresh(), and RecalcParam().

◆ m_betaBase

double ns3::TcpIllinois::m_betaBase
private

Base value of beta for standard AIMD.

Definition at line 241 of file tcp-illinois.h.

Referenced by CongestionStateSet(), GetTypeId(), and RecalcParam().

◆ m_betaMax

double ns3::TcpIllinois::m_betaMax
private

Maximum beta threshold.

Definition at line 240 of file tcp-illinois.h.

Referenced by CalculateBeta(), and GetTypeId().

◆ m_betaMin

double ns3::TcpIllinois::m_betaMin
private

Minimum beta threshold.

Definition at line 239 of file tcp-illinois.h.

Referenced by CalculateBeta(), and GetTypeId().

◆ m_cntRtt

uint32_t ns3::TcpIllinois::m_cntRtt
private

Number of RTT measurements during last RTT.

Definition at line 229 of file tcp-illinois.h.

Referenced by CalculateAvgDelay(), PktsAcked(), RecalcParam(), and Reset().

◆ m_endSeq

SequenceNumber32 ns3::TcpIllinois::m_endSeq
private

Right edge of current RTT.

Definition at line 232 of file tcp-illinois.h.

Referenced by IncreaseWindow(), and Reset().

◆ m_maxRtt

Time ns3::TcpIllinois::m_maxRtt
private

Maximum of all RTT measurements.

Definition at line 231 of file tcp-illinois.h.

Referenced by CalculateMaxDelay(), and PktsAcked().

◆ m_rttAbove

bool ns3::TcpIllinois::m_rttAbove
private

True when da > d1.

Definition at line 233 of file tcp-illinois.h.

Referenced by CalculateAlpha(), and CongestionStateSet().

◆ m_rttLow

uint8_t ns3::TcpIllinois::m_rttLow
private

Number of RTTs da has stayed below d1.

Definition at line 234 of file tcp-illinois.h.

Referenced by CalculateAlpha(), and CongestionStateSet().

◆ m_sumRtt

Time ns3::TcpIllinois::m_sumRtt
private

Sum of all RTT measurements during last RTT.

Definition at line 228 of file tcp-illinois.h.

Referenced by CalculateAvgDelay(), PktsAcked(), and Reset().

◆ m_theta

uint32_t ns3::TcpIllinois::m_theta
private

Number of RTTs required before setting alpha to its max.

Definition at line 244 of file tcp-illinois.h.

Referenced by CalculateAlpha(), and GetTypeId().

◆ m_winThresh

uint32_t ns3::TcpIllinois::m_winThresh
private

Window threshold for adaptive sizing.

Definition at line 243 of file tcp-illinois.h.

Referenced by GetTypeId(), and RecalcParam().


The documentation for this class was generated from the following files: