88 .SetGroupName(
"Internet")
90 .AddAttribute(
"BetaLoss",
91 "Beta for multiplicative decrease",
95 .AddAttribute(
"BetaEcn",
96 "Beta for multiplicative decrease for ABE",
166 if (segmentsAcked >= 1)
168 tcb->m_cWnd += tcb->m_segmentSize;
169 NS_LOG_INFO(
"In SlowStart, updated to cwnd " << tcb->m_cWnd <<
" ssthresh "
171 return segmentsAcked - 1;
191 if (segmentsAcked > 0)
194 static_cast<double>(tcb->m_segmentSize * tcb->m_segmentSize) / tcb->m_cWnd.Get();
195 adder = std::max(1.0, adder);
196 tcb->m_cWnd +=
static_cast<uint32_t>(adder);
197 NS_LOG_INFO(
"In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
" ssthresh "
216 if (tcb->m_cWnd < tcb->m_ssThresh)
218 segmentsAcked =
SlowStart(tcb, segmentsAcked);
221 if (tcb->m_cWnd >= tcb->m_ssThresh)
249 return std::max<uint32_t>(2 * state->m_segmentSize,
253 return std::max<uint32_t>(2 * state->m_segmentSize, bytesInFlight *
m_betaLoss);
This class can be used to hold variables of floating point type such as 'double' or 'float'.
friend Ptr< T > CopyObject(Ptr< T > object)
Copy an Object.
Smart pointer class similar to boost::intrusive_ptr.
Congestion control abstract class.
virtual void CwndEvent(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
Trigger events/calculations on occurrence of congestion window event.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance algorithm implementation.
virtual void CongControl(Ptr< TcpSocketState > tcb, const TcpRateOps::TcpRateConnection &rc, const TcpRateOps::TcpRateSample &rs)
Called when packets are delivered to update cwnd and pacing rate.
static TypeId GetTypeId()
Get the type ID.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Timing information on received ACK.
~TcpCongestionOps() override
virtual bool HasCongControl() const
Returns true when Congestion Control Algorithm implements CongControl.
virtual void CongestionStateSet(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCongState_t newState)
Trigger events/calculations specific to a congestion state.
The NewReno implementation.
double m_betaEcn
Beta for New-Reno multiplicative decrease with ABE.
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.
double m_betaLoss
Beta for New-Reno multiplicative decrease.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
std::string GetName() const override
Get the name of the congestion control algorithm.
void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Try to increase the cWnd following the NewReno specification.
static TypeId GetTypeId()
Get the type ID.
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
TcpCAEvent_t
Congestion avoidance events.
TcpCongState_t
Definition of the Congestion state machine.
@ ECN_ECE_RCVD
Last ACK received had ECE bit set in TCP header.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
Information about the connection rate.