An implementation of TCP Veno. More...
#include "tcp-veno.h"
Public Member Functions | |
TcpVeno (const TcpVeno &sock) | |
Copy constructor. More... | |
TcpVeno (void) | |
Create an unbound tcp socket. More... | |
virtual | ~TcpVeno (void) |
virtual void | CongestionStateSet (Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) |
Enable/disable Veno depending on the congestion state. More... | |
virtual Ptr< TcpCongestionOps > | Fork () |
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 during Veno multiplicative-decrease phase. More... | |
virtual void | IncreaseWindow (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) |
Adjust cwnd following Veno additive increase algorithm. More... | |
virtual void | PktsAcked (Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) |
Perform RTT sampling needed to execute Veno 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< Object > | GetObject () 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< Object > | GetObject (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... | |
SimpleRefCount & | operator= ([[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 | DisableVeno () |
Turn off Veno. More... | |
void | EnableVeno () |
Enable Veno algorithm to start Veno sampling. More... | |
Private Attributes | |
uint32_t | m_ackCnt |
Number of received ACK. More... | |
Time | m_baseRtt |
Minimum of all RTT measurements seen during connection. More... | |
uint32_t | m_beta |
Threshold for congestion detection. More... | |
uint32_t | m_cntRtt |
Number of RTT measurements during last RTT. More... | |
uint32_t | m_diff |
Difference between expected and actual throughput. More... | |
bool | m_doingVenoNow |
If true, do Veno for this RTT. More... | |
bool | m_inc |
If true, cwnd needs to be incremented. More... | |
Time | m_minRtt |
Minimum of RTTs measured within last RTT. 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... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
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
ns3::TcpVeno is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 72 bytes (on a 64-bit architecture).
Definition at line 71 of file tcp-veno.h.
ns3::TcpVeno::TcpVeno | ( | void | ) |
Create an unbound tcp socket.
Definition at line 52 of file tcp-veno.cc.
References NS_LOG_FUNCTION.
ns3::TcpVeno::TcpVeno | ( | const TcpVeno & | sock | ) |
Copy constructor.
sock | the object to copy |
Definition at line 66 of file tcp-veno.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 80 of file tcp-veno.cc.
References NS_LOG_FUNCTION.
|
virtual |
Enable/disable Veno depending on the congestion state.
We only start a Veno 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 132 of file tcp-veno.cc.
References ns3::TcpSocketState::CA_OPEN, DisableVeno(), EnableVeno(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
private |
Turn off Veno.
Definition at line 124 of file tcp-veno.cc.
References m_doingVenoNow, and NS_LOG_FUNCTION.
Referenced by CongestionStateSet().
|
private |
Enable Veno algorithm to start Veno sampling.
Veno algorithm is enabled in the following situations:
Definition at line 115 of file tcp-veno.cc.
References m_doingVenoNow, m_minRtt, ns3::Time::Max(), and NS_LOG_FUNCTION.
Referenced by CongestionStateSet().
|
virtual |
Copy the congestion control algorithm across sockets.
Reimplemented from ns3::TcpNewReno.
Definition at line 86 of file tcp-veno.cc.
|
virtual |
Get the name of the congestion control algorithm.
Reimplemented from ns3::TcpNewReno.
Definition at line 236 of file tcp-veno.cc.
|
virtual |
Get slow start threshold during Veno multiplicative-decrease phase.
tcb | internal congestion state |
bytesInFlight | bytes in flight |
Reimplemented from ns3::TcpNewReno.
Definition at line 242 of file tcp-veno.cc.
References ns3::TcpNewReno::GetSsThresh(), m_beta, m_diff, max, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
static |
Get the type ID.
Definition at line 38 of file tcp-veno.cc.
References m_beta, ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().
|
virtual |
Adjust cwnd following Veno additive increase algorithm.
tcb | internal congestion state |
segmentsAcked | count of segments ACKed |
Reimplemented from ns3::TcpNewReno.
Definition at line 149 of file tcp-veno.cc.
References ns3::TcpNewReno::CongestionAvoidance(), ns3::TcpSocketState::GetCwndInSegments(), ns3::Time::GetSeconds(), ns3::TcpNewReno::IncreaseWindow(), m_baseRtt, m_beta, m_cntRtt, ns3::TcpSocketState::m_cWnd, m_diff, m_doingVenoNow, m_inc, m_minRtt, ns3::TcpSocketState::m_ssThresh, ns3::Time::Max(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::TcpNewReno::SlowStart().
|
virtual |
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).
tcb | internal congestion state |
segmentsAcked | count of segments ACKed |
rtt | last RTT |
Reimplemented from ns3::TcpCongestionOps.
Definition at line 92 of file tcp-veno.cc.
References ns3::Time::IsZero(), m_baseRtt, m_cntRtt, m_minRtt, min, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
private |
Number of received ACK.
Definition at line 170 of file tcp-veno.h.
|
private |
Minimum of all RTT measurements seen during connection.
Definition at line 164 of file tcp-veno.h.
Referenced by IncreaseWindow(), and PktsAcked().
|
private |
Threshold for congestion detection.
Definition at line 171 of file tcp-veno.h.
Referenced by GetSsThresh(), GetTypeId(), and IncreaseWindow().
|
private |
Number of RTT measurements during last RTT.
Definition at line 166 of file tcp-veno.h.
Referenced by IncreaseWindow(), and PktsAcked().
|
private |
Difference between expected and actual throughput.
Definition at line 168 of file tcp-veno.h.
Referenced by GetSsThresh(), and IncreaseWindow().
|
private |
If true, do Veno for this RTT.
Definition at line 167 of file tcp-veno.h.
Referenced by DisableVeno(), EnableVeno(), and IncreaseWindow().
|
private |
If true, cwnd needs to be incremented.
Definition at line 169 of file tcp-veno.h.
Referenced by IncreaseWindow().
|
private |
Minimum of RTTs measured within last RTT.
Definition at line 165 of file tcp-veno.h.
Referenced by EnableVeno(), IncreaseWindow(), and PktsAcked().