A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bs-scheduler-rtps.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008 INRIA
3 * 2009 TELEMATICS LAB, Politecnico di Bari
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Author: Giuseppe Piro <g.piro@poliba.it>
8 */
9
10/* BS outbound scheduler as per in Section 6.3.5.1 */
11
12#ifndef BS_SCHEDULER_RTPS_H
13#define BS_SCHEDULER_RTPS_H
14
15#include "bs-scheduler.h"
16#include "dl-mac-messages.h"
17#include "wimax-phy.h"
18
19#include "ns3/packet-burst.h"
20#include "ns3/packet.h"
21
22#include <list>
23
24namespace ns3
25{
26
27class BaseStationNetDevice;
28class GenericMacHeader;
29class WimaxConnection;
30class Cid;
31
32/**
33 * \ingroup wimax
34 * \brief This class implements a simple downlink scheduler for rtPS flows.
35 *
36 * The DL-rtPS-Scheduler assigns the available bandwidth the service flows
37 * in the following order: IR Connections, Broadcast Connections, Basic and
38 * Primary Connections, UGS Connections, rtPS Connections, nrtPS Connections,
39 * BE Connections.
40 * The IR, Broadcast and Basic/Primary Connections must transmit
41 * all packet in the queue. The UGS flows can transmit the quota of date equal to
42 * the "Grant Size" (that is one of service flows QoS parameters) according to their
43 * requested MaxLatency (another QoS parameter).
44 * All rtPS flows are able to transmit all packet in the queue according to the available
45 * bandwidth. The bandwidth saturation control has been implemented to redistribute
46 *the effective available bandwidth to all rtPS flows that have at least one packet
47 * to transmit. The remaining bandwidth is allocated to rntPS and BE Connections.
48 */
50{
51 public:
53 /**
54 * Constructor
55 *
56 * \param bs base station device
57 */
59 ~BSSchedulerRtps() override;
60
61 /**
62 * \brief Get the type ID.
63 * \return the object TypeId
64 */
65 static TypeId GetTypeId();
66
67 /**
68 * \brief This function returns all the downlink bursts scheduled for the next
69 * downlink sub-frame
70 * \returns all the downlink bursts scheduled for the next downlink sub-frame
71 */
72 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* GetDownlinkBursts() const override;
73
74 /**
75 * \brief This function adds a downlink burst to the list of downlink bursts
76 * scheduled for the next downlink sub-frame
77 * \param connection a pointer to connection in which the burst will be sent
78 * \param diuc downlink iuc
79 * \param modulationType the modulation type of the burst
80 * \param burst the downlink burst to add to the downlink sub frame
81 */
83 uint8_t diuc,
84 WimaxPhy::ModulationType modulationType,
85 Ptr<PacketBurst> burst) override;
86 /**
87 * \brief Schedule function.
88 */
89 void Schedule() override;
90 /**
91 * \brief Check for IR and Broadcast connections that have packets to transmit.
92 * \param connection will point to a initial ranging or broadcast connection
93 * which have packets to transmit
94 * \returns false if no initial ranging or broadcast connection has packets
95 * to transmit, true otherwise
96 */
98 /**
99 * \brief Check for Basic and Primary connections that have packets to transmit.
100 * \param connection will point to a basic or primary connection
101 * which have packets to transmit
102 * \returns false if no basic or primary connection has packets
103 * to transmit, true otherwise
104 */
106 /**
107 * \brief Check for UGS connections that have packets to transmit.
108 *
109 * The method return the UGS connection that have packets to transmits,
110 * according to the MaxLatency specifications.
111 * \param connection will point to a connection that has packets to be sent
112 * \return true if successful
113 */
115 /**
116 * \brief Check for rtPS connections that have packets to transmit.
117 * \param connection will point to a connection that has packets to be sent
118 * \returns false if no connection has packets to be sent, true otherwise
119 */
121 /**
122 * \brief Check for nrtPS connections that have packets to transmit.
123 * \param connection will point to a connection that has packets to be sent
124 * \returns false if no connection has packets to be sent, true otherwise
125 */
127 /**
128 * \brief Check for BE connections that have packets to transmit.
129 * \param connection will point to a connection that has packets to be sent
130 * \returns false if no connection has packets to be sent, true otherwise
131 */
133
134 /**
135 * \brief Selects a connection from the list of connections having packets to be sent .
136 * \param connection will point to a connection that has packets to be sent
137 * \returns false if no connection has packets to be sent, true otherwise
138 */
139 bool SelectConnection(Ptr<WimaxConnection>& connection) override;
140
141 /**
142 * \brief schedules the broadcast connections
143 * \param availableSymbols the remaining free OFDM symbols in the current subframe
144 */
145 void BSSchedulerBroadcastConnection(uint32_t& availableSymbols);
146
147 /**
148 * \brief schedules the IR connections
149 * \param availableSymbols the remaining free OFDM symbols in the current subframe
150 */
151 void BSSchedulerInitialRangingConnection(uint32_t& availableSymbols);
152
153 /**
154 * \brief schedules the basic connections
155 * \param availableSymbols the remaining free OFDM symbols in the current subframe
156 */
157 void BSSchedulerBasicConnection(uint32_t& availableSymbols);
158
159 /**
160 * \brief schedules the primary connection
161 * \param availableSymbols the remaining free OFDM symbols in the current subframe
162 */
163 void BSSchedulerPrimaryConnection(uint32_t& availableSymbols);
164 /**
165 * \brief schedules the UGS connection
166 * \param availableSymbols the remaining free OFDM symbols in the current subframe
167 */
168 void BSSchedulerUGSConnection(uint32_t& availableSymbols);
169 /**
170 * \brief Downlink Scheduler for rtPS connections.
171 *
172 * \param availableSymbols available symbols for rtPS flows
173 *
174 * This method represent the DL Scheduler for rtPS connections.
175 * The scheduler is designed to serve all rtPS connections that
176 * have at least one packet to transmit, every DL Subframe.
177 * To each rtPS connections are allocated, at the beginning,
178 * the bandwidth to transmit a quota of data equal to the
179 * queue length.
180 * If the sum of all pre-allocated bandwidth exceed the available
181 * symbols for rtPS connections, the Channel Saturation Control function
182 * is called to redistribute the available bandwidth.
183 */
184 void BSSchedulerRTPSConnection(uint32_t& availableSymbols);
185
186 /**
187 * \brief schedules the NRTPS connections
188 * \param availableSymbols the remaining free OFDM symbols in the current subframe
189 */
190 void BSSchedulerNRTPSConnection(uint32_t& availableSymbols);
191
192 /**
193 * \brief schedules the BE connection
194 * \param availableSymbols the remaining free OFDM symbols in the current subframe
195 */
196 void BSSchedulerBEConnection(uint32_t& availableSymbols);
197
198 /**
199 * \brief Creates a downlink UGS burst
200 * \param serviceFlow the service flow of the burst
201 * \param modulationType the modulation type to be used for the burst
202 * \param availableSymbols maximum number of OFDM symbols to be used by the burst
203 * \returns a Burst (list of packets)
204 */
206 WimaxPhy::ModulationType modulationType,
207 uint32_t availableSymbols) override;
208
209 private:
210 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* m_downlinkBursts; ///< down link bursts
211};
212
213} // namespace ns3
214
215#endif /* BS_SCHEDULER_RTPS_H */
BaseStation Scheduler.
This class implements a simple downlink scheduler for rtPS flows.
static TypeId GetTypeId()
Get the type ID.
void Schedule() override
Schedule function.
void BSSchedulerPrimaryConnection(uint32_t &availableSymbols)
schedules the primary connection
std::list< std::pair< OfdmDlMapIe *, Ptr< PacketBurst > > > * GetDownlinkBursts() const override
This function returns all the downlink bursts scheduled for the next downlink sub-frame.
bool SelectRTPSConnection(Ptr< WimaxConnection > &connection)
Check for rtPS connections that have packets to transmit.
void BSSchedulerUGSConnection(uint32_t &availableSymbols)
schedules the UGS connection
void BSSchedulerBEConnection(uint32_t &availableSymbols)
schedules the BE connection
bool SelectNRTPSConnection(Ptr< WimaxConnection > &connection)
Check for nrtPS connections that have packets to transmit.
void BSSchedulerBasicConnection(uint32_t &availableSymbols)
schedules the basic connections
void AddDownlinkBurst(Ptr< const WimaxConnection > connection, uint8_t diuc, WimaxPhy::ModulationType modulationType, Ptr< PacketBurst > burst) override
This function adds a downlink burst to the list of downlink bursts scheduled for the next downlink su...
bool SelectMenagementConnection(Ptr< WimaxConnection > &connection)
Check for Basic and Primary connections that have packets to transmit.
void BSSchedulerInitialRangingConnection(uint32_t &availableSymbols)
schedules the IR connections
bool SelectUGSConnection(Ptr< WimaxConnection > &connection)
Check for UGS connections that have packets to transmit.
void BSSchedulerRTPSConnection(uint32_t &availableSymbols)
Downlink Scheduler for rtPS connections.
void BSSchedulerBroadcastConnection(uint32_t &availableSymbols)
schedules the broadcast connections
bool SelectBEConnection(Ptr< WimaxConnection > &connection)
Check for BE connections that have packets to transmit.
void BSSchedulerNRTPSConnection(uint32_t &availableSymbols)
schedules the NRTPS connections
Ptr< PacketBurst > CreateUgsBurst(ServiceFlow *serviceFlow, WimaxPhy::ModulationType modulationType, uint32_t availableSymbols) override
Creates a downlink UGS burst.
bool SelectIRandBCConnection(Ptr< WimaxConnection > &connection)
Check for IR and Broadcast connections that have packets to transmit.
bool SelectConnection(Ptr< WimaxConnection > &connection) override
Selects a connection from the list of connections having packets to be sent .
std::list< std::pair< OfdmDlMapIe *, Ptr< PacketBurst > > > * m_downlinkBursts
down link bursts
Smart pointer class similar to boost::intrusive_ptr.
This class implements service flows as described by the IEEE-802.16 standard.
a unique identifier for an interface.
Definition type-id.h:48
ModulationType
ModulationType enumeration.
Definition wimax-phy.h:43
Every class exported by the ns3 library is enclosed in the ns3 namespace.