A Discrete-Event Network Simulator
API
bs-uplink-scheduler-mbqos.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 INRIA/LRC - Computer Networks Laboratory
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  * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  * Flavio Kobuta <flaviokubota@gmail.com>
20  *
21  */
22 
23 #ifndef UPLINK_SCHEDULER_MBQOS_H
24 #define UPLINK_SCHEDULER_MBQOS_H
25 
26 #include <stdint.h>
27 #include "ul-mac-messages.h"
28 #include "ns3/nstime.h"
29 #include "wimax-phy.h"
30 #include "ul-job.h"
31 #include "service-flow-record.h"
32 #include "ns3/object.h"
33 #include "bs-uplink-scheduler.h"
34 #include "service-flow.h"
35 
36 namespace ns3 {
37 
38 class BaseStationNetDevice;
39 class SSRecord;
40 class ServiceFlow;
41 class ServiceFlowRecord;
42 class UlJob;
43 
70 {
71 public:
79  ~UplinkSchedulerMBQoS (void);
80 
85  static TypeId GetTypeId (void);
86 
91  std::list<OfdmUlMapIe> GetUplinkAllocations (void) const;
92 
101  void GetChannelDescriptorsToUpdate (bool &updateDcd, bool &updateUcd, bool &sendDcd, bool &sendUcd);
106  uint32_t CalculateAllocationStartTime (void);
114  void AddUplinkAllocation (OfdmUlMapIe &ulMapIe,
115  const uint32_t &allocationSize,
116  uint32_t &symbolsToAllocation,
117  uint32_t &availableSymbols);
118 
122  void Schedule (void);
132  void ServiceUnsolicitedGrants (const SSRecord *ssRecord,
133  enum ServiceFlow::SchedulingType schedulingType,
134  OfdmUlMapIe &ulMapIe,
135  const WimaxPhy::ModulationType modulationType,
136  uint32_t &symbolsToAllocation,
137  uint32_t &availableSymbols);
147  void ServiceBandwidthRequests (const SSRecord *ssRecord,
148  enum ServiceFlow::SchedulingType schedulingType,
149  OfdmUlMapIe &ulMapIe,
150  const WimaxPhy::ModulationType modulationType,
151  uint32_t &symbolsToAllocation,
152  uint32_t &availableSymbols);
163  bool ServiceBandwidthRequests (ServiceFlow *serviceFlow,
164  enum ServiceFlow::SchedulingType schedulingType,
165  OfdmUlMapIe &ulMapIe,
166  const WimaxPhy::ModulationType modulationType,
167  uint32_t &symbolsToAllocation,
168  uint32_t &availableSymbols);
174  void AllocateInitialRangingInterval (uint32_t &symbolsToAllocation, uint32_t &availableSymbols);
180  void SetupServiceFlow (SSRecord *ssRecord, ServiceFlow *serviceFlow);
181 
192  void CheckDeadline (uint32_t &availableSymbols);
193 
203  void CheckMinimumBandwidth (uint32_t &availableSymbols);
204 
209  void UplinkSchedWindowTimer (void);
210 
217  void EnqueueJob (UlJob::JobPriority priority, Ptr<UlJob> job);
218 
226 
227  void ProcessBandwidthRequest (const BandwidthRequestHeader &bwRequestHdr);
228 
235  Time DetermineDeadline (ServiceFlow *serviceFlow);
236 
240  void InitOnce (void);
241 
248  uint32_t CountSymbolsQueue (std::list<Ptr<UlJob> > jobs);
249 
256  uint32_t CountSymbolsJobs (Ptr<UlJob> job);
257 
263 
272  Ptr<UlJob>
273  CreateUlJob (SSRecord *ssRecord, enum ServiceFlow::SchedulingType schedType, ReqType reqType);
274 
281  uint32_t
282  GetPendingSize (ServiceFlow* serviceFlow);
283 
295  bool
297  enum ServiceFlow::SchedulingType schedulingType, OfdmUlMapIe &ulMapIe,
298  const WimaxPhy::ModulationType modulationType,
299  uint32_t &symbolsToAllocation, uint32_t &availableSymbols, uint32_t allocationSizeBytes);
300 
301 private:
302  std::list<OfdmUlMapIe> m_uplinkAllocations;
303 
304  // queues for scheduler
305  std::list<Ptr<UlJob> > m_uplinkJobs_high;
306  std::list<Ptr<UlJob> > m_uplinkJobs_inter;
307  std::list<Ptr<UlJob> > m_uplinkJobs_low;
308 
309  // interval to reset window
311 };
312 
313 } // namespace ns3
314 
315 #endif /* UPLINK_SCHEDULER_MBQOS_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:74
This class is used by the base station to store some information related to subscriber station in the...
Definition: ss-record.h:44
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:40
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:59
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:103
a unique identifier for an interface.
Definition: type-id.h:59
JobPriority
Job priority enumeration.
Definition: ul-job.h:52
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:52
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ReqType
Request type enumeration.
Definition: ul-job.h:38
#define list