A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bs-uplink-scheduler.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18 */
19
20#ifndef UPLINK_SCHEDULER_H
21#define UPLINK_SCHEDULER_H
22
23#include "service-flow-record.h"
24#include "service-flow.h"
25#include "ul-mac-messages.h"
26#include "wimax-phy.h"
27
28#include "ns3/nstime.h"
29
30#include <stdint.h>
31
32namespace ns3
33{
34
35class BaseStationNetDevice;
36class SSRecord;
37class ServiceFlow;
38class ServiceFlowRecord;
39
40/**
41 * \ingroup wimax
42 * \brief Virtual class for uplink scheduler.
43 */
44class UplinkScheduler : public Object
45{
46 public:
48 /**
49 * Constructor
50 *
51 * \param bs base station device
52 */
54 ~UplinkScheduler() override;
55
56 /**
57 * \brief Get the type ID.
58 * \return the object TypeId
59 */
60 static TypeId GetTypeId();
61
62 /**
63 * \return the number of IR opps allocated
64 */
65 virtual uint8_t GetNrIrOppsAllocated() const;
66 /**
67 * \brief Set the number of IR opps allocated
68 * \param nrIrOppsAllocated number of IR opps allocated
69 */
70 virtual void SetNrIrOppsAllocated(uint8_t nrIrOppsAllocated);
71
72 /**
73 * \return true if the IR interval is allocated
74 */
75 virtual bool GetIsIrIntrvlAllocated() const;
76 /**
77 * \brief Set if the IR interval is allocated
78 * \param isIrIntrvlAllocated
79 */
80 virtual void SetIsIrIntrvlAllocated(bool isIrIntrvlAllocated);
81
82 /**
83 * \return true if the Inv IR interval is allocated
84 */
85 virtual bool GetIsInvIrIntrvlAllocated() const;
86 /**
87 * \brief Set if the Inv IR interval is allocated
88 * \param isInvIrIntrvlAllocated
89 */
90 virtual void SetIsInvIrIntrvlAllocated(bool isInvIrIntrvlAllocated);
91
92 /**
93 * \return uplink allocations
94 */
95 virtual std::list<OfdmUlMapIe> GetUplinkAllocations() const;
96
97 /**
98 * \return the timestamp of the IR interval
99 */
101 /**
102 * \brief Set timestamp IR interval
103 * \param timeStampIrInterval
104 */
105 virtual void SetTimeStampIrInterval(Time timeStampIrInterval);
106
107 /**
108 * \return the DCD timestamp
109 */
110 virtual Time GetDcdTimeStamp() const;
111 /**
112 * \brief Set DCD timestamp
113 * \param dcdTimeStamp
114 */
115 virtual void SetDcdTimeStamp(Time dcdTimeStamp);
116
117 /**
118 * \return the UCD timestamp
119 */
120 virtual Time GetUcdTimeStamp() const;
121 /**
122 * \brief Set UCD timestamp
123 * \param ucdTimeStamp
124 */
125 virtual void SetUcdTimeStamp(Time ucdTimeStamp);
126
127 /**
128 * \return the base station device
129 */
131 /**
132 * \brief Set base station device
133 * \param bs
134 */
135 virtual void SetBs(Ptr<BaseStationNetDevice> bs);
136 /**
137 * Determines if channel descriptors sent in the current frame are
138 * required to be updated
139 */
140 virtual void GetChannelDescriptorsToUpdate(bool&, bool&, bool&, bool&) = 0;
141 /**
142 * \return the calculated allocation start time
143 */
145 /**
146 * Add uplink allocation
147 * \param ulMapIe the UL map IE
148 * \param allocationSize the allocation size
149 * \param symbolsToAllocation the symbols to allocation
150 * \param availableSymbols the available symbols
151 */
152 virtual void AddUplinkAllocation(OfdmUlMapIe& ulMapIe,
153 const uint32_t& allocationSize,
154 uint32_t& symbolsToAllocation,
155 uint32_t& availableSymbols) = 0;
156 /**
157 * Schedule function
158 */
159 virtual void Schedule() = 0;
160 /**
161 * Service unsolicited grants function
162 * \param ssRecord the SS record
163 * \param schedulingType the scheduling type
164 * \param ulMapIe the UL map IE
165 * \param modulationType the modulation type
166 * \param symbolsToAllocation the symbols to allocation
167 * \param availableSymbols the available symbols
168 */
169 virtual void ServiceUnsolicitedGrants(const SSRecord* ssRecord,
170 ServiceFlow::SchedulingType schedulingType,
171 OfdmUlMapIe& ulMapIe,
172 const WimaxPhy::ModulationType modulationType,
173 uint32_t& symbolsToAllocation,
174 uint32_t& availableSymbols) = 0;
175 /**
176 * Service bandwidth request function
177 * \param ssRecord the SS record
178 * \param schedulingType the scheduling type
179 * \param ulMapIe the UL map IE
180 * \param modulationType the modulation type
181 * \param symbolsToAllocation the symbols to allocation
182 * \param availableSymbols the available symbols
183 */
184 virtual void ServiceBandwidthRequests(const SSRecord* ssRecord,
185 ServiceFlow::SchedulingType schedulingType,
186 OfdmUlMapIe& ulMapIe,
187 const WimaxPhy::ModulationType modulationType,
188 uint32_t& symbolsToAllocation,
189 uint32_t& availableSymbols) = 0;
190 /**
191 * Service bandwidth request function
192 * \param serviceFlow the service flow
193 * \param schedulingType the scheduling type
194 * \param ulMapIe the UL map IE
195 * \param modulationType the modulation type
196 * \param symbolsToAllocation the symbols to allocation
197 * \param availableSymbols the available symbols
198 * \returns true if successful
199 */
200 virtual bool ServiceBandwidthRequests(ServiceFlow* serviceFlow,
201 ServiceFlow::SchedulingType schedulingType,
202 OfdmUlMapIe& ulMapIe,
203 const WimaxPhy::ModulationType modulationType,
204 uint32_t& symbolsToAllocation,
205 uint32_t& availableSymbols) = 0;
206 /**
207 * Allocate initial ranging interval function
208 * \param symbolsToAllocation the symbols to allocation
209 * \param availableSymbols the available symbols
210 */
211 virtual void AllocateInitialRangingInterval(uint32_t& symbolsToAllocation,
212 uint32_t& availableSymbols) = 0;
213 /**
214 * Setp service flow function
215 * \param ssRecord the SS record
216 * \param serviceFlow the service flow
217 */
218 virtual void SetupServiceFlow(SSRecord* ssRecord, ServiceFlow* serviceFlow) = 0;
219 /**
220 * Process bandwidth request function
221 * \param bwRequestHdr
222 */
223 virtual void ProcessBandwidthRequest(const BandwidthRequestHeader& bwRequestHdr) = 0;
224
225 /**
226 * one time initialization function
227 */
228 virtual void InitOnce() = 0;
229
230 /**
231 * \brief Set requested bandwidth
232 * \param sfr service flow record
233 */
235
236 private:
237 Ptr<BaseStationNetDevice> m_bs; ///< the base station
238 std::list<OfdmUlMapIe> m_uplinkAllocations; ///< uplink allocations
239 Time m_timeStampIrInterval; ///< timestamp IR interval
240 uint8_t m_nrIrOppsAllocated; ///< number IR opps allocated
241 bool m_isIrIntrvlAllocated; ///< is IR interval allocated
242 bool m_isInvIrIntrvlAllocated; ///< is Inv IR interval allocated
243 Time m_dcdTimeStamp; ///< DCD timestamp
244 Time m_ucdTimeStamp; ///< UCD timestamp
245};
246
247} // namespace ns3
248
249#endif /* UPLINK_SCHEDULER_H */
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
A base class which provides memory management and object aggregation.
Definition: object.h:89
This class implements the UL-MAP_IE message as described by "IEEE Standard for Local and metropolitan...
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
This class is used by the base station to store some information related to subscriber station in the...
Definition: ss-record.h:46
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:62
this class implements a structure to manage some parameters and statistics related to a service flow
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
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.