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);
Simulation virtual time values and global simulation resolution.
uint32_t m_stcpAiFactor
STCP additive increase parameter.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Normal state, no dubious events.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
TcpYeah(void)
Create an unbound tcp socket.
uint32_t m_fastCount
Number of RTTs in "Fast" mode.
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Enable/disable YeAH algorithm depending on the congestion state.
uint32_t m_epsilon
Log maximum fraction to be removed on early decongestion.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_segmentSize
Segment size.
void DisableYeah()
Stop taking YeAH samples.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t m_delta
Log minimum fraction of cwnd to be removed on loss.
The NewReno implementation.
uint32_t m_gamma
Fraction of queue to be removed per RTT when precautionary decongestion executed. ...
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Compute RTTs needed to execute YeAH algorithm.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
static Time Max()
Maximum representable Time.
Time m_minRtt
Minimum of all RTTs measured within last RTT.
An implementation of TCP YeAH.
Hold an unsigned integer type.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
uint32_t m_cntRtt
Number of RTT measurements during last RTT.
uint32_t m_phy
Maximum delta from base.
SequenceNumber32 m_lastAckedSeq
Last sequence ACKed.
friend Ptr< T > CopyObject(Ptr< T > object)
Copy an Object.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
uint32_t m_renoCount
Estimated cwnd of competing Reno flow.
TcpCongState_t
Definition of the Congestion state machine.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void EnableYeah(const SequenceNumber32 &nextTxSequence)
Enable YeAH algorithm to start taking YeAH samples.
uint32_t m_lastQ
Last number of packets in the bottleneck queue.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
TracedValue< uint32_t > m_cWnd
Congestion window.
Time m_baseRtt
Minimum of all YeAH RTT measurements seen during connection.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
uint32_t m_rho
Minimum number of consecutive RTT to consider competition with Reno flows on loss.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Adjust cwnd following YeAH dual-mode algorithm.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
bool m_doingYeahNow
If true, do YeAH for this RTT.
uint32_t m_zeta
Minimum number of state switches to reset m_renoCount.
Ptr< TcpScalable > m_stcp
TcpScalable object.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
static TypeId GetTypeId(void)
Get the type ID.
SequenceNumber32 m_begSndNxt
Right edge during last RTT.
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.
uint32_t m_alpha
Maximum backlog allowed at the bottleneck queue; Q_max in the paper.
uint32_t m_doingRenoNow
Number of RTTs in "Slow" mode.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold upon the receipt of 3 dupACKs.
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.