|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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";
a unique identifier for an interface.
uint8_t m_rttLow
Number of RTTs da has stayed below d1.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
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.
double m_betaBase
Base value of beta for standard AIMD.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void CalculateBeta(double da, double dm)
Calculate multiplicative decrease factor beta.
void CalculateAlpha(double da, double dm)
Calculate additive increase factor alpha.
TracedValue< SequenceNumber32 > m_nextTxSequence
Next seqnum to be sent (SND.NXT), ReTx pushes it back.
uint32_t m_segmentSize
Segment size.
TcpCongState_t
Definition of the Congestion state machine.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
static TypeId GetTypeId(void)
Get the type ID.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
void Reset(const SequenceNumber32 &nextTxSequence)
Reset Illinois parameters.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following Illinois congestion avoidance algorithm.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
bool m_rttAbove
True when da > d1.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
An implementation of TCP Illinois algorithm.
bool IsZero(void) const
Exactly equivalent to t == 0.
double m_beta
Multiplicative decrease factor.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Measure RTT for each ACK Keep track of min and max RTT.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
double m_alphaBase
Base value of alpha for standard AIMD.
Simulation virtual time values and global simulation resolution.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
double m_alphaMax
Maximum alpha threshold.
Time m_maxRtt
Maximum of all RTT measurements.
Time CalculateAvgDelay() const
Calculate average queueing delay.
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.
void RecalcParam(uint32_t cWnd)
Recalculate alpha and beta every RTT.
@ CA_LOSS
CWND was reduced due to RTO timeout or SACK reneging.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t GetCwndInSegments() const
Get cwnd in segments rather than bytes.
double m_betaMax
Maximum beta threshold.
double m_alpha
Additive increase factor.
SequenceNumber32 m_endSeq
Right edge of current RTT.
double m_betaMin
Minimum beta threshold.
The NewReno implementation.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
TracedValue< uint32_t > m_cWnd
Congestion window.
Hold an unsigned integer type.
uint32_t m_ackCnt
Number of received ACK.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
double m_alphaMin
Minimum alpha threshold.
uint32_t m_theta
Number of RTTs required before setting alpha to its max.
TcpIllinois(void)
Create an unbound tcp socket.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
uint32_t m_winThresh
Window threshold for adaptive sizing.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
virtual ~TcpIllinois(void)
Time CalculateMaxDelay() const
Calculate maximum queueing delay.
Time m_sumRtt
Sum of all RTT measurements during last RTT.