41 .AddConstructor<TcpYeah> ()
42 .SetGroupName (
"Internet")
43 .AddAttribute (
"Alpha",
"Maximum backlog allowed at the bottleneck queue",
46 MakeUintegerChecker<uint32_t> ())
47 .AddAttribute (
"Gamma",
"Fraction of queue to be removed per RTT",
50 MakeUintegerChecker<uint32_t> ())
51 .AddAttribute (
"Delta",
"Log minimum fraction of cwnd to be removed on loss",
54 MakeUintegerChecker<uint32_t> ())
55 .AddAttribute (
"Epsilon",
"Log maximum fraction to be removed on early decongestion",
58 MakeUintegerChecker<uint32_t> ())
59 .AddAttribute (
"Phy",
"Maximum delta from base",
62 MakeUintegerChecker<uint32_t> ())
63 .AddAttribute (
"Rho",
"Minimum # of consecutive RTT to consider competition on loss",
66 MakeUintegerChecker<uint32_t> ())
67 .AddAttribute (
"Zeta",
"Minimum # of state switches to reset m_renoCount",
70 MakeUintegerChecker<uint32_t> ())
71 .AddAttribute (
"StcpAiFactor",
"STCP additive increase factor",
74 MakeUintegerChecker<uint32_t> ())
93 m_doingYeahNow (true),
101 m_stcp = CreateObject <TcpScalable> ();
107 m_alpha (sock.m_alpha),
108 m_gamma (sock.m_gamma),
109 m_delta (sock.m_delta),
110 m_epsilon (sock.m_epsilon),
113 m_zeta (sock.m_zeta),
114 m_stcpAiFactor (sock.m_stcpAiFactor),
115 m_baseRtt (sock.m_baseRtt),
116 m_minRtt (sock.m_minRtt),
117 m_cntRtt (sock.m_cntRtt),
118 m_doingYeahNow (sock.m_doingYeahNow),
119 m_begSndNxt (sock.m_begSndNxt),
120 m_lastQ (sock.m_lastQ),
121 m_doingRenoNow (sock.m_doingRenoNow),
122 m_renoCount (sock.m_renoCount),
123 m_fastCount (sock.m_fastCount)
137 return CopyObject<TcpYeah> (
this);
204 NS_LOG_LOGIC (
"In slow start, invoke NewReno slow start.");
209 NS_LOG_LOGIC (
"In Fast mode, increment cwnd according to STCP rule.");
210 m_stcp->IncreaseWindow (tcb, segmentsAcked);
222 NS_LOG_LOGIC (
"A YeAH cycle has finished, check if enough RTT samples.");
229 NS_LOG_LOGIC (
"Enough RTT samples to perform YeAH calculations");
246 uint32_t queue =
static_cast<uint32_t
> (bw * rttQueue.
GetSeconds ());
248 " given by cwnd = " << segCwnd <<
260 NS_LOG_LOGIC (
"Execute the precautionary decongestion.");
262 segCwnd -= reduction;
267 NS_LOG_INFO (
"In Slow mode, after precautionary decongestion, "
268 "updated to cwnd " << tcb->
m_cWnd <<
282 NS_LOG_DEBUG (
"In Slow mode, updated to m_renoCount = " <<
294 NS_LOG_DEBUG (
"In Fast mode, updated to m_renoCount = " <<
317 uint32_t bytesInFlight)
321 uint32_t segBytesInFlight = bytesInFlight / tcb->m_segmentSize;
325 NS_LOG_LOGIC (
"Not competing with Reno flows upon loss");
333 reduction =
std::max (segBytesInFlight >> 1,
static_cast<uint32_t
> (2));
336 NS_LOG_INFO (
"Reduction amount upon loss = " << reduction);
342 uint32_t ret =
std::max (bytesInFlight - (reduction * tcb->m_segmentSize),
343 2U * tcb->m_segmentSize);
friend Ptr< T > CopyObject(Ptr< T > object)
Copy an Object.
Smart pointer class similar to boost::intrusive_ptr.
The NewReno implementation.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
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_OPEN
Normal state, no dubious events.
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.
An implementation of TCP YeAH.
Time m_minRtt
Minimum of all RTTs measured within last RTT.
uint32_t m_zeta
Minimum number of state switches to reset m_renoCount.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold upon the receipt of 3 dupACKs.
uint32_t m_renoCount
Estimated cwnd of competing Reno flow.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Compute RTTs needed to execute YeAH algorithm.
bool m_doingYeahNow
If true, do YeAH for this RTT.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t m_lastQ
Last number of packets in the bottleneck queue.
SequenceNumber32 m_begSndNxt
Right edge during last RTT.
uint32_t m_stcpAiFactor
STCP additive increase parameter.
Ptr< TcpScalable > m_stcp
TcpScalable object.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following YeAH dual-mode algorithm.
uint32_t m_alpha
Maximum backlog allowed at the bottleneck queue; Q_max in the paper.
TcpYeah(void)
Create an unbound tcp socket.
uint32_t m_phy
Maximum delta from base.
uint32_t m_epsilon
Log maximum fraction to be removed on early decongestion.
void EnableYeah(const SequenceNumber32 &nextTxSequence)
Enable YeAH algorithm to start taking YeAH samples.
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Enable/disable YeAH algorithm depending on the congestion state.
uint32_t m_doingRenoNow
Number of RTTs in "Slow" mode.
uint32_t m_rho
Minimum number of consecutive RTT to consider competition with Reno flows on loss.
void DisableYeah()
Stop taking YeAH samples.
uint32_t m_fastCount
Number of RTTs in "Fast" mode.
Time m_baseRtt
Minimum of all YeAH RTT measurements seen during connection.
uint32_t m_gamma
Fraction of queue to be removed per RTT when precautionary decongestion executed.
uint32_t m_delta
Log minimum fraction of cwnd to be removed on loss.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Simulation virtual time values and global simulation resolution.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
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.
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
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.
#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_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#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.