View | Details | Raw Unified | Return to bug 2590
Collapse All | Expand All

(-)a/src/traffic-control/model/red-queue-disc.cc (-3 / +6 lines)
 Lines 569-576    Link Here 
569
569
570
// Update m_curMaxP to keep the average queue length within the target range.
570
// Update m_curMaxP to keep the average queue length within the target range.
571
void
571
void
572
RedQueueDisc::UpdateMaxP (double newAve, Time now)
572
RedQueueDisc::UpdateMaxP (double newAve)
573
{
573
{
574
  NS_LOG_FUNCTION (this << newAve);
575
576
  Time now = Simulator::Now ();
574
  double m_part = 0.4 * (m_maxTh - m_minTh);
577
  double m_part = 0.4 * (m_maxTh - m_minTh);
575
  // AIMD rule to keep target Q~1/2(m_minTh + m_maxTh)
578
  // AIMD rule to keep target Q~1/2(m_minTh + m_maxTh)
576
  if (newAve < m_minTh + m_part && m_curMaxP > m_bottom)
579
  if (newAve < m_minTh + m_part && m_curMaxP > m_bottom)
 Lines 601-610    Link Here 
601
  double newAve = qAvg * pow(1.0-qW, m);
604
  double newAve = qAvg * pow(1.0-qW, m);
602
  newAve += qW * nQueued;
605
  newAve += qW * nQueued;
603
606
604
  Time now = Simulator::Now();
607
  Time now = Simulator::Now ();
605
  if (m_isAdaptMaxP && now > m_lastSet + m_interval)
608
  if (m_isAdaptMaxP && now > m_lastSet + m_interval)
606
    {
609
    {
607
      UpdateMaxP(newAve, now);
610
      UpdateMaxP (newAve);
608
    }
611
    }
609
612
610
  return newAve;
613
  return newAve;
(-)a/src/traffic-control/model/red-queue-disc.h (-5 / +3 lines)
 Lines 66-72    Link Here 
66
#include "ns3/nstime.h"
66
#include "ns3/nstime.h"
67
#include "ns3/boolean.h"
67
#include "ns3/boolean.h"
68
#include "ns3/data-rate.h"
68
#include "ns3/data-rate.h"
69
#include "ns3/nstime.h"
70
#include "ns3/random-variable-stream.h"
69
#include "ns3/random-variable-stream.h"
71
70
72
namespace ns3 {
71
namespace ns3 {
 Lines 238-246    Link Here 
238
   /**
237
   /**
239
    * \brief Update m_curMaxP
238
    * \brief Update m_curMaxP
240
    * \param newAve new average queue length
239
    * \param newAve new average queue length
241
    * \param now Current Time
242
    */
240
    */
243
  void UpdateMaxP (double newAve, Time now);
241
  void UpdateMaxP (double newAve);
244
  /**
242
  /**
245
   * \brief Check if a packet needs to be dropped due to probability mark
243
   * \brief Check if a packet needs to be dropped due to probability mark
246
   * \param item queue item
244
   * \param item queue item
 Lines 320-327    Link Here 
320
  uint32_t m_count;         //!< Number of packets since last random number generation
318
  uint32_t m_count;         //!< Number of packets since last random number generation
321
  /**
319
  /**
322
   * 0 for default RED
320
   * 0 for default RED
323
   * 1 experimental (see red-queue.cc)
321
   * 1 experimental (see red-queue-disc.cc)
324
   * 2 experimental (see red-queue.cc)
322
   * 2 experimental (see red-queue-disc.cc)
325
   * 3 use Idle packet size in the ptc
323
   * 3 use Idle packet size in the ptc
326
   */
324
   */
327
  uint32_t m_cautious;
325
  uint32_t m_cautious;

Return to bug 2590