28 #include "ns3/simulator.h"
29 #include "ns3/string.h"
30 #include "ns3/uinteger.h"
49 .SetParent<QueueLimits>()
50 .SetGroupName(
"Network")
52 .AddAttribute(
"HoldTime",
53 "The DQL algorithm hold time",
57 .AddAttribute(
"MaxLimit",
62 .AddAttribute(
"MinLimit",
66 MakeUintegerChecker<uint32_t>())
67 .AddTraceSource(
"Limit",
68 "Limit value calculated by DQL",
70 "ns3::TracedValueCallback::Uint32");
106 uint32_t prevInprogress;
111 bool allPrevCompleted;
121 inprogress = numQueued - completed;
125 if ((ovlimit && !inprogress) || (
m_prevOvlimit && allPrevCompleted))
147 else if (inprogress && prevInprogress && !allPrevCompleted)
149 NS_LOG_DEBUG(
"Queue not starved, check decrease limit");
162 uint32_t slackLastObjs;
178 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
~DynamicQueueLimits() override
void Reset() override
Reset queue limits state.
uint32_t m_numCompleted
Total ever completed.
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.
uint32_t m_prevNumQueued
Previous queue total.
uint32_t m_lastObjCnt
Count at last queuing.
uint32_t m_prevLastObjCnt
Previous queuing cnt.
static TypeId GetTypeId()
Get the type ID.
void Completed(uint32_t count) override
Record number of completed bytes and recalculate the limit.
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.
int32_t Available() const override
Available is called from NotifyTransmittedBytes to calculate the number of bytes that can be passed a...
TracedValue< uint32_t > m_limit
Current limit.
void Queued(uint32_t count) override
Record the number of bytes queued.
uint32_t m_maxLimit
Max limit.
A base class which provides memory management and object aggregation.
static Time Now()
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,...
#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 AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)