A Discrete-Event Network Simulator
API
fq-pie-queue-disc.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
4  * Copyright (c) 2018 NITK Surathkal (modified for FQ-PIE)
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Pasquale Imputato <p.imputato@gmail.com>
20  * Stefano Avallone <stefano.avallone@unina.it>
21  * Modified for FQ-PIE by: Sumukha PK <sumukhapk46@gmail.com>
22  * Prajval M <26prajval98@gmail.com>
23  * Ishaan R D <ishaanrd6@gmail.com>
24  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
25  */
26 
27 
28 #include "ns3/log.h"
29 #include "ns3/string.h"
30 #include "ns3/queue.h"
31 #include "fq-pie-queue-disc.h"
32 #include "pie-queue-disc.h"
33 #include "ns3/net-device-queue-interface.h"
34 
35 namespace ns3 {
36 
37 NS_LOG_COMPONENT_DEFINE ("FqPieQueueDisc");
38 
39 NS_OBJECT_ENSURE_REGISTERED (FqPieFlow);
40 
42 {
43  static TypeId tid = TypeId ("ns3::FqPieFlow")
45  .SetGroupName ("TrafficControl")
46  .AddConstructor<FqPieFlow> ()
47  ;
48  return tid;
49 }
50 
52  : m_deficit (0),
53  m_status (INACTIVE),
54  m_index (0)
55 {
56  NS_LOG_FUNCTION (this);
57 }
58 
60 {
61  NS_LOG_FUNCTION (this);
62 }
63 
64 void
65 FqPieFlow::SetDeficit (uint32_t deficit)
66 {
67  NS_LOG_FUNCTION (this << deficit);
68  m_deficit = deficit;
69 }
70 
71 int32_t
73 {
74  NS_LOG_FUNCTION (this);
75  return m_deficit;
76 }
77 
78 void
79 FqPieFlow::IncreaseDeficit (int32_t deficit)
80 {
81  NS_LOG_FUNCTION (this << deficit);
82  m_deficit += deficit;
83 }
84 
85 void
87 {
88  NS_LOG_FUNCTION (this);
89  m_status = status;
90 }
91 
94 {
95  NS_LOG_FUNCTION (this);
96  return m_status;
97 }
98 
99 void
100 FqPieFlow::SetIndex (uint32_t index)
101 {
102  NS_LOG_FUNCTION (this);
103  m_index = index;
104 }
105 
106 uint32_t
108 {
109  return m_index;
110 }
111 
112 
114 
116 {
117  static TypeId tid = TypeId ("ns3::FqPieQueueDisc")
118  .SetParent<QueueDisc> ()
119  .SetGroupName ("TrafficControl")
120  .AddConstructor<FqPieQueueDisc> ()
121  .AddAttribute ("UseEcn",
122  "True to use ECN (packets are marked instead of being dropped)",
123  BooleanValue (true),
126  .AddAttribute ("MarkEcnThreshold",
127  "ECN marking threshold (RFC 8033 suggests 0.1 (i.e., 10%) default)",
128  DoubleValue (0.1),
130  MakeDoubleChecker<double> (0, 1))
131  .AddAttribute ("CeThreshold",
132  "The FqPie CE threshold for marking packets",
133  TimeValue (Time::Max ()),
135  MakeTimeChecker ())
136  .AddAttribute ("UseL4s",
137  "True to use L4S (only ECT1 packets are marked at CE threshold)",
138  BooleanValue (false),
141  .AddAttribute ("MeanPktSize",
142  "Average of packet size",
143  UintegerValue (1000),
145  MakeUintegerChecker<uint32_t> ())
146  .AddAttribute ("A",
147  "Value of alpha",
148  DoubleValue (0.125),
150  MakeDoubleChecker<double> ())
151  .AddAttribute ("B",
152  "Value of beta",
153  DoubleValue (1.25),
155  MakeDoubleChecker<double> ())
156  .AddAttribute ("Tupdate",
157  "Time period to calculate drop probability",
158  TimeValue (Seconds (0.015)),
160  MakeTimeChecker ())
161  .AddAttribute ("Supdate",
162  "Start time of the update timer",
163  TimeValue (Seconds (0)),
165  MakeTimeChecker ())
166  .AddAttribute ("MaxSize",
167  "The maximum number of packets accepted by this queue disc",
168  QueueSizeValue (QueueSize ("10240p")),
172  .AddAttribute ("DequeueThreshold",
173  "Minimum queue size in bytes before dequeue rate is measured",
174  UintegerValue (16384),
176  MakeUintegerChecker<uint32_t> ())
177  .AddAttribute ("QueueDelayReference",
178  "Desired queue delay",
179  TimeValue (Seconds (0.015)),
181  MakeTimeChecker ())
182  .AddAttribute ("MaxBurstAllowance",
183  "Current max burst allowance before random drop",
184  TimeValue (Seconds (0.15)),
186  MakeTimeChecker ())
187  .AddAttribute ("UseDequeueRateEstimator",
188  "Enable/Disable usage of Dequeue Rate Estimator",
189  BooleanValue (false),
192  .AddAttribute ("UseCapDropAdjustment",
193  "Enable/Disable Cap Drop Adjustment feature mentioned in RFC 8033",
194  BooleanValue (true),
197  .AddAttribute ("UseDerandomization",
198  "Enable/Disable Derandomization feature mentioned in RFC 8033",
199  BooleanValue (false),
202  .AddAttribute ("Flows",
203  "The number of queues into which the incoming packets are classified",
204  UintegerValue (1024),
206  MakeUintegerChecker<uint32_t> ())
207  .AddAttribute ("DropBatchSize",
208  "The maximum number of packets dropped from the fat flow",
209  UintegerValue (64),
211  MakeUintegerChecker<uint32_t> ())
212  .AddAttribute ("Perturbation",
213  "The salt used as an additional input to the hash function used to classify packets",
214  UintegerValue (0),
216  MakeUintegerChecker<uint32_t> ())
217  .AddAttribute ("EnableSetAssociativeHash",
218  "Enable/Disable Set Associative Hash",
219  BooleanValue (false),
222  .AddAttribute ("SetWays",
223  "The size of a set of queues (used by set associative hash)",
224  UintegerValue (8),
226  MakeUintegerChecker<uint32_t> ())
227  ;
228  return tid;
229 }
230 
233  m_quantum (0)
234 {
235  NS_LOG_FUNCTION (this);
236 }
237 
239 {
240  NS_LOG_FUNCTION (this);
241 }
242 
243 void
244 FqPieQueueDisc::SetQuantum (uint32_t quantum)
245 {
246  NS_LOG_FUNCTION (this << quantum);
247  m_quantum = quantum;
248 }
249 
250 uint32_t
252 {
253  return m_quantum;
254 }
255 
256 uint32_t
258 {
259  NS_LOG_FUNCTION (this << flowHash);
260 
261  uint32_t h = (flowHash % m_flows);
262  uint32_t innerHash = h % m_setWays;
263  uint32_t outerHash = h - innerHash;
264 
265  for (uint32_t i = outerHash; i < outerHash + m_setWays; i++)
266  {
267  auto it = m_flowsIndices.find (i);
268 
269  if (it == m_flowsIndices.end ()
270  || (m_tags.find (i) != m_tags.end () && m_tags[i] == flowHash)
271  || StaticCast<FqPieFlow> (GetQueueDiscClass (it->second))->GetStatus () == FqPieFlow::INACTIVE)
272  {
273  // this queue has not been created yet or is associated with this flow
274  // or is inactive, hence we can use it
275  m_tags[i] = flowHash;
276  return i;
277  }
278  }
279 
280  // all the queues of the set are used. Use the first queue of the set
281  m_tags[outerHash] = flowHash;
282  return outerHash;
283 }
284 
285 bool
287 {
288  NS_LOG_FUNCTION (this << item);
289 
290  uint32_t flowHash, h;
291 
292  if (GetNPacketFilters () == 0)
293  {
294  flowHash = item->Hash (m_perturbation);
295  }
296  else
297  {
298  int32_t ret = Classify (item);
299 
300  if (ret != PacketFilter::PF_NO_MATCH)
301  {
302  flowHash = static_cast<uint32_t> (ret);
303  }
304  else
305  {
306  NS_LOG_ERROR ("No filter has been able to classify this packet, drop it.");
308  return false;
309  }
310  }
311 
313  {
314  h = SetAssociativeHash (flowHash);
315  }
316  else
317  {
318  h = flowHash % m_flows;
319  }
320 
321  Ptr<FqPieFlow> flow;
322  if (m_flowsIndices.find (h) == m_flowsIndices.end ())
323  {
324  NS_LOG_DEBUG ("Creating a new flow queue with index " << h);
325  flow = m_flowFactory.Create<FqPieFlow> ();
327  // If Pie, Set values of PieQueueDisc to match this QueueDisc
328  Ptr<PieQueueDisc> pie = qd->GetObject<PieQueueDisc> ();
329  if (pie)
330  {
331  pie->SetAttribute ("UseEcn", BooleanValue (m_useEcn));
332  pie->SetAttribute ("CeThreshold", TimeValue (m_ceThreshold));
333  pie->SetAttribute ("UseL4s", BooleanValue (m_useL4s));
334  }
335  qd->Initialize ();
336  flow->SetQueueDisc (qd);
337  flow->SetIndex (h);
338  AddQueueDiscClass (flow);
339 
341  }
342  else
343  {
344  flow = StaticCast<FqPieFlow> (GetQueueDiscClass (m_flowsIndices[h]));
345  }
346 
347  if (flow->GetStatus () == FqPieFlow::INACTIVE)
348  {
349  flow->SetStatus (FqPieFlow::NEW_FLOW);
350  flow->SetDeficit (m_quantum);
351  m_newFlows.push_back (flow);
352  }
353 
354  flow->GetQueueDisc ()->Enqueue (item);
355 
356  NS_LOG_DEBUG ("Packet enqueued into flow " << h << "; flow index " << m_flowsIndices[h]);
357 
358  if (GetCurrentSize () > GetMaxSize ())
359  {
360  NS_LOG_DEBUG ("Overload; enter FqPieDrop ()");
361  FqPieDrop ();
362  }
363 
364  return true;
365 }
366 
369 {
370  NS_LOG_FUNCTION (this);
371 
372  Ptr<FqPieFlow> flow;
373  Ptr<QueueDiscItem> item;
374 
375  do
376  {
377  bool found = false;
378 
379  while (!found && !m_newFlows.empty ())
380  {
381  flow = m_newFlows.front ();
382 
383  if (flow->GetDeficit () <= 0)
384  {
385  NS_LOG_DEBUG ("Increase deficit for new flow index " << flow->GetIndex ());
386  flow->IncreaseDeficit (m_quantum);
387  flow->SetStatus (FqPieFlow::OLD_FLOW);
388  m_oldFlows.push_back (flow);
389  m_newFlows.pop_front ();
390  }
391  else
392  {
393  NS_LOG_DEBUG ("Found a new flow " << flow->GetIndex () << " with positive deficit");
394  found = true;
395  }
396  }
397 
398  while (!found && !m_oldFlows.empty ())
399  {
400  flow = m_oldFlows.front ();
401 
402  if (flow->GetDeficit () <= 0)
403  {
404  NS_LOG_DEBUG ("Increase deficit for old flow index " << flow->GetIndex ());
405  flow->IncreaseDeficit (m_quantum);
406  m_oldFlows.push_back (flow);
407  m_oldFlows.pop_front ();
408  }
409  else
410  {
411  NS_LOG_DEBUG ("Found an old flow " << flow->GetIndex () << " with positive deficit");
412  found = true;
413  }
414  }
415 
416  if (!found)
417  {
418  NS_LOG_DEBUG ("No flow found to dequeue a packet");
419  return 0;
420  }
421 
422  item = flow->GetQueueDisc ()->Dequeue ();
423 
424  if (!item)
425  {
426  NS_LOG_DEBUG ("Could not get a packet from the selected flow queue");
427  if (!m_newFlows.empty ())
428  {
429  flow->SetStatus (FqPieFlow::OLD_FLOW);
430  m_oldFlows.push_back (flow);
431  m_newFlows.pop_front ();
432  }
433  else
434  {
435  flow->SetStatus (FqPieFlow::INACTIVE);
436  m_oldFlows.pop_front ();
437  }
438  }
439  else
440  {
441  NS_LOG_DEBUG ("Dequeued packet " << item->GetPacket ());
442  }
443  }
444  while (item == 0);
445 
446  flow->IncreaseDeficit (item->GetSize () * -1);
447 
448  return item;
449 }
450 
451 bool
453 {
454  NS_LOG_FUNCTION (this);
455  if (GetNQueueDiscClasses () > 0)
456  {
457  NS_LOG_ERROR ("FqPieQueueDisc cannot have classes");
458  return false;
459  }
460 
461  if (GetNInternalQueues () > 0)
462  {
463  NS_LOG_ERROR ("FqPieQueueDisc cannot have internal queues");
464  return false;
465  }
466  // we are at initialization time. If the user has not set a quantum value,
467  // set the quantum to the MTU of the device (if any)
468  if (!m_quantum)
469  {
471  Ptr<NetDevice> dev;
472  // if the NetDeviceQueueInterface object is aggregated to a
473  // NetDevice, get the MTU of such NetDevice
474  if (ndqi && (dev = ndqi->GetObject<NetDevice> ()))
475  {
476  m_quantum = dev->GetMtu ();
477  NS_LOG_DEBUG ("Setting the quantum to the MTU of the device: " << m_quantum);
478  }
479 
480  if (!m_quantum)
481  {
482  NS_LOG_ERROR ("The quantum parameter cannot be null");
483  return false;
484  }
485  }
486 
488  {
489  NS_LOG_ERROR ("The number of queues must be an integer multiple of the size "
490  "of the set of queues used by set associative hash");
491  return false;
492  }
493 
494  // If UseL4S attribute is enabled then CE threshold must be set.
495  if (m_useL4s)
496  {
497  NS_ABORT_MSG_IF (m_ceThreshold == Time::Max (), "CE threshold not set");
498  if (m_useEcn == false)
499  {
500  NS_LOG_WARN ("Enabling ECN as L4S mode is enabled");
501  }
502  }
503  return true;
504 }
505 
506 void
508 {
509  NS_LOG_FUNCTION (this);
510 
511  m_flowFactory.SetTypeId ("ns3::FqPieFlow");
512 
513  m_queueDiscFactory.SetTypeId ("ns3::PieQueueDisc");
515  m_queueDiscFactory.Set ("MeanPktSize", UintegerValue (1000));
516  m_queueDiscFactory.Set ("A", DoubleValue (0.125));
517  m_queueDiscFactory.Set ("B", DoubleValue (1.25));
518  m_queueDiscFactory.Set ("Tupdate", TimeValue (Seconds (0.015)));
519  m_queueDiscFactory.Set ("Supdate", TimeValue (Seconds (0)));
520  m_queueDiscFactory.Set ("DequeueThreshold", UintegerValue (16384));
521  m_queueDiscFactory.Set ("QueueDelayReference", TimeValue (Seconds (0.015)));
522  m_queueDiscFactory.Set ("MaxBurstAllowance", TimeValue (Seconds (0.15)));
523  m_queueDiscFactory.Set ("UseDequeueRateEstimator", BooleanValue (false));
524  m_queueDiscFactory.Set ("UseCapDropAdjustment", BooleanValue (true));
525  m_queueDiscFactory.Set ("UseDerandomization", BooleanValue (false));
526 }
527 
528 uint32_t
530 {
531  NS_LOG_FUNCTION (this);
532 
533  uint32_t maxBacklog = 0, index = 0;
534  Ptr<QueueDisc> qd;
535 
536  /* Queue is full! Find the fat flow and drop packet(s) from it */
537  for (uint32_t i = 0; i < GetNQueueDiscClasses (); i++)
538  {
539  qd = GetQueueDiscClass (i)->GetQueueDisc ();
540  uint32_t bytes = qd->GetNBytes ();
541  if (bytes > maxBacklog)
542  {
543  maxBacklog = bytes;
544  index = i;
545  }
546  }
547 
548  /* Our goal is to drop half of this fat flow backlog */
549  uint32_t len = 0, count = 0, threshold = maxBacklog >> 1;
550  qd = GetQueueDiscClass (index)->GetQueueDisc ();
551  Ptr<QueueDiscItem> item;
552 
553  do
554  {
555  NS_LOG_DEBUG ("Drop packet (overflow); count: " << count << " len: " << len << " threshold: " << threshold);
556  item = qd->GetInternalQueue (0)->Dequeue ();
558  len += item->GetSize ();
559  }
560  while (++count < m_dropBatchSize && len < threshold);
561 
562  return index;
563 }
564 
565 } // namespace ns3
566 
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::FqPieQueueDisc::m_useDqRateEstimator
bool m_useDqRateEstimator
Enable/Disable usage of dequeue rate estimator for queue delay calculation.
Definition: fq-pie-queue-disc.h:185
ns3::QueueDiscSizePolicy
QueueDiscSizePolicy
Enumeration of the available policies to handle the queue disc size.
Definition: queue-disc.h:104
ns3::FqPieQueueDisc::m_useL4s
bool m_useL4s
True if L4S is used (ECT1 packets are marked at CE threshold)
Definition: fq-pie-queue-disc.h:176
ns3::MULTIPLE_QUEUES
@ MULTIPLE_QUEUES
Used by queue discs with multiple internal queues/child queue discs.
Definition: queue-disc.h:107
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
ns3::FqPieQueueDisc::m_perturbation
uint32_t m_perturbation
hash perturbation value
Definition: fq-pie-queue-disc.h:194
ns3::FqPieFlow::m_deficit
int32_t m_deficit
the deficit for this flow
Definition: fq-pie-queue-disc.h:106
ns3::MakeTimeChecker
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition: boolean.h:37
ns3::FqPieQueueDisc::m_flowFactory
ObjectFactory m_flowFactory
Factory to create a new flow.
Definition: fq-pie-queue-disc.h:203
ns3::FqPieFlow::INACTIVE
@ INACTIVE
Definition: fq-pie-queue-disc.h:64
ns3::QueueDisc::SetMaxSize
bool SetMaxSize(QueueSize size)
Set the maximum size of the queue disc.
Definition: queue-disc.cc:482
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::QueueDisc
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition: queue-disc.h:181
ns3::FqPieQueueDisc::m_ceThreshold
Time m_ceThreshold
Threshold above which to CE mark.
Definition: fq-pie-queue-disc.h:175
ns3::QueueDisc::GetMaxSize
QueueSize GetMaxSize(void) const
Get the maximum size of the queue disc.
Definition: queue-disc.cc:454
ns3::FqPieQueueDisc::m_queueDiscFactory
ObjectFactory m_queueDiscFactory
Factory to create a new queue.
Definition: fq-pie-queue-disc.h:204
ns3::QueueDisc::GetQueueDiscClass
Ptr< QueueDiscClass > GetQueueDiscClass(std::size_t i) const
Get the i-th queue disc class.
Definition: queue-disc.cc:662
ns3::MakeQueueSizeChecker
Ptr< const AttributeChecker > MakeQueueSizeChecker(void)
Definition: queue-size.cc:29
NS_LOG_WARN
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:265
ns3::PieQueueDisc
Implements PIE Active Queue Management discipline.
Definition: pie-queue-disc.h:53
ns3::FqPieFlow::FqPieFlow
FqPieFlow()
FqPieFlow constructor.
Definition: fq-pie-queue-disc.cc:51
ns3::ObjectBase::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
ns3::QueueDisc::GetNBytes
uint32_t GetNBytes(void) const
Get the amount of bytes stored by the queue disc.
Definition: queue-disc.cc:447
ns3::PACKETS
@ PACKETS
Use number of packets for queue size.
Definition: queue-size.h:44
ns3::QueueDisc::AddQueueDiscClass
void AddQueueDiscClass(Ptr< QueueDiscClass > qdClass)
Add a queue disc class to the tail of the list of classes.
Definition: queue-disc.cc:634
ns3::NetDevice::GetMtu
virtual uint16_t GetMtu(void) const =0
ns3::FqPieQueueDisc::m_useDerandomization
bool m_useDerandomization
Enable Derandomization feature mentioned in RFC 8033.
Definition: fq-pie-queue-disc.h:187
ns3::MakeBooleanAccessor
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: boolean.h:85
fq-pie-queue-disc.h
ns3::FqPieQueueDisc::DoEnqueue
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
Definition: fq-pie-queue-disc.cc:286
ns3::FqPieFlow::OLD_FLOW
@ OLD_FLOW
Definition: fq-pie-queue-disc.h:66
ns3::FqPieFlow
A flow queue used by the FqPie queue disc.
Definition: fq-pie-queue-disc.h:44
ns3::QueueDisc::GetNPacketFilters
std::size_t GetNPacketFilters(void) const
Get the number of packet filters.
Definition: queue-disc.cc:628
ns3::FqPieQueueDisc::m_tUpdate
Time m_tUpdate
Time period after which CalculateP () is called.
Definition: fq-pie-queue-disc.h:178
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::DoubleValue
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:41
ns3::FqPieQueueDisc::FqPieQueueDisc
FqPieQueueDisc()
FqPieQueueDisc constructor.
Definition: fq-pie-queue-disc.cc:231
ns3::FqPieQueueDisc::m_setWays
uint32_t m_setWays
size of a set of queues (used by set associative hash)
Definition: fq-pie-queue-disc.h:192
pie-queue-disc.h
ns3::QueueDiscClass
QueueDiscClass is the base class for classes that are included in a queue disc.
Definition: queue-disc.h:49
ns3::FqPieQueueDisc::m_newFlows
std::list< Ptr< FqPieFlow > > m_newFlows
The list of new flows.
Definition: fq-pie-queue-disc.h:197
ns3::QueueSizeValue
Definition: queue-size.h:221
ns3::FqPieQueueDisc::m_markEcnTh
double m_markEcnTh
ECN marking threshold (default 10% as suggested in RFC 8033)
Definition: fq-pie-queue-disc.h:174
ns3::QueueDisc::GetNetDeviceQueueInterface
Ptr< NetDeviceQueueInterface > GetNetDeviceQueueInterface(void) const
Definition: queue-disc.cc:546
ns3::FqPieQueueDisc::SetAssociativeHash
uint32_t SetAssociativeHash(uint32_t flowHash)
Compute the index of the queue for the flow having the given flowHash, according to the set associati...
Definition: fq-pie-queue-disc.cc:257
ns3::FqPieQueueDisc::m_a
double m_a
Parameter to pie controller.
Definition: fq-pie-queue-disc.h:182
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::FqPieFlow::m_status
FlowStatus m_status
the status of this flow
Definition: fq-pie-queue-disc.h:107
ns3::FqPieQueueDisc::m_dropBatchSize
uint32_t m_dropBatchSize
Max number of packets dropped from the fat flow.
Definition: fq-pie-queue-disc.h:193
ns3::FqPieQueueDisc::m_dqThreshold
uint32_t m_dqThreshold
Minimum queue size in bytes before dequeue rate is measured.
Definition: fq-pie-queue-disc.h:184
ns3::FqPieQueueDisc::m_meanPktSize
uint32_t m_meanPktSize
Average packet size in bytes.
Definition: fq-pie-queue-disc.h:180
ns3::FqPieQueueDisc::m_tags
std::map< uint32_t, uint32_t > m_tags
Tags used by set associative hash.
Definition: fq-pie-queue-disc.h:201
ns3::FqPieQueueDisc::~FqPieQueueDisc
virtual ~FqPieQueueDisc()
Definition: fq-pie-queue-disc.cc:238
ns3::Time::Max
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Definition: nstime.h:283
ns3::FqPieQueueDisc::m_maxBurst
Time m_maxBurst
Maximum burst allowed before random early dropping kicks in.
Definition: fq-pie-queue-disc.h:181
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
ns3::FqPieFlow::GetDeficit
int32_t GetDeficit(void) const
Get the deficit for this flow.
Definition: fq-pie-queue-disc.cc:72
ns3::QueueDisc::GetNInternalQueues
std::size_t GetNInternalQueues(void) const
Get the number of internal queues.
Definition: queue-disc.cc:608
ns3::FqPieQueueDisc::UNCLASSIFIED_DROP
static constexpr const char * UNCLASSIFIED_DROP
No packet filter able to classify packet.
Definition: fq-pie-queue-disc.h:148
ns3::QueueDisc::GetCurrentSize
QueueSize GetCurrentSize(void)
Get the current size of the queue disc in bytes, if operating in bytes mode, or packets,...
Definition: queue-disc.cc:523
NS_ABORT_MSG_IF
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
ns3::FqPieFlow::~FqPieFlow
virtual ~FqPieFlow()
Definition: fq-pie-queue-disc.cc:59
ns3::FqPieQueueDisc::m_flowsIndices
std::map< uint32_t, uint32_t > m_flowsIndices
Map with the index of class for each flow.
Definition: fq-pie-queue-disc.h:200
ns3::FqPieFlow::GetStatus
FlowStatus GetStatus(void) const
Get the status of this flow.
Definition: fq-pie-queue-disc.cc:93
ns3::FqPieQueueDisc::GetQuantum
uint32_t GetQuantum(void) const
Get the quantum value.
Definition: fq-pie-queue-disc.cc:251
ns3::FqPieQueueDisc::m_enableSetAssociativeHash
bool m_enableSetAssociativeHash
whether to enable set associative hash
Definition: fq-pie-queue-disc.h:195
ns3::FqPieQueueDisc::m_b
double m_b
Parameter to pie controller.
Definition: fq-pie-queue-disc.h:183
ns3::MakeDoubleAccessor
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: double.h:42
NS_LOG_ERROR
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:257
ns3::FqPieFlow::FlowStatus
FlowStatus
Used to determine the status of this flow queue.
Definition: fq-pie-queue-disc.h:63
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::FqPieQueueDisc::m_flows
uint32_t m_flows
Number of flow queues.
Definition: fq-pie-queue-disc.h:191
ns3::PacketFilter::PF_NO_MATCH
static const int PF_NO_MATCH
Standard value used by packet filters to indicate that no match was possible.
Definition: packet-filter.h:48
ns3::QueueDisc::DropAfterDequeue
void DropAfterDequeue(Ptr< const QueueDiscItem > item, const char *reason)
Perform the actions required when the queue disc is notified of a packet dropped after dequeue.
Definition: queue-disc.cc:768
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::FqPieFlow::SetStatus
void SetStatus(FlowStatus status)
Set the status for this flow.
Definition: fq-pie-queue-disc.cc:86
ns3::ObjectFactory::Set
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Definition: object-factory.h:223
ns3::FqPieQueueDisc::FqPieDrop
uint32_t FqPieDrop(void)
Drop a packet from the head of the queue with the largest current byte count.
Definition: fq-pie-queue-disc.cc:529
ns3::INACTIVE
@ INACTIVE
Inactive Period or unslotted CSMA-CA.
Definition: lr-wpan-mac.h:93
ns3::FqPieQueueDisc::SetQuantum
void SetQuantum(uint32_t quantum)
Set the quantum value.
Definition: fq-pie-queue-disc.cc:244
ns3::TimeValue
AttributeValue implementation for Time.
Definition: nstime.h:1353
ns3::FqPieQueueDisc::m_isCapDropAdjustment
bool m_isCapDropAdjustment
Enable/Disable Cap Drop Adjustment feature mentioned in RFC 8033.
Definition: fq-pie-queue-disc.h:186
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::QueueSizeUnit
QueueSizeUnit
Enumeration of the operating modes of queues.
Definition: queue-size.h:43
ns3::MakeQueueSizeAccessor
Ptr< const AttributeAccessor > MakeQueueSizeAccessor(T1 a1)
Definition: queue-size.h:221
ns3::FqPieFlow::SetDeficit
void SetDeficit(uint32_t deficit)
Set the deficit for this flow.
Definition: fq-pie-queue-disc.cc:65
ns3::ObjectFactory::SetTypeId
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Definition: object-factory.cc:40
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
ns3::FqPieQueueDisc::m_sUpdate
Time m_sUpdate
Start time of the update timer.
Definition: fq-pie-queue-disc.h:177
ns3::FqPieQueueDisc::OVERLIMIT_DROP
static constexpr const char * OVERLIMIT_DROP
Overlimit dropped packets.
Definition: fq-pie-queue-disc.h:149
ns3::FqPieFlow::GetIndex
uint32_t GetIndex(void) const
Get the index of this flow.
Definition: fq-pie-queue-disc.cc:107
ns3::ObjectFactory::Create
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Definition: object-factory.cc:98
ns3::FqPieFlow::SetIndex
void SetIndex(uint32_t index)
Set the index for this flow.
Definition: fq-pie-queue-disc.cc:100
ns3::FqPieQueueDisc
A FqPie packet queue disc.
Definition: fq-pie-queue-disc.h:119
ns3::QueueDisc::Classify
int32_t Classify(Ptr< QueueDiscItem > item)
Classify a packet by calling the packet filters, one at a time, until either a filter able to classif...
Definition: queue-disc.cc:675
ns3::FqPieFlow::m_index
uint32_t m_index
the index for this flow
Definition: fq-pie-queue-disc.h:108
ns3::MakeUintegerAccessor
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: uinteger.h:45
ns3::QueueDisc::GetNQueueDiscClasses
std::size_t GetNQueueDiscClasses(void) const
Get the number of queue disc classes.
Definition: queue-disc.cc:669
ns3::QueueDisc::DropBeforeEnqueue
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.
Definition: queue-disc.cc:729
ns3::FqPieFlow::NEW_FLOW
@ NEW_FLOW
Definition: fq-pie-queue-disc.h:65
ns3::QueueDisc::GetInternalQueue
Ptr< InternalQueue > GetInternalQueue(std::size_t i) const
Get the i-th internal queue.
Definition: queue-disc.cc:601
ns3::QueueSize
Class for representing queue sizes.
Definition: queue-size.h:95
ns3::FqPieQueueDisc::m_qDelayRef
Time m_qDelayRef
Desired queue delay.
Definition: fq-pie-queue-disc.h:179
ns3::FqPieQueueDisc::m_oldFlows
std::list< Ptr< FqPieFlow > > m_oldFlows
The list of old flows.
Definition: fq-pie-queue-disc.h:198
ns3::FqPieQueueDisc::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: fq-pie-queue-disc.cc:115
ns3::FqPieQueueDisc::DoDequeue
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
Definition: fq-pie-queue-disc.cc:368
ns3::FqPieQueueDisc::m_quantum
uint32_t m_quantum
Deficit assigned to flows at each round.
Definition: fq-pie-queue-disc.h:190
ns3::FqPieQueueDisc::m_useEcn
bool m_useEcn
True if ECN is used (packets are marked instead of being dropped)
Definition: fq-pie-queue-disc.h:173
ns3::MakeTimeAccessor
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: nstime.h:1354
ns3::NetDevice
Network layer to device interface.
Definition: net-device.h:96
ns3::FqPieQueueDisc::InitializeParams
virtual void InitializeParams(void)
Initialize parameters (if any) before the first packet is enqueued.
Definition: fq-pie-queue-disc.cc:507
ns3::FqPieFlow::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: fq-pie-queue-disc.cc:41
ns3::FqPieFlow::IncreaseDeficit
void IncreaseDeficit(int32_t deficit)
Increase the deficit for this flow.
Definition: fq-pie-queue-disc.cc:79
ns3::FqPieQueueDisc::CheckConfig
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
Definition: fq-pie-queue-disc.cc:452