An implementation of TCP YeAH. More...
#include "tcp-yeah.h"
Public Member Functions | |
TcpYeah () | |
Create an unbound tcp socket. | |
TcpYeah (const TcpYeah &sock) | |
Copy constructor. | |
~TcpYeah () override | |
void | CongestionStateSet (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override |
Enable/disable YeAH algorithm depending on the congestion state. | |
Ptr< TcpCongestionOps > | Fork () 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 upon the receipt of 3 dupACKs. | |
void | IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override |
Adjust cwnd following YeAH dual-mode algorithm. | |
void | PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override |
Compute RTTs needed to execute YeAH algorithm. | |
Public Member Functions inherited from ns3::TcpNewReno | |
TcpNewReno () | |
TcpNewReno (const TcpNewReno &sock) | |
Copy constructor. | |
~TcpNewReno () override | |
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< Object > | GetObject () 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< Object > | GetObject (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. | |
SimpleRefCount & | operator= (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 | DisableYeah () |
Stop taking YeAH samples. | |
void | EnableYeah (const SequenceNumber32 &nextTxSequence) |
Enable YeAH algorithm to start taking YeAH samples. | |
Private Attributes | |
uint32_t | m_alpha |
Maximum backlog allowed at the bottleneck queue; Q_max in the paper. | |
Time | m_baseRtt |
Minimum of all YeAH RTT measurements seen during connection. | |
SequenceNumber32 | m_begSndNxt |
Right edge during last RTT. | |
uint32_t | m_cntRtt |
Number of RTT measurements during last RTT. | |
uint32_t | m_delta |
Log minimum fraction of cwnd to be removed on loss. | |
uint32_t | m_doingRenoNow |
Number of RTTs in "Slow" mode. | |
bool | m_doingYeahNow |
If true, do YeAH for this RTT. | |
uint32_t | m_epsilon |
Log maximum fraction to be removed on early decongestion. | |
uint32_t | m_fastCount |
Number of RTTs in "Fast" mode. | |
uint32_t | m_gamma |
Fraction of queue to be removed per RTT when precautionary decongestion executed. | |
uint32_t | m_lastQ |
Last number of packets in the bottleneck queue. | |
Time | m_minRtt |
Minimum of all RTTs measured within last RTT. | |
uint32_t | m_phy |
Maximum delta from base. | |
uint32_t | m_renoCount |
Estimated cwnd of competing Reno flow. | |
uint32_t | m_rho |
Minimum number of consecutive RTT to consider competition with Reno flows on loss. | |
Ptr< TcpScalable > | m_stcp |
TcpScalable object. | |
uint32_t | m_stcpAiFactor |
STCP additive increase parameter. | |
uint32_t | m_zeta |
Minimum number of state switches to reset m_renoCount. | |
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. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
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
ns3::TcpYeah is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Group: Internet
Size of this type is 144 bytes (on a 64-bit architecture).
Definition at line 61 of file tcp-yeah.h.
ns3::TcpYeah::TcpYeah | ( | ) |
Create an unbound tcp socket.
Definition at line 76 of file tcp-yeah.cc.
References ns3::CreateObject(), m_stcp, m_stcpAiFactor, and NS_LOG_FUNCTION.
ns3::TcpYeah::TcpYeah | ( | const TcpYeah & | sock | ) |
Copy constructor.
sock | the object to copy |
Definition at line 102 of file tcp-yeah.cc.
References ns3::Object::CopyObject, m_stcp, and NS_LOG_FUNCTION.
|
override |
Definition at line 126 of file tcp-yeah.cc.
References NS_LOG_FUNCTION.
|
overridevirtual |
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).
tcb | internal congestion state |
newState | new congestion state to which the TCP is going to switch |
Reimplemented from ns3::TcpCongestionOps.
Definition at line 178 of file tcp-yeah.cc.
References ns3::TcpSocketState::CA_OPEN, DisableYeah(), EnableYeah(), and NS_LOG_FUNCTION.
|
private |
Stop taking YeAH samples.
Definition at line 170 of file tcp-yeah.cc.
References m_doingYeahNow, and NS_LOG_FUNCTION.
Referenced by CongestionStateSet().
|
private |
Enable YeAH algorithm to start taking YeAH samples.
YeAH algorithm is enabled in the following situations:
nextTxSequence | Sequence to transmit next |
Definition at line 159 of file tcp-yeah.cc.
References m_begSndNxt, m_cntRtt, m_doingYeahNow, m_minRtt, ns3::Time::Max(), and NS_LOG_FUNCTION.
Referenced by CongestionStateSet().
|
overridevirtual |
Copy the congestion control algorithm across sockets.
Reimplemented from ns3::TcpNewReno.
Definition at line 132 of file tcp-yeah.cc.
References ns3::Object::CopyObject.
|
overridevirtual |
Get the name of the congestion control algorithm.
Reimplemented from ns3::TcpNewReno.
Definition at line 304 of file tcp-yeah.cc.
|
overridevirtual |
Get slow start threshold upon the receipt of 3 dupACKs.
tcb | internal congestion state |
bytesInFlight | number of outstanding bytes |
Reimplemented from ns3::TcpNewReno.
Definition at line 310 of file tcp-yeah.cc.
References m_delta, m_doingRenoNow, m_fastCount, m_lastQ, m_renoCount, m_rho, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.
|
static |
Get the type ID.
Definition at line 26 of file tcp-yeah.cc.
References m_alpha, m_delta, m_epsilon, m_gamma, m_phy, m_rho, m_stcpAiFactor, m_zeta, ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), and ns3::TypeId::SetParent().
|
overridevirtual |
Adjust cwnd following YeAH dual-mode algorithm.
tcb | internal congestion state |
segmentsAcked | count of segments ACKed |
Reimplemented from ns3::TcpNewReno.
Definition at line 193 of file tcp-yeah.cc.
References ns3::TcpNewReno::CongestionAvoidance(), ns3::Time::GetMilliSeconds(), ns3::Time::GetSeconds(), m_alpha, m_baseRtt, m_begSndNxt, m_cntRtt, m_doingRenoNow, m_epsilon, m_fastCount, m_gamma, m_lastQ, m_minRtt, m_phy, m_renoCount, m_stcp, m_zeta, ns3::Time::Max(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and ns3::TcpNewReno::SlowStart().
|
overridevirtual |
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).
tcb | internal congestion state |
segmentsAcked | count of segments ACKed |
rtt | last RTT |
Reimplemented from ns3::TcpCongestionOps.
Definition at line 138 of file tcp-yeah.cc.
References ns3::Time::GetMilliSeconds(), ns3::Time::IsZero(), m_baseRtt, m_cntRtt, m_minRtt, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
private |
Maximum backlog allowed at the bottleneck queue; Q_max in the paper.
Definition at line 153 of file tcp-yeah.h.
Referenced by GetTypeId(), and IncreaseWindow().
|
private |
Minimum of all YeAH RTT measurements seen during connection.
Definition at line 165 of file tcp-yeah.h.
Referenced by IncreaseWindow(), and PktsAcked().
|
private |
Right edge during last RTT.
Definition at line 169 of file tcp-yeah.h.
Referenced by EnableYeah(), and IncreaseWindow().
|
private |
Number of RTT measurements during last RTT.
Definition at line 167 of file tcp-yeah.h.
Referenced by EnableYeah(), IncreaseWindow(), and PktsAcked().
|
private |
Log minimum fraction of cwnd to be removed on loss.
Definition at line 156 of file tcp-yeah.h.
Referenced by GetSsThresh(), and GetTypeId().
|
private |
Number of RTTs in "Slow" mode.
Definition at line 171 of file tcp-yeah.h.
Referenced by GetSsThresh(), and IncreaseWindow().
|
private |
If true, do YeAH for this RTT.
Definition at line 168 of file tcp-yeah.h.
Referenced by DisableYeah(), and EnableYeah().
|
private |
Log maximum fraction to be removed on early decongestion.
Definition at line 157 of file tcp-yeah.h.
Referenced by GetTypeId(), and IncreaseWindow().
|
private |
Number of RTTs in "Fast" mode.
Definition at line 173 of file tcp-yeah.h.
Referenced by GetSsThresh(), and IncreaseWindow().
|
private |
Fraction of queue to be removed per RTT when precautionary decongestion executed.
Definition at line 154 of file tcp-yeah.h.
Referenced by GetTypeId(), and IncreaseWindow().
|
private |
Last number of packets in the bottleneck queue.
Definition at line 170 of file tcp-yeah.h.
Referenced by GetSsThresh(), and IncreaseWindow().
|
private |
Minimum of all RTTs measured within last RTT.
Definition at line 166 of file tcp-yeah.h.
Referenced by EnableYeah(), IncreaseWindow(), and PktsAcked().
|
private |
Maximum delta from base.
Definition at line 158 of file tcp-yeah.h.
Referenced by GetTypeId(), and IncreaseWindow().
|
private |
Estimated cwnd of competing Reno flow.
Definition at line 172 of file tcp-yeah.h.
Referenced by GetSsThresh(), and IncreaseWindow().
|
private |
Minimum number of consecutive RTT to consider competition with Reno flows on loss.
Definition at line 159 of file tcp-yeah.h.
Referenced by GetSsThresh(), and GetTypeId().
|
private |
TcpScalable object.
Definition at line 164 of file tcp-yeah.h.
Referenced by TcpYeah(), TcpYeah(), and IncreaseWindow().
|
private |
STCP additive increase parameter.
Definition at line 163 of file tcp-yeah.h.
Referenced by TcpYeah(), and GetTypeId().
|
private |
Minimum number of state switches to reset m_renoCount.
Definition at line 161 of file tcp-yeah.h.
Referenced by GetTypeId(), and IncreaseWindow().