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

An implementation of LEDBAT. More...

#include "tcp-ledbat.h"

+ Inheritance diagram for ns3::TcpLedbat:
+ Collaboration diagram for ns3::TcpLedbat:

Classes

struct  OwdCircBuf
 Buffer structure to store delays. More...
 

Public Member Functions

 TcpLedbat ()
 Create an unbound tcp socket.
 
 TcpLedbat (const TcpLedbat &sock)
 Copy constructor.
 
 ~TcpLedbat () override
 Destructor.
 
Ptr< TcpCongestionOpsFork () override
 Copy the congestion control algorithm across sockets.
 
std::string GetName () const override
 Get the name of the TCP flavour.
 
void IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
 Adjust cwnd following LEDBAT algorithm.
 
void PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
 Get information from the acked packet.
 
void SetDoSs (SlowStartType doSS)
 Change the Slow Start Capability.
 
- 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 CongestionStateSet (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
 Trigger events/calculations specific to a congestion state.
 
virtual void CwndEvent (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
 Trigger events/calculations on occurrence of congestion window event.
 
virtual Ptr< TcpCongestionOpsFork ()=0
 Copy the congestion control algorithm across sockets.
 
virtual std::string GetName () const =0
 Get the name of the congestion control algorithm.
 
virtual uint32_t GetSsThresh (Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)=0
 Get the slow start threshold after a loss event.
 
virtual bool HasCongControl () const
 Returns true when Congestion Control Algorithm implements CongControl.
 
virtual void IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
 Congestion avoidance algorithm implementation.
 
virtual void Init (Ptr< TcpSocketState > tcb)
 Set configuration required by congestion control algorithm.
 
virtual void PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
 Timing information on received ACK.
 
- 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.
 
- 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) 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.
 
virtual TypeId GetInstanceTypeId () const =0
 Get the most derived TypeId for this Object.
 
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.
 

Protected Member Functions

void CongestionAvoidance (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
 Reduce Congestion.
 
- 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.
 

Private Types

typedef uint32_t(* FilterFunction) (OwdCircBuf &)
 Filter function used by LEDBAT for current delay.
 
enum  SlowStartType { DO_NOT_SLOWSTART , DO_SLOWSTART }
 The slowstart types. More...
 
enum  State : uint32_t { LEDBAT_VALID_OWD = (1 << 1) , LEDBAT_CAN_SS = (1 << 3) }
 The state of LEDBAT. More...
 

Private Member Functions

void AddDelay (OwdCircBuf &cb, uint32_t owd, uint32_t maxlen)
 Add new delay to the buffers.
 
uint32_t BaseDelay ()
 Return the value of base delay.
 
uint32_t CurrentDelay (FilterFunction filter)
 Return the value of current delay.
 
void InitCircBuf (OwdCircBuf &buffer)
 Initialise a new buffer.
 
void UpdateBaseDelay (uint32_t owd)
 Update the base delay buffer.
 

Static Private Member Functions

static uint32_t MinCircBuf (OwdCircBuf &b)
 Return the minimum delay of the buffer.
 

Private Attributes

uint32_t m_baseHistoLen
 Length of base delay history buffer.
 
OwdCircBuf m_baseHistory
 Buffer to store the base delay.
 
SlowStartType m_doSs
 Permissible Slow Start State.
 
uint32_t m_flag
 LEDBAT Flag.
 
double m_gain
 GAIN value from RFC.
 
uint64_t m_lastRollover
 Timestamp of last added delay.
 
uint32_t m_minCwnd
 Minimum cWnd value mentioned in RFC 6817.
 
OwdCircBuf m_noiseFilter
 Buffer to store the current delay.
 
uint32_t m_noiseFilterLen
 Length of current delay buffer.
 
int32_t m_sndCwndCnt
 The congestion window addition parameter.
 
Time m_target
 Target Queue Delay.
 

Additional Inherited Members

Detailed Description

An implementation of LEDBAT.

Config Paths

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

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

Attributes

  • BaseHistoryLen: Number of Base delay samples
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 10
    • Flags: constructwriteread
  • Gain: Offset Gain
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 1
    • Flags: constructwriteread
  • MinCwnd: Minimum cWnd for Ledbat
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 2
    • Flags: constructwriteread
  • NoiseFilterLen: Number of Current delay samples
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 4
    • Flags: constructwriteread
  • SSParam: Possibility of Slow Start
    • Set with class: ns3::EnumValue
    • Underlying type: yes|no
    • Initial value: yes
    • Flags: constructwrite
  • TargetDelay: Targeted Queue Delay
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +1e+08ns
    • Flags: constructwriteread

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

Definition at line 39 of file tcp-ledbat.h.

Member Typedef Documentation

◆ FilterFunction

typedef uint32_t(* ns3::TcpLedbat::FilterFunction) (OwdCircBuf &)
private

Filter function used by LEDBAT for current delay.

Definition at line 145 of file tcp-ledbat.h.

Member Enumeration Documentation

◆ SlowStartType

The slowstart types.

Enumerator
DO_NOT_SLOWSTART 

Do not Slow Start.

DO_SLOWSTART 

Do NewReno Slow Start.

Definition at line 45 of file tcp-ledbat.h.

◆ State

The state of LEDBAT.

If LEDBAT is not in VALID_OWD state, it falls to default congestion ops.

Enumerator
LEDBAT_VALID_OWD 

If valid timestamps are present.

LEDBAT_CAN_SS 

If LEDBAT allows Slow Start.

Definition at line 55 of file tcp-ledbat.h.

Constructor & Destructor Documentation

◆ TcpLedbat() [1/2]

ns3::TcpLedbat::TcpLedbat ( )

Create an unbound tcp socket.

Definition at line 90 of file tcp-ledbat.cc.

References DO_SLOWSTART, InitCircBuf(), LEDBAT_CAN_SS, m_baseHistoLen, m_baseHistory, m_doSs, m_flag, m_gain, m_lastRollover, m_minCwnd, m_noiseFilter, m_noiseFilterLen, m_sndCwndCnt, m_target, ns3::MilliSeconds(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ TcpLedbat() [2/2]

ns3::TcpLedbat::TcpLedbat ( const TcpLedbat sock)

Copy constructor.

Parameters
sockthe object to copy

Definition at line 115 of file tcp-ledbat.cc.

References m_baseHistoLen, m_baseHistory, m_doSs, m_flag, m_gain, m_lastRollover, m_minCwnd, m_noiseFilter, m_noiseFilterLen, m_sndCwndCnt, m_target, and NS_LOG_FUNCTION.

◆ ~TcpLedbat()

ns3::TcpLedbat::~TcpLedbat ( )
override

Destructor.

Definition at line 132 of file tcp-ledbat.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddDelay()

void ns3::TcpLedbat::AddDelay ( OwdCircBuf cb,
uint32_t  owd,
uint32_t  maxlen 
)
private

Add new delay to the buffers.

Parameters
cbThe buffer
owdThe new delay
maxlenThe maximum permitted length

Definition at line 242 of file tcp-ledbat.cc.

References ns3::TcpLedbat::OwdCircBuf::buffer, ns3::TcpLedbat::OwdCircBuf::min, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by PktsAcked(), and UpdateBaseDelay().

+ Here is the caller graph for this function:

◆ BaseDelay()

uint32_t ns3::TcpLedbat::BaseDelay ( )
private

Return the value of base delay.

Returns
The base delay

Definition at line 171 of file tcp-ledbat.cc.

References m_baseHistory, MinCircBuf(), and NS_LOG_FUNCTION.

Referenced by CongestionAvoidance().

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

◆ CongestionAvoidance()

void ns3::TcpLedbat::CongestionAvoidance ( Ptr< TcpSocketState tcb,
uint32_t  segmentsAcked 
)
overrideprotectedvirtual

Reduce Congestion.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed

Reimplemented from ns3::TcpNewReno.

Definition at line 197 of file tcp-ledbat.cc.

References BaseDelay(), ns3::TcpNewReno::CongestionAvoidance(), CurrentDelay(), ns3::Time::GetMilliSeconds(), LEDBAT_VALID_OWD, m_flag, m_gain, m_minCwnd, m_sndCwndCnt, m_target, MinCircBuf(), and NS_LOG_FUNCTION.

Referenced by IncreaseWindow().

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

◆ CurrentDelay()

uint32_t ns3::TcpLedbat::CurrentDelay ( FilterFunction  filter)
private

Return the value of current delay.

Parameters
filterThe filter function
Returns
The current delay

Definition at line 164 of file tcp-ledbat.cc.

References m_noiseFilter, and NS_LOG_FUNCTION.

Referenced by CongestionAvoidance().

+ Here is the caller graph for this function:

◆ Fork()

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

Copy the congestion control algorithm across sockets.

Returns
a pointer of the copied object

Reimplemented from ns3::TcpNewReno.

Definition at line 138 of file tcp-ledbat.cc.

◆ GetName()

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

Get the name of the TCP flavour.

Returns
The name of the TCP

Reimplemented from ns3::TcpNewReno.

Definition at line 144 of file tcp-ledbat.cc.

◆ GetTypeId()

◆ IncreaseWindow()

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

Adjust cwnd following LEDBAT algorithm.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed

Reimplemented from ns3::TcpNewReno.

Definition at line 178 of file tcp-ledbat.cc.

References CongestionAvoidance(), DO_SLOWSTART, LEDBAT_CAN_SS, m_doSs, m_flag, NS_LOG_FUNCTION, and ns3::TcpNewReno::SlowStart().

+ Here is the call graph for this function:

◆ InitCircBuf()

void ns3::TcpLedbat::InitCircBuf ( OwdCircBuf buffer)
private

Initialise a new buffer.

Parameters
bufferThe buffer to be initialised

Definition at line 108 of file tcp-ledbat.cc.

References ns3::TcpLedbat::OwdCircBuf::buffer, ns3::TcpLedbat::OwdCircBuf::min, and NS_LOG_FUNCTION.

Referenced by TcpLedbat().

+ Here is the caller graph for this function:

◆ MinCircBuf()

uint32_t ns3::TcpLedbat::MinCircBuf ( OwdCircBuf b)
staticprivate

Return the minimum delay of the buffer.

Parameters
bThe buffer
Returns
The minimum delay

Definition at line 150 of file tcp-ledbat.cc.

References ns3::TcpLedbat::OwdCircBuf::buffer, ns3::TcpLedbat::OwdCircBuf::min, and NS_LOG_FUNCTION_NOARGS.

Referenced by BaseDelay(), and CongestionAvoidance().

+ Here is the caller graph for this function:

◆ PktsAcked()

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

Get information from the acked packet.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed
rttThe estimated rtt

Reimplemented from ns3::TcpCongestionOps.

Definition at line 304 of file tcp-ledbat.cc.

References AddDelay(), ns3::Time::IsPositive(), LEDBAT_VALID_OWD, m_flag, m_noiseFilter, m_noiseFilterLen, NS_LOG_FUNCTION, and UpdateBaseDelay().

+ Here is the call graph for this function:

◆ SetDoSs()

void ns3::TcpLedbat::SetDoSs ( SlowStartType  doSS)

Change the Slow Start Capability.

Parameters
doSSSlow Start Option

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

References LEDBAT_CAN_SS, m_doSs, m_flag, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ UpdateBaseDelay()

void ns3::TcpLedbat::UpdateBaseDelay ( uint32_t  owd)
private

Update the base delay buffer.

Parameters
owdThe delay

Definition at line 274 of file tcp-ledbat.cc.

References AddDelay(), ns3::TcpLedbat::OwdCircBuf::buffer, ns3::Time::GetSeconds(), m_baseHistoLen, m_baseHistory, m_lastRollover, ns3::TcpLedbat::OwdCircBuf::min, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by PktsAcked().

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

Member Data Documentation

◆ m_baseHistoLen

uint32_t ns3::TcpLedbat::m_baseHistoLen
private

Length of base delay history buffer.

Definition at line 189 of file tcp-ledbat.h.

Referenced by TcpLedbat(), GetTypeId(), and UpdateBaseDelay().

◆ m_baseHistory

OwdCircBuf ns3::TcpLedbat::m_baseHistory
private

Buffer to store the base delay.

Definition at line 193 of file tcp-ledbat.h.

Referenced by TcpLedbat(), BaseDelay(), and UpdateBaseDelay().

◆ m_doSs

SlowStartType ns3::TcpLedbat::m_doSs
private

Permissible Slow Start State.

Definition at line 188 of file tcp-ledbat.h.

Referenced by TcpLedbat(), IncreaseWindow(), and SetDoSs().

◆ m_flag

uint32_t ns3::TcpLedbat::m_flag
private

LEDBAT Flag.

Definition at line 195 of file tcp-ledbat.h.

Referenced by TcpLedbat(), CongestionAvoidance(), IncreaseWindow(), PktsAcked(), and SetDoSs().

◆ m_gain

double ns3::TcpLedbat::m_gain
private

GAIN value from RFC.

Definition at line 187 of file tcp-ledbat.h.

Referenced by TcpLedbat(), CongestionAvoidance(), and GetTypeId().

◆ m_lastRollover

uint64_t ns3::TcpLedbat::m_lastRollover
private

Timestamp of last added delay.

Definition at line 191 of file tcp-ledbat.h.

Referenced by TcpLedbat(), and UpdateBaseDelay().

◆ m_minCwnd

uint32_t ns3::TcpLedbat::m_minCwnd
private

Minimum cWnd value mentioned in RFC 6817.

Definition at line 196 of file tcp-ledbat.h.

Referenced by TcpLedbat(), CongestionAvoidance(), and GetTypeId().

◆ m_noiseFilter

OwdCircBuf ns3::TcpLedbat::m_noiseFilter
private

Buffer to store the current delay.

Definition at line 194 of file tcp-ledbat.h.

Referenced by TcpLedbat(), CurrentDelay(), and PktsAcked().

◆ m_noiseFilterLen

uint32_t ns3::TcpLedbat::m_noiseFilterLen
private

Length of current delay buffer.

Definition at line 190 of file tcp-ledbat.h.

Referenced by TcpLedbat(), GetTypeId(), and PktsAcked().

◆ m_sndCwndCnt

int32_t ns3::TcpLedbat::m_sndCwndCnt
private

The congestion window addition parameter.

Definition at line 192 of file tcp-ledbat.h.

Referenced by TcpLedbat(), and CongestionAvoidance().

◆ m_target

Time ns3::TcpLedbat::m_target
private

Target Queue Delay.

Definition at line 186 of file tcp-ledbat.h.

Referenced by TcpLedbat(), CongestionAvoidance(), and GetTypeId().


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