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

An implementation of TCP YeAH. More...

#include "tcp-yeah.h"

+ Inheritance diagram for ns3::TcpYeah:
+ Collaboration diagram for ns3::TcpYeah:

Public Member Functions

 TcpYeah (const TcpYeah &sock)
 Copy constructor. More...
 
 TcpYeah (void)
 Create an unbound tcp socket. More...
 
virtual ~TcpYeah (void)
 
virtual void CongestionStateSet (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
 Enable/disable YeAH algorithm depending on the congestion state. More...
 
virtual Ptr< TcpCongestionOpsFork ()
 Copy the congestion control algorithm across sockets. More...
 
virtual std::string GetName () const
 Get the name of the congestion control algorithm. More...
 
virtual uint32_t GetSsThresh (Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
 Get slow start threshold upon the receipt of 3 dupACKs. More...
 
virtual void IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
 Adjust cwnd following YeAH dual-mode algorithm. More...
 
virtual void PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
 Compute RTTs needed to execute YeAH algorithm. More...
 
- Public Member Functions inherited from ns3::TcpNewReno
 TcpNewReno ()
 
 TcpNewReno (const TcpNewReno &sock)
 Copy constructor. More...
 
 ~TcpNewReno ()
 
- Public Member Functions inherited from ns3::TcpCongestionOps
 TcpCongestionOps ()
 
 TcpCongestionOps (const TcpCongestionOps &other)
 Copy constructor. More...
 
virtual ~TcpCongestionOps ()
 
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 ([[maybe_unused]] Ptr< TcpSocketState > tcb)
 Set configuration required by congestion control algorithm. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this 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...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) 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 (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= ([[maybe_unused]] const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) 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 erros. 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 (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::TcpNewReno
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::TcpCongestionOps
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void DisableYeah ()
 Stop taking YeAH samples. More...
 
void EnableYeah (const SequenceNumber32 &nextTxSequence)
 Enable YeAH algorithm to start taking YeAH samples. More...
 

Private Attributes

uint32_t m_alpha
 Maximum backlog allowed at the bottleneck queue; Q_max in the paper. More...
 
Time m_baseRtt
 Minimum of all YeAH RTT measurements seen during connection. More...
 
SequenceNumber32 m_begSndNxt
 Right edge during last RTT. More...
 
uint32_t m_cntRtt
 Number of RTT measurements during last RTT. More...
 
uint32_t m_delta
 Log minimum fraction of cwnd to be removed on loss. More...
 
uint32_t m_doingRenoNow
 Number of RTTs in "Slow" mode. More...
 
bool m_doingYeahNow
 If true, do YeAH for this RTT. More...
 
uint32_t m_epsilon
 Log maximum fraction to be removed on early decongestion. More...
 
uint32_t m_fastCount
 Number of RTTs in "Fast" mode. More...
 
uint32_t m_gamma
 Fraction of queue to be removed per RTT when precautionary decongestion executed. More...
 
uint32_t m_lastQ
 Last number of packets in the bottleneck queue. More...
 
Time m_minRtt
 Minimum of all RTTs measured within last RTT. More...
 
uint32_t m_phy
 Maximum delta from base. More...
 
uint32_t m_renoCount
 Estimated cwnd of competing Reno flow. More...
 
uint32_t m_rho
 Minimum number of consecutive RTT to consider competition with Reno flows on loss. More...
 
Ptr< TcpScalablem_stcp
 TcpScalable object. More...
 
uint32_t m_stcpAiFactor
 STCP additive increase parameter. More...
 
uint32_t m_zeta
 Minimum number of state switches to reset m_renoCount. 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 (void)
 Destructor implementation. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 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 (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

An implementation of TCP YeAH.

YeAH-TCP (Yet Another HighSpeed TCP) is a heuristic designed to balance various requirements of a state-of-the-art congestion control algorithm: 1) fully exploit the link capacity of high BDP networks while inducing a small number of congestion events 2) compete friendly with Reno flows 3) achieve intra and RTT fairness 4) robust to random losses 5) achieve high performance regardless of buffer size

YeAH operates between 2 modes: Fast and Slow mode. In the Fast mode when the queue occupancy is small and the network congestion level is low, YeAH increments its congestion window according to the aggressive STCP rule. When the number of packets in the queue grows beyond a threshold and the network congestion level is high, YeAH enters its Slow mode, acting as Reno with a decongestion algorithm. YeAH employs Vegas' mechanism for calculating the backlog as in Equation (1). The estimation of the network congestion level is shown in Equation (2).

                 Q = (RTT - BaseRTT) (cwnd / RTT)    (1)
                 L = (RTT - BaseRTT) / BaseRTT       (2)

To ensure TCP friendliness, YeAH also implements an algorithm to detect the presence of legacy Reno flows. Upon the receipt of 3 duplicate ACKs, YeAH decreases its slow start threshold according to Equation (3) if it's not competing with Reno flows. Otherwise, the ssthresh is halved as in Reno.

                 ssthresh = min{max{cwnd/8, Q}, cwnd/2}

More information: http://www.csc.lsu.edu/~sjpark/cs7601/4-YeAH_TCP.pdf

Config Paths

ns3::TcpYeah is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/$ns3::TcpL4Protocol/SocketList/[i]/CongestionOps/$ns3::TcpNewReno/$ns3::TcpYeah"
  • "/NodeList/[i]/$ns3::TcpL4Protocol/SocketList/[i]/CongestionOps/$ns3::TcpYeah"

Attributes

  • Alpha: Maximum backlog allowed at the bottleneck queue
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 80
    • Flags: construct write read
  • Gamma: Fraction of queue to be removed per RTT
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 1
    • Flags: construct write read
  • Delta: Log minimum fraction of cwnd to be removed on loss
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 3
    • Flags: construct write read
  • Epsilon: Log maximum fraction to be removed on early decongestion
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 1
    • Flags: construct write read
  • Phy: Maximum delta from base
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 8
    • Flags: construct write read
  • Rho: Minimum # of consecutive RTT to consider competition on loss
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 16
    • Flags: construct write read
  • Zeta: Minimum # of state switches to reset m_renoCount
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 50
    • Flags: construct write read
  • StcpAiFactor: STCP additive increase factor
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 100
    • Flags: construct write read

No TraceSources are defined for this type.
Size of this type is 120 bytes (on a 64-bit architecture).

Definition at line 72 of file tcp-yeah.h.

Constructor & Destructor Documentation

◆ TcpYeah() [1/2]

ns3::TcpYeah::TcpYeah ( void  )

Create an unbound tcp socket.

Definition at line 79 of file tcp-yeah.cc.

References m_stcp, m_stcpAiFactor, and NS_LOG_FUNCTION.

◆ TcpYeah() [2/2]

ns3::TcpYeah::TcpYeah ( const TcpYeah sock)

Copy constructor.

Parameters
sockthe object to copy

Definition at line 105 of file tcp-yeah.cc.

References ns3::Object::CopyObject, m_stcp, and NS_LOG_FUNCTION.

◆ ~TcpYeah()

ns3::TcpYeah::~TcpYeah ( void  )
virtual

Definition at line 129 of file tcp-yeah.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ CongestionStateSet()

void ns3::TcpYeah::CongestionStateSet ( Ptr< TcpSocketState tcb,
const TcpSocketState::TcpCongState_t  newState 
)
virtual

Enable/disable YeAH algorithm depending on the congestion state.

We only start a YeAH cycle when we are in normal congestion state (CA_OPEN state).

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

Reimplemented from ns3::TcpCongestionOps.

Definition at line 182 of file tcp-yeah.cc.

References ns3::TcpSocketState::CA_OPEN, DisableYeah(), EnableYeah(), ns3::TcpSocketState::m_nextTxSequence, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DisableYeah()

void ns3::TcpYeah::DisableYeah ( )
private

Stop taking YeAH samples.

Definition at line 174 of file tcp-yeah.cc.

References m_doingYeahNow, and NS_LOG_FUNCTION.

Referenced by CongestionStateSet().

+ Here is the caller graph for this function:

◆ EnableYeah()

void ns3::TcpYeah::EnableYeah ( const SequenceNumber32 nextTxSequence)
private

Enable YeAH algorithm to start taking YeAH samples.

YeAH algorithm is enabled in the following situations:

  1. at the establishment of a connection
  2. after an RTO
  3. after fast recovery
  4. when an idle connection is restarted
Parameters
nextTxSequenceSequence to transmit next

Definition at line 163 of file tcp-yeah.cc.

References m_begSndNxt, m_cntRtt, m_doingYeahNow, m_minRtt, ns3::Time::Max(), and NS_LOG_FUNCTION.

Referenced by CongestionStateSet().

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

◆ Fork()

Ptr< TcpCongestionOps > ns3::TcpYeah::Fork ( )
virtual

Copy the congestion control algorithm across sockets.

Returns
a pointer of the copied object

Reimplemented from ns3::TcpNewReno.

Definition at line 135 of file tcp-yeah.cc.

◆ GetName()

std::string ns3::TcpYeah::GetName ( ) const
virtual

Get the name of the congestion control algorithm.

Returns
A string identifying the name

Reimplemented from ns3::TcpNewReno.

Definition at line 310 of file tcp-yeah.cc.

◆ GetSsThresh()

uint32_t ns3::TcpYeah::GetSsThresh ( Ptr< const TcpSocketState tcb,
uint32_t  bytesInFlight 
)
virtual

Get slow start threshold upon the receipt of 3 dupACKs.

Parameters
tcbinternal congestion state
bytesInFlightnumber of outstanding bytes
Returns
the slow start threshold value

Reimplemented from ns3::TcpNewReno.

Definition at line 316 of file tcp-yeah.cc.

References m_delta, m_doingRenoNow, m_fastCount, m_lastQ, m_renoCount, m_rho, max, min, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

Definition at line 37 of file tcp-yeah.cc.

References m_alpha, m_delta, m_epsilon, m_gamma, m_phy, m_rho, m_stcpAiFactor, m_zeta, ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IncreaseWindow()

void ns3::TcpYeah::IncreaseWindow ( Ptr< TcpSocketState tcb,
uint32_t  segmentsAcked 
)
virtual

◆ PktsAcked()

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

Compute RTTs needed to execute YeAH algorithm.

The function filters RTT samples from the last RTT to find the current smallest propagation delay + queueing delay (minRtt). We take the minimum to avoid the effects of delayed ACKs.

The function also min-filters all RTT measurements seen to find the propagation delay (baseRtt).

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed
rttlast RTT

Reimplemented from ns3::TcpCongestionOps.

Definition at line 141 of file tcp-yeah.cc.

References ns3::Time::GetMilliSeconds(), ns3::Time::IsZero(), m_baseRtt, m_cntRtt, m_minRtt, min, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_alpha

uint32_t ns3::TcpYeah::m_alpha
private

Maximum backlog allowed at the bottleneck queue; Q_max in the paper.

Definition at line 166 of file tcp-yeah.h.

Referenced by GetTypeId(), and IncreaseWindow().

◆ m_baseRtt

Time ns3::TcpYeah::m_baseRtt
private

Minimum of all YeAH RTT measurements seen during connection.

Definition at line 176 of file tcp-yeah.h.

Referenced by IncreaseWindow(), and PktsAcked().

◆ m_begSndNxt

SequenceNumber32 ns3::TcpYeah::m_begSndNxt
private

Right edge during last RTT.

Definition at line 180 of file tcp-yeah.h.

Referenced by EnableYeah(), and IncreaseWindow().

◆ m_cntRtt

uint32_t ns3::TcpYeah::m_cntRtt
private

Number of RTT measurements during last RTT.

Definition at line 178 of file tcp-yeah.h.

Referenced by EnableYeah(), IncreaseWindow(), and PktsAcked().

◆ m_delta

uint32_t ns3::TcpYeah::m_delta
private

Log minimum fraction of cwnd to be removed on loss.

Definition at line 168 of file tcp-yeah.h.

Referenced by GetSsThresh(), and GetTypeId().

◆ m_doingRenoNow

uint32_t ns3::TcpYeah::m_doingRenoNow
private

Number of RTTs in "Slow" mode.

Definition at line 182 of file tcp-yeah.h.

Referenced by GetSsThresh(), and IncreaseWindow().

◆ m_doingYeahNow

bool ns3::TcpYeah::m_doingYeahNow
private

If true, do YeAH for this RTT.

Definition at line 179 of file tcp-yeah.h.

Referenced by DisableYeah(), and EnableYeah().

◆ m_epsilon

uint32_t ns3::TcpYeah::m_epsilon
private

Log maximum fraction to be removed on early decongestion.

Definition at line 169 of file tcp-yeah.h.

Referenced by GetTypeId(), and IncreaseWindow().

◆ m_fastCount

uint32_t ns3::TcpYeah::m_fastCount
private

Number of RTTs in "Fast" mode.

Definition at line 184 of file tcp-yeah.h.

Referenced by GetSsThresh(), and IncreaseWindow().

◆ m_gamma

uint32_t ns3::TcpYeah::m_gamma
private

Fraction of queue to be removed per RTT when precautionary decongestion executed.

Definition at line 167 of file tcp-yeah.h.

Referenced by GetTypeId(), and IncreaseWindow().

◆ m_lastQ

uint32_t ns3::TcpYeah::m_lastQ
private

Last number of packets in the bottleneck queue.

Definition at line 181 of file tcp-yeah.h.

Referenced by GetSsThresh(), and IncreaseWindow().

◆ m_minRtt

Time ns3::TcpYeah::m_minRtt
private

Minimum of all RTTs measured within last RTT.

Definition at line 177 of file tcp-yeah.h.

Referenced by EnableYeah(), IncreaseWindow(), and PktsAcked().

◆ m_phy

uint32_t ns3::TcpYeah::m_phy
private

Maximum delta from base.

Definition at line 170 of file tcp-yeah.h.

Referenced by GetTypeId(), and IncreaseWindow().

◆ m_renoCount

uint32_t ns3::TcpYeah::m_renoCount
private

Estimated cwnd of competing Reno flow.

Definition at line 183 of file tcp-yeah.h.

Referenced by GetSsThresh(), and IncreaseWindow().

◆ m_rho

uint32_t ns3::TcpYeah::m_rho
private

Minimum number of consecutive RTT to consider competition with Reno flows on loss.

Definition at line 171 of file tcp-yeah.h.

Referenced by GetSsThresh(), and GetTypeId().

◆ m_stcp

Ptr<TcpScalable> ns3::TcpYeah::m_stcp
private

TcpScalable object.

Definition at line 175 of file tcp-yeah.h.

Referenced by TcpYeah(), and IncreaseWindow().

◆ m_stcpAiFactor

uint32_t ns3::TcpYeah::m_stcpAiFactor
private

STCP additive increase parameter.

Definition at line 174 of file tcp-yeah.h.

Referenced by TcpYeah(), and GetTypeId().

◆ m_zeta

uint32_t ns3::TcpYeah::m_zeta
private

Minimum number of state switches to reset m_renoCount.

Definition at line 172 of file tcp-yeah.h.

Referenced by GetTypeId(), and IncreaseWindow().


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