34 .SetGroupName (
"Internet")
61 .SetGroupName (
"Internet")
129 if (segmentsAcked >= 1)
131 tcb->m_cWnd += tcb->m_segmentSize;
132 NS_LOG_INFO (
"In SlowStart, updated to cwnd " << tcb->m_cWnd <<
" ssthresh " << tcb->m_ssThresh);
133 return segmentsAcked - 1;
153 if (segmentsAcked > 0)
155 double adder =
static_cast<double> (tcb->m_segmentSize * tcb->m_segmentSize) / tcb->m_cWnd.Get ();
156 adder = std::max (1.0, adder);
157 tcb->m_cWnd +=
static_cast<uint32_t
> (adder);
158 NS_LOG_INFO (
"In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
159 " ssthresh " << tcb->m_ssThresh);
177 if (tcb->m_cWnd < tcb->m_ssThresh)
179 segmentsAcked =
SlowStart (tcb, segmentsAcked);
182 if (tcb->m_cWnd >= tcb->m_ssThresh)
205 uint32_t bytesInFlight)
209 return std::max (2 * state->m_segmentSize, bytesInFlight / 2);
215 return CopyObject<TcpNewReno> (
this);
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 "...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
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.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
virtual void IncreaseWindow(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Try to increase the cWnd following the NewReno specification.
The NewReno implementation.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
std::string GetName() const
Get the name of the congestion control algorithm.
static TypeId GetTypeId(void)
Get the type ID.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Congestion control abstract class.
virtual ~TcpCongestionOps()
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
A base class which provides memory management and object aggregation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.