A Discrete-Event Network Simulator
API
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 NITK Surathkal
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Shravya Ks <shravya.ks0@gmail.com>
19  * Smriti Murali <m.smriti.95@gmail.com>
20  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
21  */
22 
23 /*
24  * PORT NOTE: This code was ported from ns-2.36rc1 (queue/pie.cc).
25  * Most of the comments are also ported from the same.
26  */
27 
28 #include "ns3/log.h"
29 #include "ns3/enum.h"
30 #include "ns3/uinteger.h"
31 #include "ns3/double.h"
32 #include "ns3/simulator.h"
33 #include "ns3/abort.h"
34 #include "pie-queue-disc.h"
35 #include "ns3/drop-tail-queue.h"
36 
37 namespace ns3 {
38 
39 NS_LOG_COMPONENT_DEFINE ("PieQueueDisc");
40 
41 NS_OBJECT_ENSURE_REGISTERED (PieQueueDisc);
42 
44 {
45  static TypeId tid = TypeId ("ns3::PieQueueDisc")
46  .SetParent<QueueDisc> ()
47  .SetGroupName ("TrafficControl")
48  .AddConstructor<PieQueueDisc> ()
49  .AddAttribute ("MeanPktSize",
50  "Average of packet size",
51  UintegerValue (1000),
53  MakeUintegerChecker<uint32_t> ())
54  .AddAttribute ("A",
55  "Value of alpha",
56  DoubleValue (0.125),
58  MakeDoubleChecker<double> ())
59  .AddAttribute ("B",
60  "Value of beta",
61  DoubleValue (1.25),
63  MakeDoubleChecker<double> ())
64  .AddAttribute ("Tupdate",
65  "Time period to calculate drop probability",
66  TimeValue (MilliSeconds (15)),
68  MakeTimeChecker ())
69  .AddAttribute ("Supdate",
70  "Start time of the update timer",
71  TimeValue (Seconds (0)),
73  MakeTimeChecker ())
74  .AddAttribute ("MaxSize",
75  "The maximum number of packets accepted by this queue disc",
76  QueueSizeValue (QueueSize ("25p")),
80  .AddAttribute ("DequeueThreshold",
81  "Minimum queue size in bytes before dequeue rate is measured",
82  UintegerValue (16384),
84  MakeUintegerChecker<uint32_t> ())
85  .AddAttribute ("QueueDelayReference",
86  "Desired queue delay",
87  TimeValue (MilliSeconds (15)),
89  MakeTimeChecker ())
90  .AddAttribute ("MaxBurstAllowance",
91  "Current max burst allowance before random drop",
92  TimeValue (MilliSeconds (150)),
94  MakeTimeChecker ())
95  .AddAttribute ("UseDequeueRateEstimator",
96  "Enable/Disable usage of Dequeue Rate Estimator",
97  BooleanValue (false),
100  .AddAttribute ("UseCapDropAdjustment",
101  "Enable/Disable Cap Drop Adjustment feature mentioned in RFC 8033",
102  BooleanValue (true),
105  .AddAttribute ("UseEcn",
106  "True to use ECN (packets are marked instead of being dropped)",
107  BooleanValue (false),
110  .AddAttribute ("MarkEcnThreshold",
111  "ECN marking threshold (RFC 8033 suggests 0.1 (i.e., 10%) default)",
112  DoubleValue (0.1),
114  MakeDoubleChecker<double> (0,1))
115  .AddAttribute ("UseDerandomization",
116  "Enable/Disable Derandomization feature mentioned in RFC 8033",
117  BooleanValue (false),
120  .AddAttribute ("ActiveThreshold",
121  "Threshold for activating PIE (disabled by default)",
122  TimeValue (Time::Max ()),
124  MakeTimeChecker ())
125  .AddAttribute ("CeThreshold",
126  "The FqPie CE threshold for marking packets",
127  TimeValue (Time::Max ()),
129  MakeTimeChecker ())
130  .AddAttribute ("UseL4s",
131  "True to use L4S (only ECT1 packets are marked at CE threshold)",
132  BooleanValue (false),
135  ;
136 
137  return tid;
138 }
139 
142 {
143  NS_LOG_FUNCTION (this);
144  m_uv = CreateObject<UniformRandomVariable> ();
146 }
147 
149 {
150  NS_LOG_FUNCTION (this);
151 }
152 
153 void
155 {
156  NS_LOG_FUNCTION (this);
157  m_uv = 0;
158  m_rtrsEvent.Cancel ();
160 }
161 
162 Time
164 {
165  return m_qDelay;
166 }
167 
168 int64_t
170 {
171  NS_LOG_FUNCTION (this << stream);
172  m_uv->SetStream (stream);
173  return 1;
174 }
175 
176 bool
178 {
179  NS_LOG_FUNCTION (this << item);
180 
181  QueueSize nQueued = GetCurrentSize ();
182  // If L4S is enabled, then check if the packet is ECT1, and if it is then set isEct true
183  bool isEct1 = false;
184  if (item && m_useL4s)
185  {
186  uint8_t tosByte = 0;
187  if (item->GetUint8Value (QueueItem::IP_DSFIELD, tosByte) && (((tosByte & 0x3) == 1) || (tosByte & 0x3) == 3))
188  {
189  if ((tosByte & 0x3) == 1)
190  {
191  NS_LOG_DEBUG ("Enqueueing ECT1 packet " << static_cast<uint16_t> (tosByte & 0x3));
192  }
193  else
194  {
195  NS_LOG_DEBUG ("Enqueueing CE packet " << static_cast<uint16_t> (tosByte & 0x3));
196  }
197  isEct1 = true;
198  }
199  }
200 
201  if (nQueued + item > GetMaxSize ())
202  {
203  // Drops due to queue limit: reactive
205  m_accuProb = 0;
206  return false;
207  }
208  // isEct1 will be true only if L4S enabled as well as the packet is ECT1.
209  // If L4S is enabled and packet is ECT1 then directly enqueue the packet.
210  else if ((m_activeThreshold == Time::Max () || m_active) && !isEct1 && DropEarly (item, nQueued.GetValue ()))
211  {
212  if (!m_useEcn || m_dropProb >= m_markEcnTh || !Mark (item, UNFORCED_MARK))
213  {
214  // Early probability drop: proactive
216  m_accuProb = 0;
217  return false;
218  }
219  }
220 
221  // No drop
222  bool retval = GetInternalQueue (0)->Enqueue (item);
223 
224  // If the queue is over a certain threshold, Turn ON PIE
226  {
227  m_active = true;
228  m_qDelayOld = Seconds (0);
229  m_dropProb = 0;
230  m_inMeasurement = true;
231  m_dqCount = 0;
232  m_avgDqRate = 0;
234  m_accuProb = 0;
235  m_dqStart = Now ();
236  }
237 
238  // If queue has been Idle for a while, Turn OFF PIE
239  // Reset Counters when accessing the queue after some idle period if PIE was active before
241  {
242  m_active = false;
243  m_inMeasurement = false ;
244  }
245 
246  // If Queue::Enqueue fails, QueueDisc::DropBeforeEnqueue is called by the
247  // internal queue because QueueDisc::AddInternalQueue sets the trace callback
248 
249  NS_LOG_LOGIC ("\t bytesInQueue " << GetInternalQueue (0)->GetNBytes ());
250  NS_LOG_LOGIC ("\t packetsInQueue " << GetInternalQueue (0)->GetNPackets ());
251 
252  return retval;
253 }
254 
255 void
257 {
258  // Initially queue is empty so variables are initialize to zero except m_dqCount
259  m_inMeasurement = false;
261  m_dropProb = 0;
262  m_avgDqRate = 0.0;
263  m_dqStart = Seconds (0);
265  m_qDelayOld = Seconds (0);
266  m_accuProb = 0.0;
267  m_active = false;
268 }
269 
270 bool PieQueueDisc::DropEarly (Ptr<QueueDiscItem> item, uint32_t qSize)
271 {
272  NS_LOG_FUNCTION (this << item << qSize);
273  if (m_burstAllowance.GetSeconds () > 0)
274  {
275  // If there is still burst_allowance left, skip random early drop.
276  return false;
277  }
278 
279  if (m_burstState == NO_BURST)
280  {
283  }
284 
285  double p = m_dropProb;
286 
287  uint32_t packetSize = item->GetSize ();
288 
289  if (GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES)
290  {
291  p = p * packetSize / m_meanPktSize;
292  }
293 
294  // Safeguard PIE to be work conserving (Section 4.1 of RFC 8033)
295  if ((m_qDelayOld.GetSeconds () < (0.5 * m_qDelayRef.GetSeconds ())) && (m_dropProb < 0.2))
296  {
297  return false;
298  }
299  else if (GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES && qSize <= 2 * m_meanPktSize)
300  {
301  return false;
302  }
303  else if (GetMaxSize ().GetUnit () == QueueSizeUnit::PACKETS && qSize <= 2)
304  {
305  return false;
306  }
307 
309  {
310  if (m_dropProb == 0)
311  {
312  m_accuProb = 0;
313  }
315  if (m_accuProb < 0.85)
316  {
317  return false;
318  }
319  else if (m_accuProb >= 8.5)
320  {
321  return true;
322  }
323  }
324 
325  double u = m_uv->GetValue ();
326  if (u > p)
327  {
328  return false;
329  }
330 
331  return true;
332 }
333 
335 {
336  NS_LOG_FUNCTION (this);
337  Time qDelay;
338  double p = 0.0;
339  bool missingInitFlag = false;
340 
342  {
343  if (m_avgDqRate > 0)
344  {
345  qDelay = Seconds (GetInternalQueue (0)->GetNBytes () / m_avgDqRate);
346  }
347  else
348  {
349  qDelay = Seconds (0);
350  missingInitFlag = true;
351  }
352  m_qDelay = qDelay;
353  }
354  else
355  {
356  qDelay = m_qDelay;
357  }
358  NS_LOG_DEBUG ("Queue delay while calculating probability: " << qDelay.GetMilliSeconds () << "ms");
359 
360  if (m_burstAllowance.GetSeconds () > 0)
361  {
362  m_dropProb = 0;
363  }
364  else
365  {
366  p = m_a * (qDelay.GetSeconds () - m_qDelayRef.GetSeconds ()) + m_b * (qDelay.GetSeconds () - m_qDelayOld.GetSeconds ());
367  if (m_dropProb < 0.000001)
368  {
369  p /= 2048;
370  }
371  else if (m_dropProb < 0.00001)
372  {
373  p /= 512;
374  }
375  else if (m_dropProb < 0.0001)
376  {
377  p /= 128;
378  }
379  else if (m_dropProb < 0.001)
380  {
381  p /= 32;
382  }
383  else if (m_dropProb < 0.01)
384  {
385  p /= 8;
386  }
387  else if (m_dropProb < 0.1)
388  {
389  p /= 2;
390  }
391  else
392  {
393  // The pseudocode in Section 4.2 of RFC 8033 suggests to use this for
394  // assignment of p, but this assignment causes build failure on Mac OS
395  // p = p;
396  }
397 
398  // Cap Drop Adjustment (Section 5.5 of RFC 8033)
399  if (m_isCapDropAdjustment && (m_dropProb >= 0.1) && (p > 0.02))
400  {
401  p = 0.02;
402  }
403  }
404 
405  p += m_dropProb;
406 
407  // For non-linear drop in prob
408  // Decay the drop probability exponentially (Section 4.2 of RFC 8033)
409  if (qDelay.GetSeconds () == 0 && m_qDelayOld.GetSeconds () == 0)
410  {
411  p *= 0.98;
412  }
413 
414  // bound the drop probability (Section 4.2 of RFC 8033)
415  if (p < 0)
416  {
417  m_dropProb = 0;
418  }
419  else if (p > 1)
420  {
421  m_dropProb = 1;
422  }
423  else
424  {
425  m_dropProb = p;
426  }
427 
428  // Section 4.4 #2
430  {
432  }
433  else
434  {
436  }
437 
438  uint32_t burstResetLimit = static_cast<uint32_t>(BURST_RESET_TIMEOUT / m_tUpdate.GetSeconds ());
439  if ( (qDelay.GetSeconds () < 0.5 * m_qDelayRef.GetSeconds ()) && (m_qDelayOld.GetSeconds () < (0.5 * m_qDelayRef.GetSeconds ())) && (m_dropProb == 0) && !missingInitFlag )
440  {
442  m_avgDqRate = 0.0;
443  }
444  if ( (qDelay.GetSeconds () < 0.5 * m_qDelayRef.GetSeconds ()) && (m_qDelayOld.GetSeconds () < (0.5 * m_qDelayRef.GetSeconds ())) && (m_dropProb == 0) && (m_burstAllowance.GetSeconds () == 0))
445  {
447  {
449  m_burstReset = 0;
450  }
451  else if (m_burstState == IN_BURST)
452  {
453  m_burstReset++;
454  if (m_burstReset > burstResetLimit)
455  {
456  m_burstReset = 0;
458  }
459  }
460  }
461  else if (m_burstState == IN_BURST)
462  {
463  m_burstReset = 0;
464  }
465 
466  m_qDelayOld = qDelay;
468 }
469 
472 {
473  NS_LOG_FUNCTION (this);
474 
475  if (GetInternalQueue (0)->IsEmpty ())
476  {
477  NS_LOG_LOGIC ("Queue empty");
478  return 0;
479  }
480 
481  Ptr<QueueDiscItem> item = GetInternalQueue (0)->Dequeue ();
482  NS_ASSERT_MSG (item != nullptr, "Dequeue null, but internal queue not empty");
483 
484  // If L4S is enabled and packet is ECT1, then check if delay is greater
485  // than CE threshold and if it is then mark the packet,
486  // skip PIE steps, and return the item.
487  if (m_useL4s)
488  {
489  uint8_t tosByte = 0;
490  if (item->GetUint8Value (QueueItem::IP_DSFIELD, tosByte) && (((tosByte & 0x3) == 1) || (tosByte & 0x3) == 3))
491  {
492  if ((tosByte & 0x3) == 1)
493  {
494  NS_LOG_DEBUG ("ECT1 packet " << static_cast<uint16_t> (tosByte & 0x3));
495  }
496  else
497  {
498  NS_LOG_DEBUG ("CE packet " << static_cast<uint16_t> (tosByte & 0x3));
499  }
500  if ((Now () - item->GetTimeStamp () > m_ceThreshold) && Mark (item, CE_THRESHOLD_EXCEEDED_MARK))
501  {
502  NS_LOG_LOGIC ("Marking due to CeThreshold " << m_ceThreshold.GetSeconds ());
503  }
504  return item;
505  }
506  }
507 
508  // if not in a measurement cycle and the queue has built up to dq_threshold,
509  // start the measurement cycle
511  {
512  if ( (GetInternalQueue (0)->GetNBytes () >= m_dqThreshold) && (!m_inMeasurement) )
513  {
514  m_dqStart = Now ();
515  m_dqCount = 0;
516  m_inMeasurement = true;
517  }
518 
519  if (m_inMeasurement)
520  {
521  m_dqCount += item->GetSize ();
522 
523  // done with a measurement cycle
524  if (m_dqCount >= m_dqThreshold)
525  {
526  Time dqTime = Now () - m_dqStart;
527  if (dqTime > Seconds (0))
528  {
529  if (m_avgDqRate == 0)
530  {
531  m_avgDqRate = m_dqCount / dqTime.GetSeconds ();
532  }
533  else
534  {
535  m_avgDqRate = (0.5 * m_avgDqRate) + (0.5 * (m_dqCount / dqTime.GetSeconds ()));
536  }
537  }
538  NS_LOG_DEBUG ("Average Dequeue Rate after Dequeue: " << m_avgDqRate);
539 
540  // restart a measurement cycle if there is enough data
542  {
543  m_dqStart = Now ();
544  m_dqCount = 0;
545  m_inMeasurement = true;
546  }
547  else
548  {
549  m_dqCount = 0;
550  m_inMeasurement = false;
551  }
552  }
553  }
554  }
555  else
556  {
557  m_qDelay = Now () - item->GetTimeStamp ();
558 
559  if (GetInternalQueue (0)->GetNBytes () == 0)
560  {
561  m_qDelay = Seconds (0);
562  }
563  }
564  return item;
565 }
566 
567 bool
569 {
570  NS_LOG_FUNCTION (this);
571  if (GetNQueueDiscClasses () > 0)
572  {
573  NS_LOG_ERROR ("PieQueueDisc cannot have classes");
574  return false;
575  }
576 
577  if (GetNPacketFilters () > 0)
578  {
579  NS_LOG_ERROR ("PieQueueDisc cannot have packet filters");
580  return false;
581  }
582 
583  if (GetNInternalQueues () == 0)
584  {
585  // add a DropTail queue
587  ("MaxSize", QueueSizeValue (GetMaxSize ())));
588  }
589 
590  if (GetNInternalQueues () != 1)
591  {
592  NS_LOG_ERROR ("PieQueueDisc needs 1 internal queue");
593  return false;
594  }
595 
596  return true;
597 }
598 
599 } //namespace ns3
AttributeValue implementation for Boolean.
Definition: boolean.h:37
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:41
Introspection did not find any typical Config paths.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
Implements PIE Active Queue Management discipline.
uint32_t m_dqThreshold
Minimum queue size in bytes before dequeue rate is measured.
uint32_t m_meanPktSize
Average packet size in bytes.
double m_markEcnTh
ECN marking threshold (default 10% as suggested in RFC 8033)
bool m_useDqRateEstimator
Enable/Disable usage of dequeue rate estimator for queue delay calculation.
virtual void InitializeParams(void)
Initialize the queue parameters.
bool m_useL4s
True if L4S is used (ECT1 packets are marked at CE threshold)
Time m_sUpdate
Start time of the update timer.
Time m_dqStart
Start timestamp of current measurement cycle.
bool m_useDerandomization
Enable Derandomization feature mentioned in RFC 8033.
static constexpr const char * UNFORCED_DROP
Early probability drops: proactive.
Time m_maxBurst
Maximum burst allowed before random early dropping kicks in.
EventId m_rtrsEvent
Event used to decide the decision of interval of drop probability calculation.
void CalculateP()
Periodically update the drop probability based on the delay samples: not only the current delay sampl...
virtual ~PieQueueDisc()
PieQueueDisc Destructor.
Time m_ceThreshold
Threshold above which to CE mark.
Time m_qDelayOld
Old value of queue delay.
double m_dropProb
Variable used in calculation of drop probability.
Time m_burstAllowance
Current max burst value in seconds that is allowed before random drops kick in.
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
BurstStateT m_burstState
Used to determine the current state of burst.
bool DropEarly(Ptr< QueueDiscItem > item, uint32_t qSize)
Check if a packet needs to be dropped due to probability drop.
static TypeId GetTypeId(void)
Get the type ID.
bool m_active
Indicates whether PIE is in active state or not.
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
double m_avgDqRate
Time averaged dequeue rate.
static const uint64_t DQCOUNT_INVALID
Invalid dqCount value.
uint32_t m_burstReset
Used to reset value of burst allowance.
virtual void DoDispose(void)
Dispose of the object.
bool m_inMeasurement
Indicates whether we are in a measurement cycle.
static constexpr const char * FORCED_DROP
Drops due to queue limit: reactive.
Time m_qDelayRef
Desired queue delay.
double m_a
Parameter to pie controller.
static constexpr const char * CE_THRESHOLD_EXCEEDED_MARK
Early probability marks: proactive.
Time m_activeThreshold
Threshold for activating PIE (disabled by default)
bool m_isCapDropAdjustment
Enable/Disable Cap Drop Adjustment feature mentioned in RFC 8033.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
double m_accuProb
Accumulated drop probability.
Ptr< UniformRandomVariable > m_uv
Rng stream.
bool m_useEcn
Enable ECN Marking functionality.
Time m_tUpdate
Time period after which CalculateP () is called.
Time GetQueueDelay(void)
Get queue delay.
PieQueueDisc()
PieQueueDisc Constructor.
Time m_qDelay
Current value of queue delay.
uint64_t m_dqCount
Number of bytes departed since current measurement cycle starts.
double m_b
Parameter to pie controller.
static constexpr const char * UNFORCED_MARK
Early probability marks: proactive.
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition: queue-disc.h:181
void AddInternalQueue(Ptr< InternalQueue > queue)
Add an internal queue to the tail of the list of queues.
Definition: queue-disc.cc:579
QueueSize GetCurrentSize(void)
Get the current size of the queue disc in bytes, if operating in bytes mode, or packets,...
Definition: queue-disc.cc:521
uint32_t GetNBytes(void) const
Get the amount of bytes stored by the queue disc.
Definition: queue-disc.cc:445
QueueSize GetMaxSize(void) const
Get the maximum size of the queue disc.
Definition: queue-disc.cc:452
Ptr< InternalQueue > GetInternalQueue(std::size_t i) const
Get the i-th internal queue.
Definition: queue-disc.cc:599
std::size_t GetNPacketFilters(void) const
Get the number of packet filters.
Definition: queue-disc.cc:626
uint32_t GetNPackets(void) const
Get the number of packets stored by the queue disc.
Definition: queue-disc.cc:438
std::size_t GetNQueueDiscClasses(void) const
Get the number of queue disc classes.
Definition: queue-disc.cc:667
bool SetMaxSize(QueueSize size)
Set the maximum size of the queue disc.
Definition: queue-disc.cc:480
virtual void DoDispose(void)
Dispose of the object.
Definition: queue-disc.cc:382
std::size_t GetNInternalQueues(void) const
Get the number of internal queues.
Definition: queue-disc.cc:606
bool Mark(Ptr< QueueDiscItem > item, const char *reason)
Marks the given packet and, if successful, updates the counters associated with the given reason.
Definition: queue-disc.cc:816
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:727
Class for representing queue sizes.
Definition: queue-size.h:95
uint32_t GetValue() const
Get the underlying value.
Definition: queue-size.cc:174
AttributeValue implementation for QueueSize.
Definition: queue-size.h:221
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:556
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:379
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:383
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Definition: nstime.h:282
AttributeValue implementation for Time.
Definition: nstime.h:1308
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
Hold an unsigned integer type.
Definition: uinteger.h:44
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
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
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
Ptr< const AttributeChecker > MakeQueueSizeChecker(void)
Definition: queue-size.cc:28
Ptr< const AttributeAccessor > MakeQueueSizeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: queue-size.h:221
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:1309
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
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:257
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObjectWithAttributes(Args... args)
Allocate an Object on the heap and initialize with a set of attributes.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
@ BYTES
Use number of bytes for queue size.
Definition: queue-size.h:45
@ PACKETS
Use number of packets for queue size.
Definition: queue-size.h:44
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1244
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1252
QueueDiscSizePolicy
Enumeration of the available policies to handle the queue disc size.
Definition: queue-disc.h:104
@ SINGLE_INTERNAL_QUEUE
Used by queue discs with single internal queue.
Definition: queue-disc.h:105
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:522
#define BURST_RESET_TIMEOUT
static const uint32_t packetSize