17#include "ns3/simulator.h"
18#include "ns3/string.h"
19#include "ns3/uinteger.h"
38 .SetParent<QueueLimits>()
39 .SetGroupName(
"Network")
41 .AddAttribute(
"HoldTime",
42 "The DQL algorithm hold time",
46 .AddAttribute(
"MaxLimit",
51 .AddAttribute(
"MinLimit",
56 .AddTraceSource(
"Limit",
57 "Limit value calculated by DQL",
59 "ns3::TracedValueCallback::Uint32");
100 bool allPrevCompleted;
110 inprogress = numQueued - completed;
114 if ((ovlimit && !inprogress) || (
m_prevOvlimit && allPrevCompleted))
136 else if (inprogress && prevInprogress && !allPrevCompleted)
138 NS_LOG_DEBUG(
"Queue not starved, check decrease limit");
167 slack = std::max(slack, slackLastObjs);
220 return std::max((a - b), 0);
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 AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.