42 .AddConstructor<TcpIllinois> ()
43 .SetGroupName (
"Internet")
44 .AddAttribute (
"AlphaMin",
"Minimum alpha threshold",
47 MakeDoubleChecker<double> ())
48 .AddAttribute (
"AlphaMax",
"Maximum alpha threshold",
51 MakeDoubleChecker<double> ())
52 .AddAttribute (
"AlphaBase",
"Alpha base threshold",
55 MakeDoubleChecker<double> ())
56 .AddAttribute (
"BetaMin",
"Minimum beta threshold",
59 MakeDoubleChecker<double> ())
60 .AddAttribute (
"BetaMax",
"Maximum beta threshold",
63 MakeDoubleChecker<double> ())
64 .AddAttribute (
"BetaBase",
"Beta base threshold",
67 MakeDoubleChecker<double> ())
68 .AddAttribute (
"WinThresh",
"Window threshold",
71 MakeUintegerChecker<uint32_t> ())
72 .AddAttribute (
"Theta",
"Theta threshold",
75 MakeUintegerChecker<uint32_t> ())
106 m_sumRtt (sock.m_sumRtt),
107 m_cntRtt (sock.m_cntRtt),
108 m_baseRtt (sock.m_baseRtt),
109 m_maxRtt (sock.m_maxRtt),
110 m_endSeq (sock.m_endSeq),
111 m_rttAbove (sock.m_rttAbove),
112 m_rttLow (sock.m_rttLow),
113 m_alphaMin (sock.m_alphaMin),
114 m_alphaMax (sock.m_alphaMax),
115 m_alphaBase (sock.m_alphaBase),
116 m_alpha (sock.m_alpha),
117 m_betaMin (sock.m_betaMin),
118 m_betaMax (sock.m_betaMax),
119 m_betaBase (sock.m_betaBase),
120 m_beta (sock.m_beta),
121 m_winThresh (sock.m_winThresh),
122 m_theta (sock.m_theta),
123 m_ackCnt (sock.m_ackCnt)
140 NS_LOG_INFO (
"cWnd < winThresh, set alpha & beta to base values");
150 NS_LOG_INFO (
"Updated to dm = " << dm <<
" da = " << da);
193 uint32_t oldCwnd = segCwnd;
195 if (segmentsAcked > 0)
206 if (segCwnd != oldCwnd)
244 uint32_t segBytesInFlight = bytesInFlight / tcb->m_segmentSize;
245 uint32_t ssThresh =
static_cast<uint32_t
> (
std::max (2.0, (1.0 -
m_beta) * segBytesInFlight));
247 NS_LOG_DEBUG (
"Calculated ssThresh (in segments) = " << ssThresh);
249 return ssThresh * tcb->m_segmentSize;
257 double d1 = dm / 100;
273 NS_LOG_INFO (
"da stays below d1 for theta times RTT amount of time, " 274 "increase alpha to alphaMax");
316 else if (da > d2 && da < d3)
329 else if (da >= d3 || d3 <= d2)
370 return CopyObject<TcpIllinois> (
this);
378 return "TcpIllinois";
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Time m_baseRtt
Minimum of all RTT measurements.
Simulation virtual time values and global simulation resolution.
double m_beta
Multiplicative decrease factor.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void Reset(const SequenceNumber32 &nextTxSequence)
Reset Illinois parameters.
double m_betaMax
Maximum beta threshold.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold after congestion event.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Illinois congestion avoidance algorithm.
uint32_t m_ackCnt
Number of received ACK.
bool m_rttAbove
True when da > d1.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void CalculateAlpha(double da, double dm)
Calculate additive increase factor alpha.
uint32_t m_segmentSize
Segment size.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
double m_alpha
Additive increase factor.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
The NewReno implementation.
Time m_sumRtt
Sum of all RTT measurements during last RTT.
uint32_t m_theta
Number of RTTs required before setting alpha to its max.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
double m_alphaBase
Base value of alpha for standard AIMD.
double m_alphaMin
Minimum alpha threshold.
Hold an unsigned integer type.
double m_alphaMax
Maximum alpha threshold.
void CalculateBeta(double da, double dm)
Calculate multiplicative decrease factor beta.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
Time m_maxRtt
Maximum of all RTT measurements.
TcpIllinois(void)
Create an unbound tcp socket.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
Time CalculateMaxDelay() const
Calculate maximum queueing delay.
TcpCongState_t
Definition of the Congestion state machine.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual ~TcpIllinois(void)
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Reset Illinois parameters to default values upon a loss.
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...
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
SequenceNumber32 m_endSeq
Right edge of current RTT.
double m_betaMin
Minimum beta threshold.
double m_betaBase
Base value of beta for standard AIMD.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
CWND was reduced due to RTO timeout or SACK reneging.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void RecalcParam(uint32_t cWnd)
Recalculate alpha and beta every RTT.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t m_winThresh
Window threshold for adaptive sizing.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Measure RTT for each ACK Keep track of min and max RTT.
An implementation of TCP Illinois algorithm.
Time CalculateAvgDelay() const
Calculate average queueing delay.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint8_t m_rttLow
Number of RTTs da has stayed below d1.
uint32_t GetCwndInSegments() const
Get cwnd in segments rather than bytes.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.