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 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Giuseppe Piro <g.piro@poliba.it>
19 */
20
21/* BS outbound scheduler as per in Section 6.3.5.1 */
22
23#ifndef BS_SCHEDULER_RTPS_H
24#define BS_SCHEDULER_RTPS_H
25
26#include "bs-scheduler.h"
27#include "dl-mac-messages.h"
28#include "wimax-phy.h"
29
30#include "ns3/packet-burst.h"
31#include "ns3/packet.h"
32
33#include <list>
34
35namespace ns3
36{
37
38class BaseStationNetDevice;
39class GenericMacHeader;
40class WimaxConnection;
41class Cid;
42
43/**
44 * \ingroup wimax
45 * \brief This class implements a simple downlink scheduler for rtPS flows.
46 *
47 * The DL-rtPS-Scheduler assigns the available bandwidth the service flows
48 * in the following order: IR Connections, Broadcast Connections, Basic and
49 * Primary Connections, UGS Connections, rtPS Connections, nrtPS Connections,
50 * BE Connections.
51 * The IR, Broadcast and Basic/Primary Connections must transmit
52 * all packet in the queue. The UGS flows can transmit the quota of date equal to
53 * the "Grant Size" (that is one of service flows QoS parameters) according to their
54 * requested MaxLatency (another QoS parameter).
55 * All rtPS flows are able to transmit all packet in the queue according to the available
56 * bandwidth. The bandwidth saturation control has been implemented to redistribute
57 *the effective available bandwidth to all rtPS flows that have at least one packet
58 * to transmit. The remaining bandwidth is allocated to rntPS and BE Connections.
59 */
61{
62 public:
64 /**
65 * Constructor
66 *
67 * \param bs base station device
68 */
70 ~BSSchedulerRtps() override;
71
72 /**
73 * \brief Get the type ID.
74 * \return the object TypeId
75 */
76 static TypeId GetTypeId();
77
78 /**
79 * \brief This function returns all the downlink bursts scheduled for the next
80 * downlink sub-frame
81 * \returns all the downlink bursts scheduled for the next downlink sub-frame
82 */
83 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* GetDownlinkBursts() const override;
84
85 /**
86 * \brief This function adds a downlink burst to the list of downlink bursts
87 * scheduled for the next downlink sub-frame
88 * \param connection a pointer to connection in which the burst will be sent
89 * \param diuc downlink iuc
90 * \param modulationType the modulation type of the burst
91 * \param burst the downlink burst to add to the downlink sub frame
92 */
94 uint8_t diuc,
95 WimaxPhy::ModulationType modulationType,
96 Ptr<PacketBurst> burst) override;
97 /**
98 * \brief Schedule function.
99 */
100 void Schedule() override;
101 /**
102 * \brief Check for IR and Broadcast connections that have packets to transmit.
103 * \param connection will point to a initial ranging or broadcast connection
104 * which have packets to transmit
105 * \returns false if no initial ranging or broadcast connection has packets
106 * to transmit, true otherwise
107 */
109 /**
110 * \brief Check for Basic and Primary connections that have packets to transmit.
111 * \param connection will point to a basic or primary connection
112 * which have packets to transmit
113 * \returns false if no basic or primary connection has packets
114 * to transmit, true otherwise
115 */
117 /**
118 * \brief Check for UGS connections that have packets to transmit.
119 *
120 * The method return the UGS connection that have packets to transmits,
121 * according to the MaxLatency specifications.
122 * \param connection will point to a connection that has packets to be sent
123 * \return true if successful
124 */
126 /**
127 * \brief Check for rtPS connections that have packets to transmit.
128 * \param connection will point to a connection that has packets to be sent
129 * \returns false if no connection has packets to be sent, true otherwise
130 */
132 /**
133 * \brief Check for nrtPS connections that have packets to transmit.
134 * \param connection will point to a connection that has packets to be sent
135 * \returns false if no connection has packets to be sent, true otherwise
136 */
138 /**
139 * \brief Check for BE connections that have packets to transmit.
140 * \param connection will point to a connection that has packets to be sent
141 * \returns false if no connection has packets to be sent, true otherwise
142 */
144
145 /**
146 * \brief Selects a connection from the list of connections having packets to be sent .
147 * \param connection will point to a connection that has packets to be sent
148 * \returns false if no connection has packets to be sent, true otherwise
149 */
150 bool SelectConnection(Ptr<WimaxConnection>& connection) override;
151
152 /**
153 * \brief schedules the broadcast connections
154 * \param availableSymbols the remaining free OFDM symbols in the current subframe
155 */
156 void BSSchedulerBroadcastConnection(uint32_t& availableSymbols);
157
158 /**
159 * \brief schedules the IR connections
160 * \param availableSymbols the remaining free OFDM symbols in the current subframe
161 */
162 void BSSchedulerInitialRangingConnection(uint32_t& availableSymbols);
163
164 /**
165 * \brief schedules the basic connections
166 * \param availableSymbols the remaining free OFDM symbols in the current subframe
167 */
168 void BSSchedulerBasicConnection(uint32_t& availableSymbols);
169
170 /**
171 * \brief schedules the primary connection
172 * \param availableSymbols the remaining free OFDM symbols in the current subframe
173 */
174 void BSSchedulerPrimaryConnection(uint32_t& availableSymbols);
175 /**
176 * \brief schedules the UGS connection
177 * \param availableSymbols the remaining free OFDM symbols in the current subframe
178 */
179 void BSSchedulerUGSConnection(uint32_t& availableSymbols);
180 /**
181 * \brief Downlink Scheduler for rtPS connections.
182 *
183 * \param availableSymbols available symbols for rtPS flows
184 *
185 * This method represent the DL Scheduler for rtPS connections.
186 * The scheduler is designed to serve all rtPS connections that
187 * have at least one packet to transmit, every DL Subframe.
188 * To each rtPS connections are allocated, at the beginning,
189 * the bandwidth to transmit a quota of data equal to the
190 * queue length.
191 * If the sum of all pre-allocated bandwidth exceed the available
192 * symbols for rtPS connections, the Channel Saturation Control function
193 * is called to redistribute the available bandwidth.
194 */
195 void BSSchedulerRTPSConnection(uint32_t& availableSymbols);
196
197 /**
198 * \brief schedules the NRTPS connections
199 * \param availableSymbols the remaining free OFDM symbols in the current subframe
200 */
201 void BSSchedulerNRTPSConnection(uint32_t& availableSymbols);
202
203 /**
204 * \brief schedules the BE connection
205 * \param availableSymbols the remaining free OFDM symbols in the current subframe
206 */
207 void BSSchedulerBEConnection(uint32_t& availableSymbols);
208
209 /**
210 * \brief Creates a downlink UGS burst
211 * \param serviceFlow the service flow of the burst
212 * \param modulationType the modulation type to be used for the burst
213 * \param availableSymbols maximum number of OFDM symbols to be used by the burst
214 * \returns a Burst (list of packets)
215 */
217 WimaxPhy::ModulationType modulationType,
218 uint32_t availableSymbols) override;
219
220 private:
221 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* m_downlinkBursts; ///< down link bursts
222};
223
224} // namespace ns3
225
226#endif /* BS_SCHEDULER_RTPS_H */
BaseStation Scheduler.
Definition: bs-scheduler.h:48
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.
Definition: ptr.h:77
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
a unique identifier for an interface.
Definition: type-id.h:59
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:54
Every class exported by the ns3 library is enclosed in the ns3 namespace.