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);
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.
static Time Now(void)
Return the current simulation virtual time.
An implementation of the H-TCP variant of TCP.
Time m_minRtt
Minimum RTT in each congestion period.
Time m_lastCon
Time of the last congestion for the flow.
double m_defaultBackoff
default value when throughput ratio less than default
uint32_t m_dataSent
Current amount of data sent since last congestion.
void UpdateAlpha(void)
Updates the additive increase parameter for H-TCP.
double m_throughputRatio
ratio of two consequence throughput
Time m_delta
Time in second that has elapsed since the.
uint32_t m_lastThroughput
Throughput in last congestion period.
static TypeId GetTypeId(void)
Get the type ID.
double m_alpha
AIMD additive increase parameter.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
double m_beta
AIMD multiplicative decrease factor.
Time m_deltaL
Threshold for switching between standard and new increase function.
void UpdateBeta(void)
Updates the multiplicative decrease factor beta for H-TCP.
Time m_maxRtt
Maximum RTT in each congestion period.
TcpHtcp(void)
Create an unbound tcp socket.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Timing information on received ACK.
virtual std::string GetName() const
Get the name of the congestion control algorithm.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
uint32_t m_throughput
Current throughput since last congestion.
The NewReno implementation.
uint32_t m_segmentSize
Segment size.
TracedValue< TcpCongState_t > m_congState
State in the Congestion state machine.
@ CA_OPEN
Normal state, no dubious events.
TracedValue< uint32_t > m_cWnd
Congestion window.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
Simulation virtual time values and global simulation resolution.
double GetDouble(void) const
Get the raw time value, in the current resolution unit.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
#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 Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.