23 #include "ns3/abort.h" 
   25 #include "ns3/tcp-socket-state.h" 
   40             .AddConstructor<TcpDctcp>()
 
   41             .SetGroupName(
"Internet")
 
   42             .AddAttribute(
"DctcpShiftG",
 
   43                           "Parameter G for updating dctcp_alpha",
 
   46                           MakeDoubleChecker<double>(0, 1))
 
   47             .AddAttribute(
"DctcpAlphaOnInit",
 
   48                           "Initial alpha value",
 
   51                           MakeDoubleChecker<double>(0, 1))
 
   52             .AddAttribute(
"UseEct0",
 
   53                           "Use ECT(0) for ECN codepoint, if false use ECT(1)",
 
   57             .AddTraceSource(
"CongestionEstimate",
 
   58                             "Update sender-side congestion estimate state",
 
   60                             "ns3::TcpDctcp::CongestionEstimateTracedCallback");
 
   75       m_priorRcvNxtFlag(false),
 
   79       m_delayedAckReserved(false),
 
   87       m_ackedBytesEcn(sock.m_ackedBytesEcn),
 
   88       m_ackedBytesTotal(sock.m_ackedBytesTotal),
 
   89       m_priorRcvNxt(sock.m_priorRcvNxt),
 
   90       m_priorRcvNxtFlag(sock.m_priorRcvNxtFlag),
 
   91       m_alpha(sock.m_alpha),
 
   92       m_nextSeq(sock.m_nextSeq),
 
   93       m_nextSeqFlag(sock.m_nextSeqFlag),
 
   94       m_ceState(sock.m_ceState),
 
   95       m_delayedAckReserved(sock.m_delayedAckReserved),
 
   97       m_useEct0(sock.m_useEct0),
 
   98       m_initialized(sock.m_initialized)
 
  112     return CopyObject<TcpDctcp>(
this);
 
  119     NS_LOG_INFO(
this << 
"Enabling DctcpEcn for DCTCP");
 
  133     return static_cast<uint32_t
>((1 - 
m_alpha / 2.0) * tcb->m_cWnd);
 
  152         double bytesEcn = 0.0; 
 
  189         tmpRcvNxt = tcb->
m_rxBuffer->NextRxSequence();
 
  196         tcb->
m_rxBuffer->SetNextRxSequence(tmpRcvNxt);
 
  216         tmpRcvNxt = tcb->
m_rxBuffer->NextRxSequence();
 
  223         tcb->
m_rxBuffer->SetNextRxSequence(tmpRcvNxt);
 
AttributeValue implementation for Boolean.
 
This class can be used to hold variables of floating point type such as 'double' or 'float'.
 
Smart pointer class similar to boost::intrusive_ptr.
 
An implementation of DCTCP.
 
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
 
static TypeId GetTypeId()
Get the type ID.
 
SequenceNumber32 m_priorRcvNxt
Sequence number of the first missing byte in data.
 
double m_alpha
Parameter used to estimate the amount of network congestion.
 
double m_g
Estimation gain.
 
bool m_initialized
Whether DCTCP has been initialized.
 
bool m_ceState
DCTCP Congestion Experienced state.
 
bool m_priorRcvNxtFlag
Variable used in setting the value of m_priorRcvNxt for first time.
 
void InitializeDctcpAlpha(double alpha)
Initialize the value of m_alpha.
 
SequenceNumber32 m_nextSeq
TCP sequence number threshold for beginning a new observation window.
 
uint32_t m_ackedBytesEcn
Number of acked bytes which are marked.
 
void Init(Ptr< TcpSocketState > tcb) override
Set configuration required by congestion control algorithm, This method will force DctcpEcn mode and ...
 
TcpDctcp()
Create an unbound tcp socket.
 
void Reset(Ptr< TcpSocketState > tcb)
Resets the value of m_ackedBytesEcn, m_ackedBytesTotal and m_nextSeq.
 
uint32_t m_ackedBytesTotal
Total number of acked bytes.
 
bool m_nextSeqFlag
Variable used in setting the value of m_nextSeq for first time.
 
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 PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Timing information on received ACK.
 
void CwndEvent(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event) override
Trigger events/calculations on occurrence of congestion window event.
 
void CeState1to0(Ptr< TcpSocketState > tcb)
Changes state of m_ceState to false.
 
void UpdateAckReserved(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
Updates the value of m_delayedAckReserved.
 
bool m_delayedAckReserved
Delayed Ack state.
 
TracedCallback< uint32_t, uint32_t, double > m_traceCongestionEstimate
Callback pointer for congestion state update.
 
bool m_useEct0
Use ECT(0) for ECN codepoint.
 
void CeState0to1(Ptr< TcpSocketState > tcb)
Changes state of m_ceState to true.
 
~TcpDctcp() override
Destructor.
 
Reno congestion control algorithm.
 
uint32_t m_segmentSize
Segment size.
 
TcpCAEvent_t
Congestion avoidance events.
 
@ CA_EVENT_ECN_IS_CE
received CE marked IP packet.
 
@ CA_EVENT_ECN_NO_CE
ECT set, but not CE marked.
 
@ CA_EVENT_DELAYED_ACK
Delayed ack is sent.
 
@ CA_EVENT_NON_DELAYED_ACK
Non-delayed ack is sent.
 
EcnMode_t m_ecnMode
ECN mode.
 
Callback< void, uint8_t > m_sendEmptyPacketCallback
Callback to send an empty packet.
 
UseEcn_t m_useEcn
Socket ECN capability.
 
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
 
@ DctcpEcn
ECN functionality as described in RFC 8257.
 
@ ECN_ECE_RCVD
Last ACK received had ECE bit set in TCP header.
 
@ ECN_IDLE
ECN is enabled but currently there is no action pertaining to ECE or CWR to be taken.
 
@ ECN_CE_RCVD
Last packet received had CE bit set in IP header.
 
@ ECN_SENDING_ECE
Receiver sends an ACK with ECE bit set in TCP header.
 
Ptr< TcpRxBuffer > m_rxBuffer
Rx buffer (reordering buffer)
 
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
 
TracedValue< EcnState_t > m_ecnState
Current ECN State, represented as combination of EcnState values.
 
EcnCodePoint_t m_ectCodePoint
ECT code point to use.
 
Simulation virtual time values and global simulation resolution.
 
T Get() const
Get the underlying value.
 
a unique identifier for an interface.
 
TypeId SetParent(TypeId tid)
Set the parent TypeId.
 
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
 
Ptr< const AttributeChecker > MakeBooleanChecker()
 
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
 
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
 
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
 
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
 
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
 
Every class exported by the ns3 library is enclosed in the ns3 namespace.