44 .AddConstructor<TcpIllinois> ()
45 .SetGroupName (
"Internet")
46 .AddAttribute (
"AlphaMin",
"Minimum alpha threshold",
49 MakeDoubleChecker<double> ())
50 .AddAttribute (
"AlphaMax",
"Maximum alpha threshold",
53 MakeDoubleChecker<double> ())
54 .AddAttribute (
"AlphaBase",
"Alpha base threshold",
57 MakeDoubleChecker<double> ())
58 .AddAttribute (
"BetaMin",
"Minimum beta threshold",
61 MakeDoubleChecker<double> ())
62 .AddAttribute (
"BetaMax",
"Maximum beta threshold",
65 MakeDoubleChecker<double> ())
66 .AddAttribute (
"BetaBase",
"Beta base threshold",
69 MakeDoubleChecker<double> ())
70 .AddAttribute (
"WinThresh",
"Window threshold",
73 MakeUintegerChecker<uint32_t> ())
74 .AddAttribute (
"Theta",
"Theta threshold",
77 MakeUintegerChecker<uint32_t> ())
108 m_sumRtt (sock.m_sumRtt),
109 m_cntRtt (sock.m_cntRtt),
110 m_baseRtt (sock.m_baseRtt),
111 m_maxRtt (sock.m_maxRtt),
112 m_endSeq (sock.m_endSeq),
113 m_rttAbove (sock.m_rttAbove),
114 m_rttLow (sock.m_rttLow),
115 m_alphaMin (sock.m_alphaMin),
116 m_alphaMax (sock.m_alphaMax),
117 m_alphaBase (sock.m_alphaBase),
118 m_alpha (sock.m_alpha),
119 m_betaMin (sock.m_betaMin),
120 m_betaMax (sock.m_betaMax),
121 m_betaBase (sock.m_betaBase),
122 m_beta (sock.m_beta),
123 m_winThresh (sock.m_winThresh),
124 m_theta (sock.m_theta),
125 m_ackCnt (sock.m_ackCnt)
142 NS_LOG_INFO (
"cWnd < winThresh, set alpha & beta to base values");
152 NS_LOG_INFO (
"Updated to dm = " << dm <<
" da = " << da);
195 uint32_t oldCwnd = segCwnd;
197 if (segmentsAcked > 0)
208 if (segCwnd != oldCwnd)
246 uint32_t segBytesInFlight = bytesInFlight / tcb->m_segmentSize;
247 uint32_t ssThresh =
static_cast<uint32_t
> (
std::max (2.0, (1.0 -
m_beta) * segBytesInFlight));
249 NS_LOG_DEBUG (
"Calculated ssThresh (in segments) = " << ssThresh);
251 return ssThresh * tcb->m_segmentSize;
259 double d1 = dm / 100;
275 NS_LOG_INFO (
"da stays below d1 for theta times RTT amount of time, "
276 "increase alpha to alphaMax");
318 else if (da > d2 && da < d3)
331 else if (da >= d3 || d3 <= d2)
372 return CopyObject<TcpIllinois> (
this);
380 return "TcpIllinois";
This class can be used to hold variables of floating point type such as 'double' or 'float'.
An implementation of TCP Illinois algorithm.
virtual std::string GetName() const
Get the name of the congestion control 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.
bool m_rttAbove
True when da > d1.
TcpIllinois(void)
Create an unbound tcp socket.
double m_betaMin
Minimum beta threshold.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
void CalculateAlpha(double da, double dm)
Calculate additive increase factor alpha.
Time m_baseRtt
Minimum of all RTT measurements.
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Reset Illinois parameters to default values upon a loss.
double m_alphaMin
Minimum alpha threshold.
uint32_t m_winThresh
Window threshold for adaptive sizing.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold after congestion event.
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
virtual ~TcpIllinois(void)
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.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Measure RTT for each ACK Keep track of min and max RTT.
Time m_sumRtt
Sum of all RTT measurements during last RTT.
double m_alphaMax
Maximum alpha threshold.
static TypeId GetTypeId(void)
Get the type ID.
void Reset(const SequenceNumber32 &nextTxSequence)
Reset Illinois parameters.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Illinois congestion avoidance algorithm.
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.
uint32_t m_segmentSize
Segment size.
uint32_t GetCwndInSegments() const
Get cwnd in segments rather than bytes.
TcpCongState_t
Definition of the Congestion state machine.
@ CA_LOSS
CWND was reduced due to RTO timeout or SACK reneging.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
TracedValue< uint32_t > m_cWnd
Congestion window.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
Simulation virtual time values and global simulation resolution.
bool IsZero(void) const
Exactly equivalent to t == 0.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
#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.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.