|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/object-factory.h"
25 #include "ns3/queue.h"
26 #include "ns3/socket.h"
39 .SetGroupName (
"TrafficControl")
41 .AddAttribute (
"MaxSize",
42 "The maximum number of packets accepted by this queue disc.",
62 const uint32_t
PfifoFastQueueDisc::prio2band[16] = {1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
71 NS_LOG_LOGIC (
"Queue disc limit exceeded -- dropping packet");
78 if (item->GetPacket ()->PeekPacketTag (priorityTag))
83 uint32_t band =
prio2band[priority & 0x0f];
92 NS_LOG_WARN (
"Packet enqueue failed. Check the size of the internal queues");
111 NS_LOG_LOGIC (
"Popped from band " << i <<
": " << item);
132 NS_LOG_LOGIC (
"Peeked from band " << i <<
": " << item);
148 NS_LOG_ERROR (
"PfifoFastQueueDisc cannot have classes");
154 NS_LOG_ERROR (
"PfifoFastQueueDisc needs no packet filter");
162 factory.
SetTypeId (
"ns3::DropTailQueue<QueueDiscItem>");
171 NS_LOG_ERROR (
"PfifoFastQueueDisc needs 3 internal queues");
179 NS_LOG_ERROR (
"PfifoFastQueueDisc needs 3 internal queues operating in packet mode");
183 for (uint8_t i = 0; i < 2; i++)
187 NS_LOG_ERROR (
"The capacity of some internal queue(s) is less than the queue disc capacity");
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
QueueDiscSizePolicy
Enumeration of the available policies to handle the queue disc size.
@ MULTIPLE_QUEUES
Used by queue discs with multiple internal queues/child queue discs.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
bool SetMaxSize(QueueSize size)
Set the maximum size of the queue disc.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void InitializeParams(void)
Initialize parameters (if any) before the first packet is enqueued.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
QueueSize GetMaxSize(void) const
Get the maximum size of the queue disc.
Ptr< const AttributeChecker > MakeQueueSizeChecker(void)
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
@ PACKETS
Use number of packets for queue size.
std::size_t GetNPacketFilters(void) const
Get the number of packet filters.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const QueueDiscItem > Peek(void)
Get a copy of the next packet the queue discipline will extract.
Smart pointer class similar to boost::intrusive_ptr.
static constexpr const char * LIMIT_EXCEEDED_DROP
Packet dropped due to queue disc limit exceeded.
uint8_t GetPriority(void) const
Get the tag's priority.
Instantiate subclasses of ns3::Object.
Introspection did not find any typical Config paths.
void AddInternalQueue(Ptr< InternalQueue > queue)
Add an internal queue to the tail of the list of queues.
std::size_t GetNInternalQueues(void) const
Get the number of internal queues.
QueueSize GetCurrentSize(void)
Get the current size of the queue disc in bytes, if operating in bytes mode, or packets,...
static TypeId GetTypeId(void)
Get the type ID.
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
PfifoFastQueueDisc()
PfifoFastQueueDisc constructor.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Ptr< QueueDiscItem > Dequeue(void)
Extract from the queue disc the packet that has been dequeued by calling Peek, if any,...
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
uint32_t GetNPackets(void) const
Get the number of packets stored by the queue disc.
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
indicates whether the socket has a priority set.
virtual ~PfifoFastQueueDisc()
static const uint32_t prio2band[16]
Priority to band map.
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
QueueSizeUnit
Enumeration of the operating modes of queues.
Ptr< const AttributeAccessor > MakeQueueSizeAccessor(T1 a1)
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
std::size_t GetNQueueDiscClasses(void) const
Get the number of queue disc classes.
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.
Ptr< InternalQueue > GetInternalQueue(std::size_t i) const
Get the i-th internal queue.
Class for representing queue sizes.
virtual Ptr< const QueueDiscItem > DoPeek(void)
Return a copy of the next packet the queue disc will extract.
Linux pfifo_fast is the default priority queue enabled on Linux systems.