|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Time m_minRtt
Minimum RTT in each congestion period.
TcpHtcp(void)
Create an unbound tcp socket.
static TypeId GetTypeId(void)
Get the type ID.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t m_segmentSize
Segment size.
@ CA_OPEN
Normal state, no dubious events.
double m_throughputRatio
ratio of two consequence throughput
virtual std::string GetName() const
Get the name of the congestion control algorithm.
double m_beta
AIMD multiplicative decrease factor.
void UpdateAlpha(void)
Updates the additive increase parameter for H-TCP.
Time m_lastCon
Time of the last congestion for the flow.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Timing information on received ACK.
Time m_deltaL
Threshold for switching between standard and new increase function.
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
NewReno congestion avoidance.
Smart pointer class similar to boost::intrusive_ptr.
uint32_t m_throughput
Current throughput since last congestion.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
TracedValue< TcpCongState_t > m_congState
State in the Congestion state machine.
uint32_t m_dataSent
Current amount of data sent since last congestion.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Simulation virtual time values and global simulation resolution.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
#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.
The NewReno implementation.
AttributeValue implementation for Time.
double m_alpha
AIMD additive increase parameter.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
TracedValue< uint32_t > m_cWnd
Congestion window.
Time m_delta
Time in second that has elapsed since the.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
double GetDouble(void) const
Get the raw time value, in the current resolution unit.
Time m_maxRtt
Maximum RTT in each congestion period.
uint32_t m_lastThroughput
Throughput in last congestion period.
TracedValue< uint32_t > m_ssThresh
Slow start threshold.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
double m_defaultBackoff
default value when throughput ratio less than default
An implementation of the H-TCP variant of TCP.
void UpdateBeta(void)
Updates the multiplicative decrease factor beta for H-TCP.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.