22 #include "ns3/abort.h" 23 #include "ns3/queue-limits.h" 24 #include "ns3/queue.h" 25 #include "ns3/net-device-queue-interface.h" 26 #include "ns3/uinteger.h" 27 #include "ns3/pointer.h" 28 #include "ns3/traffic-control-layer.h" 36 : m_queueDiscFactory (factory)
63 "Cannot attach a queue disc to a non existing class");
92 "Cannot create a queue disc class with no attached queue disc");
95 NS_ABORT_MSG_IF (handle >= queueDiscs.size () || queueDiscs[handle] == 0,
96 "A queue disc with handle " << handle <<
" has not been created yet");
114 NS_ABORT_MSG_IF (nTxQueues == 0,
"The device must have at least one queue");
152 factory.Set (n01, v01);
153 factory.Set (n02, v02);
154 factory.Set (n03, v03);
155 factory.Set (n04, v04);
156 factory.Set (n05, v05);
157 factory.Set (n06, v06);
158 factory.Set (n07, v07);
159 factory.Set (n08, v08);
160 factory.Set (n09, v09);
161 factory.Set (n10, v10);
162 factory.Set (n11, v11);
163 factory.Set (n12, v12);
164 factory.Set (n13, v13);
165 factory.Set (n14, v14);
166 factory.Set (n15, v15);
184 << handle <<
" does not exist");
190 factory.
Set (n01, v01);
191 factory.
Set (n02, v02);
192 factory.
Set (n03, v03);
193 factory.
Set (n04, v04);
194 factory.
Set (n05, v05);
195 factory.
Set (n06, v06);
196 factory.
Set (n07, v07);
197 factory.
Set (n08, v08);
199 for (
int i = 0; i < count; i++)
217 << handle <<
" does not exist");
221 factory.Set (n01, v01);
222 factory.Set (n02, v02);
223 factory.Set (n03, v03);
224 factory.Set (n04, v04);
225 factory.Set (n05, v05);
226 factory.Set (n06, v06);
227 factory.Set (n07, v07);
228 factory.Set (n08, v08);
245 << handle <<
" does not exist");
249 factory.Set (n01, v01);
250 factory.Set (n02, v02);
251 factory.Set (n03, v03);
252 factory.Set (n04, v04);
253 factory.Set (n05, v05);
254 factory.Set (n06, v06);
255 factory.Set (n07, v07);
256 factory.Set (n08, v08);
261 for (
int i = 0; i < count; i++)
264 list.push_back (classId);
288 << handle <<
" does not exist");
292 factory.Set (n01, v01);
293 factory.Set (n02, v02);
294 factory.Set (n03, v03);
295 factory.Set (n04, v04);
296 factory.Set (n05, v05);
297 factory.Set (n06, v06);
298 factory.Set (n07, v07);
299 factory.Set (n08, v08);
300 factory.Set (n09, v09);
301 factory.Set (n10, v10);
302 factory.Set (n11, v11);
303 factory.Set (n12, v12);
304 factory.Set (n13, v13);
305 factory.Set (n14, v14);
306 factory.Set (n15, v15);
335 for (ClassIdList::const_iterator c = classes.begin (); c != classes.end (); c++)
337 uint16_t childHandle =
AddChildQueueDisc (handle, *c, type, n01, v01, n02, v02, n03, v03,
338 n04, v04, n05, v05, n06, v06, n07, v07, n08, v08, n09, v09,
339 n10, v10, n11, v11, n12, v12, n13, v13, n14, v14, n15, v15);
340 list.push_back (childHandle);
400 NS_ABORT_MSG_IF (!ndqi,
"A NetDeviceQueueInterface object has not been" 401 "aggregated to the NetDevice");
402 for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
405 ndqi->GetTxQueue (i)->SetQueueLimits (ql);
431 tc->DeleteRootQueueDiscOnDevice (d);
437 for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
439 ndqi->GetTxQueue (i)->SetQueueLimits (0);
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
QueueDiscContainer Install(NetDeviceContainer c)
QueueDiscFactory()
Default constructor.
void AddQueueDiscClass(Ptr< QueueDiscClass > qdClass)
Add a queue disc class to the tail of the list of classes.
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
Introspection did not find any typical Config paths.
Hold a value for an Attribute.
std::vector< ObjectFactory > m_queueDiscClassesFactory
Vector of factories to create queue disc classes.
#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.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
std::vector< Ptr< QueueDisc > > m_queueDiscs
Vector of all the created queue discs.
void Uninstall(NetDeviceContainer c)
ClassIdList AddQueueDiscClasses(uint16_t handle, uint16_t count, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add the given number of queue disc classes (of the given type and with the gi...
void AddPacketFilter(uint16_t handle, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add a packet filter (of the given type and with the given attributes) to the ...
Abstract base class for NetDevice queue length controller.
static void AppendItemTypeIfNotPresent(std::string &typeId, const std::string &itemType)
Append the item type to the provided type ID if the latter does not end with '>'. ...
void SetChildQueueDisc(uint16_t classId, uint16_t handle)
Set the (child) queue disc to attach to a class.
Holds a vector of ns3::QueueDisc pointers.
ObjectFactory m_queueDiscFactory
Factory to create this queue disc.
void AddInternalQueue(Ptr< InternalQueue > queue)
Add an internal queue to the tail of the list of queues.
TrafficControlHelper()
Create a TrafficControlHelper to make life easier when creating QueueDisc objects.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
holds a vector of ns3::NetDevice pointers
Build a set of QueueDisc objects.
void SetQueueLimits(std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add a queue limits object to the transmission queues of the devices...
Ptr< QueueDisc > CreateQueueDisc(const std::vector< Ptr< QueueDisc > > &queueDiscs)
Create a queue disc with the currently stored configuration.
Network device transmission queue interface.
HandleList AddChildQueueDiscs(uint16_t handle, const ClassIdList &classes, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue(), std::string n09="", const AttributeValue &v09=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue(), std::string n11="", const AttributeValue &v11=EmptyAttributeValue(), std::string n12="", const AttributeValue &v12=EmptyAttributeValue(), std::string n13="", const AttributeValue &v13=EmptyAttributeValue(), std::string n14="", const AttributeValue &v14=EmptyAttributeValue(), std::string n15="", const AttributeValue &v15=EmptyAttributeValue())
Helper function used to attach a child queue disc (of the given type and with the given attributes) t...
uint16_t AddChildQueueDisc(uint16_t handle, uint16_t classId, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue(), std::string n09="", const AttributeValue &v09=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue(), std::string n11="", const AttributeValue &v11=EmptyAttributeValue(), std::string n12="", const AttributeValue &v12=EmptyAttributeValue(), std::string n13="", const AttributeValue &v13=EmptyAttributeValue(), std::string n14="", const AttributeValue &v14=EmptyAttributeValue(), std::string n15="", const AttributeValue &v15=EmptyAttributeValue())
Helper function used to attach a child queue disc (of the given type and with the given attributes) t...
std::vector< uint16_t > ClassIdList
Container type for Class IDs.
uint16_t AddQueueDiscClass(ObjectFactory factory)
Add a factory to create a queue disc class.
uint16_t GetUid(void) const
Get the internal id of this TypeId.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr<T>.
static TrafficControlHelper Default(std::size_t nTxQueues=1)
uint16_t SetRootQueueDisc(std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue(), std::string n09="", const AttributeValue &v09=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue(), std::string n11="", const AttributeValue &v11=EmptyAttributeValue(), std::string n12="", const AttributeValue &v12=EmptyAttributeValue(), std::string n13="", const AttributeValue &v13=EmptyAttributeValue(), std::string n14="", const AttributeValue &v14=EmptyAttributeValue(), std::string n15="", const AttributeValue &v15=EmptyAttributeValue())
Helper function used to set a root queue disc of the given type and with the given attributes...
std::vector< ObjectFactory > m_internalQueuesFactory
Vector of factories to create internal queues.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
void AddInternalQueue(ObjectFactory factory)
Add a factory to create an internal queue.
ObjectFactory m_queueLimitsFactory
Factory to create a queue limits object.
void AddPacketFilter(ObjectFactory factory)
Add a factory to create a packet filter.
TypeId GetTypeId(void) const
Get the TypeId which will be created by this ObjectFactory.
Instantiate subclasses of ns3::Object.
std::vector< ObjectFactory > m_packetFiltersFactory
Vector of factories to create packet filters.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
std::vector< QueueDiscFactory > m_queueDiscFactory
QueueDisc factory, stores the configuration of all the queue discs.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
void AddInternalQueues(uint16_t handle, uint16_t count, std::string type, std::string n01="", const AttributeValue &v01=EmptyAttributeValue(), std::string n02="", const AttributeValue &v02=EmptyAttributeValue(), std::string n03="", const AttributeValue &v03=EmptyAttributeValue(), std::string n04="", const AttributeValue &v04=EmptyAttributeValue(), std::string n05="", const AttributeValue &v05=EmptyAttributeValue(), std::string n06="", const AttributeValue &v06=EmptyAttributeValue(), std::string n07="", const AttributeValue &v07=EmptyAttributeValue(), std::string n08="", const AttributeValue &v08=EmptyAttributeValue())
Helper function used to add the given number of internal queues (of the given type and with the given...
Introspection did not find any typical Config paths.
std::map< uint16_t, uint16_t > m_classIdChildHandleMap
Map storing the associations between class IDs and child queue disc handles.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
PacketFilter is the abstract base class for filters used by queue discs to classify packets...
void AddPacketFilter(Ptr< PacketFilter > filter)
Add a packet filter to the tail of the list of filters used to classify packets.
This class stores object factories required to create a queue disc and all of its components (packet ...
void Add(QueueDiscContainer other)
Append the contents of another QueueDiscContainer to the end of this container.
std::vector< uint16_t > HandleList
Container type for Handlers.