A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
37
namespace
ns3
38
{
39
40
class
SSRecord;
41
class
ServiceFlow;
42
class
UlJob;
43
class
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
*/
56
class
BandwidthManager
:
public
Object
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
*/
69
BandwidthManager
(
Ptr<WimaxNetDevice>
device);
70
~BandwidthManager
()
override
;
71
72
// Delete copy constructor and assignment operator to avoid misuse
73
BandwidthManager
(
const
BandwidthManager
&) =
delete
;
74
BandwidthManager
&
operator=
(
const
BandwidthManager
&) =
delete
;
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
*/
90
ServiceFlow
*
SelectFlowForRequest
(
uint32_t
& bytesToRequest);
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
*/
108
uint32_t
GetSymbolsPerFrameAllocated
();
109
110
private
:
111
Ptr<WimaxNetDevice>
m_device
;
///< the device
112
uint16_t
m_nrBwReqsSent
;
///< bandwidth requests sent
113
};
114
115
}
// namespace ns3
116
117
#endif
/* BANDWIDTH_MANAGER_H */
bs-uplink-scheduler.h
cid.h
ns3::BandwidthManager
This class manage the bandwidth request and grant mechanism.
Definition:
bandwidth-manager.h:57
ns3::BandwidthManager::SetSubframeRatio
void SetSubframeRatio()
Set subframe ratio.
Definition:
bandwidth-manager.cc:204
ns3::BandwidthManager::m_nrBwReqsSent
uint16_t m_nrBwReqsSent
bandwidth requests sent
Definition:
bandwidth-manager.h:112
ns3::BandwidthManager::GetSymbolsPerFrameAllocated
uint32_t GetSymbolsPerFrameAllocated()
Get symbols per frame allocated.
Definition:
bandwidth-manager.cc:219
ns3::BandwidthManager::m_device
Ptr< WimaxNetDevice > m_device
the device
Definition:
bandwidth-manager.h:111
ns3::BandwidthManager::CalculateAllocationSize
uint32_t CalculateAllocationSize(const SSRecord *ssRecord, const ServiceFlow *serviceFlow)
Calculate allocation size function.
Definition:
bandwidth-manager.cc:68
ns3::BandwidthManager::SelectFlowForRequest
ServiceFlow * SelectFlowForRequest(uint32_t &bytesToRequest)
Select flow for request function.
Definition:
bandwidth-manager.cc:119
ns3::BandwidthManager::operator=
BandwidthManager & operator=(const BandwidthManager &)=delete
ns3::BandwidthManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
bandwidth-manager.cc:62
ns3::BandwidthManager::~BandwidthManager
~BandwidthManager() override
Definition:
bandwidth-manager.cc:57
ns3::BandwidthManager::ProcessBandwidthRequest
void ProcessBandwidthRequest(const BandwidthRequestHeader &bwRequestHdr)
Process bandwidth request.
Definition:
bandwidth-manager.cc:183
ns3::BandwidthManager::BandwidthManager
BandwidthManager(const BandwidthManager &)=delete
ns3::BandwidthManager::SendBandwidthRequest
void SendBandwidthRequest(uint8_t uiuc, uint16_t allocationSize)
Send bandwidth request.
Definition:
bandwidth-manager.cc:148
ns3::BandwidthManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
bandwidth-manager.cc:45
ns3::BandwidthRequestHeader
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
Definition:
wimax-mac-header.h:260
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::SSRecord
This class is used by the base station to store some information related to subscriber station in the...
Definition:
ss-record.h:46
ns3::ServiceFlow
This class implements service flows as described by the IEEE-802.16 standard.
Definition:
service-flow.h:43
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ul-job.h
wimax-net-device.h
src
wimax
model
bandwidth-manager.h
Generated on Tue May 28 2024 23:41:07 for ns-3 by
1.9.6