65 #include "ns3/packet.h"
66 #include "ns3/queue.h"
67 #include "ns3/nstime.h"
68 #include "ns3/boolean.h"
69 #include "ns3/data-rate.h"
70 #include "ns3/nstime.h"
75 class UniformRandomVariable;
160 void SetTh (
double minTh,
double maxTh);
201 double Estimator (uint32_t nQueued, uint32_t m,
double qAvg,
double qW);
221 double CalculatePNew (
double qAvg,
double ,
bool gentle,
double vA,
222 double vB,
double vC,
double vD,
double maxP);
233 double ModifyP (
double p, uint32_t count, uint32_t countBytes,
234 uint32_t meanPktSize,
bool wait, uint32_t size);
285 #endif // RED_QUEUE_H
uint32_t m_bytesInQueue
bytes in the queue
uint32_t qLimDrop
Drops due to queue limits.
Ptr< UniformRandomVariable > m_uv
rng stream
QueueMode m_mode
Mode (Bytes or packets)
Simulation virtual time values and global simulation resolution.
uint32_t DropEarly(Ptr< Packet > p, uint32_t qSize)
Check if packet p needs to be dropped due to probability mark.
virtual ~RedQueue()
Destructor.
void SetMode(RedQueue::QueueMode mode)
Set the operating mode of this queue.
double m_ptc
packet time constant in packets/second
void SetQueueLimit(uint32_t lim)
Set the limit of the queue.
virtual Ptr< Packet > DoDequeue(void)
Pull a packet from the queue.
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
virtual bool DoEnqueue(Ptr< Packet > p)
Push a packet in the queue.
DataRate m_linkBandwidth
Link bandwidth.
uint32_t m_queueLimit
Queue limit in bytes / packets.
Stats m_stats
RED statistics.
Abstract base class for packet Queues.
Class for representing data rates.
bool m_isGentle
True to increases dropping prob.
uint32_t GetQueueSize(void)
Get the current value of the queue in bytes or packets.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Time m_linkDelay
Link delay.
std::list< Ptr< Packet > > m_packets
packets in the queue
double m_vA
1.0 / (m_maxTh - m_minTh)
RedQueue::QueueMode GetMode(void)
Get the encapsulation mode of this queue.
Stats GetStats()
Get the RED statistics after running.
uint32_t m_countBytes
Number of bytes since last drop.
virtual Ptr< const Packet > DoPeek(void) const
Peek the front packet in the queue.
uint32_t m_meanPktSize
Avg pkt size.
RedQueue()
RedQueue Constructor.
bool m_isNs1Compat
Ns-1 compatibility.
double m_lInterm
The max probability of dropping a packet.
static TypeId GetTypeId(void)
Get the type ID.
double Estimator(uint32_t nQueued, uint32_t m, double qAvg, double qW)
Compute the average queue size.
void SetTh(double minTh, double maxTh)
Set the thresh limits of RED.
An "unforced" (random) drop.
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_count
Number of packets since last random number generation.
uint32_t m_idle
0/1 idle status
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. ...
void InitializeParams(void)
Initialize the queue parameters.
bool m_isWait
True for waiting between dropped packets.
uint32_t m_old
0 when average queue first exceeds threshold
bool m_hasRedStarted
True if RED has started.
QueueMode
Enumeration of the modes supported in the class.
uint32_t m_idlePktSize
Avg pkt size used during idle times.
Time m_idleTime
Start of current idle period.
uint32_t forcedDrop
Forced drops, qavg > max threshold.
double m_qW
Queue weight given to cur queue size sample.
double m_qAvg
Average queue length.
double m_vB
-m_minTh / (m_maxTh - m_minTh)
uint32_t unforcedDrop
Early probability drops.
double m_vC
(1.0 - m_curMaxP) / m_maxTh - used in "gentle" mode
double m_maxTh
Max avg length threshold (bytes), should be >= 2*minTh.
double m_curMaxP
Current max_p.
a unique identifier for an interface.
double m_minTh
Min avg length threshold (bytes)
double m_vD
2.0 * m_curMaxP - 1.0 - used in "gentle" mode