traffic-control: Remove deprecated QueueDisc attributes

This commit is contained in:
Stefano Avallone
2018-05-29 23:42:05 +02:00
parent 7e1f2d3612
commit f65cc17cd3
16 changed files with 25 additions and 482 deletions

View File

@@ -81,6 +81,11 @@ or with a string value with 'b' (bytes) or 'p' (packets) suffix, such as:
Config::SetDefault ("ns3::QueueBase::MaxSize", StringValue ("4p"));
</pre>
</li>
<li>The Limit attribute of the PfifoFastQueueDisc class, that had been deprecated in favor of the MaxSize attribute in ns-3.28, has now been removed and cannot be used anymore. Likewise, the methods to get/set the old Limit attribute have been removed as well. The GetMaxSize/SetMaxSize methods of the base QueueDisc class must be used instead.</li>
<li>The Mode, MaxPackets and MaxBytes attributes of the CoDelQueueDisc class, that had been deprecated in favor of the MaxSize attribute in ns-3.28, have now been removed and cannot be used anymore. Likewise, the methods to get/set the old attributes have been removed as well. The GetMaxSize/SetMaxSize methods of the base QueueDisc class must be used instead.</li>
<li>The PacketLimit attribute of the FqCoDelQueueDisc class, that had been deprecated in favor of the MaxSize attribute in ns-3.28, has now been removed and cannot be used anymore. Likewise, the methods to get/set the old PacketLimit attribute have been removed as well. The GetMaxSize/SetMaxSize methods of the base QueueDisc class must be used instead.</li>
<li>The Mode and QueueLimit attributes of the PieQueueDisc class, that had been deprecated in favor of the MaxSize attribute in ns-3.28, have now been removed and cannot be used anymore. Likewise, the methods to get/set the old attributes have been removed as well. The GetMaxSize/SetMaxSize methods of the base QueueDisc class must be used instead.</li>
<li>The Mode and QueueLimit attributes of the RedQueueDisc class, that had been deprecated in favor of the MaxSize attribute in ns-3.28, have now been removed and cannot be used anymore. Likewise, the methods to get/set the old attributes have been removed as well. The GetMaxSize/SetMaxSize methods of the base QueueDisc class must be used instead.</li>
</ul>
<h2>Changes to build system:</h2>
<ul>

View File

@@ -346,13 +346,13 @@ int main (int argc, char *argv[])
Time access_d (access_delay);
Time bottle_d (delay);
Config::SetDefault ("ns3::CoDelQueueDisc::Mode", EnumValue (CoDelQueueDisc::QUEUE_DISC_MODE_BYTES));
uint32_t size = static_cast<uint32_t>((std::min (access_b, bottle_b).GetBitRate () / 8) *
((access_d + bottle_d) * 2).GetSeconds ());
Config::SetDefault ("ns3::PfifoFastQueueDisc::Limit", UintegerValue (size / mtu_bytes));
Config::SetDefault ("ns3::CoDelQueueDisc::MaxBytes", UintegerValue (size));
Config::SetDefault ("ns3::PfifoFastQueueDisc::MaxSize",
QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, size / mtu_bytes)));
Config::SetDefault ("ns3::CoDelQueueDisc::MaxSize",
QueueSizeValue (QueueSize (QueueSizeUnit::BYTES, size)));
for (uint32_t i = 0; i < num_flows; i++)
{

View File

@@ -78,7 +78,7 @@ main (int argc, char *argv[])
// single PointToPointNetDevice (NetDevice 0) and added a
// DropTailQueue to it.
// Now, we can manipulate the MaxPackets value of the already
// Now, we can manipulate the MaxSize value of the already
// instantiated DropTailQueue. Here are various ways to do that.
// We assume that a smart pointer (Ptr) to a relevant network device
@@ -97,7 +97,7 @@ main (int argc, char *argv[])
Ptr<Queue<Packet> > txQueue = ptr.Get<Queue<Packet> > ();
// Using the GetObject function, we can perform a safe downcast
// to a DropTailQueue, where MaxPackets is a member
// to a DropTailQueue, where MaxSize is a member
Ptr<DropTailQueue<Packet> > dtq = txQueue->GetObject <DropTailQueue<Packet> > ();
NS_ASSERT (dtq);

View File

@@ -179,7 +179,7 @@ the default pfifo_fast can be configured as follows:
TrafficControlHelper tch;
uint16_t handle = tch.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
tch.AddInternalQueues (handle, 3, "ns3::DropTailQueue", "MaxPackets", UintegerValue (1000));
tch.AddInternalQueues (handle, 3, "ns3::DropTailQueue", "MaxSize", StringValue ("1000p"));
QueueDiscContainer qdiscs = tch.Install (devices);
The above code adds three internal queues and a packet filter to the root queue disc of type PfifoFast.

View File

@@ -73,7 +73,7 @@ std::stringstream filePlotQueueDiscAvg;
void
CheckQueueDiscSize (Ptr<QueueDisc> queue)
{
uint32_t qSize = StaticCast<PieQueueDisc> (queue)->GetQueueSize ();
uint32_t qSize = queue->GetCurrentSize ().GetValue ();
avgQueueDiscSize += qSize;
checkTimes++;

View File

@@ -411,9 +411,8 @@ main (int argc, char *argv[])
// like in ns2 test, r2 -> r1, have a queue in packet mode
Ptr<QueueDisc> queue = queueDiscs.Get (1);
StaticCast<RedQueueDisc> (queue)->SetMode (RedQueueDisc::QUEUE_DISC_MODE_PACKETS);
queue->SetMaxSize (QueueSize ("1000p"));
StaticCast<RedQueueDisc> (queue)->SetTh (5, 15);
StaticCast<RedQueueDisc> (queue)->SetQueueLimit (1000);
}
BuildAppsTest (redTest);

View File

@@ -74,34 +74,9 @@ TypeId CoDelQueueDisc::GetTypeId (void)
.SetParent<QueueDisc> ()
.SetGroupName ("TrafficControl")
.AddConstructor<CoDelQueueDisc> ()
.AddAttribute ("Mode",
"Whether to use Bytes (see MaxBytes) or Packets (see MaxPackets) as the maximum queue size metric.",
EnumValue (QUEUE_DISC_MODE_BYTES),
MakeEnumAccessor (&CoDelQueueDisc::SetMode,
&CoDelQueueDisc::GetMode),
MakeEnumChecker (QUEUE_DISC_MODE_BYTES, "QUEUE_DISC_MODE_BYTES",
QUEUE_DISC_MODE_PACKETS, "QUEUE_DISC_MODE_PACKETS"),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MaxPackets",
"The maximum number of packets accepted by this CoDelQueueDisc.",
UintegerValue (DEFAULT_CODEL_LIMIT),
MakeUintegerAccessor (&CoDelQueueDisc::SetMaxPackets,
&CoDelQueueDisc::GetMaxPackets),
MakeUintegerChecker<uint32_t> (),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MaxBytes",
"The maximum number of bytes accepted by this CoDelQueueDisc.",
UintegerValue (1500 * DEFAULT_CODEL_LIMIT),
MakeUintegerAccessor (&CoDelQueueDisc::SetMaxBytes,
&CoDelQueueDisc::GetMaxBytes),
MakeUintegerChecker<uint32_t> (),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MaxSize",
"The maximum number of packets/bytes accepted by this queue disc.",
QueueSizeValue (QueueSize ("0p")),
QueueSizeValue (QueueSize (QueueSizeUnit::BYTES, 1500 * DEFAULT_CODEL_LIMIT)),
MakeQueueSizeAccessor (&QueueDisc::SetMaxSize,
&QueueDisc::GetMaxSize),
MakeQueueSizeChecker ())
@@ -143,8 +118,6 @@ TypeId CoDelQueueDisc::GetTypeId (void)
CoDelQueueDisc::CoDelQueueDisc ()
: QueueDisc (QueueDiscSizePolicy::SINGLE_INTERNAL_QUEUE),
m_maxPackets (1), // to avoid that setting the mode at construction time is ignored
m_maxBytes (1), // to avoid that setting the mode at construction time is ignored
m_count (0),
m_lastCount (0),
m_dropping (false),
@@ -184,72 +157,6 @@ CoDelQueueDisc::ControlLaw (uint32_t t)
return t + ReciprocalDivide (Time2CoDel (m_interval), m_recInvSqrt << REC_INV_SQRT_SHIFT);
}
void
CoDelQueueDisc::SetMode (QueueDiscMode mode)
{
NS_LOG_FUNCTION (this << mode);
if (mode == QUEUE_DISC_MODE_BYTES)
{
SetMaxSize (QueueSize (QueueSizeUnit::BYTES, m_maxBytes));
}
else if (mode == QUEUE_DISC_MODE_PACKETS)
{
SetMaxSize (QueueSize (QueueSizeUnit::PACKETS, m_maxPackets));
}
else
{
NS_ABORT_MSG ("Unknown queue size unit");
}
}
CoDelQueueDisc::QueueDiscMode
CoDelQueueDisc::GetMode (void) const
{
NS_LOG_FUNCTION (this);
return (GetMaxSize ().GetUnit () == QueueSizeUnit::PACKETS ? QUEUE_DISC_MODE_PACKETS : QUEUE_DISC_MODE_BYTES);
}
void
CoDelQueueDisc::SetMaxPackets (uint32_t maxPackets)
{
NS_LOG_FUNCTION (this << maxPackets);
m_maxPackets = maxPackets;
if (GetMaxSize ().GetUnit () == QueueSizeUnit::PACKETS)
{
SetMaxSize (QueueSize (QueueSizeUnit::PACKETS, m_maxPackets));
}
}
uint32_t
CoDelQueueDisc::GetMaxPackets (void) const
{
NS_LOG_FUNCTION (this);
return m_maxPackets;
}
void
CoDelQueueDisc::SetMaxBytes (uint32_t maxBytes)
{
NS_LOG_FUNCTION (this << maxBytes);
m_maxBytes = maxBytes;
if (GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES)
{
SetMaxSize (QueueSize (QueueSizeUnit::BYTES, m_maxBytes));
}
}
uint32_t
CoDelQueueDisc::GetMaxBytes (void) const
{
NS_LOG_FUNCTION (this);
return m_maxBytes;
}
bool
CoDelQueueDisc::DoEnqueue (Ptr<QueueDiscItem> item)
{
@@ -437,24 +344,6 @@ CoDelQueueDisc::DoDequeue (void)
return item;
}
uint32_t
CoDelQueueDisc::GetQueueSize (void)
{
NS_LOG_FUNCTION (this);
if (GetMode () == QUEUE_DISC_MODE_BYTES)
{
return GetInternalQueue (0)->GetNBytes ();
}
else if (GetMode () == QUEUE_DISC_MODE_PACKETS)
{
return GetInternalQueue (0)->GetNPackets ();
}
else
{
NS_ABORT_MSG ("Unknown mode.");
}
}
Time
CoDelQueueDisc::GetTarget (void)
{

View File

@@ -77,42 +77,6 @@ public:
virtual ~CoDelQueueDisc ();
/**
* \brief Enumeration of the modes supported in the class.
* \deprecated This enum will go away in future versions of ns-3.
*
*/
enum QueueDiscMode
{
QUEUE_DISC_MODE_PACKETS, /**< Use number of packets for maximum queue disc size */
QUEUE_DISC_MODE_BYTES, /**< Use number of bytes for maximum queue disc size */
};
/**
* \brief Set the operating mode of this queue disc.
*
* \param mode The operating mode of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetMode (QueueDiscMode mode);
/**
* \brief Get the operating mode of this queue disc.
*
* \returns The operating mode of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead GetMaxSize()
*/
QueueDiscMode GetMode (void) const;
/**
* \brief Get the current value of the queue in bytes or packets.
*
* \returns The queue size in bytes or packets.
*/
uint32_t GetQueueSize (void);
/**
* \brief Get the target queue delay
*
@@ -139,38 +103,6 @@ public:
static constexpr const char* OVERLIMIT_DROP = "Overlimit drop"; //!< Overlimit dropped packet
private:
/**
* \brief Set the maximum amount of packets that can be stored in this queue
*
* \param maxPackets amount of packets
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetMaxPackets (uint32_t maxPackets);
/**
* \return the maximum amount of packets that can be stored in this queue
* \deprecated This method will go away in future versions of ns-3.
* See instead GetMaxSize()
*/
uint32_t GetMaxPackets (void) const;
/**
* \brief Set the maximum amount of bytes that can be stored in this queue
*
* \param maxBytes amount of bytes
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetMaxBytes (uint32_t maxBytes);
/**
* \return the maximum amount of bytes that can be stored in this queue
* \deprecated This method will go away in future versions of ns-3.
* See instead GetMaxSize()
*/
uint32_t GetMaxBytes (void) const;
friend class::CoDelQueueDiscNewtonStepTest; // Test code
friend class::CoDelQueueDiscControlLawTest; // Test code
/**
@@ -262,8 +194,6 @@ private:
virtual void InitializeParams (void);
uint32_t m_maxPackets; //!< Max # of packets accepted by the queue
uint32_t m_maxBytes; //!< Max # of bytes accepted by the queue
uint32_t m_minBytes; //!< Minimum bytes in queue to allow a packet drop
Time m_interval; //!< 100 ms sliding minimum time window width
Time m_target; //!< 5 ms target queue delay
@@ -277,7 +207,6 @@ private:
uint32_t m_state2; //!< Number of times we perform next drop while in dropping state
uint32_t m_state3; //!< Number of times we enter drop state and drop the fist packet
uint32_t m_states; //!< Total number of times we are in state 1, state 2, or state 3
QueueDiscMode m_mode; //!< The operating mode (Bytes or packets)
};
} // namespace ns3

View File

@@ -108,17 +108,9 @@ TypeId FqCoDelQueueDisc::GetTypeId (void)
StringValue ("5ms"),
MakeStringAccessor (&FqCoDelQueueDisc::m_target),
MakeStringChecker ())
.AddAttribute ("PacketLimit",
"The hard limit on the real queue size, measured in packets",
UintegerValue (10 * 1024),
MakeUintegerAccessor (&FqCoDelQueueDisc::SetLimit,
&FqCoDelQueueDisc::GetLimit),
MakeUintegerChecker<uint32_t> (),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MaxSize",
"The maximum number of packets accepted by this queue disc",
QueueSizeValue (QueueSize ("0p")),
QueueSizeValue (QueueSize ("10240p")),
MakeQueueSizeAccessor (&QueueDisc::SetMaxSize,
&QueueDisc::GetMaxSize),
MakeQueueSizeChecker ())
@@ -318,20 +310,6 @@ FqCoDelQueueDisc::DoPeek (void)
return PeekDequeued ();
}
void
FqCoDelQueueDisc::SetLimit (uint32_t limit)
{
NS_LOG_FUNCTION (this << limit);
SetMaxSize (QueueSize (QueueSizeUnit::PACKETS, limit));
}
uint32_t
FqCoDelQueueDisc::GetLimit (void) const
{
NS_LOG_FUNCTION (this);
return GetMaxSize ().GetValue ();
}
bool
FqCoDelQueueDisc::CheckConfig (void)
{

View File

@@ -131,24 +131,6 @@ public:
static constexpr const char* OVERLIMIT_DROP = "Overlimit drop"; //!< Overlimit dropped packets
private:
/**
* \brief Set the limit of this queue disc.
*
* \param limit The limit of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetLimit (uint32_t limit);
/**
* \brief Get the limit of this queue disc.
*
* \returns The limit of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead GetMaxSize()
*/
uint32_t GetLimit (void) const;
virtual bool DoEnqueue (Ptr<QueueDiscItem> item);
virtual Ptr<QueueDiscItem> DoDequeue (void);
virtual Ptr<const QueueDiscItem> DoPeek (void);

View File

@@ -39,17 +39,9 @@ TypeId PfifoFastQueueDisc::GetTypeId (void)
.SetParent<QueueDisc> ()
.SetGroupName ("TrafficControl")
.AddConstructor<PfifoFastQueueDisc> ()
.AddAttribute ("Limit",
"The maximum number of packets accepted by this queue disc.",
UintegerValue (1000),
MakeUintegerAccessor (&PfifoFastQueueDisc::SetLimit,
&PfifoFastQueueDisc::GetLimit),
MakeUintegerChecker<uint32_t> (),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MaxSize",
"The maximum number of packets accepted by this queue disc.",
QueueSizeValue (QueueSize ("0p")),
QueueSizeValue (QueueSize ("1000p")),
MakeQueueSizeAccessor (&QueueDisc::SetMaxSize,
&QueueDisc::GetMaxSize),
MakeQueueSizeChecker ())
@@ -148,20 +140,6 @@ PfifoFastQueueDisc::DoPeek (void)
return item;
}
void
PfifoFastQueueDisc::SetLimit (uint32_t limit)
{
NS_LOG_FUNCTION (this << limit);
SetMaxSize (QueueSize (QueueSizeUnit::PACKETS, limit));
}
uint32_t
PfifoFastQueueDisc::GetLimit (void) const
{
NS_LOG_FUNCTION (this);
return GetMaxSize ().GetValue ();
}
bool
PfifoFastQueueDisc::CheckConfig (void)
{

View File

@@ -66,24 +66,6 @@ public:
static constexpr const char* LIMIT_EXCEEDED_DROP = "Queue disc limit exceeded"; //!< Packet dropped due to queue disc limit exceeded
private:
/**
* \brief Set the limit of this queue disc.
*
* \param limit The limit of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetLimit (uint32_t limit);
/**
* \brief Get the limit of this queue disc.
*
* \returns The limit of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead GetMaxSize()
*/
uint32_t GetLimit (void) const;
/**
* Priority to band map. Values are taken from the prio2band array used by
* the Linux pfifo_fast queue disc.

View File

@@ -47,15 +47,6 @@ TypeId PieQueueDisc::GetTypeId (void)
.SetParent<QueueDisc> ()
.SetGroupName ("TrafficControl")
.AddConstructor<PieQueueDisc> ()
.AddAttribute ("Mode",
"Determines unit for QueueLimit",
EnumValue (QUEUE_DISC_MODE_PACKETS),
MakeEnumAccessor (&PieQueueDisc::SetMode,
&PieQueueDisc::GetMode),
MakeEnumChecker (QUEUE_DISC_MODE_BYTES, "QUEUE_DISC_MODE_BYTES",
QUEUE_DISC_MODE_PACKETS, "QUEUE_DISC_MODE_PACKETS"),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MeanPktSize",
"Average of packet size",
UintegerValue (1000),
@@ -81,16 +72,9 @@ TypeId PieQueueDisc::GetTypeId (void)
TimeValue (Seconds (0)),
MakeTimeAccessor (&PieQueueDisc::m_sUpdate),
MakeTimeChecker ())
.AddAttribute ("QueueLimit",
"Queue limit in bytes/packets",
UintegerValue (25),
MakeUintegerAccessor (&PieQueueDisc::SetQueueLimit),
MakeUintegerChecker<uint32_t> (),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MaxSize",
"The maximum number of packets accepted by this queue disc",
QueueSizeValue (QueueSize ("0p")),
QueueSizeValue (QueueSize ("25p")),
MakeQueueSizeAccessor (&QueueDisc::SetMaxSize,
&QueueDisc::GetMaxSize),
MakeQueueSizeChecker ())
@@ -136,57 +120,6 @@ PieQueueDisc::DoDispose (void)
QueueDisc::DoDispose ();
}
void
PieQueueDisc::SetMode (QueueDiscMode mode)
{
NS_LOG_FUNCTION (this << mode);
if (mode == QUEUE_DISC_MODE_BYTES)
{
SetMaxSize (QueueSize (QueueSizeUnit::BYTES, GetMaxSize ().GetValue ()));
}
else if (mode == QUEUE_DISC_MODE_PACKETS)
{
SetMaxSize (QueueSize (QueueSizeUnit::PACKETS, GetMaxSize ().GetValue ()));
}
else
{
NS_ABORT_MSG ("Unknown queue size unit");
}
}
PieQueueDisc::QueueDiscMode
PieQueueDisc::GetMode (void) const
{
NS_LOG_FUNCTION (this);
return (GetMaxSize ().GetUnit () == QueueSizeUnit::PACKETS ? QUEUE_DISC_MODE_PACKETS : QUEUE_DISC_MODE_BYTES);
}
void
PieQueueDisc::SetQueueLimit (uint32_t lim)
{
NS_LOG_FUNCTION (this << lim);
SetMaxSize (QueueSize (GetMaxSize ().GetUnit (), lim));
}
uint32_t
PieQueueDisc::GetQueueSize (void)
{
NS_LOG_FUNCTION (this);
if (GetMode () == QUEUE_DISC_MODE_BYTES)
{
return GetInternalQueue (0)->GetNBytes ();
}
else if (GetMode () == QUEUE_DISC_MODE_PACKETS)
{
return GetInternalQueue (0)->GetNPackets ();
}
else
{
NS_ABORT_MSG ("Unknown PIE mode.");
}
}
Time
PieQueueDisc::GetQueueDelay (void)
{
@@ -266,7 +199,7 @@ bool PieQueueDisc::DropEarly (Ptr<QueueDiscItem> item, uint32_t qSize)
uint32_t packetSize = item->GetSize ();
if (GetMode () == QUEUE_DISC_MODE_BYTES)
if (GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES)
{
p = p * packetSize / m_meanPktSize;
}
@@ -277,11 +210,11 @@ bool PieQueueDisc::DropEarly (Ptr<QueueDiscItem> item, uint32_t qSize)
{
return false;
}
else if (GetMode () == QUEUE_DISC_MODE_BYTES && qSize <= 2 * m_meanPktSize)
else if (GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES && qSize <= 2 * m_meanPktSize)
{
return false;
}
else if (GetMode () == QUEUE_DISC_MODE_PACKETS && qSize <= 2)
else if (GetMaxSize ().GetUnit () == QueueSizeUnit::PACKETS && qSize <= 2)
{
return false;
}

View File

@@ -77,51 +77,6 @@ public:
IN_BURST_PROTECTING,
};
/**
* \brief Enumeration of the modes supported in the class.
* \deprecated This enum will go away in future versions of ns-3.
*
*/
enum QueueDiscMode
{
QUEUE_DISC_MODE_PACKETS, /**< Use number of packets for maximum queue disc size */
QUEUE_DISC_MODE_BYTES, /**< Use number of bytes for maximum queue disc size */
};
/**
* \brief Set the operating mode of this queue disc.
*
* \param mode The operating mode of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetMode (QueueDiscMode mode);
/**
* \brief Get the operating mode of this queue disc.
*
* \returns The operating mode of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead GetMaxSize()
*/
QueueDiscMode GetMode (void) const;
/**
* \brief Get the current value of the queue in bytes or packets.
*
* \returns The queue size in bytes or packets.
*/
uint32_t GetQueueSize (void);
/**
* \brief Set the limit of the queue in bytes or packets.
*
* \param lim The limit in bytes or packets.
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetQueueLimit (uint32_t lim);
/**
* \brief Get queue delay.
*

View File

@@ -78,15 +78,6 @@ TypeId RedQueueDisc::GetTypeId (void)
.SetParent<QueueDisc> ()
.SetGroupName("TrafficControl")
.AddConstructor<RedQueueDisc> ()
.AddAttribute ("Mode",
"Determines unit for QueueLimit",
EnumValue (QUEUE_DISC_MODE_PACKETS),
MakeEnumAccessor (&RedQueueDisc::SetMode,
&RedQueueDisc::GetMode),
MakeEnumChecker (QUEUE_DISC_MODE_BYTES, "QUEUE_DISC_MODE_BYTES",
QUEUE_DISC_MODE_PACKETS, "QUEUE_DISC_MODE_PACKETS"),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MeanPktSize",
"Average of packet size",
UintegerValue (500),
@@ -137,16 +128,9 @@ TypeId RedQueueDisc::GetTypeId (void)
DoubleValue (15),
MakeDoubleAccessor (&RedQueueDisc::m_maxTh),
MakeDoubleChecker<double> ())
.AddAttribute ("QueueLimit",
"Queue limit in bytes/packets",
UintegerValue (25),
MakeUintegerAccessor (&RedQueueDisc::SetQueueLimit),
MakeUintegerChecker<uint32_t> (),
TypeId::DEPRECATED,
"Use the MaxSize attribute instead")
.AddAttribute ("MaxSize",
"The maximum number of packets accepted by this queue disc",
QueueSizeValue (QueueSize ("0p")),
QueueSizeValue (QueueSize ("25p")),
MakeQueueSizeAccessor (&QueueDisc::SetMaxSize,
&QueueDisc::GetMaxSize),
MakeQueueSizeChecker ())
@@ -260,32 +244,6 @@ RedQueueDisc::DoDispose (void)
QueueDisc::DoDispose ();
}
void
RedQueueDisc::SetMode (QueueDiscMode mode)
{
NS_LOG_FUNCTION (this << mode);
if (mode == QUEUE_DISC_MODE_BYTES)
{
SetMaxSize (QueueSize (QueueSizeUnit::BYTES, GetMaxSize ().GetValue ()));
}
else if (mode == QUEUE_DISC_MODE_PACKETS)
{
SetMaxSize (QueueSize (QueueSizeUnit::PACKETS, GetMaxSize ().GetValue ()));
}
else
{
NS_ABORT_MSG ("Unknown queue size unit");
}
}
RedQueueDisc::QueueDiscMode
RedQueueDisc::GetMode (void) const
{
NS_LOG_FUNCTION (this);
return (GetMaxSize ().GetUnit () == QueueSizeUnit::PACKETS ? QUEUE_DISC_MODE_PACKETS : QUEUE_DISC_MODE_BYTES);
}
void
RedQueueDisc::SetAredAlpha (double alpha)
{
@@ -362,13 +320,6 @@ RedQueueDisc::GetFengAdaptiveB (void)
return m_b;
}
void
RedQueueDisc::SetQueueLimit (uint32_t lim)
{
NS_LOG_FUNCTION (this << lim);
SetMaxSize (QueueSize (GetMaxSize ().GetUnit (), lim));
}
void
RedQueueDisc::SetTh (double minTh, double maxTh)
{
@@ -536,7 +487,7 @@ RedQueueDisc::InitializeParams (void)
{
m_minTh = targetqueue / 2.0;
}
if (GetMode () == QUEUE_DISC_MODE_BYTES)
if (GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES)
{
m_minTh = m_minTh * m_meanPktSize;
}
@@ -812,7 +763,7 @@ RedQueueDisc::ModifyP (double p, uint32_t size)
NS_LOG_FUNCTION (this << p << size);
double count1 = (double) m_count;
if (GetMode () == QUEUE_DISC_MODE_BYTES)
if (GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES)
{
count1 = (double) (m_countBytes / m_meanPktSize);
}
@@ -844,7 +795,7 @@ RedQueueDisc::ModifyP (double p, uint32_t size)
}
}
if ((GetMode () == QUEUE_DISC_MODE_BYTES) && (p < 1.0))
if ((GetMaxSize ().GetUnit () == QueueSizeUnit::BYTES) && (p < 1.0))
{
p = (p * size) / m_meanPktSize;
}

View File

@@ -118,35 +118,6 @@ public:
DTYPE_UNFORCED, //!< An "unforced" (random) drop
};
/**
* \brief Enumeration of the modes supported in the class.
* \deprecated This enum will go away in future versions of ns-3.
*
*/
enum QueueDiscMode
{
QUEUE_DISC_MODE_PACKETS, /**< Use number of packets for maximum queue disc size */
QUEUE_DISC_MODE_BYTES, /**< Use number of bytes for maximum queue disc size */
};
/**
* \brief Set the operating mode of this queue disc.
*
* \param mode The operating mode of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetMode (QueueDiscMode mode);
/**
* \brief Get the operating mode of this queue disc.
*
* \returns The operating mode of this queue disc.
* \deprecated This method will go away in future versions of ns-3.
* See instead GetMaxSize()
*/
QueueDiscMode GetMode (void) const;
/**
* \brief Set the alpha value to adapt m_curMaxP.
*
@@ -203,15 +174,6 @@ public:
*/
double GetFengAdaptiveB (void);
/**
* \brief Set the limit of the queue.
*
* \param lim The limit in bytes or packets.
* \deprecated This method will go away in future versions of ns-3.
* See instead SetMaxSize()
*/
void SetQueueLimit (uint32_t lim);
/**
* \brief Set the thresh limits of RED.
*