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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7 */
8
9#ifndef UPLINK_SCHEDULER_H
10#define UPLINK_SCHEDULER_H
11
12#include "service-flow-record.h"
13#include "service-flow.h"
14#include "ul-mac-messages.h"
15#include "wimax-phy.h"
16
17#include "ns3/nstime.h"
18
19#include <stdint.h>
20
21namespace ns3
22{
23
24class BaseStationNetDevice;
25class SSRecord;
26class ServiceFlow;
27class ServiceFlowRecord;
28
29/**
30 * \ingroup wimax
31 * \brief Virtual class for uplink scheduler.
32 */
33class UplinkScheduler : public Object
34{
35 public:
37 /**
38 * Constructor
39 *
40 * \param bs base station device
41 */
43 ~UplinkScheduler() override;
44
45 /**
46 * \brief Get the type ID.
47 * \return the object TypeId
48 */
49 static TypeId GetTypeId();
50
51 /**
52 * \return the number of IR opps allocated
53 */
54 virtual uint8_t GetNrIrOppsAllocated() const;
55 /**
56 * \brief Set the number of IR opps allocated
57 * \param nrIrOppsAllocated number of IR opps allocated
58 */
59 virtual void SetNrIrOppsAllocated(uint8_t nrIrOppsAllocated);
60
61 /**
62 * \return true if the IR interval is allocated
63 */
64 virtual bool GetIsIrIntrvlAllocated() const;
65 /**
66 * \brief Set if the IR interval is allocated
67 * \param isIrIntrvlAllocated
68 */
69 virtual void SetIsIrIntrvlAllocated(bool isIrIntrvlAllocated);
70
71 /**
72 * \return true if the Inv IR interval is allocated
73 */
74 virtual bool GetIsInvIrIntrvlAllocated() const;
75 /**
76 * \brief Set if the Inv IR interval is allocated
77 * \param isInvIrIntrvlAllocated
78 */
79 virtual void SetIsInvIrIntrvlAllocated(bool isInvIrIntrvlAllocated);
80
81 /**
82 * \return uplink allocations
83 */
84 virtual std::list<OfdmUlMapIe> GetUplinkAllocations() const;
85
86 /**
87 * \return the timestamp of the IR interval
88 */
90 /**
91 * \brief Set timestamp IR interval
92 * \param timeStampIrInterval
93 */
94 virtual void SetTimeStampIrInterval(Time timeStampIrInterval);
95
96 /**
97 * \return the DCD timestamp
98 */
99 virtual Time GetDcdTimeStamp() const;
100 /**
101 * \brief Set DCD timestamp
102 * \param dcdTimeStamp
103 */
104 virtual void SetDcdTimeStamp(Time dcdTimeStamp);
105
106 /**
107 * \return the UCD timestamp
108 */
109 virtual Time GetUcdTimeStamp() const;
110 /**
111 * \brief Set UCD timestamp
112 * \param ucdTimeStamp
113 */
114 virtual void SetUcdTimeStamp(Time ucdTimeStamp);
115
116 /**
117 * \return the base station device
118 */
120 /**
121 * \brief Set base station device
122 * \param bs
123 */
124 virtual void SetBs(Ptr<BaseStationNetDevice> bs);
125 /**
126 * Determines if channel descriptors sent in the current frame are
127 * required to be updated
128 */
129 virtual void GetChannelDescriptorsToUpdate(bool&, bool&, bool&, bool&) = 0;
130 /**
131 * \return the calculated allocation start time
132 */
134 /**
135 * Add uplink allocation
136 * \param ulMapIe the UL map IE
137 * \param allocationSize the allocation size
138 * \param symbolsToAllocation the symbols to allocation
139 * \param availableSymbols the available symbols
140 */
141 virtual void AddUplinkAllocation(OfdmUlMapIe& ulMapIe,
142 const uint32_t& allocationSize,
143 uint32_t& symbolsToAllocation,
144 uint32_t& availableSymbols) = 0;
145 /**
146 * Schedule function
147 */
148 virtual void Schedule() = 0;
149 /**
150 * Service unsolicited grants function
151 * \param ssRecord the SS record
152 * \param schedulingType the scheduling type
153 * \param ulMapIe the UL map IE
154 * \param modulationType the modulation type
155 * \param symbolsToAllocation the symbols to allocation
156 * \param availableSymbols the available symbols
157 */
158 virtual void ServiceUnsolicitedGrants(const SSRecord* ssRecord,
159 ServiceFlow::SchedulingType schedulingType,
160 OfdmUlMapIe& ulMapIe,
161 const WimaxPhy::ModulationType modulationType,
162 uint32_t& symbolsToAllocation,
163 uint32_t& availableSymbols) = 0;
164 /**
165 * Service bandwidth request function
166 * \param ssRecord the SS record
167 * \param schedulingType the scheduling type
168 * \param ulMapIe the UL map IE
169 * \param modulationType the modulation type
170 * \param symbolsToAllocation the symbols to allocation
171 * \param availableSymbols the available symbols
172 */
173 virtual void ServiceBandwidthRequests(const SSRecord* ssRecord,
174 ServiceFlow::SchedulingType schedulingType,
175 OfdmUlMapIe& ulMapIe,
176 const WimaxPhy::ModulationType modulationType,
177 uint32_t& symbolsToAllocation,
178 uint32_t& availableSymbols) = 0;
179 /**
180 * Service bandwidth request function
181 * \param serviceFlow the service flow
182 * \param schedulingType the scheduling type
183 * \param ulMapIe the UL map IE
184 * \param modulationType the modulation type
185 * \param symbolsToAllocation the symbols to allocation
186 * \param availableSymbols the available symbols
187 * \returns true if successful
188 */
189 virtual bool ServiceBandwidthRequests(ServiceFlow* serviceFlow,
190 ServiceFlow::SchedulingType schedulingType,
191 OfdmUlMapIe& ulMapIe,
192 const WimaxPhy::ModulationType modulationType,
193 uint32_t& symbolsToAllocation,
194 uint32_t& availableSymbols) = 0;
195 /**
196 * Allocate initial ranging interval function
197 * \param symbolsToAllocation the symbols to allocation
198 * \param availableSymbols the available symbols
199 */
200 virtual void AllocateInitialRangingInterval(uint32_t& symbolsToAllocation,
201 uint32_t& availableSymbols) = 0;
202 /**
203 * Setp service flow function
204 * \param ssRecord the SS record
205 * \param serviceFlow the service flow
206 */
207 virtual void SetupServiceFlow(SSRecord* ssRecord, ServiceFlow* serviceFlow) = 0;
208 /**
209 * Process bandwidth request function
210 * \param bwRequestHdr
211 */
212 virtual void ProcessBandwidthRequest(const BandwidthRequestHeader& bwRequestHdr) = 0;
213
214 /**
215 * one time initialization function
216 */
217 virtual void InitOnce() = 0;
218
219 /**
220 * \brief Set requested bandwidth
221 * \param sfr service flow record
222 */
224
225 private:
226 Ptr<BaseStationNetDevice> m_bs; ///< the base station
227 std::list<OfdmUlMapIe> m_uplinkAllocations; ///< uplink allocations
228 Time m_timeStampIrInterval; ///< timestamp IR interval
229 uint8_t m_nrIrOppsAllocated; ///< number IR opps allocated
230 bool m_isIrIntrvlAllocated; ///< is IR interval allocated
231 bool m_isInvIrIntrvlAllocated; ///< is Inv IR interval allocated
232 Time m_dcdTimeStamp; ///< DCD timestamp
233 Time m_ucdTimeStamp; ///< UCD timestamp
234};
235
236} // namespace ns3
237
238#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:78
This class implements the UL-MAP_IE message as described by "IEEE Standard forLocal and metropolitan ...
Smart pointer class similar to boost::intrusive_ptr.
This class is used by the base station to store some information related to subscriber station in the...
Definition ss-record.h:35
This class implements service flows as described by the IEEE-802.16 standard.
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
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:94
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.