27 #include "ns3/uinteger.h"
28 #include "ns3/simulator.h"
29 #include "ns3/string.h"
48 .SetParent<QueueLimits> ()
49 .SetGroupName (
"Network")
51 .AddAttribute (
"HoldTime",
52 "The DQL algorithm hold time",
56 .AddAttribute (
"MaxLimit",
61 .AddAttribute (
"MinLimit",
65 MakeUintegerChecker<uint32_t> ())
66 .AddTraceSource (
"Limit",
67 "Limit value calculated by DQL",
69 "ns3::TracedValueCallback::Uint32")
105 uint32_t inprogress, prevInprogress, limit;
106 uint32_t ovlimit, completed, numQueued;
107 bool allPrevCompleted;
117 inprogress = numQueued - completed;
121 if ((ovlimit && !inprogress) || (
m_prevOvlimit && allPrevCompleted))
143 else if (inprogress && prevInprogress && !allPrevCompleted)
145 NS_LOG_DEBUG (
"Queue not starved, check decrease limit");
157 uint32_t slack, slackLastObjs;
173 slack =
std::max (slack, slackLastObjs);
DynamicQueueLimits would be used in conjunction with a producer/consumer type queue (possibly a netde...
uint32_t m_adjLimit
limit + num_completed
uint32_t m_numCompleted
Total ever completed.
virtual ~DynamicQueueLimits()
static TypeId GetTypeId(void)
Get the type ID.
Time m_slackStartTime
Time slacks seen.
uint32_t m_numQueued
Total ever queued.
uint32_t m_prevOvlimit
Previous over limit.
uint32_t m_minLimit
Minimum limit.
Time m_slackHoldTime
Time to measure slack.
virtual int32_t Available() const
Available is called from NotifyTransmittedBytes to calculate the number of bytes that can be passed a...
uint32_t m_prevNumQueued
Previous queue total.
virtual void Queued(uint32_t count)
Record the number of bytes queued.
virtual void Reset()
Reset queue limits state.
uint32_t m_lastObjCnt
Count at last queuing.
uint32_t m_prevLastObjCnt
Previous queuing cnt.
int32_t Posdiff(int32_t a, int32_t b)
Calculates the difference between the two operators and returns the number if positive,...
uint32_t m_lowestSlack
Lowest slack found.
TracedValue< uint32_t > m_limit
Current limit.
uint32_t m_maxLimit
Max limit.
virtual void Completed(uint32_t count)
Record number of completed bytes and recalculate the limit.
A base class which provides memory management and object aggregation.
static Time Now(void)
Return the current simulation virtual time.
Hold variables of type string.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
static const uint32_t DQL_MAX_LIMIT
static const uint32_t UINTMAX
static const uint32_t DQL_MAX_OBJECT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#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_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 > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.