36 .AddConstructor<TcpHybla>()
37 .SetGroupName(
"Internet")
43 .AddTraceSource(
"Rho",
44 "Rho parameter of Hybla",
46 "ns3::TracedValueCallback::Double");
61 m_cWndCnt(sock.m_cWndCnt)
87 if (rtt == tcb->m_minRtt)
99 NS_ASSERT(tcb->m_cWnd <= tcb->m_ssThresh);
101 if (segmentsAcked >= 1)
108 double increment = std::pow(2,
m_rho) - 1.0;
112 tcb->m_cWnd = std::min(tcb->m_cWnd + incr, tcb->m_ssThresh);
114 NS_LOG_INFO(
"In SlowStart, updated to cwnd " << tcb->m_cWnd <<
" ssthresh "
115 << tcb->m_ssThresh <<
" with an increment of "
116 << increment * tcb->m_segmentSize);
118 return segmentsAcked - 1;
132 while (segmentsAcked > 0)
138 segCwnd = tcb->GetCwndInSegments();
139 increment = std::pow(
m_rho, 2) /
static_cast<double>(segCwnd);
157 tcb->m_cWnd += inc * tcb->m_segmentSize;
159 NS_LOG_INFO(
"In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
" ssthresh "
160 << tcb->m_ssThresh <<
" with an increment of "
161 << inc * tcb->m_segmentSize);
168 return CopyObject<TcpHybla>(
this);
Smart pointer class similar to boost::intrusive_ptr.
Implementation of the TCP Hybla algorithm.
static TypeId GetTypeId()
Get the type ID.
Time m_rRtt
Reference RTT.
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
TcpHybla()
Create an unbound tcp socket.
uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
Tcp NewReno slow start algorithm.
TracedValue< double > m_rho
Rho parameter.
std::string GetName() const override
Get the name of the congestion control algorithm.
void RecalcParam(const Ptr< TcpSocketState > &tcb)
Recalculate algorithm parameters.
double m_cWndCnt
cWnd integer-to-float counter
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt) override
Timing information on received ACK.
void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked) override
NewReno congestion avoidance.
The NewReno implementation.
Simulation virtual time values and global simulation resolution.
int64_t GetMilliSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
#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.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.