45 .AddConstructor<TcpScalable> ()
46 .SetGroupName (
"Internet")
47 .AddAttribute (
"AIFactor",
"Additive Increase Factor",
50 MakeUintegerChecker<uint32_t> ())
51 .AddAttribute (
"MDFactor",
"Multiplicative Decrease Factor",
54 MakeDoubleChecker<double> ())
70 m_ackCnt (sock.m_ackCnt),
71 m_aiFactor (sock.m_aiFactor),
72 m_mdFactor (sock.m_mdFactor)
85 return CopyObject<TcpScalable> (
this);
90 uint32_t segmentsAcked)
97 uint32_t oldCwnd = segCwnd;
114 if (segCwnd != oldCwnd)
125 return "TcpScalable";
130 uint32_t bytesInFlight)
134 uint32_t segCwnd = bytesInFlight / tcb->m_segmentSize;
137 uint32_t ssThresh =
static_cast<uint32_t
> (
std::max (2.0, segCwnd * b));
140 " resulting (in segment) ssThresh=" << ssThresh);
142 return ssThresh * tcb->m_segmentSize;
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Smart pointer class similar to boost::intrusive_ptr.
The NewReno implementation.
An implementation of TCP Scalable.
static TypeId GetTypeId(void)
Get the type ID.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
TcpScalable(void)
Create an unbound tcp socket.
uint32_t m_ackCnt
Number of received ACK.
uint32_t m_aiFactor
Additive increase factor.
double m_mdFactor
Multiplicative decrease factor.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance of TcpScalable (Equation 1)
virtual std::string GetName() const
Get the name of the congestion control algorithm.
virtual ~TcpScalable(void)
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold following Scalable principle (Equation 2)
uint32_t m_segmentSize
Segment size.
uint32_t GetCwndInSegments() const
Get cwnd in segments rather than bytes.
TracedValue< uint32_t > m_cWnd
Congestion window.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
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 > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(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_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#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.