31 #include "ns3/tcp-socket-base.h"
44 .AddConstructor<TcpScalable> ()
45 .SetGroupName (
"Internet")
46 .AddAttribute (
"AIFactor",
"Additive Increase Factor",
49 MakeUintegerChecker<uint32_t> ())
50 .AddAttribute (
"MDFactor",
"Multiplicative Decrease Factor",
53 MakeDoubleChecker<double> ())
69 m_ackCnt (sock.m_ackCnt),
70 m_aiFactor (sock.m_aiFactor),
71 m_mdFactor (sock.m_mdFactor)
84 return CopyObject<TcpScalable> (
this);
89 uint32_t segmentsAcked)
93 uint32_t segCwnd = tcb->GetCwndInSegments ();
94 uint32_t oldCwnd = segCwnd;
111 if (segCwnd != oldCwnd)
113 tcb->m_cWnd = segCwnd * tcb->m_segmentSize;
114 NS_LOG_INFO (
"In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
115 " ssthresh " << tcb->m_ssThresh);
122 return "TcpScalable";
127 uint32_t bytesInFlight)
131 uint32_t segCwnd = bytesInFlight / tcb->m_segmentSize;
134 uint32_t ssThresh =
std::max (2.0, segCwnd * b);
137 " resulting (in segment) ssThresh=" << ssThresh);
139 return ssThresh * tcb->m_segmentSize;
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 ~TcpScalable(void)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
double m_mdFactor
Multiplicative decrease factor.
static TypeId GetTypeId(void)
Get the type ID.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
uint32_t m_aiFactor
Additive increase factor.
The NewReno implementation.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Congestion avoidance of TcpScalable (Equation 1)
Hold an unsigned integer type.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
An implementation of TCP Scalable.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
TcpScalable(void)
Create an unbound tcp socket.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t m_ackCnt
Number of received ACK.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
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.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get slow start threshold following Scalable principle (Equation 2)
virtual std::string GetName() const
Get the name of the congestion control algorithm.