30 #include "ns3/uinteger.h" 31 #include "ns3/double.h" 32 #include "ns3/simulator.h" 33 #include "ns3/abort.h" 35 #include "ns3/drop-tail-queue.h" 36 #include "ns3/net-device-queue-interface.h" 48 .SetGroupName (
"TrafficControl")
50 .AddAttribute (
"MeanPktSize",
51 "Average of packet size",
54 MakeUintegerChecker<uint32_t> ())
59 MakeDoubleChecker<double> ())
64 MakeDoubleChecker<double> ())
65 .AddAttribute (
"Tupdate",
66 "Time period to calculate drop probability",
70 .AddAttribute (
"Supdate",
71 "Start time of the update timer",
75 .AddAttribute (
"MaxSize",
76 "The maximum number of packets accepted by this queue disc",
81 .AddAttribute (
"DequeueThreshold",
82 "Minimum queue size in bytes before dequeue rate is measured",
85 MakeUintegerChecker<uint32_t> ())
86 .AddAttribute (
"QueueDelayReference",
87 "Desired queue delay",
91 .AddAttribute (
"MaxBurstAllowance",
92 "Current max burst allowance in seconds before random drop",
105 m_uv = CreateObject<UniformRandomVariable> ();
206 bool earlyDrop =
true;
239 bool missingInitFlag =
false;
247 missingInitFlag =
true;
357 uint32_t pktSize = item->GetSize ();
421 NS_LOG_ERROR (
"PieQueueDisc cannot have packet filters");
Simulation virtual time values and global simulation resolution.
Time m_tUpdate
Time period after which CalculateP () is called.
uint32_t GetNPackets(void) const
Get the number of packets stored by the queue disc.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
Class for representing queue sizes.
void DropBeforeEnqueue(Ptr< const QueueDiscItem > item, const char *reason)
Perform the actions required when the queue disc is notified of a packet dropped before enqueue...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
double m_avgDqRate
Time averaged dequeue rate.
Time m_maxBurst
Maximum burst allowed before random early dropping kicks in.
uint32_t GetValue() const
Get the underlying value.
double m_a
Parameter to pie controller.
QueueSize GetCurrentSize(void)
Get the current size of the queue disc in bytes, if operating in bytes mode, or packets, otherwise.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static constexpr const char * FORCED_DROP
Drops due to queue limit: reactive.
virtual void InitializeParams(void)
Initialize the queue parameters.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t GetNBytes(void) const
Get the amount of bytes stored by the queue disc.
uint32_t m_burstReset
Used to reset value of burst allowance.
static constexpr const char * UNFORCED_DROP
Early probability drops: proactive.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Implements PIE Active Queue Management discipline.
Time m_qDelayRef
Desired queue delay.
double m_dropProb
Variable used in calculation of drop probability.
uint32_t m_meanPktSize
Average packet size in bytes.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
void AddInternalQueue(Ptr< InternalQueue > queue)
Add an internal queue to the tail of the list of queues.
Time GetQueueDelay(void)
Get queue delay.
Ptr< T > CreateObjectWithAttributes(std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
Allocate an Object on the heap and initialize with a set of attributes.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
AttributeValue implementation for Time.
Ptr< InternalQueue > GetInternalQueue(std::size_t i) const
Get the i-th internal queue.
Hold an unsigned integer type.
Use number of packets for queue size.
Time m_sUpdate
Start time of the update timer.
uint32_t m_dqThreshold
Minimum queue size in bytes before dequeue rate is measured.
#define BURST_RESET_TIMEOUT
Ptr< const AttributeAccessor > MakeQueueSizeAccessor(T1 a1)
virtual void DoDispose(void)
Dispose of the object.
Time m_qDelayOld
Old value of queue delay.
double m_dqStart
Start timestamp of current measurement cycle.
bool DropEarly(Ptr< QueueDiscItem > item, uint32_t qSize)
Check if a packet needs to be dropped due to probability drop.
virtual void DoDispose(void)
Dispose of the object.
Introspection did not find any typical Config paths.
Ptr< const AttributeChecker > MakeQueueSizeChecker(void)
void CalculateP()
Periodically update the drop probability based on the delay samples: not only the current delay sampl...
static void Remove(const EventId &id)
Remove an event from the event list.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::size_t GetNQueueDiscClasses(void) const
Get the number of queue disc classes.
EventId m_rtrsEvent
Event used to decide the decision of interval of drop probability calculation.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static Time Now(void)
Return the current simulation virtual time.
Ptr< UniformRandomVariable > m_uv
Rng stream.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
PieQueueDisc()
PieQueueDisc Constructor.
QueueSize GetMaxSize(void) const
Get the maximum size of the queue disc.
QueueSizeUnit GetUnit() const
Get the underlying unit.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
QueueDiscSizePolicy
Enumeration of the available policies to handle the queue disc size.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Used by queue discs with single internal queue.
Time m_qDelay
Current value of queue delay.
static TypeId GetTypeId(void)
Get the type ID.
std::size_t GetNPacketFilters(void) const
Get the number of packet filters.
BurstStateT m_burstState
Used to determine the current state of burst.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time m_burstAllowance
Current max burst value in seconds that is allowed before random drops kick in.
bool SetMaxSize(QueueSize size)
Set the maximum size of the queue disc.
virtual ~PieQueueDisc()
PieQueueDisc Destructor.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
static const uint32_t packetSize
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
double m_b
Parameter to pie controller.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Use number of bytes for queue size.
uint64_t m_dqCount
Number of bytes departed since current measurement cycle starts.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
static const uint64_t DQCOUNT_INVALID
Invalid dqCount value.
bool m_inMeasurement
Indicates whether we are in a measurement cycle.
std::size_t GetNInternalQueues(void) const
Get the number of internal queues.