A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bs-uplink-scheduler.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008 INRIA
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  * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  */
20 
21 #ifndef UPLINK_SCHEDULER_H
22 #define UPLINK_SCHEDULER_H
23 
24 #include <stdint.h>
25 #include "ul-mac-messages.h"
26 #include "ns3/nstime.h"
27 #include "wimax-phy.h"
28 #include "service-flow-record.h"
29 #include "service-flow.h"
30 
31 namespace ns3 {
32 
33 class BaseStationNetDevice;
34 class SSRecord;
35 class ServiceFlow;
36 class ServiceFlowRecord;
37 
42 class UplinkScheduler : public Object
43 {
44 public:
45  UplinkScheduler (void);
47  virtual ~UplinkScheduler (void);
48 
49  static TypeId GetTypeId (void);
50 
51  virtual uint8_t GetNrIrOppsAllocated (void) const;
52  virtual void SetNrIrOppsAllocated (uint8_t nrIrOppsAllocated);
53 
54  virtual bool GetIsIrIntrvlAllocated (void) const;
55  virtual void SetIsIrIntrvlAllocated (bool isIrIntrvlAllocated);
56 
57  virtual bool GetIsInvIrIntrvlAllocated (void) const;
58  virtual void SetIsInvIrIntrvlAllocated (bool isInvIrIntrvlAllocated);
59 
60  virtual std::list<OfdmUlMapIe> GetUplinkAllocations (void) const;
61 
62  virtual Time GetTimeStampIrInterval (void);
63  virtual void SetTimeStampIrInterval (Time timeStampIrInterval);
64 
65  virtual Time GetDcdTimeStamp (void) const;
66  virtual void SetDcdTimeStamp (Time dcdTimeStamp);
67 
68  virtual Time GetUcdTimeStamp (void) const;
69  virtual void SetUcdTimeStamp (Time ucdTimeStamp);
70 
71  virtual Ptr<BaseStationNetDevice> GetBs (void);
72  virtual void SetBs (Ptr<BaseStationNetDevice> bs);
77  virtual void GetChannelDescriptorsToUpdate (bool&, bool&, bool&, bool&) = 0;
78  virtual uint32_t CalculateAllocationStartTime (void) = 0;
79  virtual void AddUplinkAllocation (OfdmUlMapIe &ulMapIe,
80  const uint32_t &allocationSize,
81  uint32_t &symbolsToAllocation,
82  uint32_t &availableSymbols) = 0;
83  virtual void Schedule (void) = 0;
84  virtual void ServiceUnsolicitedGrants (const SSRecord *ssRecord,
85  enum ServiceFlow::SchedulingType schedulingType,
86  OfdmUlMapIe &ulMapIe,
87  const WimaxPhy::ModulationType modulationType,
88  uint32_t &symbolsToAllocation,
89  uint32_t &availableSymbols) = 0;
90  virtual void ServiceBandwidthRequests (const SSRecord *ssRecord,
91  enum ServiceFlow::SchedulingType schedulingType,
92  OfdmUlMapIe &ulMapIe,
93  const WimaxPhy::ModulationType modulationType,
94  uint32_t &symbolsToAllocation,
95  uint32_t &availableSymbols) = 0;
96  virtual bool ServiceBandwidthRequests (ServiceFlow *serviceFlow,
97  enum ServiceFlow::SchedulingType schedulingType,
98  OfdmUlMapIe &ulMapIe,
99  const WimaxPhy::ModulationType modulationType,
100  uint32_t &symbolsToAllocation,
101  uint32_t &availableSymbols) = 0;
102  virtual void AllocateInitialRangingInterval (uint32_t &symbolsToAllocation, uint32_t &availableSymbols) = 0;
103  virtual void SetupServiceFlow (SSRecord *ssRecord, ServiceFlow *serviceFlow) = 0;
104  virtual void ProcessBandwidthRequest (const BandwidthRequestHeader &bwRequestHdr) = 0;
105 
106  virtual void InitOnce (void) = 0;
107 
108  virtual void OnSetRequestedBandwidth (ServiceFlowRecord *sfr) = 0;
109 
110 private:
112  std::list<OfdmUlMapIe> m_uplinkAllocations;
113  Time m_timeStampIrInterval;
114  uint8_t m_nrIrOppsAllocated;
115  bool m_isIrIntrvlAllocated;
116  bool m_isInvIrIntrvlAllocated;
117  Time m_dcdTimeStamp;
118  Time m_ucdTimeStamp;
119 };
120 
121 } // namespace ns3
122 
123 #endif /* UPLINK_SCHEDULER_H */
keep track of time unit.
Definition: nstime.h:149
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
this class implements a structure to manage some parameters and statistics related to a service flow ...
this class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
This class is used by the base station to store some information related to subscriber station in the...
Definition: ss-record.h:43
a base class which provides memory management and object aggregation
Definition: object.h:63
a unique identifier for an interface.
Definition: type-id.h:44