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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
8
* <amine.ismail@UDcast.com>
9
*/
10
11
#ifndef BANDWIDTH_MANAGER_H
12
#define BANDWIDTH_MANAGER_H
13
14
#include "
bs-uplink-scheduler.h
"
15
#include "
cid.h
"
16
#include "
ul-job.h
"
17
#include "
wimax-net-device.h
"
18
19
#include <stdint.h>
20
21
/*
22
The same bandwidth manager class serves both for BS and SS though some functions are exclusive to
23
only one of them.
24
*/
25
26
namespace
ns3
27
{
28
29
class
SSRecord;
30
class
ServiceFlow;
31
class
UlJob;
32
class
UplinkScheduler;
33
34
/**
35
* \ingroup wimax
36
* \brief This class manage the bandwidth request and grant mechanism.
37
* The bandwidth request and grant mechanism is supported by the Bandwidth
38
* Manager. Both BS and SS maintain a bandwidth manager. Furthermore BS's
39
* bandwidth manager works together with the uplink scheduler to determine
40
* total bandwidth available and allocation size for each service flow.
41
* Bandwidth request mechanism is a key feature of the WiMAX scheduler
42
* since all three non-UGS services explicitly request for bandwidth by
43
* sending a bandwidth request to BS.
44
*/
45
class
BandwidthManager
:
public
Object
46
{
47
public
:
48
/**
49
* \brief Get the type ID.
50
* \return the object TypeId
51
*/
52
static
TypeId
GetTypeId
();
53
/**
54
* Constructor
55
*
56
* \param device WIMAX device
57
*/
58
BandwidthManager
(
Ptr<WimaxNetDevice>
device);
59
~BandwidthManager
()
override
;
60
61
// Delete copy constructor and assignment operator to avoid misuse
62
BandwidthManager
(
const
BandwidthManager
&) =
delete
;
63
BandwidthManager
&
operator=
(
const
BandwidthManager
&) =
delete
;
64
65
void
DoDispose
()
override
;
66
67
/**
68
* Calculate allocation size function
69
* \param ssRecord the SS record
70
* \param serviceFlow the service flow
71
* \returns the allocation size
72
*/
73
uint32_t
CalculateAllocationSize
(
const
SSRecord
* ssRecord,
const
ServiceFlow
* serviceFlow);
74
/**
75
* Select flow for request function
76
* \param bytesToRequest bytes to request
77
* \returns a service flow
78
*/
79
ServiceFlow
*
SelectFlowForRequest
(
uint32_t
& bytesToRequest);
80
/**
81
* Send bandwidth request
82
* \param uiuc the UIUC
83
* \param allocationSize the allocation size
84
*/
85
void
SendBandwidthRequest
(uint8_t uiuc, uint16_t allocationSize);
86
/**
87
* Process bandwidth request
88
* \param bwRequestHdr the bandwidth request
89
*/
90
void
ProcessBandwidthRequest
(
const
BandwidthRequestHeader
& bwRequestHdr);
91
/// Set subframe ratio
92
void
SetSubframeRatio
();
93
/**
94
* Get symbols per frame allocated
95
* \returns the symbols per the frame allocated
96
*/
97
uint32_t
GetSymbolsPerFrameAllocated
();
98
99
private
:
100
Ptr<WimaxNetDevice>
m_device
;
///< the device
101
uint16_t
m_nrBwReqsSent
;
///< bandwidth requests sent
102
};
103
104
}
// namespace ns3
105
106
#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:46
ns3::BandwidthManager::SetSubframeRatio
void SetSubframeRatio()
Set subframe ratio.
Definition
bandwidth-manager.cc:193
ns3::BandwidthManager::m_nrBwReqsSent
uint16_t m_nrBwReqsSent
bandwidth requests sent
Definition
bandwidth-manager.h:101
ns3::BandwidthManager::GetSymbolsPerFrameAllocated
uint32_t GetSymbolsPerFrameAllocated()
Get symbols per frame allocated.
Definition
bandwidth-manager.cc:208
ns3::BandwidthManager::m_device
Ptr< WimaxNetDevice > m_device
the device
Definition
bandwidth-manager.h:100
ns3::BandwidthManager::CalculateAllocationSize
uint32_t CalculateAllocationSize(const SSRecord *ssRecord, const ServiceFlow *serviceFlow)
Calculate allocation size function.
Definition
bandwidth-manager.cc:57
ns3::BandwidthManager::SelectFlowForRequest
ServiceFlow * SelectFlowForRequest(uint32_t &bytesToRequest)
Select flow for request function.
Definition
bandwidth-manager.cc:108
ns3::BandwidthManager::operator=
BandwidthManager & operator=(const BandwidthManager &)=delete
ns3::BandwidthManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition
bandwidth-manager.cc:51
ns3::BandwidthManager::~BandwidthManager
~BandwidthManager() override
Definition
bandwidth-manager.cc:46
ns3::BandwidthManager::BandwidthManager
BandwidthManager(Ptr< WimaxNetDevice > device)
Constructor.
Definition
bandwidth-manager.cc:40
ns3::BandwidthManager::ProcessBandwidthRequest
void ProcessBandwidthRequest(const BandwidthRequestHeader &bwRequestHdr)
Process bandwidth request.
Definition
bandwidth-manager.cc:172
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:137
ns3::BandwidthManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
bandwidth-manager.cc:34
ns3::BandwidthRequestHeader
This class implements the bandwidth-request mac Header as described by IEEE Standard for Local and me...
Definition
wimax-mac-header.h:249
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SSRecord
This class is used by the base station to store some information related to subscriber station in the...
Definition
ss-record.h:35
ns3::ServiceFlow
This class implements service flows as described by the IEEE-802.16 standard.
Definition
service-flow.h:32
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
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 Fri Nov 8 2024 13:59:09 for ns-3 by
1.11.0