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");
140 factory.Set (n01, v01);
141 factory.Set (n02, v02);
142 factory.Set (n03, v03);
143 factory.Set (n04, v04);
144 factory.Set (n05, v05);
145 factory.Set (n06, v06);
146 factory.Set (n07, v07);
147 factory.Set (n08, v08);
148 factory.Set (n09, v09);
149 factory.Set (n10, v10);
150 factory.Set (n11, v11);
151 factory.Set (n12, v12);
152 factory.Set (n13, v13);
153 factory.Set (n14, v14);
154 factory.Set (n15, v15);
172 << handle <<
" does not exist");
178 factory.
Set (n01, v01);
179 factory.
Set (n02, v02);
180 factory.
Set (n03, v03);
181 factory.
Set (n04, v04);
182 factory.
Set (n05, v05);
183 factory.
Set (n06, v06);
184 factory.
Set (n07, v07);
185 factory.
Set (n08, v08);
187 for (
int i = 0; i < count; i++)
205 << handle <<
" does not exist");
209 factory.Set (n01, v01);
210 factory.Set (n02, v02);
211 factory.Set (n03, v03);
212 factory.Set (n04, v04);
213 factory.Set (n05, v05);
214 factory.Set (n06, v06);
215 factory.Set (n07, v07);
216 factory.Set (n08, v08);
233 << handle <<
" does not exist");
237 factory.Set (n01, v01);
238 factory.Set (n02, v02);
239 factory.Set (n03, v03);
240 factory.Set (n04, v04);
241 factory.Set (n05, v05);
242 factory.Set (n06, v06);
243 factory.Set (n07, v07);
244 factory.Set (n08, v08);
249 for (
int i = 0; i < count; i++)
252 list.push_back (classId);
276 << handle <<
" does not exist");
280 factory.Set (n01, v01);
281 factory.Set (n02, v02);
282 factory.Set (n03, v03);
283 factory.Set (n04, v04);
284 factory.Set (n05, v05);
285 factory.Set (n06, v06);
286 factory.Set (n07, v07);
287 factory.Set (n08, v08);
288 factory.Set (n09, v09);
289 factory.Set (n10, v10);
290 factory.Set (n11, v11);
291 factory.Set (n12, v12);
292 factory.Set (n13, v13);
293 factory.Set (n14, v14);
294 factory.Set (n15, v15);
323 for (ClassIdList::const_iterator c = classes.begin (); c != classes.end (); c++)
325 uint16_t childHandle =
AddChildQueueDisc (handle, *c, type, n01, v01, n02, v02, n03, v03,
326 n04, v04, n05, v05, n06, v06, n07, v07, n08, v08, n09, v09,
327 n10, v10, n11, v11, n12, v12, n13, v13, n14, v14, n15, v15);
328 list.push_back (childHandle);
392 NS_ABORT_MSG_IF (ndqi->GetNTxQueues () == 0,
"Could not install QueueLimits" 393 <<
"because the TX queues have not been created yet");
394 for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
397 ndqi->GetTxQueue (i)->SetQueueLimits (ql);
423 tc->DeleteRootQueueDiscOnDevice (d);
429 for (uint8_t i = 0; i < ndqi->GetNTxQueues (); i++)
431 ndqi->GetTxQueue (i)->SetQueueLimits (0);
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>.
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 ...
static TrafficControlHelper Default(void)
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.
void SetNetDevice(Ptr< NetDevice > device)
Set the NetDevice on which this queue discipline is installed.