A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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
37namespace ns3
38{
39
40class SSRecord;
41class ServiceFlow;
42class UlJob;
43class UplinkScheduler;
44
45/**
46 * \ingroup wimax
47 * \brief This class manage the bandwidth request and grant mechanism.
48 * The bandwidth request and grant mechanism is supported by the Bandwidth
49 * Manager. Both BS and SS maintain a bandwidth manager. Furthermore BS's
50 * bandwidth manager works together with the uplink scheduler to determine
51 * total bandwidth available and allocation size for each service flow.
52 * Bandwidth request mechanism is a key feature of the WiMAX scheduler
53 * since all three non-UGS services explicitly request for bandwidth by
54 * sending a bandwidth request to BS.
55 */
57{
58 public:
59 /**
60 * \brief Get the type ID.
61 * \return the object TypeId
62 */
63 static TypeId GetTypeId();
64 /**
65 * Constructor
66 *
67 * \param device WIMAX device
68 */
70 ~BandwidthManager() override;
71
72 // Delete copy constructor and assignment operator to avoid misuse
75
76 void DoDispose() override;
77
78 /**
79 * Calculate allocation size function
80 * \param ssRecord the SS record
81 * \param serviceFlow the service flow
82 * \returns the allocation size
83 */
84 uint32_t CalculateAllocationSize(const SSRecord* ssRecord, const ServiceFlow* serviceFlow);
85 /**
86 * Select flow for request function
87 * \param bytesToRequest bytes to request
88 * \returns a service flow
89 */
91 /**
92 * Send bandwidth request
93 * \param uiuc the UIUC
94 * \param allocationSize the allocation size
95 */
96 void SendBandwidthRequest(uint8_t uiuc, uint16_t allocationSize);
97 /**
98 * Process bandwidth request
99 * \param bwRequestHdr the bandwidth request
100 */
101 void ProcessBandwidthRequest(const BandwidthRequestHeader& bwRequestHdr);
102 /// Set subframe ratio
103 void SetSubframeRatio();
104 /**
105 * Get symbols per frame allocated
106 * \returns the symbols per the frame allocated
107 */
109
110 private:
112 uint16_t m_nrBwReqsSent; ///< bandwidth requests sent
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.
BandwidthManager & operator=(const BandwidthManager &)=delete
void DoDispose() override
Destructor implementation.
void ProcessBandwidthRequest(const BandwidthRequestHeader &bwRequestHdr)
Process bandwidth request.
BandwidthManager(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.