A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::TcpVeno Class Reference

An implementation of TCP Veno. More...

#include "tcp-veno.h"

+ Inheritance diagram for ns3::TcpVeno:
+ Collaboration diagram for ns3::TcpVeno:

Public Member Functions

 TcpVeno ()
 Create an unbound tcp socket.
 
 TcpVeno (const TcpVeno &sock)
 Copy constructor.
 
 ~TcpVeno () override
 
void CongestionStateSet (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override
 Enable/disable Veno depending on the congestion state.
 
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 during Veno multiplicative-decrease phase.
 
void IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
 Adjust cwnd following Veno additive increase algorithm.
 
void PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
 Perform RTT sampling needed to execute Veno 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< 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 DisableVeno ()
 Turn off Veno.
 
void EnableVeno ()
 Enable Veno algorithm to start Veno sampling.
 

Private Attributes

uint32_t m_ackCnt
 Number of received ACK.
 
Time m_baseRtt
 Minimum of all RTT measurements seen during connection.
 
uint32_t m_beta
 Threshold for congestion detection.
 
uint32_t m_cntRtt
 Number of RTT measurements during last RTT.
 
uint32_t m_diff
 Difference between expected and actual throughput.
 
bool m_doingVenoNow
 If true, do Veno for this RTT.
 
bool m_inc
 If true, cwnd needs to be incremented.
 
Time m_minRtt
 Minimum of RTTs measured within last RTT.
 

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 Veno.

TCP Veno enhances Reno algorithm for more effectively dealing with random packet loss in wireless access networks by employing Vegas's method in estimating the backlog at the bottleneck queue to distinguish between congestive and non-congestive states.

The backlog (the number of packets accumulated at the bottleneck queue) is calculated using Equation (1):

    N = Actual * (RTT - BaseRTT) = Diff * BaseRTT        (1)

where Diff = Expected - Actual = cwnd/BaseRTT - cwnd/RTT

Veno makes decision on cwnd modification based on the calculated N and its predefined threshold beta.

Specifically, it refines the additive increase algorithm of Reno so that the connection can stay longer in the stable state by incrementing cwnd by 1/cwnd for every other new ACK received after the available bandwidth has been fully utilized, i.e. when N exceeds beta. Otherwise, Veno increases its cwnd by 1/cwnd upon every new ACK receipt as in Reno.

In the multiplicative decrease algorithm, when Veno is in the non-congestive state, i.e. when N is less than beta, Veno decrements its cwnd by only 1/5 because the loss encountered is more likely a corruption-based loss than a congestion-based. Only when N is greater than beta, Veno halves its sending rate as in Reno.

More information: http://dx.doi.org/10.1109/JSAC.2002.807336

Definition at line 60 of file tcp-veno.h.

Constructor & Destructor Documentation

◆ TcpVeno() [1/2]

ns3::TcpVeno::TcpVeno ( )

Create an unbound tcp socket.

Definition at line 42 of file tcp-veno.cc.

References NS_LOG_FUNCTION.

◆ TcpVeno() [2/2]

ns3::TcpVeno::TcpVeno ( const TcpVeno & sock)

Copy constructor.

Parameters
sockthe object to copy

Definition at line 56 of file tcp-veno.cc.

References NS_LOG_FUNCTION.

◆ ~TcpVeno()

ns3::TcpVeno::~TcpVeno ( )
override

Definition at line 70 of file tcp-veno.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ CongestionStateSet()

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

Enable/disable Veno depending on the congestion state.

We only start a Veno 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 120 of file tcp-veno.cc.

References ns3::TcpSocketState::CA_OPEN, DisableVeno(), EnableVeno(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ DisableVeno()

void ns3::TcpVeno::DisableVeno ( )
private

Turn off Veno.

Definition at line 112 of file tcp-veno.cc.

References m_doingVenoNow, and NS_LOG_FUNCTION.

Referenced by CongestionStateSet().

+ Here is the caller graph for this function:

◆ EnableVeno()

void ns3::TcpVeno::EnableVeno ( )
private

Enable Veno algorithm to start Veno sampling.

Veno 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

Definition at line 103 of file tcp-veno.cc.

References m_doingVenoNow, 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::TcpVeno::Fork ( )
overridevirtual

Copy the congestion control algorithm across sockets.

Returns
a pointer of the copied object

Reimplemented from ns3::TcpNewReno.

Definition at line 76 of file tcp-veno.cc.

References ns3::Object::CopyObject.

◆ GetName()

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

Get the name of the congestion control algorithm.

Returns
A string identifying the name

Reimplemented from ns3::TcpNewReno.

Definition at line 223 of file tcp-veno.cc.

◆ GetSsThresh()

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

Get slow start threshold during Veno multiplicative-decrease phase.

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

Reimplemented from ns3::TcpNewReno.

Definition at line 229 of file tcp-veno.cc.

References ns3::TcpNewReno::GetSsThresh(), m_beta, m_diff, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::TcpVeno::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 28 of file tcp-veno.cc.

References m_beta, ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IncreaseWindow()

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

Adjust cwnd following Veno additive increase algorithm.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed

Reimplemented from ns3::TcpNewReno.

Definition at line 136 of file tcp-veno.cc.

References ns3::TcpNewReno::CongestionAvoidance(), ns3::Time::GetSeconds(), ns3::TcpNewReno::IncreaseWindow(), m_baseRtt, m_beta, m_cntRtt, m_diff, m_doingVenoNow, m_inc, m_minRtt, ns3::Time::Max(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::TcpNewReno::SlowStart().

+ Here is the call graph for this function:

◆ PktsAcked()

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

Perform RTT sampling needed to execute Veno algorithm.

The function filters RTT samples from the last RTT to find the current smallest propagation delay + queueing delay (m_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 (m_baseRtt).

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed
rttlast RTT

Reimplemented from ns3::TcpCongestionOps.

Definition at line 82 of file tcp-veno.cc.

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

+ Here is the call graph for this function:

Member Data Documentation

◆ m_ackCnt

uint32_t ns3::TcpVeno::m_ackCnt
private

Number of received ACK.

Definition at line 157 of file tcp-veno.h.

◆ m_baseRtt

Time ns3::TcpVeno::m_baseRtt
private

Minimum of all RTT measurements seen during connection.

Definition at line 151 of file tcp-veno.h.

Referenced by IncreaseWindow(), and PktsAcked().

◆ m_beta

uint32_t ns3::TcpVeno::m_beta
private

Threshold for congestion detection.

Definition at line 158 of file tcp-veno.h.

Referenced by GetSsThresh(), GetTypeId(), and IncreaseWindow().

◆ m_cntRtt

uint32_t ns3::TcpVeno::m_cntRtt
private

Number of RTT measurements during last RTT.

Definition at line 153 of file tcp-veno.h.

Referenced by IncreaseWindow(), and PktsAcked().

◆ m_diff

uint32_t ns3::TcpVeno::m_diff
private

Difference between expected and actual throughput.

Definition at line 155 of file tcp-veno.h.

Referenced by GetSsThresh(), and IncreaseWindow().

◆ m_doingVenoNow

bool ns3::TcpVeno::m_doingVenoNow
private

If true, do Veno for this RTT.

Definition at line 154 of file tcp-veno.h.

Referenced by DisableVeno(), EnableVeno(), and IncreaseWindow().

◆ m_inc

bool ns3::TcpVeno::m_inc
private

If true, cwnd needs to be incremented.

Definition at line 156 of file tcp-veno.h.

Referenced by IncreaseWindow().

◆ m_minRtt

Time ns3::TcpVeno::m_minRtt
private

Minimum of RTTs measured within last RTT.

Definition at line 152 of file tcp-veno.h.

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


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