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 * 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
26namespace ns3
27{
28
29class SSRecord;
30class ServiceFlow;
31class UlJob;
32class 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 */
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 */
59 ~BandwidthManager() override;
60
61 // Delete copy constructor and assignment operator to avoid misuse
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 */
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 */
98
99 private:
101 uint16_t m_nrBwReqsSent; ///< bandwidth requests sent
102};
103
104} // namespace ns3
105
106#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.
BandwidthManager(Ptr< WimaxNetDevice > device)
Constructor.
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:78
Smart pointer class similar to boost::intrusive_ptr.
This class is used by the base station to store some information related to subscriber station in the...
Definition ss-record.h:35
This class implements service flows as described by the IEEE-802.16 standard.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.