|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
32 #include "ns3/queue-disc.h"
33 #include "ns3/nstime.h"
34 #include "ns3/boolean.h"
35 #include "ns3/data-rate.h"
36 #include "ns3/simulator.h"
37 #include "ns3/string.h"
38 #include "ns3/traced-value.h"
39 #include "ns3/random-variable-stream.h"
40 #include "ns3/trace-source-accessor.h"
44 #define REC_INV_SQRT_CACHE (16)
45 #define DEFAULT_COBALT_LIMIT 1000
a unique identifier for an interface.
double GetPdrop() const
Get the drop probability of Blue.
Time m_blueThreshold
Threshold to enable blue enhancement.
Ptr< UniformRandomVariable > m_uv
Rng stream.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void CacheInit(void)
There is a big difference in timing between the accurate values placed in the cache and the approxima...
virtual void DoDispose(void)
Dispose of the object.
static constexpr const char * FORCED_MARK
forced marks by Codel on ECN-enabled
double m_decrement
decrement value for marking probability
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
bool m_useL4s
True if L4S is used (ECT1 packets are marked at CE threshold)
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
virtual Ptr< const QueueDiscItem > DoPeek(void)
Return a copy of the next packet the queue disc will extract.
Time m_target
target queue delay
Time GetTarget(void) const
Get the target queue delay.
virtual void InitializeParams(void)
Initialize the queue parameters.
Time m_interval
sliding minimum time window width
uint32_t m_lastUpdateTimeBlue
Blue's last update time for drop probability.
int64_t Time2CoDel(Time t) const
Return the unsigned 32-bit integer representation of the input Time object.
Stats m_stats
Cobalt statistics.
Smart pointer class similar to boost::intrusive_ptr.
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
static constexpr const char * CE_THRESHOLD_EXCEEDED_MARK
Sojourn time above CE threshold.
uint32_t m_recInvSqrt
Reciprocal inverse square root.
double m_pDrop
Drop Probability.
bool CobaltShouldDrop(Ptr< QueueDiscItem > item, int64_t now)
Called to decide whether the current packet should be dropped based on decisions taken by Blue and Co...
TracedValue< bool > m_dropping
True if in dropping state.
int64_t GetDropNext(void) const
Get the time for next packet drop while in the dropping state.
void CobaltQueueEmpty(int64_t now)
Called when the queue becomes empty to alter the drop probabilities of Blue.
bool CoDelTimeAfter(int64_t a, int64_t b)
Check if CoDel time a is successive to b.
void CobaltQueueFull(int64_t now)
Called when the queue becomes full to alter the drop probabilities of Blue.
Simulation virtual time values and global simulation resolution.
Cobalt packet queue disc.
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
virtual ~CobaltQueueDisc()
Destructor.
int64_t ControlLaw(int64_t t)
Determine the time for next drop CoDel control law is t + m_interval/sqrt(m_count).
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
CobaltQueueDisc()
CobaltQueueDisc Constructor.
TracedValue< uint32_t > m_count
Number of packets dropped since entering drop state.
TracedValue< int64_t > m_dropNext
Time to drop next packet.
#define REC_INV_SQRT_CACHE
static constexpr const char * OVERLIMIT_DROP
Overlimit dropped packet.
uint32_t m_recInvSqrtCache[REC_INV_SQRT_CACHE]
Cache to maintain some initial values of InvSqrt.
bool m_useEcn
True if ECN is used (packets are marked instead of being dropped)
static TypeId GetTypeId(void)
Get the type ID.
bool CoDelTimeAfterEq(int64_t a, int64_t b)
Check if CoDel time a is successive or equal to b.
double m_increment
increment value for marking probability
Time GetInterval(void) const
Get the interval.
static constexpr const char * TARGET_EXCEEDED_DROP
Sojourn time above target.
Time m_ceThreshold
Threshold above which to CE mark.
void NewtonStep(void)
Calculate the reciprocal square root of m_count by using Newton's method http://en....