25#include "ns3/simulator.h"
38 TypeId(
"ns3::TcpWestwoodPlus")
40 .SetGroupName(
"Internet")
44 "Use this to choose no filter or Tustin's approximation filter",
48 .AddTraceSource(
"EstimatedBW",
49 "The estimated bandwidth",
51 "ns3::TracedValueCallback::DataRate");
69 m_currentBW(sock.m_currentBW),
70 m_lastSampleBW(sock.m_lastSampleBW),
71 m_lastBW(sock.m_lastBW),
72 m_fType(sock.m_fType),
73 m_IsCount(sock.m_IsCount)
120 constexpr double ALPHA = 0.9;
139 <<
" ssThresh: " << ssThresh);
141 return std::max(2 * tcb->m_segmentSize, ssThresh);
Class for representing data rates.
Hold variables of type enum.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
The NewReno implementation.
An implementation of TCP Westwood+.
void EstimateBW(const Time &rtt, Ptr< TcpSocketState > tcb)
Estimate the network's bandwidth.
TracedValue< DataRate > m_currentBW
Current value of the estimated BW.
DataRate m_lastBW
Last bandwidth sample after being filtered.
EventId m_bwEstimateEvent
The BW estimation event for Westwood+.
DataRate m_lastSampleBW
Last bandwidth sample.
uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight) override
Get the slow start threshold after a loss event.
void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t packetsAcked, const Time &rtt) override
Timing information on received ACK.
bool m_IsCount
Start keeping track of m_ackedSegments for Westwood+ if TRUE.
FilterType m_fType
0 for none, 1 for Tustin
uint32_t m_ackedSegments
The number of segments ACKed between RTTs.
static TypeId GetTypeId()
Get the type ID.
Ptr< TcpCongestionOps > Fork() override
Copy the congestion control algorithm across sockets.
~TcpWestwoodPlus() override
Simulation virtual time values and global simulation resolution.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
bool IsZero() const
Exactly equivalent to t == 0.
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,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
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.
Ptr< const AttributeChecker > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)