33 .AddConstructor<TcpIllinois>()
34 .SetGroupName(
"Internet")
35 .AddAttribute(
"AlphaMin",
36 "Minimum alpha threshold",
40 .AddAttribute(
"AlphaMax",
41 "Maximum alpha threshold",
45 .AddAttribute(
"AlphaBase",
46 "Alpha base threshold",
50 .AddAttribute(
"BetaMin",
51 "Minimum beta threshold",
55 .AddAttribute(
"BetaMax",
56 "Maximum beta threshold",
60 .AddAttribute(
"BetaBase",
61 "Beta base threshold",
65 .AddAttribute(
"WinThresh",
70 .AddAttribute(
"Theta",
104 m_sumRtt(sock.m_sumRtt),
105 m_cntRtt(sock.m_cntRtt),
106 m_baseRtt(sock.m_baseRtt),
107 m_maxRtt(sock.m_maxRtt),
108 m_endSeq(sock.m_endSeq),
109 m_rttAbove(sock.m_rttAbove),
110 m_rttLow(sock.m_rttLow),
111 m_alphaMin(sock.m_alphaMin),
112 m_alphaMax(sock.m_alphaMax),
113 m_alphaBase(sock.m_alphaBase),
114 m_alpha(sock.m_alpha),
115 m_betaMin(sock.m_betaMin),
116 m_betaMax(sock.m_betaMax),
117 m_betaBase(sock.m_betaBase),
119 m_winThresh(sock.m_winThresh),
120 m_theta(sock.m_theta),
121 m_ackCnt(sock.m_ackCnt)
138 NS_LOG_INFO(
"cWnd < winThresh, set alpha & beta to base values");
148 NS_LOG_INFO(
"Updated to dm = " << dm <<
" da = " << da);
167 Reset(tcb->m_nextTxSequence);
176 if (tcb->m_lastAckedSeq >=
m_endSeq)
179 Reset(tcb->m_nextTxSequence);
182 if (tcb->m_cWnd < tcb->m_ssThresh)
185 NS_LOG_INFO(
"In SlowStart, updated to cwnd " << tcb->m_cWnd <<
" ssthresh "
190 uint32_t segCwnd = tcb->GetCwndInSegments();
193 if (segmentsAcked > 0)
204 if (segCwnd != oldCwnd)
206 tcb->m_cWnd = segCwnd * tcb->m_segmentSize;
207 NS_LOG_INFO(
"In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
" ssthresh "
241 uint32_t segBytesInFlight = bytesInFlight / tcb->m_segmentSize;
244 NS_LOG_DEBUG(
"Calculated ssThresh (in segments) = " << ssThresh);
246 return ssThresh * tcb->m_segmentSize;
254 double d1 = dm / 100;
270 NS_LOG_INFO(
"da stays below d1 for theta times RTT amount of time, "
271 "increase alpha to alphaMax");
314 else if (da > d2 && da < d3)
326 else if (da >= d3 || d3 <= d2)
375 return "TcpIllinois";
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 TCP Illinois algorithm.
double m_alphaBase
Base value of alpha for standard AIMD.
double m_beta
Multiplicative decrease factor.
uint32_t m_ackCnt
Number of received ACK.
void RecalcParam(uint32_t cWnd)
Recalculate alpha and beta every RTT.
Time CalculateMaxDelay() const
Calculate maximum queueing delay.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get slow start threshold after congestion event.
bool m_rttAbove
True when da > d1.
std::string GetName() const override
Get the name of the congestion control algorithm.
static TypeId GetTypeId()
Get the type ID.
double m_betaMin
Minimum beta threshold.
void CalculateAlpha(double da, double dm)
Calculate additive increase factor alpha.
void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState) override
Reset Illinois parameters to default values upon a loss.
Time m_baseRtt
Minimum of all RTT measurements.
double m_alphaMin
Minimum alpha threshold.
uint32_t m_winThresh
Window threshold for adaptive sizing.
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
TcpIllinois()
Create an unbound tcp socket.
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Adjust cwnd following Illinois congestion avoidance algorithm.
uint8_t m_rttLow
Number of RTTs da has stayed below d1.
void CalculateBeta(double da, double dm)
Calculate multiplicative decrease factor beta.
Time m_maxRtt
Maximum of all RTT measurements.
double m_alpha
Additive increase factor.
double m_betaMax
Maximum beta threshold.
double m_betaBase
Base value of beta for standard AIMD.
uint32_t m_theta
Number of RTTs required before setting alpha to its max.
Time m_sumRtt
Sum of all RTT measurements during last RTT.
double m_alphaMax
Maximum alpha threshold.
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
void Reset(const SequenceNumber32 &nextTxSequence)
Reset Illinois parameters.
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Measure RTT for each ACK Keep track of min and max RTT.
Time CalculateAvgDelay() const
Calculate average queueing delay.
SequenceNumber32 m_endSeq
Right edge of current RTT.
The NewReno implementation.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm.
TcpCongState_t
Definition of the Congestion state machine.
@ CA_LOSS
CWND was reduced due to RTO timeout or SACK reneging.
Simulation virtual time values and global simulation resolution.
int64_t GetMilliSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
bool IsZero() const
Exactly equivalent to t == 0.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)