46 .AddConstructor<TcpScalable>()
47 .SetGroupName(
"Internet")
48 .AddAttribute(
"AIFactor",
49 "Additive Increase Factor",
52 MakeUintegerChecker<uint32_t>())
53 .AddAttribute(
"MDFactor",
54 "Multiplicative Decrease Factor",
57 MakeDoubleChecker<double>());
72 m_ackCnt(sock.m_ackCnt),
73 m_aiFactor(sock.m_aiFactor),
74 m_mdFactor(sock.m_mdFactor)
87 return CopyObject<TcpScalable>(
this);
98 uint32_t oldCwnd = segCwnd;
115 if (segCwnd != oldCwnd)
126 return "TcpScalable";
134 uint32_t segCwnd = bytesInFlight / tcb->m_segmentSize;
137 uint32_t ssThresh =
static_cast<uint32_t
>(
std::max(2.0, segCwnd * b));
139 NS_LOG_DEBUG(
"Calculated b(w) = " << b <<
" resulting (in segment) ssThresh=" << ssThresh);
141 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.
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get slow start threshold following Scalable principle (Equation 2)
static TypeId GetTypeId()
Get the type ID.
uint32_t m_ackCnt
Number of received ACK.
void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Congestion avoidance of TcpScalable (Equation 1)
TcpScalable()
Create an unbound tcp socket.
uint32_t m_aiFactor
Additive increase factor.
std::string GetName() const override
Get the name of the congestion control algorithm.
double m_mdFactor
Multiplicative decrease factor.
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,...
#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.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)