61 #ifndef RED_QUEUE_DISC_H
62 #define RED_QUEUE_DISC_H
64 #include "ns3/packet.h"
65 #include "ns3/queue-disc.h"
66 #include "ns3/nstime.h"
67 #include "ns3/boolean.h"
68 #include "ns3/data-rate.h"
69 #include "ns3/nstime.h"
70 #include "ns3/random-variable-stream.h"
187 void SetTh (
double minTh,
double maxTh);
235 double Estimator (uint32_t nQueued, uint32_t m,
double qAvg,
double qW);
261 double CalculatePNew (
double qAvg,
double ,
bool gentle,
double vA,
262 double vB,
double vC,
double vD,
double maxP);
273 double ModifyP (
double p, uint32_t count, uint32_t countBytes,
274 uint32_t meanPktSize,
bool wait, uint32_t size);
331 #endif // RED_QUEUE_DISC_H
bool m_isGentle
True to increases dropping prob.
Simulation virtual time values and global simulation resolution.
uint32_t GetQueueSize(void)
Get the current value of the queue in bytes or packets.
Smart pointer class similar to boost::intrusive_ptr.
double m_beta
Decrement parameter for m_curMaxP in ARED.
uint32_t m_count
Number of packets since last random number generation.
bool m_isARED
True to enable Adaptive RED.
void SetTh(double minTh, double maxTh)
Set the thresh limits of RED.
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
double m_qAvg
Average queue length.
Time m_linkDelay
Link delay.
void SetAredBeta(double beta)
Set the beta value to adapt m_curMaxP.
uint32_t m_idle
0/1 idle status
double m_vD
2.0 * m_curMaxP - 1.0 - used in "gentle" mode
double m_vC
(1.0 - m_curMaxP) / m_maxTh - used in "gentle" mode
double m_qW
Queue weight given to cur queue size sample.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Stats m_stats
RED statistics.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
double GetAredAlpha(void)
Get the alpha value to adapt m_curMaxP.
Time m_rtt
Rtt to be considered while automatically setting m_bottom in ARED.
double m_alpha
Increment parameter for m_curMaxP in ARED.
Time m_lastSet
Last time m_curMaxP was updated.
void UpdateMaxP(double newAve, Time now)
Update m_curMaxP.
bool m_isAdaptMaxP
True to adapt m_curMaxP.
static TypeId GetTypeId(void)
Get the type ID.
Class for representing data rates.
double m_curMaxP
Current max_p.
QueueMode
Enumeration of the modes supported in the class.
void SetQueueLimit(uint32_t lim)
Set the limit of the queue.
Time m_idleTime
Start of current idle period.
uint32_t forcedDrop
Forced drops, qavg > max threshold.
uint32_t m_queueLimit
Queue limit in bytes / packets.
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
virtual void InitializeParams(void)
Initialize the queue parameters.
uint32_t m_cautious
0 for default RED 1 experimental (see red-queue.cc) 2 experimental (see red-queue.cc) 3 use Idle packet size in the ptc
uint32_t qLimDrop
Drops due to queue limits.
Ptr< UniformRandomVariable > m_uv
rng stream
Queue::QueueMode m_mode
Mode (Bytes or packets)
double m_vB
-m_minTh / (m_maxTh - m_minTh)
double m_minTh
Min avg length threshold (bytes)
uint32_t m_idlePktSize
Avg pkt size used during idle times.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double m_vA
1.0 / (m_maxTh - m_minTh)
double CalculatePNew(double qAvg, double, bool gentle, double vA, double vB, double vC, double vD, double maxP)
Returns a probability using these function parameters for the DropEarly function. ...
uint32_t m_countBytes
Number of bytes since last drop.
double m_lInterm
The max probability of dropping a packet.
Queue::QueueMode GetMode(void)
Get the encapsulation mode of this queue.
uint32_t DropEarly(Ptr< QueueDiscItem > item, uint32_t qSize)
Check if a packet needs to be dropped due to probability mark.
RedQueueDisc()
RedQueueDisc Constructor.
double m_bottom
Lower bound for m_curMaxP in ARED.
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
An "unforced" (random) drop.
uint32_t m_old
0 when average queue first exceeds threshold
double ModifyP(double p, uint32_t count, uint32_t countBytes, uint32_t meanPktSize, bool wait, uint32_t size)
Returns a probability using these function parameters for the DropEarly function. ...
DataRate m_linkBandwidth
Link bandwidth.
Time m_interval
Time interval to update m_curMaxP.
void SetMode(Queue::QueueMode mode)
Set the operating mode of this queue.
bool m_isWait
True for waiting between dropped packets.
Time m_targetDelay
Target average queuing delay in ARED.
double GetAredBeta(void)
Get the beta value to adapt m_curMaxP.
double m_ptc
packet time constant in packets/second
virtual ~RedQueueDisc()
Destructor.
double m_top
Upper bound for m_curMaxP in ARED.
double Estimator(uint32_t nQueued, uint32_t m, double qAvg, double qW)
Compute the average queue size.
uint32_t m_meanPktSize
Avg pkt size.
void SetAredAlpha(double alpha)
Set the alpha value to adapt m_curMaxP.
virtual Ptr< const QueueDiscItem > DoPeek(void) const
This function returns a copy of the next packet the queue disc will extract.
virtual void DoDispose(void)
Dispose of the object.
a unique identifier for an interface.
Stats GetStats()
Get the RED statistics after running.
double m_maxTh
Max avg length threshold (bytes), should be >= 2*minTh.
uint32_t unforcedDrop
Early probability drops.
bool m_isNs1Compat
Ns-1 compatibility.