Data structure that records the congestion state of a connection. More...
#include "tcp-socket-base.h"
Public Types | |
enum | TcpCAEvent_t { CA_EVENT_TX_START, CA_EVENT_CWND_RESTART, CA_EVENT_COMPLETE_CWR, CA_EVENT_LOSS, CA_EVENT_ECN_NO_CE, CA_EVENT_ECN_IS_CE, CA_EVENT_DELAYED_ACK, CA_EVENT_NON_DELAYED_ACK } |
enum | TcpCongState_t { CA_OPEN, CA_DISORDER, CA_CWR, CA_RECOVERY, CA_LOSS, CA_LAST_STATE } |
Definition of the Congestion state machine. More... | |
typedef void(* | TcpCongStatesTracedValueCallback) (const TcpCongState_t oldValue, const TcpCongState_t newValue) |
TracedValue Callback signature for TcpCongState_t. More... | |
Public Member Functions | |
TcpSocketState () | |
TcpSocketState Constructor. More... | |
TcpSocketState (const TcpSocketState &other) | |
Copy constructor. More... | |
uint32_t | GetCwndInSegments () const |
Get cwnd in segments rather than bytes. More... | |
uint32_t | GetSsThreshInSegments () const |
Get slow start thresh in segments rather than bytes. More... | |
![]() | |
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... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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 TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Public Attributes | |
TracedValue< TcpCongState_t > | m_congState {CA_OPEN} |
State in the Congestion state machine. More... | |
DataRate | m_currentPacingRate {0} |
Current Pacing rate. More... | |
TracedValue< uint32_t > | m_cWnd |
Congestion window. More... | |
TracedValue< SequenceNumber32 > | m_highTxMark {0} |
Highest seqno ever sent, regardless of ReTx. More... | |
uint32_t | m_initialCWnd {0} |
Initial cWnd value. More... | |
uint32_t | m_initialSsThresh {0} |
Initial Slow Start Threshold value. More... | |
SequenceNumber32 | m_lastAckedSeq {0} |
Last sequence ACKed. More... | |
DataRate | m_maxPacingRate {0} |
Max Pacing rate. More... | |
Time | m_minRtt {Time::Max ()} |
Minimum RTT observed throughout the connection. More... | |
TracedValue< SequenceNumber32 > | m_nextTxSequence {0} |
Next seqnum to be sent (SND.NXT), ReTx pushes it back. More... | |
bool | m_pacing {false} |
Pacing status. More... | |
uint32_t | m_rcvTimestampEchoReply {0} |
Sender Timestamp echoed by the receiver. More... | |
uint32_t | m_rcvTimestampValue {0} |
Receiver Timestamp value. More... | |
uint32_t | m_segmentSize {0} |
Segment size. More... | |
TracedValue< uint32_t > | m_ssThresh {0} |
Slow start threshold. More... | |
Static Public Attributes | |
static const char *const | TcpCongStateName [TcpSocketState::CA_LAST_STATE] |
Literal names of TCP states for use in log messages. More... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Data structure that records the congestion state of a connection.
Introspection did not find any typical Config paths.
In this data structure, basic informations that should be passed between socket and the congestion control algorithm are saved. Through the code, it will be referred as Transmission Control Block (TCB), but there are some differencies. In the RFCs, the TCB contains all the variables that defines a connection, while we preferred to maintain in this class only the values that should be exchanged between socket and other parts, like congestion control algorithms.
Size of this type is 208 bytes (on a 64-bit architecture).
Definition at line 94 of file tcp-socket-base.h.
Definition at line 144 of file tcp-socket-base.h.
Definition of the Congestion state machine.
The design of this state machine is taken from Linux v4.0, but it has been maintained in the Linux mainline from ages. It basically avoids to maintain a lot of boolean variables, and it allows to check the transitions from different algorithm in a cleaner way.
These states represent the situation from a congestion control point of view: in fact, apart the CA_OPEN state, the other states represent a situation in which there is a congestion, and different actions should be taken, depending on the case.
Definition at line 129 of file tcp-socket-base.h.
|
inline |
TcpSocketState Constructor.
Definition at line 107 of file tcp-socket-base.h.
ns3::TcpSocketState::TcpSocketState | ( | const TcpSocketState & | other | ) |
Copy constructor.
other | object to copy. |
Definition at line 255 of file tcp-socket-base.cc.
|
inline |
Get cwnd in segments rather than bytes.
Definition at line 201 of file tcp-socket-base.h.
References m_cWnd, and m_segmentSize.
Referenced by ns3::TcpHybla::CongestionAvoidance(), ns3::TcpHighSpeed::CongestionAvoidance(), ns3::TcpScalable::CongestionAvoidance(), ns3::TcpVegas::IncreaseWindow(), ns3::TcpVeno::IncreaseWindow(), ns3::TcpYeah::IncreaseWindow(), ns3::TcpIllinois::IncreaseWindow(), and ns3::TcpBic::Update().
|
inline |
Get slow start thresh in segments rather than bytes.
Definition at line 211 of file tcp-socket-base.h.
References m_segmentSize, and m_ssThresh.
|
static |
Get the type ID.
Get the type ID.
Definition at line 217 of file tcp-socket-base.cc.
References m_congState, m_cWnd, m_highTxMark, m_maxPacingRate, m_nextTxSequence, m_pacing, m_ssThresh, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeDataRateAccessor(), ns3::MakeDataRateChecker(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
TracedValue<TcpCongState_t> ns3::TcpSocketState::m_congState {CA_OPEN} |
State in the Congestion state machine.
Definition at line 181 of file tcp-socket-base.h.
Referenced by ns3::TcpSocketBase::DupAck(), ns3::TcpSocketBase::EnterRecovery(), ns3::GetCongStateFrom(), GetTypeId(), ns3::TcpHtcp::PktsAcked(), ns3::TcpSocketBase::ProcessAck(), ns3::TcpSocketBase::ReTxTimeout(), and ns3::TcpSocketBase::SendPendingData().
DataRate ns3::TcpSocketState::m_currentPacingRate {0} |
Current Pacing rate.
Definition at line 192 of file tcp-socket-base.h.
Referenced by ns3::TcpSocketBase::SendDataPacket(), ns3::TcpSocketBase::SendPendingData(), and ns3::TcpSocketBase::TcpSocketBase().
TracedValue<uint32_t> ns3::TcpSocketState::m_cWnd |
Congestion window.
Definition at line 172 of file tcp-socket-base.h.
Referenced by ns3::TcpHtcp::CongestionAvoidance(), ns3::TcpHybla::CongestionAvoidance(), ns3::TcpHighSpeed::CongestionAvoidance(), ns3::TcpScalable::CongestionAvoidance(), ns3::TcpLedbat::CongestionAvoidance(), ns3::TcpNewReno::CongestionAvoidance(), ns3::TcpSocketBase::DoForwardUp(), TcpHighSpeedIncrementTest::DoRun(), TcpHyblaIncrementTest::DoRun(), TcpBicIncrementTest::DoRun(), TcpScalableIncrementTest::DoRun(), TcpHtcpIncrementTest::DoRun(), TcpVegasTest::DoRun(), TcpVenoTest::DoRun(), TcpYeahIncrementTest::DoRun(), TcpIllinoisTest::DoRun(), TcpHighSpeedDecrementTest::DoRun(), TcpScalableDecrementTest::DoRun(), TcpBicDecrementTest::DoRun(), TcpYeahDecrementTest::DoRun(), ns3::TcpSocketBase::EnterRecovery(), ns3::TcpLpToNewReno::ExecuteTest(), TcpLedbatToNewReno::ExecuteTest(), TcpBicIncrementTest::ExecuteTest(), ns3::TcpLpInferenceTest1::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), ns3::TcpLpInferenceTest2::ExecuteTest(), TcpBicDecrementTest::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), GetCwndInSegments(), GetTypeId(), ns3::TcpBic::IncreaseWindow(), ns3::TcpLedbat::IncreaseWindow(), ns3::TcpVegas::IncreaseWindow(), ns3::TcpVeno::IncreaseWindow(), ns3::TcpYeah::IncreaseWindow(), ns3::TcpIllinois::IncreaseWindow(), ns3::TcpNewReno::IncreaseWindow(), TcpVenoTest::NewReno_CongestionAvoidance(), TcpVenoTest::NewReno_IncreaseWindow(), TcpVenoTest::NewReno_SlowStart(), ns3::TcpLp::PktsAcked(), ns3::TcpSocketBase::ProcessAck(), ns3::TcpSocketBase::ReTxTimeout(), ns3::TcpSocketBase::SendPendingData(), ns3::TcpHybla::SlowStart(), ns3::TcpNewReno::SlowStart(), TcpBicIncrementTest::Update(), and ns3::TcpSocketBase::Window().
TracedValue<SequenceNumber32> ns3::TcpSocketState::m_highTxMark {0} |
Highest seqno ever sent, regardless of ReTx.
Definition at line 183 of file tcp-socket-base.h.
Referenced by ns3::TcpLedbat::CongestionAvoidance(), ns3::TcpSocketBase::EnterRecovery(), TcpLedbatToNewReno::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), ns3::TcpGeneralTest::GetHighestTxMark(), GetTypeId(), ns3::TcpSocketBase::ProcessAck(), ns3::TcpSocketBase::ProcessEstablished(), ns3::TcpSocketBase::ProcessSynRcvd(), ns3::TcpSocketBase::ProcessSynSent(), ns3::TcpSocketBase::ProcessWait(), ns3::TcpSocketBase::ReTxTimeout(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::UnAckDataCount().
uint32_t ns3::TcpSocketState::m_initialCWnd {0} |
Initial cWnd value.
Definition at line 174 of file tcp-socket-base.h.
Referenced by ns3::TcpSocketBase::GetInitialCwnd(), and ns3::TcpSocketBase::SetInitialCwnd().
uint32_t ns3::TcpSocketState::m_initialSsThresh {0} |
Initial Slow Start Threshold value.
Definition at line 175 of file tcp-socket-base.h.
Referenced by ns3::TcpSocketBase::GetInitialSSThresh(), and ns3::TcpSocketBase::SetInitialSSThresh().
SequenceNumber32 ns3::TcpSocketState::m_lastAckedSeq {0} |
Last sequence ACKed.
Definition at line 179 of file tcp-socket-base.h.
Referenced by ns3::TcpLedbat::CongestionAvoidance(), TcpVegasTest::DoRun(), TcpYeahIncrementTest::DoRun(), TcpIllinoisTest::DoRun(), TcpYeahDecrementTest::DoRun(), TcpLedbatToNewReno::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), ns3::TcpVegas::IncreaseWindow(), ns3::TcpYeah::IncreaseWindow(), ns3::TcpIllinois::IncreaseWindow(), and ns3::TcpSocketBase::ProcessAck().
DataRate ns3::TcpSocketState::m_maxPacingRate {0} |
Max Pacing rate.
Definition at line 191 of file tcp-socket-base.h.
Referenced by GetTypeId(), and ns3::TcpSocketBase::TcpSocketBase().
Minimum RTT observed throughout the connection.
Definition at line 194 of file tcp-socket-base.h.
Referenced by TcpHyblaIncrementTest::DoRun(), TcpVegasTest::DoRun(), TcpVenoTest::DoRun(), TcpYeahIncrementTest::DoRun(), ns3::TcpSocketBase::EstimateRtt(), ns3::TcpHybla::PktsAcked(), and ns3::TcpHybla::RecalcParam().
TracedValue<SequenceNumber32> ns3::TcpSocketState::m_nextTxSequence {0} |
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
Definition at line 184 of file tcp-socket-base.h.
Referenced by ns3::TcpSocketBase::Close(), ns3::TcpYeah::CongestionStateSet(), ns3::TcpIllinois::CongestionStateSet(), ns3::TcpSocketBase::DoForwardUp(), ns3::TcpSocketBase::DoRetransmit(), TcpVegasTest::DoRun(), TcpYeahIncrementTest::DoRun(), TcpIllinoisTest::DoRun(), TcpYeahDecrementTest::DoRun(), ns3::TcpVegas::EnableVegas(), GetTypeId(), ns3::TcpVegas::IncreaseWindow(), ns3::TcpYeah::IncreaseWindow(), ns3::TcpIllinois::IncreaseWindow(), ns3::TcpSocketBase::NewAck(), ns3::TcpSocketBase::PersistTimeout(), ns3::TcpSocketBase::ProcessAck(), ns3::TcpSocketBase::ProcessSynRcvd(), ns3::TcpSocketBase::ProcessSynSent(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), ns3::TcpSocketBase::SendEmptyPacket(), and ns3::TcpSocketBase::SendPendingData().
bool ns3::TcpSocketState::m_pacing {false} |
Pacing status.
Definition at line 190 of file tcp-socket-base.h.
Referenced by GetTypeId(), ns3::TcpSocketBase::SendDataPacket(), and ns3::TcpSocketBase::SendPendingData().
uint32_t ns3::TcpSocketState::m_rcvTimestampEchoReply {0} |
Sender Timestamp echoed by the receiver.
Definition at line 187 of file tcp-socket-base.h.
Referenced by ns3::TcpLpToNewReno::ExecuteTest(), ns3::TcpLpInferenceTest1::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), ns3::TcpLpInferenceTest2::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), ns3::TcpLp::OwdCalculator(), ns3::TcpLp::PktsAcked(), ns3::TcpLedbat::PktsAcked(), and ns3::TcpSocketBase::ProcessOptionTimestamp().
uint32_t ns3::TcpSocketState::m_rcvTimestampValue {0} |
Receiver Timestamp value.
Definition at line 186 of file tcp-socket-base.h.
Referenced by ns3::TcpLpToNewReno::ExecuteTest(), ns3::TcpLpInferenceTest1::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), ns3::TcpLpInferenceTest2::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), ns3::TcpLp::OwdCalculator(), ns3::TcpLedbat::PktsAcked(), and ns3::TcpSocketBase::ProcessOptionTimestamp().
uint32_t ns3::TcpSocketState::m_segmentSize {0} |
Segment size.
Definition at line 178 of file tcp-socket-base.h.
Referenced by TcpSsThreshRtoTest::AfterRTOExpired(), ns3::TcpHtcp::CongestionAvoidance(), ns3::TcpHybla::CongestionAvoidance(), ns3::TcpHighSpeed::CongestionAvoidance(), ns3::TcpScalable::CongestionAvoidance(), ns3::TcpLedbat::CongestionAvoidance(), ns3::TcpNewReno::CongestionAvoidance(), ns3::TcpSocketBase::DoRetransmit(), TcpHighSpeedIncrementTest::DoRun(), TcpHyblaIncrementTest::DoRun(), TcpBicIncrementTest::DoRun(), TcpScalableIncrementTest::DoRun(), TcpHtcpIncrementTest::DoRun(), TcpVegasTest::DoRun(), TcpVenoTest::DoRun(), TcpYeahIncrementTest::DoRun(), TcpIllinoisTest::DoRun(), TcpHighSpeedDecrementTest::DoRun(), TcpScalableDecrementTest::DoRun(), TcpBicDecrementTest::DoRun(), TcpYeahDecrementTest::DoRun(), ns3::TcpSocketBase::DupAck(), ns3::TcpSocketBase::EnterRecovery(), ns3::TcpWestwood::EstimateBW(), ns3::TcpLpToNewReno::ExecuteTest(), TcpLedbatToNewReno::ExecuteTest(), ns3::TcpLpInferenceTest1::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), ns3::TcpLpInferenceTest2::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), GetCwndInSegments(), ns3::TcpSocketBase::GetSegSize(), GetSsThreshInSegments(), ns3::TcpBic::IncreaseWindow(), ns3::TcpLedbat::IncreaseWindow(), ns3::TcpVegas::IncreaseWindow(), ns3::TcpYeah::IncreaseWindow(), ns3::TcpIllinois::IncreaseWindow(), TcpVenoTest::NewReno_CongestionAvoidance(), TcpVenoTest::NewReno_SlowStart(), ns3::TcpLp::PktsAcked(), ns3::TcpHtcp::PktsAcked(), ns3::TcpSocketBase::ProcessAck(), ns3::TcpSocketBase::ReceivedAck(), ns3::TcpSocketBase::ReTxTimeout(), ns3::TcpSocketBase::SendPendingData(), ns3::TcpSocketBase::SetSegSize(), ns3::TcpHybla::SlowStart(), ns3::TcpNewReno::SlowStart(), and TcpBicIncrementTest::Update().
TracedValue<uint32_t> ns3::TcpSocketState::m_ssThresh {0} |
Slow start threshold.
Definition at line 173 of file tcp-socket-base.h.
Referenced by ns3::TcpHtcp::CongestionAvoidance(), ns3::TcpHybla::CongestionAvoidance(), ns3::TcpHighSpeed::CongestionAvoidance(), ns3::TcpScalable::CongestionAvoidance(), ns3::TcpLedbat::CongestionAvoidance(), ns3::TcpNewReno::CongestionAvoidance(), ns3::TcpSocketBase::DoForwardUp(), TcpHyblaIncrementTest::DoRun(), TcpBicIncrementTest::DoRun(), TcpVegasTest::DoRun(), TcpVenoTest::DoRun(), TcpYeahIncrementTest::DoRun(), TcpIllinoisTest::DoRun(), TcpYeahDecrementTest::DoRun(), ns3::TcpSocketBase::EnterRecovery(), ns3::TcpLpToNewReno::ExecuteTest(), TcpLedbatToNewReno::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), GetSsThreshInSegments(), GetTypeId(), ns3::TcpBic::IncreaseWindow(), ns3::TcpLedbat::IncreaseWindow(), ns3::TcpVegas::IncreaseWindow(), ns3::TcpVeno::IncreaseWindow(), ns3::TcpYeah::IncreaseWindow(), ns3::TcpIllinois::IncreaseWindow(), ns3::TcpNewReno::IncreaseWindow(), TcpVenoTest::NewReno_IncreaseWindow(), ns3::TcpSocketBase::ProcessAck(), ns3::TcpSocketBase::ReTxTimeout(), ns3::TcpHybla::SlowStart(), and ns3::TcpNewReno::SlowStart().
|
static |
Literal names of TCP states for use in log messages.
Definition at line 169 of file tcp-socket-base.h.