A Discrete-Event Network Simulator
API
bandwidth-manager.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007,2008,2009 INRIA, UDcast
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  * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18  * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19  * <amine.ismail@UDcast.com>
20  */
21 
22 #ifndef BANDWIDTH_MANAGER_H
23 #define BANDWIDTH_MANAGER_H
24 
25 #include "bs-uplink-scheduler.h"
26 #include "cid.h"
27 #include "ul-job.h"
28 #include "wimax-net-device.h"
29 
30 #include <stdint.h>
31 
32 /*
33  The same bandwidth manager class serves both for BS and SS though some functions are exclusive to
34  only one of them.
35  */
36 
37 namespace ns3
38 {
39 
40 class SSRecord;
41 class ServiceFlow;
42 class UlJob;
43 class UplinkScheduler;
44 
56 class BandwidthManager : public Object
57 {
58  public:
63  static TypeId GetTypeId();
70  ~BandwidthManager() override;
71 
72  // Delete copy constructor and assignment operator to avoid misuse
75 
76  void DoDispose() override;
77 
84  uint32_t CalculateAllocationSize(const SSRecord* ssRecord, const ServiceFlow* serviceFlow);
90  ServiceFlow* SelectFlowForRequest(uint32_t& bytesToRequest);
96  void SendBandwidthRequest(uint8_t uiuc, uint16_t allocationSize);
101  void ProcessBandwidthRequest(const BandwidthRequestHeader& bwRequestHdr);
103  void SetSubframeRatio();
108  uint32_t GetSymbolsPerFrameAllocated();
109 
110  private:
112  uint16_t m_nrBwReqsSent;
113 };
114 
115 } // namespace ns3
116 
117 #endif /* BANDWIDTH_MANAGER_H */
This class manage the bandwidth request and grant mechanism.
void SetSubframeRatio()
Set subframe ratio.
uint16_t m_nrBwReqsSent
bandwidth requests sent
uint32_t GetSymbolsPerFrameAllocated()
Get symbols per frame allocated.
Ptr< WimaxNetDevice > m_device
the device
uint32_t CalculateAllocationSize(const SSRecord *ssRecord, const ServiceFlow *serviceFlow)
Calculate allocation size function.
ServiceFlow * SelectFlowForRequest(uint32_t &bytesToRequest)
Select flow for request function.
void DoDispose() override
Destructor implementation.
BandwidthManager(Ptr< WimaxNetDevice > device)
Constructor.
void ProcessBandwidthRequest(const BandwidthRequestHeader &bwRequestHdr)
Process bandwidth request.
BandwidthManager(const BandwidthManager &)=delete
BandwidthManager & operator=(const BandwidthManager &)=delete
void SendBandwidthRequest(uint8_t uiuc, uint16_t allocationSize)
Send bandwidth request.
static TypeId GetTypeId()
Get the type ID.
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:89
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
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.