From 3b85d0da5ba464f358ecbabb7b1578b956ae1958 Mon Sep 17 00:00:00 2001 From: "Mohit P. Tahiliani" Date: Mon, 9 Jan 2017 20:01:36 +0100 Subject: [PATCH] traffic-control: (fixes #2512, #2590) Various small fixes regarding the RED queue disc --- RELEASE_NOTES | 2 ++ src/traffic-control/model/red-queue-disc.cc | 9 ++++++--- src/traffic-control/model/red-queue-disc.h | 8 +++----- src/traffic-control/test/red-queue-disc-test-suite.cc | 3 ++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index a14729c9c..71aa95a90 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -33,6 +33,7 @@ Bugs fixed - Bug 2485 - Check for queue full should happen before checking RED thresholds - Bug 2492 - uan: Make use of RxGain attribute in UanPhyGen class - Bug 2511 - HT Greenfield is not working +- Bug 2512 - Byte mode not configured correctly in red-queue-disc-test-suite.cc - Bug 2513 - ParetoRandomVariable needs a "scale", not a "mean" attribute. - Bug 2521 - Include ipv6-option.h in wscript - Bug 2527 - PrintRoutingTable extended to add an optional Time::Units parameter @@ -56,6 +57,7 @@ Bugs fixed - Bug 2566 - BlockAckManager::GetNRetryNeededPackets missing some packets in the queue - Bug 2577 - simulation crashes when A-MPDU and multiple TOS are used with RTS-CTS enabled - Bug 2584 - MacLow triggers StartNext even if there is no TXOP +- Bug 2590 - Minor enhancements in red-queue-disc{.h, .cc} - Bug 2591 - 802.11e Block Ack mechanism cannot be enabled on HT/VHT stations - Bug 2594 - vht-wifi-network provides very low throughtput at MCS 6, 160 MHz, SGI - Bug 2614 - RIP header version should be set to 2 diff --git a/src/traffic-control/model/red-queue-disc.cc b/src/traffic-control/model/red-queue-disc.cc index 65c4217e8..957d4266c 100644 --- a/src/traffic-control/model/red-queue-disc.cc +++ b/src/traffic-control/model/red-queue-disc.cc @@ -569,8 +569,11 @@ RedQueueDisc::InitializeParams (void) // Update m_curMaxP to keep the average queue length within the target range. void -RedQueueDisc::UpdateMaxP (double newAve, Time now) +RedQueueDisc::UpdateMaxP (double newAve) { + NS_LOG_FUNCTION (this << newAve); + + Time now = Simulator::Now (); double m_part = 0.4 * (m_maxTh - m_minTh); // AIMD rule to keep target Q~1/2(m_minTh + m_maxTh) if (newAve < m_minTh + m_part && m_curMaxP > m_bottom) @@ -601,10 +604,10 @@ RedQueueDisc::Estimator (uint32_t nQueued, uint32_t m, double qAvg, double qW) double newAve = qAvg * pow(1.0-qW, m); newAve += qW * nQueued; - Time now = Simulator::Now(); + Time now = Simulator::Now (); if (m_isAdaptMaxP && now > m_lastSet + m_interval) { - UpdateMaxP(newAve, now); + UpdateMaxP(newAve); } return newAve; diff --git a/src/traffic-control/model/red-queue-disc.h b/src/traffic-control/model/red-queue-disc.h index 216c1b31f..116ee8d2a 100644 --- a/src/traffic-control/model/red-queue-disc.h +++ b/src/traffic-control/model/red-queue-disc.h @@ -66,7 +66,6 @@ #include "ns3/nstime.h" #include "ns3/boolean.h" #include "ns3/data-rate.h" -#include "ns3/nstime.h" #include "ns3/random-variable-stream.h" namespace ns3 { @@ -238,9 +237,8 @@ private: /** * \brief Update m_curMaxP * \param newAve new average queue length - * \param now Current Time */ - void UpdateMaxP (double newAve, Time now); + void UpdateMaxP (double newAve); /** * \brief Check if a packet needs to be dropped due to probability mark * \param item queue item @@ -320,8 +318,8 @@ private: uint32_t m_count; //!< Number of packets since last random number generation /** * 0 for default RED - * 1 experimental (see red-queue.cc) - * 2 experimental (see red-queue.cc) + * 1 experimental (see red-queue-disc.cc) + * 2 experimental (see red-queue-disc.cc) * 3 use Idle packet size in the ptc */ uint32_t m_cautious; diff --git a/src/traffic-control/test/red-queue-disc-test-suite.cc b/src/traffic-control/test/red-queue-disc-test-suite.cc index be9b0c90a..3d0e669df 100644 --- a/src/traffic-control/test/red-queue-disc-test-suite.cc +++ b/src/traffic-control/test/red-queue-disc-test-suite.cc @@ -112,7 +112,8 @@ RedQueueDiscTestCase::RunRedTest (StringValue mode) if (queue->GetMode () == Queue::QUEUE_MODE_BYTES) { - pktSize = 1000; + // pktSize should be same as MeanPktSize to avoid performance gap between byte and packet mode + pktSize = 500; modeSize = pktSize; queue->SetTh (minTh * modeSize, maxTh * modeSize); queue->SetQueueLimit (qSize * modeSize);