A Discrete-Event Network Simulator
API
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 (void)
 Create an unbound tcp socket. More...
 
 TcpLedbat (const TcpLedbat &sock)
 Copy constructor. More...
 
virtual ~TcpLedbat (void)
 Destructor. More...
 
virtual Ptr< TcpCongestionOpsFork ()
 Copy the congestion control algorithm across sockets. More...
 
virtual std::string GetName () const
 Get the name of the TCP flavour. More...
 
virtual void IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
 Adjust cwnd following LEDBAT algorithm. More...
 
virtual void PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
 Get information from the acked packet. More...
 
void SetDoSs (SlowStartType doSS)
 Change the Slow Start Capability. More...
 
- Public Member Functions inherited from ns3::TcpNewReno
 TcpNewReno ()
 
 TcpNewReno (const TcpNewReno &sock)
 Copy constructor. More...
 
 ~TcpNewReno ()
 
virtual uint32_t GetSsThresh (Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
 Get the slow start threshold after a loss event. More...
 
- 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 CongestionStateSet (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
 Trigger events/calculations specific to a congestion state. 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...
 
- 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<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. 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)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (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...
 

Protected Member Functions

virtual void CongestionAvoidance (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
 Reduce Congestion. More...
 
- Protected Member Functions inherited from ns3::TcpNewReno
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...
 

Private Types

typedef uint32_t(* FilterFunction) (struct OwdCircBuf &)
 Filter function used by LEDBAT for current delay. More...
 
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 (struct OwdCircBuf &cb, uint32_t owd, uint32_t maxlen)
 Add new delay to the buffers. More...
 
uint32_t BaseDelay ()
 Return the value of base delay. More...
 
uint32_t CurrentDelay (FilterFunction filter)
 Return the value of current delay. More...
 
void InitCircBuf (struct OwdCircBuf &buffer)
 Initialise a new buffer. More...
 
void UpdateBaseDelay (uint32_t owd)
 Update the base delay buffer. More...
 

Static Private Member Functions

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

Private Attributes

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

Additional Inherited Members

Detailed Description

An implementation of LEDBAT.


Introspection did not find any typical Config paths.


Attributes

  • TargetDelay: Targeted Queue Delay
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +100000000.0ns
    • Flags: construct write read
  • BaseHistoryLen: Number of Base delay samples
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 10
    • Flags: construct write read
  • NoiseFilterLen: Number of Current delay samples
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 4
    • Flags: construct write read
  • Gain: Offset Gain
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 1
    • Flags: construct write read
  • SSParam: Possibility of Slow Start
    • Set with class: ns3::EnumValue
    • Underlying type:
    • Initial value: yes
    • Flags: construct write
  • MinCwnd: Minimum cWnd for Ledbat
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 2
    • Flags: construct write read

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

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

Member Typedef Documentation

◆ FilterFunction

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

Filter function used by LEDBAT for current delay.

Definition at line 144 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 43 of file tcp-ledbat.h.

◆ State

enum ns3::TcpLedbat::State : uint32_t
private

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 53 of file tcp-ledbat.h.

Constructor & Destructor Documentation

◆ TcpLedbat() [1/2]

ns3::TcpLedbat::TcpLedbat ( void  )

Create an unbound tcp socket.

Definition at line 87 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 111 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 ( void  )
virtual

Destructor.

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddDelay()

void ns3::TcpLedbat::AddDelay ( struct 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 229 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 call graph for this function:
+ 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 164 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 
)
protectedvirtual

Reduce Congestion.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed

Reimplemented from ns3::TcpNewReno.

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

References BaseDelay(), ns3::TcpNewReno::CongestionAvoidance(), CurrentDelay(), ns3::TracedValue< T >::Get(), ns3::Time::GetMilliSeconds(), LEDBAT_VALID_OWD, ns3::TcpSocketState::m_cWnd, m_flag, m_gain, ns3::TcpSocketState::m_highTxMark, ns3::TcpSocketState::m_lastAckedSeq, m_minCwnd, ns3::TcpSocketState::m_segmentSize, m_sndCwndCnt, ns3::TcpSocketState::m_ssThresh, m_target, max, min, 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 158 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 ( )
virtual

Copy the congestion control algorithm across sockets.

Returns
a pointer of the copied object

Reimplemented from ns3::TcpNewReno.

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

◆ GetName()

std::string ns3::TcpLedbat::GetName ( void  ) const
virtual

Get the name of the TCP flavour.

Returns
The name of the TCP

Reimplemented from ns3::TcpNewReno.

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

◆ GetTypeId()

◆ IncreaseWindow()

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

Adjust cwnd following LEDBAT algorithm.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed

Reimplemented from ns3::TcpNewReno.

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

References CongestionAvoidance(), DO_SLOWSTART, ns3::TracedValue< T >::Get(), LEDBAT_CAN_SS, ns3::TcpSocketState::m_cWnd, m_doSs, m_flag, ns3::TcpSocketState::m_segmentSize, ns3::TcpSocketState::m_ssThresh, NS_LOG_FUNCTION, and ns3::TcpNewReno::SlowStart().

Referenced by TcpLedbatToNewReno::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), and TcpLedbatDecrementTest::ExecuteTest().

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

◆ InitCircBuf()

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

Initialise a new buffer.

Parameters
bufferThe buffer to be initialised

Definition at line 104 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 ( struct OwdCircBuf b)
staticprivate

Return the minimum delay of the buffer.

Parameters
bThe buffer
Returns
The minimum delay

Definition at line 145 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 
)
virtual

Get information from the acked packet.

Parameters
tcbinternal congestion state
segmentsAckedcount of segments ACKed
rttThe estimated rtt

Reimplemented from ns3::TcpCongestionOps.

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

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

Referenced by TcpLedbatIncrementTest::ExecuteTest(), and TcpLedbatDecrementTest::ExecuteTest().

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

◆ SetDoSs()

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

Change the Slow Start Capability.

Parameters
doSSSlow Start Option

Definition at line 73 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 260 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 188 of file tcp-ledbat.h.

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

◆ m_baseHistory

OwdCircBuf ns3::TcpLedbat::m_baseHistory
private

Buffer to store the base delay.

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

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

◆ m_doSs

SlowStartType ns3::TcpLedbat::m_doSs
private

Permissible Slow Start State.

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

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

◆ m_flag

uint32_t ns3::TcpLedbat::m_flag
private

LEDBAT Flag.

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

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

◆ m_gain

double ns3::TcpLedbat::m_gain
private

GAIN value from RFC.

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

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

◆ m_lastRollover

uint64_t ns3::TcpLedbat::m_lastRollover
private

Timestamp of last added delay.

Definition at line 190 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 195 of file tcp-ledbat.h.

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

◆ m_noiseFilter

OwdCircBuf ns3::TcpLedbat::m_noiseFilter
private

Buffer to store the current delay.

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

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

◆ m_noiseFilterLen

uint32_t ns3::TcpLedbat::m_noiseFilterLen
private

Length of current delay buffer.

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

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

◆ m_sndCwndCnt

int32_t ns3::TcpLedbat::m_sndCwndCnt
private

The congestion window addition parameter.

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

Referenced by CongestionAvoidance(), and TcpLedbat().

◆ m_target

Time ns3::TcpLedbat::m_target
private

Target Queue Delay.

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

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


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