|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
31 #include "ns3/queue-disc.h"
32 #include "ns3/nstime.h"
33 #include "ns3/simulator.h"
34 #include "ns3/string.h"
35 #include "ns3/traced-value.h"
36 #include "ns3/trace-source-accessor.h"
49 #define DEFAULT_CODEL_LIMIT 1000
50 #define REC_INV_SQRT_BITS (8 * sizeof(uint16_t))
51 #define REC_INV_SQRT_SHIFT (32 - REC_INV_SQRT_BITS)
109 friend class::CoDelQueueDiscNewtonStepTest;
110 friend class::CoDelQueueDiscControlLawTest;
140 static uint16_t
NewtonStep (uint16_t recInvSqrt, uint32_t count);
153 static uint32_t
ControlLaw (uint32_t t, uint32_t interval, uint32_t recInvSqrt);
a unique identifier for an interface.
static const int CODEL_SHIFT
Number of bits discarded from the time representation.
Time m_ceThreshold
Threshold above which to CE mark.
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.
A CoDel packet queue disc.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
virtual Ptr< QueueDiscItem > DoDequeue(void)
Remove a packet from queue based on the current state If we are in dropping state,...
static uint32_t ControlLaw(uint32_t t, uint32_t interval, uint32_t recInvSqrt)
Determine the time for next drop CoDel control law is t + m_interval/sqrt(m_count).
TracedValue< uint32_t > m_lastCount
Last number of packets dropped since entering drop state.
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
Add a packet to the queue.
static constexpr const char * TARGET_EXCEEDED_DROP
Sojourn time above target.
bool CoDelTimeBefore(uint32_t a, uint32_t b)
Check if CoDel time a is preceding b.
TracedValue< uint32_t > m_dropNext
Time to drop next packet.
virtual ~CoDelQueueDisc()
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
Time GetInterval(void)
Get the interval.
static constexpr const char * OVERLIMIT_DROP
Overlimit dropped packet.
Smart pointer class similar to boost::intrusive_ptr.
Time GetTarget(void)
Get the target queue delay.
uint32_t m_firstAboveTime
Time to declare sojourn time above target.
CoDelQueueDisc()
CoDelQueueDisc Constructor.
bool CoDelTimeBeforeEq(uint32_t a, uint32_t b)
Check if CoDel time a is preceding or equal to b.
Simulation virtual time values and global simulation resolution.
static uint16_t NewtonStep(uint16_t recInvSqrt, uint32_t count)
Calculate the reciprocal square root of m_count by using Newton's method http://en....
Time m_interval
100 ms sliding minimum time window width
static constexpr const char * TARGET_EXCEEDED_MARK
Sojourn time above target.
Time m_target
5 ms target queue delay
uint32_t Time2CoDel(Time t)
Return the unsigned 32-bit integer representation of the input Time object.
bool OkToDrop(Ptr< QueueDiscItem > item, uint32_t now)
Determine whether a packet is OK to be dropped.
uint16_t m_recInvSqrt
Reciprocal inverse square root.
uint32_t m_minBytes
Minimum bytes in queue to allow a packet drop.
TracedValue< bool > m_dropping
True if in dropping state.
TracedValue< uint32_t > m_count
Number of packets dropped since entering drop state.
bool m_useL4s
True if L4S is used (ECT1 packets are marked at CE threshold)
static constexpr const char * CE_THRESHOLD_EXCEEDED_MARK
Sojourn time above CE threshold.
bool CoDelTimeAfter(uint32_t a, uint32_t b)
Check if CoDel time a is successive to b.
Test 3: NewtonStep unit test - test against explicit port of Linux implementation.
static TypeId GetTypeId(void)
Get the type ID.
bool CoDelTimeAfterEq(uint32_t a, uint32_t b)
Check if CoDel time a is successive or equal to b.
uint32_t GetDropNext(void)
Get the time for next packet drop while in the dropping state.
Test 4: ControlLaw unit test - test against explicit port of Linux implementation.
bool m_useEcn
True if ECN is used (packets are marked instead of being dropped)