A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
fq-codel-queue-disc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Pasquale Imputato <p.imputato@gmail.com>
18 * Stefano Avallone <stefano.avallone@unina.it>
19 */
20
21#ifndef FQ_CODEL_QUEUE_DISC
22#define FQ_CODEL_QUEUE_DISC
23
24#include "ns3/object-factory.h"
25#include "ns3/queue-disc.h"
26
27#include <list>
28#include <map>
29
30namespace ns3
31{
32
40{
41 public:
46 static TypeId GetTypeId();
51
52 ~FqCoDelFlow() override;
53
59 {
63 };
64
69 void SetDeficit(uint32_t deficit);
74 int32_t GetDeficit() const;
79 void IncreaseDeficit(int32_t deficit);
84 void SetStatus(FlowStatus status);
89 FlowStatus GetStatus() const;
94 void SetIndex(uint32_t index);
99 uint32_t GetIndex() const;
100
101 private:
105};
106
114{
115 public:
120 static TypeId GetTypeId();
125
126 ~FqCoDelQueueDisc() override;
127
134 void SetQuantum(uint32_t quantum);
135
142 uint32_t GetQuantum() const;
143
144 // Reasons for dropping packets
145 static constexpr const char* UNCLASSIFIED_DROP =
146 "Unclassified drop";
147 static constexpr const char* OVERLIMIT_DROP = "Overlimit drop";
148
149 private:
150 bool DoEnqueue(Ptr<QueueDiscItem> item) override;
151 Ptr<QueueDiscItem> DoDequeue() override;
152 bool CheckConfig() override;
153 void InitializeParams() override;
154
160
161 bool m_useEcn;
170
171 std::string m_interval;
172 std::string m_target;
180 bool m_useL4s;
181
182 std::list<Ptr<FqCoDelFlow>> m_newFlows;
183 std::list<Ptr<FqCoDelFlow>> m_oldFlows;
184
185 std::map<uint32_t, uint32_t> m_flowsIndices;
186 std::map<uint32_t, uint32_t> m_tags;
187
190};
191
192} // namespace ns3
193
194#endif /* FQ_CODEL_QUEUE_DISC */
A flow queue used by the FqCoDel queue disc.
FqCoDelFlow()
FqCoDelFlow constructor.
FlowStatus GetStatus() const
Get the status of this flow.
void SetIndex(uint32_t index)
Set the index for this flow.
uint32_t GetIndex() const
Get the index of this flow.
static TypeId GetTypeId()
Get the type ID.
void SetDeficit(uint32_t deficit)
Set the deficit for this flow.
int32_t m_deficit
the deficit for this flow
FlowStatus m_status
the status of this flow
int32_t GetDeficit() const
Get the deficit for this flow.
uint32_t m_index
the index for this flow
void IncreaseDeficit(int32_t deficit)
Increase the deficit for this flow.
void SetStatus(FlowStatus status)
Set the status for this flow.
FlowStatus
Used to determine the status of this flow queue.
A FqCoDel packet queue disc.
std::list< Ptr< FqCoDelFlow > > m_oldFlows
The list of old flows.
Time m_ceThreshold
Threshold above which to CE mark.
uint32_t m_setWays
size of a set of queues (used by set associative hash)
void InitializeParams() override
Initialize parameters (if any) before the first packet is enqueued.
ObjectFactory m_queueDiscFactory
Factory to create a new queue.
static constexpr const char * UNCLASSIFIED_DROP
No packet filter able to classify packet.
static constexpr const char * OVERLIMIT_DROP
Overlimit dropped packets.
ObjectFactory m_flowFactory
Factory to create a new flow.
uint32_t FqCoDelDrop()
Drop a packet from the head of the queue with the largest current byte count.
Ptr< QueueDiscItem > DoDequeue() override
This function actually extracts a packet from the queue disc.
void SetQuantum(uint32_t quantum)
Set the quantum value.
std::string m_interval
CoDel interval attribute.
uint32_t m_dropBatchSize
Max number of packets dropped from the fat flow.
bool DoEnqueue(Ptr< QueueDiscItem > item) override
This function actually enqueues a packet into the queue disc.
std::string m_target
CoDel target attribute.
bool m_useEcn
True if ECN is used (packets are marked instead of being dropped)
FqCoDelQueueDisc()
FqCoDelQueueDisc constructor.
uint32_t m_perturbation
hash perturbation value
std::map< uint32_t, uint32_t > m_flowsIndices
Map with the index of class for each flow.
std::map< uint32_t, uint32_t > m_tags
Tags used by set associative hash.
bool CheckConfig() override
Check whether the current configuration is correct.
uint32_t SetAssociativeHash(uint32_t flowHash)
Compute the index of the queue for the flow having the given flowHash, according to the set associati...
bool m_useL4s
True if L4S is used (ECT1 packets are marked at CE threshold)
bool m_enableSetAssociativeHash
whether to enable set associative hash
uint32_t m_quantum
Deficit assigned to flows at each round.
std::list< Ptr< FqCoDelFlow > > m_newFlows
The list of new flows.
static TypeId GetTypeId()
Get the type ID.
uint32_t m_flows
Number of flow queues.
uint32_t GetQuantum() const
Get the quantum value.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
QueueDiscClass is the base class for classes that are included in a queue disc.
Definition: queue-disc.h:52
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition: queue-disc.h:184
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.