25 #include "ns3/tcp-socket-state.h" 37 .AddConstructor<TcpDctcp> ()
38 .SetGroupName (
"Internet")
39 .AddAttribute (
"DctcpShiftG",
40 "Parameter G for updating dctcp_alpha",
43 MakeDoubleChecker<double> (0, 1))
44 .AddAttribute (
"DctcpAlphaOnInit",
45 "Initial alpha value",
48 MakeDoubleChecker<double> (0, 1))
49 .AddAttribute (
"UseEct0",
50 "Use ECT(0) for ECN codepoint, if false use ECT(1)",
79 m_ackedBytesEcn (sock.m_ackedBytesEcn),
80 m_ackedBytesTotal (sock.m_ackedBytesTotal),
81 m_priorRcvNxt (sock.m_priorRcvNxt),
82 m_priorRcvNxtFlag (sock.m_priorRcvNxtFlag),
83 m_alpha (sock.m_alpha),
84 m_nextSeq (sock.m_nextSeq),
85 m_nextSeqFlag (sock.m_nextSeqFlag),
86 m_ceState (sock.m_ceState),
87 m_delayedAckReserved (sock.m_delayedAckReserved),
89 m_useEct0 (sock.m_useEct0)
102 return CopyObject<TcpDctcp> (
this);
109 NS_LOG_INFO (
this <<
"Enabling DctcpEcn for DCTCP");
119 uint32_t val =
static_cast<uint32_t
> ((1 -
m_alpha / 2.0) * tcb->
m_cWnd);
139 double bytesEcn = 0.0;
174 tmpRcvNxt = tcb->
m_rxBuffer->NextRxSequence ();
181 tcb->
m_rxBuffer->SetNextRxSequence (tmpRcvNxt);
201 tmpRcvNxt = tcb->
m_rxBuffer->NextRxSequence ();
208 tcb->
m_rxBuffer->SetNextRxSequence (tmpRcvNxt);
log2() macro definition; to deal with Bug 1467.
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Last ACK received had ECE bit set in TCP header.
AttributeValue implementation for Boolean.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual void CwndEvent(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
Trigger events/calculations on occurrence of congestion window event.
TracedValue< EcnState_t > m_ecnState
Current ECN State, represented as combination of EcnState values.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_segmentSize
Segment size.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< TcpRxBuffer > m_rxBuffer
Rx buffer (reordering buffer)
The NewReno implementation.
virtual void Init(Ptr< TcpSocketState > tcb)
Set configuration required by congestion control algorithm, This method will force DctcpEcn mode and ...
Receiver sends an ACK with ECE bit set in TCP header.
void SetDctcpAlpha(double alpha)
Sets the value of m_alpha.
Last packet received had CE bit set in IP header.
Callback< void, uint8_t > m_sendEmptyPacketCallback
void CeState1to0(Ptr< TcpSocketState > tcb)
Changes state of m_ceState to false.
bool m_useEct0
Use ECT(0) for ECN codepoint.
virtual std::string GetName() const
Get the name of the TCP flavour.
static TypeId GetTypeId(void)
Get the type ID.
EcnMode_t m_ecnMode
ECN mode.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
ECN is enabled but currently there is no action pertaining to ECE or CWR to be taken.
void UpdateAckReserved(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
Updates the value of m_delayedAckReserved.
void Reset(Ptr< TcpSocketState > tcb)
Resets the value of m_ackedBytesEcn, m_ackedBytesTotal and m_nextSeq.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Get information from the acked packet.
UseEcn_t m_useEcn
Socket ECN capability.
bool m_ceState
DCTCP Congestion Experienced state.
ECN functionality as described in RFC 8257.
double m_alpha
Parameter used to estimate the amount of network congestion.
SequenceNumber32 m_nextSeq
TCP sequence number threshold for beginning a new observation window.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
An implementation of DCTCP.
virtual ~TcpDctcp(void)
Destructor.
double m_g
Estimation gain.
void CeState0to1(Ptr< TcpSocketState > tcb)
Changes state of m_ceState to true.
uint32_t m_ackedBytesEcn
Number of acked bytes which are marked.
TracedValue< uint32_t > m_cWnd
Congestion window.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
EcnCodePoint_t m_ectCodePoint
ECT code point to use.
uint32_t m_ackedBytesTotal
Total number of acked bytes.
TcpDctcp()
Create an unbound tcp socket.
bool m_priorRcvNxtFlag
Variable used in setting the value of m_priorRcvNxt for first time.
SequenceNumber32 m_priorRcvNxt
Sequence number of the first missing byte in data.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
bool m_delayedAckReserved
Delayed Ack state.
virtual void ReduceCwnd(Ptr< TcpSocketState > tcb)
Reduce congestion window based on DCTCP algorithm.
bool m_nextSeqFlag
Variable used in setting the value of m_nextSeq for first time.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
received CE marked IP packet.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
ECT set, but not CE marked.