29 #include "ns3/simulator.h"    41     .AddConstructor<TcpHtcp> ()
    42     .SetGroupName (
"Internet")
    43     .AddAttribute (
"DefaultBackoff",
    44                    "The default AIMD backoff factor",
    47                    MakeDoubleChecker<double> (0,1))
    48     .AddAttribute (
"ThroughputRatio",
    49                    "Threshold value for updating beta",
    52                    MakeDoubleChecker<double> ())
    53     .AddAttribute (
"DeltaL",
    54                    "Delta_L parameter in increase function",
    84     m_alpha (sock.m_alpha),
    86     m_defaultBackoff (sock.m_defaultBackoff),
    87     m_throughputRatio (sock.m_throughputRatio),
    88     m_delta (sock.m_delta),
    89     m_deltaL (sock.m_deltaL),
    90     m_lastCon (sock.m_lastCon),
    91     m_minRtt (sock.m_minRtt),
    92     m_maxRtt (sock.m_maxRtt),
    93     m_throughput (sock.m_throughput),
    94     m_lastThroughput (sock.m_lastThroughput),
    95     m_dataSent (sock.m_dataSent)
   108   return CopyObject<TcpHtcp> (
this);
   112                                    uint32_t segmentsAcked)
   115   if (segmentsAcked > 0)
   120       tcb->
m_cWnd += 
static_cast<uint32_t
> (adder);
   141       m_alpha = (1 + 10 * diffSec + 0.25 * (diffSec * diffSec));
   170                                uint32_t bytesInFlight)
   179   uint32_t segWin = 2 * tcb->m_segmentSize;
   180   uint32_t bFlight = 
static_cast<uint32_t
> (bytesInFlight * 
m_beta);
   181   uint32_t ssThresh = 
std::max (segWin, bFlight);
 Time m_delta
Time in second that has elapsed since the. 
 
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance. 
 
Simulation virtual time values and global simulation resolution. 
 
double m_alpha
AIMD additive increase parameter. 
 
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 "...
 
Normal state, no dubious events. 
 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
 
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time). 
 
void UpdateAlpha(void)
Updates the additive increase parameter for H-TCP. 
 
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Timing information on received ACK. 
 
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit. 
 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
 
Time m_maxRtt
Maximum RTT in each congestion period. 
 
uint32_t m_segmentSize
Segment size. 
 
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO. 
 
The NewReno implementation. 
 
An implementation of the H-TCP variant of TCP. 
 
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time). 
 
void UpdateBeta(void)
Updates the multiplicative decrease factor beta for H-TCP. 
 
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum. 
 
  AttributeValue implementation for Time. 
 
static TypeId GetTypeId(void)
Get the type ID. 
 
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum. 
 
double GetDouble(void) const
Get the raw time value, in the current resolution unit. 
 
TracedValue< uint32_t > m_ssThresh
Slow start threshold. 
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
TracedValue< TcpCongState_t > m_congState
State in the Congestion state machine. 
 
Time m_minRtt
Minimum RTT in each congestion period. 
 
uint32_t m_lastThroughput
Throughput in last congestion period. 
 
uint32_t m_throughput
Current throughput since last congestion. 
 
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
 Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
 
Time m_deltaL
Threshold for switching between standard and new increase function. 
 
static Time Now(void)
Return the current simulation virtual time. 
 
TracedValue< uint32_t > m_cWnd
Congestion window. 
 
double m_defaultBackoff
default value when throughput ratio less than default 
 
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
 Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
 
double m_throughputRatio
ratio of two consequence throughput 
 
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event. 
 
virtual std::string GetName() const
Get the name of the congestion control algorithm. 
 
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG. 
 
Time Seconds(double value)
Construct a Time in the indicated unit. 
 
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets. 
 
TcpHtcp(void)
Create an unbound tcp socket. 
 
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. 
 
Time m_lastCon
Time of the last congestion for the flow. 
 
This class can be used to hold variables of floating point type such as 'double' or 'float'...
 
a unique identifier for an interface. 
 
uint32_t m_dataSent
Current amount of data sent since last congestion. 
 
TypeId SetParent(TypeId tid)
Set the parent TypeId. 
 
double m_beta
AIMD multiplicative decrease factor.