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
rr-wifi-queue-scheduler.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2026 Universita' degli Studi di Napoli Federico II
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Stefano Avallone <stavallo@unina.it>
7
*/
8
9
#ifndef RR_WIFI_QUEUE_SCHEDULER_H
10
#define RR_WIFI_QUEUE_SCHEDULER_H
11
12
#include "
wifi-mac-queue-scheduler-impl.h
"
13
#include "
wifi-psdu.h
"
14
15
#include "ns3/nstime.h"
16
17
#include <unordered_map>
18
#include <vector>
19
20
namespace
ns3
21
{
22
23
class
WifiMpdu
;
24
25
/**
26
* @ingroup wifi
27
*
28
* RrWifiQueueScheduler is a wifi queue scheduler that serves container queues in a round robin
29
* fashion. The priority of a container queue is defined as the last time a frame contained in that
30
* container queue was transmitted. Specifically, every time a frame is transmitted (regardless of
31
* the link used) within a TXOP of which this device is the holder, the priority of the container
32
* queue containing the frame is set to the current time. Container queues of a same AC are
33
* therefore sorted in increasing order of last serving time and, every time an AC of this device
34
* can transmit, the container queue at the front of the list for that AC is served.
35
*/
36
class
RrWifiQueueScheduler
:
public
WifiMacQueueSchedulerImpl
<WifiSchedPrecedence<Time>>
37
{
38
public
:
39
/**
40
* @brief Get the type ID.
41
* @return the object TypeId
42
*/
43
static
TypeId
GetTypeId
();
44
45
RrWifiQueueScheduler
();
46
47
void
SetWifiMac
(
Ptr<WifiMac>
mac)
override
;
48
49
private
:
50
void
DoNotifyEnqueue
(
AcIndex
ac,
Ptr<WifiMpdu>
mpdu)
override
;
51
void
DoNotifyDequeue
(
AcIndex
ac,
const
std::list<
Ptr<WifiMpdu>
>& mpdus)
override
;
52
void
DoNotifyRemove
(
AcIndex
ac,
const
std::list<
Ptr<WifiMpdu>
>& mpdus)
override
;
53
54
/**
55
* Callback connected to the PHY trace that is fired every time a PSDU (map) is transmitted.
56
* If the PSDU is transmitted in a TXOP of which this device is the holder, the priority of the
57
* queue(s) containing the transmitted MPDUs is updated.
58
*
59
* @param phyId the ID of the PHY transmitting the PSDUs
60
* @param psduMap the PSDU map
61
* @param txVector the TX vector
62
* @param txPower the tx power
63
*/
64
void
PsduTransmitted
(uint8_t phyId,
65
WifiConstPsduMap
psduMap,
66
WifiTxVector
txVector,
67
Watt_u
txPower);
68
69
/// Maps the queue Id of containers to the last time a frame from each of them was transmitted
70
using
QueueIdLastTimeMap
= std::unordered_map<WifiContainerQueueId, Time>;
71
72
/// per-AC map of last time a frame in each container queue was transmitted
73
std::vector<QueueIdLastTimeMap>
m_perAcQueueIdLastTxTime
{
AC_UNDEF
};
74
75
NS_LOG_TEMPLATE_DECLARE
;
//!< redefinition of the log component
76
};
77
78
}
// namespace ns3
79
80
#endif
/* RR_WIFI_QUEUE_SCHEDULER_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::RrWifiQueueScheduler::m_perAcQueueIdLastTxTime
std::vector< QueueIdLastTimeMap > m_perAcQueueIdLastTxTime
per-AC map of last time a frame in each container queue was transmitted
Definition
rr-wifi-queue-scheduler.h:73
ns3::RrWifiQueueScheduler::PsduTransmitted
void PsduTransmitted(uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower)
Callback connected to the PHY trace that is fired every time a PSDU (map) is transmitted.
Definition
rr-wifi-queue-scheduler.cc:56
ns3::RrWifiQueueScheduler::QueueIdLastTimeMap
std::unordered_map< WifiContainerQueueId, Time > QueueIdLastTimeMap
Maps the queue Id of containers to the last time a frame from each of them was transmitted.
Definition
rr-wifi-queue-scheduler.h:70
ns3::RrWifiQueueScheduler::NS_LOG_TEMPLATE_DECLARE
NS_LOG_TEMPLATE_DECLARE
redefinition of the log component
Definition
rr-wifi-queue-scheduler.h:75
ns3::RrWifiQueueScheduler::DoNotifyEnqueue
void DoNotifyEnqueue(AcIndex ac, Ptr< WifiMpdu > mpdu) override
Notify the scheduler that the given MPDU has been enqueued by the given Access Category.
Definition
rr-wifi-queue-scheduler.cc:87
ns3::RrWifiQueueScheduler::RrWifiQueueScheduler
RrWifiQueueScheduler()
Definition
rr-wifi-queue-scheduler.cc:36
ns3::RrWifiQueueScheduler::SetWifiMac
void SetWifiMac(Ptr< WifiMac > mac) override
Set the wifi MAC.
Definition
rr-wifi-queue-scheduler.cc:42
ns3::RrWifiQueueScheduler::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
rr-wifi-queue-scheduler.cc:27
ns3::RrWifiQueueScheduler::DoNotifyDequeue
void DoNotifyDequeue(AcIndex ac, const std::list< Ptr< WifiMpdu > > &mpdus) override
Notify the scheduler that the given list of MPDUs have been dequeued by the given Access Category.
Definition
rr-wifi-queue-scheduler.cc:101
ns3::RrWifiQueueScheduler::DoNotifyRemove
void DoNotifyRemove(AcIndex ac, const std::list< Ptr< WifiMpdu > > &mpdus) override
Notify the scheduler that the given list of MPDUs have been removed by the given Access Category.
Definition
rr-wifi-queue-scheduler.cc:108
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:50
ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >::WifiMacQueueSchedulerImpl
WifiMacQueueSchedulerImpl()
Definition
wifi-mac-queue-scheduler-impl.h:389
ns3::WifiMpdu
WifiMpdu stores a (const) packet along with a MAC header.
Definition
wifi-mpdu.h:51
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition
wifi-tx-vector.h:98
ns3::AcIndex
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition
qos-utils.h:64
ns3::AC_UNDEF
@ AC_UNDEF
Total number of ACs.
Definition
qos-utils.h:78
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiConstPsduMap
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition
wifi-ppdu.h:38
ns3::Watt_u
double Watt_u
Watt weak type.
Definition
wifi-units.h:25
wifi-mac-queue-scheduler-impl.h
wifi-psdu.h
src
wifi
model
rr-wifi-queue-scheduler.h
Generated on
for ns-3 by
1.16.1