A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ffr-distributed-algorithm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Piotr Gawlowicz
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 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
18 *
19 */
20
21#ifndef LTE_FFR_DISTRIBUTED_ALGORITHM_H
22#define LTE_FFR_DISTRIBUTED_ALGORITHM_H
23
24#include "lte-ffr-algorithm.h"
25#include "lte-ffr-rrc-sap.h"
26#include "lte-ffr-sap.h"
27#include "lte-rrc-sap.h"
28
29namespace ns3
30{
31
32/**
33 * \brief Distributed Fractional Frequency Reuse algorithm implementation.
34 */
36{
37 public:
40
41 /**
42 * \brief Get the type ID.
43 * \return the object TypeId
44 */
45 static TypeId GetTypeId();
46
47 // inherited from LteFfrAlgorithm
48 void SetLteFfrSapUser(LteFfrSapUser* s) override;
50
51 void SetLteFfrRrcSapUser(LteFfrRrcSapUser* s) override;
53
54 /// let the forwarder class access the protected and private members
56 /// let the forwarder class access the protected and private members
58
59 protected:
60 // inherited from Object
61 void DoInitialize() override;
62 void DoDispose() override;
63
64 void Reconfigure() override;
65
66 // FFR SAP PROVIDER IMPLEMENTATION
67 std::vector<bool> DoGetAvailableDlRbg() override;
68 bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override;
69 std::vector<bool> DoGetAvailableUlRbg() override;
70 bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override;
75 void DoReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) override;
76 uint8_t DoGetTpc(uint16_t rnti) override;
77 uint16_t DoGetMinContinuousUlBandwidth() override;
78
79 // FFR SAP RRC PROVIDER IMPLEMENTATION
80 void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override;
82
83 private:
84 /**
85 * Set down link configuration function
86 *
87 * \param cellId cell ID
88 * \param bandwidth the bandwidth
89 */
90 void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth);
91 /**
92 * Set up link configuration function
93 *
94 * \param cellId cell ID
95 * \param bandwidth the bandwidth
96 */
97 void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth);
98 /**
99 * Initialize down link RBG maps function
100 */
102 /**
103 * Initialize up link RBG maps function
104 */
106
107 /**
108 * Initialize up link RBG maps function
109 *
110 * \param rnti the RNTI
111 * \param cellId the cell ID
112 * \param rsrp the RSRP
113 * \param rsrq the RSRQ
114 */
115 void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq);
116
117 /// Calculate function
118 void Calculate();
119 /**
120 * Send load information function
121 *
122 * \param targetCellId the cell ID
123 */
124 void SendLoadInformation(uint16_t targetCellId);
125
126 // FFR SAP
127 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP User
128 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP Provider
129
130 // FFR RRF SAP
131 LteFfrRrcSapUser* m_ffrRrcSapUser; ///< FFR RRC SAP User
132 LteFfrRrcSapProvider* m_ffrRrcSapProvider; ///< FFR RRC SAP Provider
133
134 std::vector<bool> m_dlRbgMap; ///< DL RBG map
135 std::vector<bool> m_ulRbgMap; ///< UL RBG map
136
137 uint8_t m_edgeRbNum; ///< edge RB number
138 std::vector<bool> m_dlEdgeRbgMap; ///< DL edge RBG map
139 std::vector<bool> m_ulEdgeRbgMap; ///< UL edge RBG map
140
141 /// UePosition enumeration
143 {
147 };
148
149 std::map<uint16_t, uint8_t> m_ues; ///< UEs map
150
151 uint8_t m_edgeSubBandRsrqThreshold; ///< edge sub band RSRQ threshold
152
153 uint8_t m_centerPowerOffset; ///< center power offset
154 uint8_t m_edgePowerOffset; ///< edge power offset
155
156 uint8_t m_centerAreaTpc; ///< center area TPC
157 uint8_t m_edgeAreaTpc; ///< edge area TCP
158
159 Time m_calculationInterval; ///< calculation interval
160 EventId m_calculationEvent; ///< calculation event
161
162 // The expected measurement identity
163 uint8_t m_rsrqMeasId; ///< RSRQ measurement ID
164 uint8_t m_rsrpMeasId; ///< RSRP measurement ID
165
166 /**
167 * \brief Measurements reported by a UE for a cell ID.
168 *
169 * The values are quantized according 3GPP TS 36.133 section 9.1.4 and 9.1.7.
170 */
171 class UeMeasure : public SimpleRefCount<UeMeasure>
172 {
173 public:
174 uint16_t m_cellId; ///< Cell ID
175 uint8_t m_rsrp; ///< RSRP
176 uint8_t m_rsrq; ///< RSRQ
177 };
178
179 /// Cell Id is used as the key for the following map
180 typedef std::map<uint16_t, Ptr<UeMeasure>> MeasurementRow_t;
181 /// RNTI is used as the key for the following map
182 typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t;
184
185 std::vector<uint16_t> m_neighborCell; ///< neighbor cell
186
187 uint8_t m_rsrpDifferenceThreshold; ///< RSRP difference threshold
188
189 std::map<uint16_t, uint32_t> m_cellWeightMap; ///< cell weight map
190
191 std::map<uint16_t, std::vector<bool>> m_rntp; ///< RNTP
192
193}; // end of class LteFfrDistributedAlgorithm
194
195} // end of namespace ns3
196
197#endif /* LTE_FR_DISTRIBUTED_ALGORITHM_H */
An identifier for simulation events.
Definition: event-id.h:55
The abstract base class of a Frequency Reuse algorithm.
Measurements reported by a UE for a cell ID.
Distributed Fractional Frequency Reuse algorithm implementation.
std::map< uint16_t, Ptr< UeMeasure > > MeasurementRow_t
Cell Id is used as the key for the following map.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
uint8_t DoGetTpc(uint16_t rnti) override
DoGetTpc for UE.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP Provider.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP Provider.
std::map< uint16_t, uint8_t > m_ues
UEs map.
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq)
Initialize up link RBG maps function.
uint8_t m_rsrpDifferenceThreshold
RSRP difference threshold.
void DoDispose() override
Destructor implementation.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP User.
std::map< uint16_t, uint32_t > m_cellWeightMap
cell weight map
bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set up link configuration function.
void DoInitialize() override
Initialize() implementation.
void DoReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params) override
DoReportDlCqiInfo.
uint16_t DoGetMinContinuousUlBandwidth() override
DoGetMinContinuousUlBandwidth in number of RB.
void SetLteFfrSapUser(LteFfrSapUser *s) override
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params) override
DoRecvLoadInformation.
MeasurementTable_t m_ueMeasures
UE measures.
std::vector< bool > DoGetAvailableDlRbg() override
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
std::map< uint16_t, std::vector< bool > > m_rntp
RNTP.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set down link configuration function.
std::vector< uint16_t > m_neighborCell
neighbor cell
std::vector< bool > m_ulRbgMap
UL RBG map.
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
uint8_t m_edgeSubBandRsrqThreshold
edge sub band RSRQ threshold
std::vector< bool > DoGetAvailableUlRbg() override
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
static TypeId GetTypeId()
Get the type ID.
LteFfrSapProvider * GetLteFfrSapProvider() override
Export the "provider" part of the LteFfrSap interface.
std::map< uint16_t, MeasurementRow_t > MeasurementTable_t
RNTI is used as the key for the following map.
LteFfrRrcSapProvider * GetLteFfrRrcSapProvider() override
Export the "provider" part of the LteFfrRrcSap interface.
std::vector< bool > m_dlRbgMap
DL RBG map.
void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s) override
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void Reconfigure() override
Automatic FR reconfiguration.
uint8_t m_centerPowerOffset
center power offset
void InitializeUplinkRbgMaps()
Initialize up link RBG maps function.
std::vector< bool > m_dlEdgeRbgMap
DL edge RBG map.
void DoReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params) override
DoReportUlCqiInfo.
void SendLoadInformation(uint16_t targetCellId)
Send load information function.
void InitializeDownlinkRbgMaps()
Initialize down link RBG maps function.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition: lte-ffr-sap.h:40
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:140
Template for the implementation of the LteFfrRrcSapProvider as a member of an owner class of type C t...
Template for the implementation of the LteFfrSapProvider as a member of an owner class of type C to w...
Definition: lte-ffr-sap.h:153
A template-based reference counting class.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:306
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
MeasResults structure.
Definition: lte-rrc-sap.h:717