From a88916387064fad6205fd66bc400d608acce26b1 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 4 Mar 2021 08:42:24 -0800 Subject: [PATCH] traffic-control: Minor changes to rebase and finalize FqPie --- doc/models/Makefile | 1 + doc/models/source/traffic-control.rst | 1 + .../ns3tc/fq-pie-queue-disc-test-suite.cc | 117 ++++++++---------- src/traffic-control/doc/fq-pie.rst | 63 ++++++---- .../model/fq-pie-queue-disc.cc | 23 ++-- src/traffic-control/model/fq-pie-queue-disc.h | 57 +++++---- 6 files changed, 139 insertions(+), 123 deletions(-) mode change 100755 => 100644 src/traffic-control/model/fq-pie-queue-disc.cc mode change 100755 => 100644 src/traffic-control/model/fq-pie-queue-disc.h diff --git a/doc/models/Makefile b/doc/models/Makefile index 3fb25a0dc..7b2494ff7 100644 --- a/doc/models/Makefile +++ b/doc/models/Makefile @@ -92,6 +92,7 @@ SOURCES = \ $(SRC)/traffic-control/doc/fq-codel.rst \ $(SRC)/traffic-control/doc/fq-cobalt.rst \ $(SRC)/traffic-control/doc/pie.rst \ + $(SRC)/traffic-control/doc/fq-pie.rst \ $(SRC)/traffic-control/doc/mq.rst \ $(SRC)/spectrum/doc/spectrum.rst \ $(SRC)/netanim/doc/animation.rst \ diff --git a/doc/models/source/traffic-control.rst b/doc/models/source/traffic-control.rst index afdfaf2f0..3220aeadc 100644 --- a/doc/models/source/traffic-control.rst +++ b/doc/models/source/traffic-control.rst @@ -15,4 +15,5 @@ Traffic Control Layer cobalt fq-cobalt pie + fq-pie mq diff --git a/src/test/ns3tc/fq-pie-queue-disc-test-suite.cc b/src/test/ns3tc/fq-pie-queue-disc-test-suite.cc index 8eaa4bbd9..26aeac63b 100644 --- a/src/test/ns3tc/fq-pie-queue-disc-test-suite.cc +++ b/src/test/ns3tc/fq-pie-queue-disc-test-suite.cc @@ -1,6 +1,7 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2020 NITK Surathkal + * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2020 NITK Surathkal (modified for FQ-PIE) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -15,12 +16,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Bhaskar Kataria - * Tom Henderson - * Mohit P. Tahiliani - * Vivek Jain - * Ankit Deepak - * + * Authors: Pasquale Imputato + * Stefano Avallone + * Modified for FQ-PIE by: Bhaskar Kataria + * Tom Henderson + * Mohit P. Tahiliani + * Vivek Jain + * Ankit Deepak + * */ #include "ns3/test.h" @@ -48,7 +51,8 @@ int32_t g_hash; * Simple test packet filter able to classify IPv4 packets * */ -class Ipv4FqPieTestPacketFilter : public Ipv4PacketFilter { +class Ipv4FqPieTestPacketFilter : public Ipv4PacketFilter +{ public: /** * \brief Get the type ID. @@ -76,12 +80,10 @@ Ipv4FqPieTestPacketFilter::GetTypeId (void) } Ipv4FqPieTestPacketFilter::Ipv4FqPieTestPacketFilter () -{ -} +{} Ipv4FqPieTestPacketFilter::~Ipv4FqPieTestPacketFilter () -{ -} +{} int32_t Ipv4FqPieTestPacketFilter::DoClassify (Ptr item) const @@ -110,12 +112,10 @@ private: FqPieQueueDiscNoSuitableFilter::FqPieQueueDiscNoSuitableFilter () : TestCase ("Test packets that are not classified by any filter") -{ -} +{} FqPieQueueDiscNoSuitableFilter::~FqPieQueueDiscNoSuitableFilter () -{ -} +{} void FqPieQueueDiscNoSuitableFilter::DoRun (void) @@ -162,12 +162,10 @@ private: FqPieQueueDiscIPFlowsSeparationAndPacketLimit::FqPieQueueDiscIPFlowsSeparationAndPacketLimit () : TestCase ("Test IP flows separation and packet limit") -{ -} +{} FqPieQueueDiscIPFlowsSeparationAndPacketLimit::~FqPieQueueDiscIPFlowsSeparationAndPacketLimit () -{ -} +{} void FqPieQueueDiscIPFlowsSeparationAndPacketLimit::AddPacket (Ptr queue, Ipv4Header hdr) @@ -231,12 +229,10 @@ private: FqPieQueueDiscDeficit::FqPieQueueDiscDeficit () : TestCase ("Test credits and flows status") -{ -} +{} FqPieQueueDiscDeficit::~FqPieQueueDiscDeficit () -{ -} +{} void FqPieQueueDiscDeficit::AddPacket (Ptr queue, Ipv4Header hdr) @@ -250,7 +246,7 @@ FqPieQueueDiscDeficit::AddPacket (Ptr queue, Ipv4Header hdr) void FqPieQueueDiscDeficit::DoRun (void) { - Ptr queueDisc = CreateObjectWithAttributes (); + Ptr queueDisc = CreateObject (); queueDisc->SetQuantum (90); queueDisc->Initialize (); @@ -373,12 +369,10 @@ private: FqPieQueueDiscTCPFlowsSeparation::FqPieQueueDiscTCPFlowsSeparation () : TestCase ("Test TCP flows separation") -{ -} +{} FqPieQueueDiscTCPFlowsSeparation::~FqPieQueueDiscTCPFlowsSeparation () -{ -} +{} void FqPieQueueDiscTCPFlowsSeparation::AddPacket (Ptr queue, Ipv4Header ipHdr, TcpHeader tcpHdr) @@ -459,12 +453,10 @@ private: FqPieQueueDiscUDPFlowsSeparation::FqPieQueueDiscUDPFlowsSeparation () : TestCase ("Test UDP flows separation") -{ -} +{} FqPieQueueDiscUDPFlowsSeparation::~FqPieQueueDiscUDPFlowsSeparation () -{ -} +{} void FqPieQueueDiscUDPFlowsSeparation::AddPacket (Ptr queue, Ipv4Header ipHdr, UdpHeader udpHdr) @@ -535,20 +527,20 @@ FqPieQueueDiscUDPFlowsSeparation::DoRun (void) * creation capability of set associative hashing in FqPIE. * We modified DoClassify () and CheckProtocol () so that we could control * the hash returned for each packet. In the beginning, we use flow hashes - * ranging from 0 to 7. These must go into different queues in the same set. - * The set number for these is obtained using outerhash, which is 0. + * ranging from 0 to 7. These must go into different queues in the same set. + * The set number for these is obtained using outerhash, which is 0. * When a new packet arrives with flow hash 1024, outerhash = 0 is obtained * and the first set is iteratively searched. - * The packet is eventually added to queue 0 since the tags of queues - * in the set do not match with the hash of the flow. The tag of queue 0 is + * The packet is eventually added to queue 0 since the tags of queues + * in the set do not match with the hash of the flow. The tag of queue 0 is * updated as 1024. When a packet with hash 1025 arrives, outerhash = 0 - * is obtained and the first set is iteratively searched. + * is obtained and the first set is iteratively searched. * Since there is no match, it is added to queue 0 and the tag of queue 0 is * updated to 1025. * * The variable outerhash stores the nearest multiple of 8 that is lesser than * the hash. When a flow hash of 20 arrives, the value of outerhash - * is 16. Since m_flowIndices[16] wasn’t previously allotted, a new flow + * is 16. Since m_flowIndices[16] wasn't previously allotted, a new flow * is created, and the tag corresponding to this queue is set to 20. */ @@ -557,19 +549,18 @@ class FqPieQueueDiscSetLinearProbing : public TestCase public: FqPieQueueDiscSetLinearProbing (); virtual ~FqPieQueueDiscSetLinearProbing (); + private: virtual void DoRun (void); void AddPacket (Ptr queue, Ipv4Header hdr); }; FqPieQueueDiscSetLinearProbing::FqPieQueueDiscSetLinearProbing () - : TestCase ("Test credits and flows status") -{ -} + : TestCase ("Test credits and flows status") +{} FqPieQueueDiscSetLinearProbing::~FqPieQueueDiscSetLinearProbing () -{ -} +{} void FqPieQueueDiscSetLinearProbing::AddPacket (Ptr queue, Ipv4Header hdr) @@ -651,7 +642,7 @@ FqPieQueueDiscSetLinearProbing::DoRun (void) * This class tests L4S mode. This test is divided to sub test one without hash collisions and so ECT0 and ECT1 flows are * classified into different flows. * Sub Test 1 - * 70 packets are enqueued into both the flows with the delay of 0.5ms between two enqueues, and dequeued with the delay of + * 70 packets are enqueued into both the flows with the delay of 0.5ms between two enqueues, and dequeued with the delay of * 1ms between two dequeues. * Sub Test 2 * 140(70 ECT0 + 70 ECT1) packets are enqueued such that ECT1 packets are enqueued at 0.5ms, 1.5ms, 2.5ms and so on, and ECT0 packets are @@ -674,12 +665,10 @@ private: FqPieQueueDiscL4sMode::FqPieQueueDiscL4sMode () : TestCase ("Test L4S mode") -{ -} +{} FqPieQueueDiscL4sMode::~FqPieQueueDiscL4sMode () -{ -} +{} void FqPieQueueDiscL4sMode::AddPacket (Ptr queue, Ipv4Header hdr, uint32_t nPkt) @@ -728,9 +717,9 @@ FqPieQueueDiscL4sMode::DoRun (void) // 2) With hash collisions // Test case 1, Without hash collisions - Ptr queueDisc = CreateObjectWithAttributes ("MaxSize", StringValue ("10240p"), "UseEcn", BooleanValue (true), - "Perturbation", UintegerValue (0), "UseL4s", BooleanValue (true), - "CeThreshold", TimeValue (MilliSeconds (2))); + Ptr queueDisc = CreateObjectWithAttributes ("MaxSize", StringValue ("10240p"), + "UseEcn", BooleanValue (true), "Perturbation", UintegerValue (0), + "UseL4s", BooleanValue (true), "CeThreshold", TimeValue (MilliSeconds (2))); queueDisc->SetQuantum (1514); queueDisc->Initialize (); @@ -756,16 +745,16 @@ FqPieQueueDiscL4sMode::DoRun (void) DequeueWithDelay (queueDisc, delay, 140); Simulator::Stop (Seconds (10.0)); Simulator::Run (); - + Ptr q0 = queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetObject (); Ptr q1 = queueDisc->GetQueueDiscClass (1)->GetQueueDisc ()->GetObject (); NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNMarkedPackets (PieQueueDisc::CE_THRESHOLD_EXCEEDED_MARK), 66, "There should be 66 marked packets" - "4th packet is enqueued at 2ms and dequeued at 4ms hence the delay of 2ms which not greater than CE threshold" - "5th packet is enqueued at 2.5ms and dequeued at 5ms hence the delay of 2.5ms and subsequent packet also do have delay" - "greater than CE threshold so all the packets after 4th packet are marked"); + "4th packet is enqueued at 2ms and dequeued at 4ms hence the delay of 2ms which not greater than CE threshold" + "5th packet is enqueued at 2.5ms and dequeued at 5ms hence the delay of 2.5ms and subsequent packet also do have delay" + "greater than CE threshold so all the packets after 4th packet are marked"); NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNDroppedPackets (PieQueueDisc::UNFORCED_DROP), 0, "Queue delay is less than max burst allowance so" - "There should not be any dropped packets"); + "There should not be any dropped packets"); NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNMarkedPackets (PieQueueDisc::UNFORCED_MARK), 0, "There should not be any marked packets"); NS_TEST_EXPECT_MSG_EQ (q1->GetStats ().GetNMarkedPackets (PieQueueDisc::UNFORCED_MARK), 0, "There should not be marked packets."); NS_TEST_EXPECT_MSG_EQ (q1->GetStats ().GetNDroppedPackets (PieQueueDisc::UNFORCED_DROP), 0, "There should not be any dropped packets"); @@ -773,9 +762,9 @@ FqPieQueueDiscL4sMode::DoRun (void) Simulator::Destroy (); // Test case 2, With hash collisions - queueDisc = CreateObjectWithAttributes ("MaxSize", StringValue ("10240p"), "UseEcn", BooleanValue (true), - "Perturbation", UintegerValue (0), "UseL4s", BooleanValue (true), - "CeThreshold", TimeValue (MilliSeconds (2))); + queueDisc = CreateObjectWithAttributes ("MaxSize", StringValue ("10240p"), + "UseEcn", BooleanValue (true), "Perturbation", UintegerValue (0), + "UseL4s", BooleanValue (true), "CeThreshold", TimeValue (MilliSeconds (2))); queueDisc->SetQuantum (1514); queueDisc->Initialize (); @@ -803,11 +792,11 @@ FqPieQueueDiscL4sMode::DoRun (void) q0 = queueDisc->GetQueueDiscClass (0)->GetQueueDisc ()->GetObject (); NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNMarkedPackets (PieQueueDisc::CE_THRESHOLD_EXCEEDED_MARK), 68, "There should be 68 marked packets" - "2nd ECT1 packet is enqueued at 1.5ms and dequeued at 3ms hence the delay of 1.5ms which not greater than CE threshold" - "3rd packet is enqueued at 2.5ms and dequeued at 5ms hence the delay of 2.5ms and subsequent packet also do have delay" - "greater than CE threshold so all the packets after 2nd packet are marked"); + "2nd ECT1 packet is enqueued at 1.5ms and dequeued at 3ms hence the delay of 1.5ms which not greater than CE threshold" + "3rd packet is enqueued at 2.5ms and dequeued at 5ms hence the delay of 2.5ms and subsequent packet also do have delay" + "greater than CE threshold so all the packets after 2nd packet are marked"); NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNDroppedPackets (PieQueueDisc::UNFORCED_DROP), 0, "Queue delay is less than max burst allowance so" - "There should not be any dropped packets"); + "There should not be any dropped packets"); NS_TEST_EXPECT_MSG_EQ (q0->GetStats ().GetNMarkedPackets (PieQueueDisc::UNFORCED_MARK), 0, "There should not be any marked packets"); Simulator::Destroy (); diff --git a/src/traffic-control/doc/fq-pie.rst b/src/traffic-control/doc/fq-pie.rst index 0397e2401..469e5e65f 100644 --- a/src/traffic-control/doc/fq-pie.rst +++ b/src/traffic-control/doc/fq-pie.rst @@ -2,61 +2,76 @@ .. highlight:: cpp .. highlight:: bash -FqPIE queue disc ------------------- +FQ-PIE queue disc +----------------- -This chapter describes the FqPIE ([Hoe16]_) queue disc implementation in |ns3|. - -The FlowQueue-PIE (FQ-PIE) algorithm is similar to the FlowQueue part of FlowQueue-CoDel (FQ-CoDel) algorithm available in ns-3-dev/src/traffic-control/doc/fq-codel.rst. -The documentation for PIE is available in ns-3-dev/src/traffic-control/doc/pie.rst. +This chapter describes the FQ-PIE ([Ram19]_) queue disc implementation in |ns3|. +The FQ-PIE queue disc combines the Proportional Integral Controller Enhanced +(PIE) AQM algorithm with the FlowQueue scheduler that is part of FQ-CoDel +(also available in |ns3|). FQ-PIE was introduced to Linux kernel version 5.6. Model Description ***************** -The source code for the FqPIE queue disc is located in the directory +The source code for the ``FqPieQueueDisc`` is located in the directory ``src/traffic-control/model`` and consists of 2 files `fq-pie-queue-disc.h` and `fq-pie-queue-disc.cc` defining a FqPieQueueDisc class and a helper FqPieFlow class. The code was ported to |ns3| based on Linux kernel code implemented by Mohit P. Tahiliani. -The Model Description is similar to the FqCoDel documentation mentioned above. - +This model calculates drop probability independently in each flow queue. +One difficulty, as pointed out by [CableLabs14]_, is that PIE calculates +drop probability based on the departure rate of a (flow) queue, which may +be more highly variable than the aggregate queue. An alternative, which +CableLabs has called SFQ-PIE, is to calculate an overall drop probability +for the entire queue structure, and then scale this drop probability based +on the ratio of the queue depth of each flow queue compared with the depth +of the current largest queue. This ns-3 model does not implement the +SFQ-PIE variant described by CableLabs. References ========== -.. [CAK16] https://github.com/torvalds/linux/blob/master/net/sched/sch_fq_pie.c , Implementation of FqPIE in Linux -.. [PIE] https://ieeexplore.ieee.org/document/9000684 +.. [Ram19] G. Ramakrishnan, M. Bhasi, V. Saicharan, L. Monis, S. D. Patil and M. P. Tahiliani, "FQ-PIE Queue Discipline in the Linux Kernel: Design, Implementation and Challenges," 2019 IEEE 44th LCN Symposium on Emerging Topics in Networking (LCN Symposium), Osnabrueck, Germany, 2019, pp. 117-124, + +.. [CableLabs14] G. White, Active Queue Management in DOCSIS 3.X Cable Modems, CableLabs white paper, May 2014. Attributes ========== -The key attributes that the FqPieQueue class holds include the following: +The key attributes that the FqPieQueue class holds include the following. +First, there are PIE-specific attributes that are copied into the individual +PIE flow queues: -Most of the key attributes are similar to the FqCoDel implementation mentioned above. -Some differences are: -Absence of ``MinBytes``, ``Interval`` and ``Target`` parameter. -Some extra parameters are +* ``UseEcn:`` Whether to use ECN marking * ``MarkEcnThreshold:`` ECN marking threshold (RFC 8033 suggests 0.1 (i.e., 10%) default). -* ``MeanPktSize:`` Average of packet size. -* ``A:`` Decrement value of drop probability. Default value is 1./4096 . -* ``B:`` The Threshold after which Blue is enabled. Default value is 400ms. +* ``UseL4s:`` Whether to use L4S (only mark ECT1 packets at CE threshold) +* ``MeanPktSize:`` Constant used to roughly convert bytes to packets +* ``A:`` Alpha value in PIE algorithm drop probability calculation +* ``B:`` Beta value in PIE algorithm drop probability calculation * ``Tupdate:`` Time period to calculate drop probability * ``Supdate:`` Start time of the update timer * ``DequeueThreshold:`` Minimum queue size in bytes before dequeue rate is measured -* ``QueueDelayReference:`` Desired queue delay -* ``MaxBurstAllowance:`` Current max burst allowance before random drop +* ``QueueDelayReference:`` AQM latency target +* ``MaxBurstAllowance:`` AQM max burst allowance before random drop * ``UseDequeueRateEstimator:`` Enable/Disable usage of Dequeue Rate Estimator * ``UseCapDropAdjustment:`` Enable/Disable Cap Drop Adjustment feature mentioned in RFC 8033 * ``UseDerandomization:`` Enable/Disable Derandomization feature mentioned in RFC 8033 +Second, there are QueueDisc level, or FQ-specific attributes:: +* ``MaxSize:`` Maximum number of packets in the queue disc +* ``Flows:`` Maximum number of flow queues +* ``DropBatchSize:`` Maximum number of packets dropped from the fat flow +* ``Perturbation:`` Salt value used as hash input when classifying flows +* ``EnableSetAssociativeHash:`` Enable or disable set associative hash +* ``SetWays:`` Size of a set of queues in set associative hash Examples ======== -A typical usage pattern is to create a traffic control helper and to configure type -and attributes of queue disc and filters from the helper. For example, FqPIE +A typical usage pattern is to create a traffic control helper and to configure +the type and attributes of queue disc and filters from the helper. For example, FqPIE can be configured as follows: .. sourcecode:: cpp @@ -80,4 +95,4 @@ The test suite can be run using the following commands:: or:: - $ NS_LOG="FqPieQueueDisc" ./waf --run "test-runner --suite=fq-pie-queue-disc" \ No newline at end of file + $ NS_LOG="FqPieQueueDisc" ./waf --run "test-runner --suite=fq-pie-queue-disc" diff --git a/src/traffic-control/model/fq-pie-queue-disc.cc b/src/traffic-control/model/fq-pie-queue-disc.cc old mode 100755 new mode 100644 index 872c28830..bf55c496b --- a/src/traffic-control/model/fq-pie-queue-disc.cc +++ b/src/traffic-control/model/fq-pie-queue-disc.cc @@ -1,6 +1,7 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2018 NITK Surathkal + * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2018 NITK Surathkal (modified for FQ-PIE) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -15,10 +16,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Sumukha PK - * Prajval M <26prajval98@gmail.com> - * Ishaan R D - * Mohit P. Tahiliani + * Authors: Pasquale Imputato + * Stefano Avallone + * Modified for FQ-PIE by: Sumukha PK + * Prajval M <26prajval98@gmail.com> + * Ishaan R D + * Mohit P. Tahiliani */ @@ -139,7 +142,7 @@ TypeId FqPieQueueDisc::GetTypeId (void) "Average of packet size", UintegerValue (1000), MakeUintegerAccessor (&FqPieQueueDisc::m_meanPktSize), - MakeUintegerChecker ()) + MakeUintegerChecker ()) .AddAttribute ("A", "Value of alpha", DoubleValue (0.125), @@ -437,7 +440,8 @@ FqPieQueueDisc::DoDequeue (void) { NS_LOG_DEBUG ("Dequeued packet " << item->GetPacket ()); } - } while (item == 0); + } + while (item == 0); flow->IncreaseDeficit (item->GetSize () * -1); @@ -490,7 +494,7 @@ FqPieQueueDisc::CheckConfig (void) // If UseL4S attribute is enabled then CE threshold must be set. if (m_useL4s) { - NS_ABORT_MSG_IF (m_ceThreshold == Time::Max(), "CE threshold not set"); + NS_ABORT_MSG_IF (m_ceThreshold == Time::Max (), "CE threshold not set"); if (m_useEcn == false) { NS_LOG_WARN ("Enabling ECN as L4S mode is enabled"); @@ -552,7 +556,8 @@ FqPieQueueDisc::FqPieDrop (void) item = qd->GetInternalQueue (0)->Dequeue (); DropAfterDequeue (item, OVERLIMIT_DROP); len += item->GetSize (); - } while (++count < m_dropBatchSize && len < threshold); + } + while (++count < m_dropBatchSize && len < threshold); return index; } diff --git a/src/traffic-control/model/fq-pie-queue-disc.h b/src/traffic-control/model/fq-pie-queue-disc.h old mode 100755 new mode 100644 index 0f9b49e8b..ad793afd9 --- a/src/traffic-control/model/fq-pie-queue-disc.h +++ b/src/traffic-control/model/fq-pie-queue-disc.h @@ -1,6 +1,7 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2018 NITK Surathkal + * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2018 NITK Surathkal (modified for FQ-PIE) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -15,10 +16,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Sumukha PK - * Prajval M <26prajval98@gmail.com> - * Ishaan R D - * Mohit P. Tahiliani + * Authors: Pasquale Imputato + * Stefano Avallone + * Modified for FQ-PIE by: Sumukha PK + * Prajval M <26prajval98@gmail.com> + * Ishaan R D + * Mohit P. Tahiliani */ #ifndef FQ_PIE_QUEUE_DISC @@ -37,7 +40,8 @@ namespace ns3 { * \brief A flow queue used by the FqPie queue disc */ -class FqPieFlow : public QueueDiscClass { +class FqPieFlow : public QueueDiscClass +{ public: /** * \brief Get the type ID. @@ -56,11 +60,11 @@ public: * \brief Used to determine the status of this flow queue */ enum FlowStatus - { - INACTIVE, - NEW_FLOW, - OLD_FLOW - }; + { + INACTIVE, + NEW_FLOW, + OLD_FLOW + }; /** * \brief Set the deficit for this flow @@ -111,7 +115,8 @@ private: * \brief A FqPie packet queue disc */ -class FqPieQueueDisc : public QueueDisc { +class FqPieQueueDisc : public QueueDisc +{ public: /** * \brief Get the type ID. @@ -125,19 +130,19 @@ public: virtual ~FqPieQueueDisc (); - /** - * \brief Set the quantum value. - * - * \param quantum The number of bytes each queue gets to dequeue on each round of the scheduling algorithm - */ - void SetQuantum (uint32_t quantum); + /** + * \brief Set the quantum value. + * + * \param quantum The number of bytes each queue gets to dequeue on each round of the scheduling algorithm + */ + void SetQuantum (uint32_t quantum); - /** - * \brief Get the quantum value. - * - * \returns The number of bytes each queue gets to dequeue on each round of the scheduling algorithm - */ - uint32_t GetQuantum (void) const; + /** + * \brief Get the quantum value. + * + * \returns The number of bytes each queue gets to dequeue on each round of the scheduling algorithm + */ + uint32_t GetQuantum (void) const; // Reasons for dropping packets static constexpr const char* UNCLASSIFIED_DROP = "Unclassified drop"; //!< No packet filter able to classify packet @@ -178,7 +183,7 @@ private: double m_b; //!< Parameter to pie controller uint32_t m_dqThreshold; //!< Minimum queue size in bytes before dequeue rate is measured bool m_useDqRateEstimator; //!< Enable/Disable usage of dequeue rate estimator for queue delay calculation - bool m_isCapDropAdjustment;//!< Enable/Disable Cap Drop Adjustment feature mentioned in RFC 8033 + bool m_isCapDropAdjustment; //!< Enable/Disable Cap Drop Adjustment feature mentioned in RFC 8033 bool m_useDerandomization; //!< Enable Derandomization feature mentioned in RFC 8033 // Fq parameters @@ -201,4 +206,4 @@ private: } // namespace ns3 -#endif /* FQ_PIE_QUEUE_DISC */ \ No newline at end of file +#endif /* FQ_PIE_QUEUE_DISC */