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

Static Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

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

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 97 of file tcp-illinois.h.

Constructor & Destructor Documentation

◆ TcpIllinois() [1/2]

ns3::TcpIllinois::TcpIllinois ( )

Create an unbound tcp socket.

Definition at line 78 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 102 of file tcp-illinois.cc.

References NS_LOG_FUNCTION.

◆ ~TcpIllinois()

ns3::TcpIllinois::~TcpIllinois ( )
override

Definition at line 126 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 250 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 337 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 297 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 345 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 156 of file tcp-illinois.cc.

References ns3::TcpSocketState::CA_LOSS, m_alpha, m_alphaBase, m_beta, m_betaBase, 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

Implements ns3::TcpCongestionOps.

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

References ns3::Object::CopyObject, and 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

Implements ns3::TcpCongestionOps.

Definition at line 371 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

Implements ns3::TcpCongestionOps.

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

References m_beta, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::TcpIllinois::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 29 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::MakeDoubleChecker(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), 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::TcpCongestionOps.

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

References m_ackCnt, m_alpha, m_endSeq, 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 214 of file tcp-illinois.cc.

References ns3::Time::IsZero(), m_baseRtt, m_cntRtt, m_maxRtt, m_sumRtt, 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 132 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 353 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 234 of file tcp-illinois.h.

Referenced by IncreaseWindow().

◆ m_alpha

double ns3::TcpIllinois::m_alpha
private

Additive increase factor.

Definition at line 227 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 226 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 225 of file tcp-illinois.h.

Referenced by CalculateAlpha(), and GetTypeId().

◆ m_alphaMin

double ns3::TcpIllinois::m_alphaMin
private

Minimum alpha threshold.

Definition at line 224 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 219 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 231 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 230 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 229 of file tcp-illinois.h.

Referenced by CalculateBeta(), and GetTypeId().

◆ m_betaMin

double ns3::TcpIllinois::m_betaMin
private

Minimum beta threshold.

Definition at line 228 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 218 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 221 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 220 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 222 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 223 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 217 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 233 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 232 of file tcp-illinois.h.

Referenced by GetTypeId(), and RecalcParam().


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