22 #include "ns3/tcp-socket-base.h"
34 .AddConstructor<TcpHybla> ()
35 .SetGroupName (
"Internet")
36 .AddAttribute (
"RRTT",
"Reference RTT",
40 .AddTraceSource (
"Rho",
41 "Rho parameter of Hybla",
43 "ns3::TracedValue::DoubleCallback")
60 m_minRtt (sock.m_minRtt),
61 m_cWndCnt (sock.m_cWndCnt)
101 NS_ASSERT (tcb->m_cWnd <= tcb->m_ssThresh);
103 if (segmentsAcked >= 1)
110 double increment = std::pow (2,
m_rho) - 1.0;
113 tcb->m_cWnd = std::min (tcb->m_cWnd + (increment * tcb->m_segmentSize),
116 NS_LOG_INFO (
"In SlowStart, updated to cwnd " << tcb->m_cWnd <<
117 " ssthresh " << tcb->m_ssThresh <<
118 " with an increment of " << increment * tcb->m_segmentSize);
120 return segmentsAcked - 1;
134 while (segmentsAcked > 0)
140 segCwnd = tcb->GetCwndInSegments ();
141 increment = std::pow (
m_rho, 2) / ((double) segCwnd);
159 tcb->m_cWnd += inc * tcb->m_segmentSize;
162 NS_LOG_INFO (
"In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
163 " ssthresh " << tcb->m_ssThresh <<
164 " with an increment of " << inc * tcb->m_segmentSize);
171 return CopyObject<TcpHybla> (
this);
Simulation virtual time values and global simulation resolution.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Timing information on received ACK.
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 std::string GetName() const
Get the name of the congestion control algorithm.
#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.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
The NewReno implementation.
TcpHybla(void)
Create an unbound tcp socket.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
AttributeValue implementation for Time.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
Time m_minRtt
Minimum smoothed round trip time value seen.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void RecalcParam(Ptr< TcpSocketState > tcb, const Time &rtt)
Recalculate algorithm paramenters.
static TypeId GetTypeId(void)
Get the type ID.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
virtual uint32_t SlowStart(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Tcp NewReno slow start algorithm.
Implementation of the TCP Hybla algorithm.
a unique identifier for an interface.
double m_cWndCnt
cWnd integer-to-float counter
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
Time m_rRtt
Reference RTT.
TracedValue< double > m_rho
Rho parameter.