A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bs-uplink-scheduler-rtps.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: Giuseppe Piro <g.piro@poliba.it>
18 */
19
20#ifndef UPLINK_SCHEDULER_RTPS_H
21#define UPLINK_SCHEDULER_RTPS_H
22
23#include "bs-uplink-scheduler.h"
24#include "ul-mac-messages.h"
25#include "wimax-phy.h"
26
27#include "ns3/nstime.h"
28
29#include <stdint.h>
30
31namespace ns3
32{
33
34class BaseStationNetDevice;
35class SSRecord;
36class ServiceFlow;
37
38/**
39 * \ingroup wimax
40 * \brief This class implements a simple uplink scheduler for rtPS flows.
41 *
42 * The UL-rtPS-Scheduler work in this way:
43 * At the beginning of the UL sub-frame some symbols are allocated
44 * to the rangingInterval Messages, DSA Messages, UGS grants and
45 * UGS/rtPS/nrtPS/BE poll.
46 * Then, the remaining available symbols are allocated to the all
47 * rtPS flows according to their requestedBandwidth.
48 * The bandwidth saturation control has been implemented to
49 * redistribute the resource if the sum of requestedBandwidth exceed
50 * the available bandwidth.
51 * At the end, if there are some free symbols, their are allocated to
52 * nrtPS and BE Connections.
53 */
54
56{
57 public:
59 /**
60 * Constructor
61 *
62 * \param bs base station device
63 */
65 ~UplinkSchedulerRtps() override;
66
67 /**
68 * \brief Get the type ID.
69 * \return the object TypeId
70 */
71 static TypeId GetTypeId();
72
73 /**
74 * \brief Get uplink allocations.
75 * \returns std::list<OfdmUlMapIe>
76 */
77 std::list<OfdmUlMapIe> GetUplinkAllocations() const override;
78
79 /**
80 * Determines if channel descriptors sent in the current frame are
81 * required to be updated
82 * \param updateDcd if true update DCD
83 * \param updateUcd if true update UCD
84 * \param sendDcd if true send DCD
85 * \param sendUcd if true send UCD
86 */
87 void GetChannelDescriptorsToUpdate(bool& updateDcd,
88 bool& updateUcd,
89 bool& sendDcd,
90 bool& sendUcd) override;
91 /**
92 * Calculate allocation start time function
93 * \returns the allocation start time value
94 */
96 /**
97 * Add Uplink Allocation function
98 * \param ulMapIe the UL map IE
99 * \param allocationSize the allocation size
100 * \param symbolsToAllocation the symbols to allocation
101 * \param availableSymbols the available symbols
102 */
103 void AddUplinkAllocation(OfdmUlMapIe& ulMapIe,
104 const uint32_t& allocationSize,
105 uint32_t& symbolsToAllocation,
106 uint32_t& availableSymbols) override;
107 /**
108 * \brief Schedule function.
109 */
110 void Schedule() override;
111 /**
112 * Service Unsolicited Grants function
113 * \param ssRecord Subscriber station record
114 * \param schedulingType the scheduling type
115 * \param ulMapIe the UL map IE
116 * \param modulationType the modulation type
117 * \param symbolsToAllocation the symbols to allocation
118 * \param availableSymbols the available symbols
119 */
120 void ServiceUnsolicitedGrants(const SSRecord* ssRecord,
121 ServiceFlow::SchedulingType schedulingType,
122 OfdmUlMapIe& ulMapIe,
123 const WimaxPhy::ModulationType modulationType,
124 uint32_t& symbolsToAllocation,
125 uint32_t& availableSymbols) override;
126 /**
127 * Service Bandwidth Requests function
128 * \param ssRecord Subscriber station record
129 * \param schedulingType the scheduling type
130 * \param ulMapIe the UL map IE
131 * \param modulationType the modulation type
132 * \param symbolsToAllocation the symbols to allocation
133 * \param availableSymbols the available symbols
134 */
135 void ServiceBandwidthRequests(const SSRecord* ssRecord,
136 ServiceFlow::SchedulingType schedulingType,
137 OfdmUlMapIe& ulMapIe,
138 const WimaxPhy::ModulationType modulationType,
139 uint32_t& symbolsToAllocation,
140 uint32_t& availableSymbols) override;
141 /**
142 * Service bandwidth requests function
143 * \param serviceFlow the service flow
144 * \param schedulingType the scheduling type
145 * \param ulMapIe the UL map IE
146 * \param modulationType the modulation type
147 * \param symbolsToAllocation the symbols to allocation
148 * \param availableSymbols the available symbols
149 * \returns true if successful
150 */
151 bool ServiceBandwidthRequests(ServiceFlow* serviceFlow,
152 ServiceFlow::SchedulingType schedulingType,
153 OfdmUlMapIe& ulMapIe,
154 const WimaxPhy::ModulationType modulationType,
155 uint32_t& symbolsToAllocation,
156 uint32_t& availableSymbols) override;
157 /**
158 * \brief Uplink Scheduler for rtPS connections.
159 *
160 * \param symbolsToAllocation symbols to allocation for UpLink Subframe
161 * \param availableSymbols available symbols for rtPS flows
162 *
163 * This method represent the UL Scheduler for rtPS connections.
164 * The scheduler is designed to serve all rtPS connections that
165 * have at least one packet to transmit, every UL Subframe.
166 * The method selects all rtPS connection that have al least one
167 * packet to transmit. To each rtPS connections are allocated,
168 * at the beginning, the bandwidth to transmit a quota of data equal
169 * to (RequestedBandwidth - GrantedBandwidth).
170 * If the sum of all pre-allocated bandwidth exceed the available
171 * symbols for rtPS connections, the Channel Saturation Control function
172 * is called to redistribute the available bandwidth.
173 */
174 void ULSchedulerRTPSConnection(uint32_t& symbolsToAllocation, uint32_t& availableSymbols);
175 /**
176 * Allocate Initial Ranging Interval function
177 *
178 * \param symbolsToAllocation symbols to allocation for UpLink Subframe
179 * \param availableSymbols available symbols for rtPS flows
180 */
181 void AllocateInitialRangingInterval(uint32_t& symbolsToAllocation,
182 uint32_t& availableSymbols) override;
183 /**
184 * Setup service flow function
185 * \param ssRecord Subscriber station record
186 * \param serviceFlow the service flow
187 */
188 void SetupServiceFlow(SSRecord* ssRecord, ServiceFlow* serviceFlow) override;
189
190 /**
191 * Process bandwidth request function
192 * \param bwRequestHdr the bandwidth request header
193 */
194 void ProcessBandwidthRequest(const BandwidthRequestHeader& bwRequestHdr) override;
195
196 /// Init once function
197 void InitOnce() override;
198
199 /**
200 * Set requested bandwidth function
201 * \param sfr the service flow record
202 */
203 void OnSetRequestedBandwidth(ServiceFlowRecord* sfr) override;
204
205 private:
206 std::list<OfdmUlMapIe> m_uplinkAllocations; ///< uplink allocations
207};
208
209} // namespace ns3
210
211#endif /* UPLINK_SCHEDULER_RTPS_H */
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
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
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.