A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
16
namespace
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
*/
38
class
PfifoFastQueueDisc
:
public
QueueDisc
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
*/
51
PfifoFastQueueDisc
();
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
;
67
Ptr<QueueDiscItem>
DoDequeue
()
override
;
68
Ptr<const QueueDiscItem>
DoPeek
()
override
;
69
bool
CheckConfig
()
override
;
70
void
InitializeParams
()
override
;
71
};
72
73
}
// namespace ns3
74
75
#endif
/* PFIFO_FAST_H */
ns3::PfifoFastQueueDisc
Linux pfifo_fast is the default priority queue enabled on Linux systems.
Definition
pfifo-fast-queue-disc.h:39
ns3::PfifoFastQueueDisc::DoEnqueue
bool DoEnqueue(Ptr< QueueDiscItem > item) override
This function actually enqueues a packet into the queue disc.
Definition
pfifo-fast-queue-disc.cc:55
ns3::PfifoFastQueueDisc::DoPeek
Ptr< const QueueDiscItem > DoPeek() override
Return a copy of the next packet the queue disc will extract.
Definition
pfifo-fast-queue-disc.cc:112
ns3::PfifoFastQueueDisc::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
pfifo-fast-queue-disc.cc:26
ns3::PfifoFastQueueDisc::CheckConfig
bool CheckConfig() override
Check whether the current configuration is correct.
Definition
pfifo-fast-queue-disc.cc:133
ns3::PfifoFastQueueDisc::DoDequeue
Ptr< QueueDiscItem > DoDequeue() override
This function actually extracts a packet from the queue disc.
Definition
pfifo-fast-queue-disc.cc:91
ns3::PfifoFastQueueDisc::LIMIT_EXCEEDED_DROP
static constexpr const char * LIMIT_EXCEEDED_DROP
Packet dropped due to queue disc limit exceeded.
Definition
pfifo-fast-queue-disc.h:56
ns3::PfifoFastQueueDisc::InitializeParams
void InitializeParams() override
Initialize parameters (if any) before the first packet is enqueued.
Definition
pfifo-fast-queue-disc.cc:187
ns3::PfifoFastQueueDisc::prio2band
static const uint32_t prio2band[16]
Priority to band map.
Definition
pfifo-fast-queue-disc.h:64
ns3::PfifoFastQueueDisc::~PfifoFastQueueDisc
~PfifoFastQueueDisc() override
Definition
pfifo-fast-queue-disc.cc:47
ns3::PfifoFastQueueDisc::PfifoFastQueueDisc
PfifoFastQueueDisc()
PfifoFastQueueDisc constructor.
Definition
pfifo-fast-queue-disc.cc:41
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::QueueDisc
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition
queue-disc.h:173
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
queue-disc.h
src
traffic-control
model
pfifo-fast-queue-disc.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0