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