36 #include "ns3/simulator.h" 51 .SetGroupName (
"Internet")
53 .AddAttribute(
"FilterType",
"Use this to choose no filter or Tustin's approximation filter",
56 .AddAttribute(
"ProtocolType",
"Use this to let the code run as Westwood or WestwoodPlus",
60 .AddTraceSource(
"EstimatedBW",
"The estimated bandwidth",
62 "ns3::TracedValueCallback::Double")
80 m_currentBW (sock.m_currentBW),
81 m_lastSampleBW (sock.m_lastSampleBW),
82 m_lastBW (sock.m_lastBW),
83 m_pType (sock.m_pType),
84 m_fType (sock.m_fType),
85 m_IsCount (sock.m_IsCount)
162 uint32_t bytesInFlight)
166 tcb->m_minRtt <<
" ssthresh: " <<
167 m_currentBW * static_cast<double> (tcb->m_minRtt.GetSeconds ()));
169 return std::max (2*tcb->m_segmentSize,
170 uint32_t (
m_currentBW * static_cast<double> (tcb->m_minRtt.GetSeconds ())));
176 return CreateObject<TcpWestwood> (*this);
EventId m_bwEstimateEvent
The BW estimation event for Westwood+.
Simulation virtual time values and global simulation resolution.
#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.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
double m_lastBW
Last bandwidth sample after being filtered.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#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_UNUSED(x)
Mark a local variable as unused.
uint32_t m_segmentSize
Segment size.
The NewReno implementation.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t packetsAcked, const Time &rtt)
Timing information on received ACK.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
enum FilterType m_fType
0 for none, 1 for Tustin
Hold variables of type enum.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint32_t GetSsThresh(Ptr< const TcpSocketState > tcb, uint32_t bytesInFlight)
Get the slow start threshold after a loss event.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
virtual ~TcpWestwood(void)
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
double m_lastSampleBW
Last bandwidth sample.
void EstimateBW(const Time &rtt, Ptr< TcpSocketState > tcb)
Estimate the network's bandwidth.
TracedValue< double > m_currentBW
Current value of the estimated BW.
bool m_IsCount
Start keeping track of m_ackedSegments for Westwood+ if TRUE.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint32_t m_ackedSegments
The number of segments ACKed between RTTs.
An implementation of TCP Westwood and Westwood+.
enum ProtocolType m_pType
0 for Westwood, 1 for Westwood+