A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
pfifo-fast-queue-disc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007, 2014 University of Washington
3 * 2015 Universita' degli Studi di Napoli Federico II
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Authors: Stefano Avallone <stavallo@unina.it>
8 * Tom Henderson <tomhend@u.washington.edu>
9 */
10
11#ifndef PFIFO_FAST_H
12#define PFIFO_FAST_H
13
14#include "queue-disc.h"
15
16namespace ns3
17{
18
19/**
20 * \ingroup traffic-control
21 *
22 * Linux pfifo_fast is the default priority queue enabled on Linux
23 * systems. Packets are enqueued in three FIFO droptail queues according
24 * to three priority bands based on the packet priority.
25 *
26 * The system behaves similar to three ns3::DropTail queues operating
27 * together, in which packets from higher priority bands are always
28 * dequeued before a packet from a lower priority band is dequeued.
29 *
30 * The queue disc capacity, i.e., the maximum number of packets that can
31 * be enqueued in the queue disc, is set through the limit attribute, which
32 * plays the same role as txqueuelen in Linux. If no internal queue is
33 * provided, three DropTail queues having each a capacity equal to limit are
34 * created by default. User is allowed to provide queues, but they must be
35 * three, operate in packet mode and each have a capacity not less
36 * than limit. No packet filter can be provided.
37 */
39{
40 public:
41 /**
42 * \brief Get the type ID.
43 * \return the object TypeId
44 */
45 static TypeId GetTypeId();
46 /**
47 * \brief PfifoFastQueueDisc constructor
48 *
49 * Creates a queue with a depth of 1000 packets per band by default
50 */
52
53 ~PfifoFastQueueDisc() override;
54
55 // Reasons for dropping packets
56 static constexpr const char* LIMIT_EXCEEDED_DROP =
57 "Queue disc limit exceeded"; //!< Packet dropped due to queue disc limit exceeded
58
59 private:
60 /**
61 * Priority to band map. Values are taken from the prio2band array used by
62 * the Linux pfifo_fast queue disc.
63 */
64 static const uint32_t prio2band[16];
65
66 bool DoEnqueue(Ptr<QueueDiscItem> item) override;
69 bool CheckConfig() override;
70 void InitializeParams() override;
71};
72
73} // namespace ns3
74
75#endif /* PFIFO_FAST_H */
Linux pfifo_fast is the default priority queue enabled on Linux systems.
bool DoEnqueue(Ptr< QueueDiscItem > item) override
This function actually enqueues a packet into the queue disc.
Ptr< const QueueDiscItem > DoPeek() override
Return a copy of the next packet the queue disc will extract.
static TypeId GetTypeId()
Get the type ID.
bool CheckConfig() override
Check whether the current configuration is correct.
Ptr< QueueDiscItem > DoDequeue() override
This function actually extracts a packet from the queue disc.
static constexpr const char * LIMIT_EXCEEDED_DROP
Packet dropped due to queue disc limit exceeded.
void InitializeParams() override
Initialize parameters (if any) before the first packet is enqueued.
static const uint32_t prio2band[16]
Priority to band map.
PfifoFastQueueDisc()
PfifoFastQueueDisc constructor.
Smart pointer class similar to boost::intrusive_ptr.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition queue-disc.h:173
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.