30 .AddConstructor<TcpDctcp>()
31 .SetGroupName(
"Internet")
32 .AddAttribute(
"DctcpShiftG",
33 "Parameter G for updating dctcp_alpha",
37 .AddAttribute(
"DctcpAlphaOnInit",
38 "Initial alpha value",
42 .AddAttribute(
"UseEct0",
43 "Use ECT(0) for ECN codepoint, if false use ECT(1)",
47 .AddTraceSource(
"CongestionEstimate",
48 "Update sender-side congestion estimate state",
50 "ns3::TcpDctcp::CongestionEstimateTracedCallback");
65 m_priorRcvNxtFlag(false),
69 m_delayedAckReserved(false),
77 m_ackedBytesEcn(sock.m_ackedBytesEcn),
78 m_ackedBytesTotal(sock.m_ackedBytesTotal),
79 m_priorRcvNxt(sock.m_priorRcvNxt),
80 m_priorRcvNxtFlag(sock.m_priorRcvNxtFlag),
81 m_alpha(sock.m_alpha),
82 m_nextSeq(sock.m_nextSeq),
83 m_nextSeqFlag(sock.m_nextSeqFlag),
84 m_ceState(sock.m_ceState),
85 m_delayedAckReserved(sock.m_delayedAckReserved),
87 m_useEct0(sock.m_useEct0),
88 m_initialized(sock.m_initialized)
109 NS_LOG_INFO(
this <<
"Enabling DctcpEcn for DCTCP");
143 double bytesEcn = 0.0;
180 tmpRcvNxt = tcb->m_rxBuffer->NextRxSequence();
187 tcb->m_rxBuffer->SetNextRxSequence(tmpRcvNxt);
207 tmpRcvNxt = tcb->m_rxBuffer->NextRxSequence();
214 tcb->m_rxBuffer->SetNextRxSequence(tmpRcvNxt);
This class can be used to hold variables of floating point type such as 'double' or 'float'.
friend Ptr< T > CopyObject(Ptr< T > object)
Copy an Object.
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.
void SetSuppressIncreaseIfCwndLimited(bool value)
TcpSocketBase follows the Linux way of setting a flag 'isCwndLimited' when BytesInFlight() >= cwnd.
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.
@ 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.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#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.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)