A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ffr-enhanced-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_ENHANCED_ALGORITHM_H
22#define LTE_FFR_ENHANCED_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
29#include <map>
30
31// value for SINR outside the range defined by FF-API, used to indicate that there
32// is no CQI for this element
33#define NO_SINR -5000
34
35namespace ns3
36{
37
38/**
39 * \brief Enhanced Fractional Frequency Reuse algorithm implementation
40 */
42{
43 public:
44 /**
45 * \brief Creates a trivial ffr algorithm instance.
46 */
48 ~LteFfrEnhancedAlgorithm() override;
49
50 /**
51 * \brief Get the type ID.
52 * \return the object TypeId
53 */
54 static TypeId GetTypeId();
55
56 // inherited from LteFfrAlgorithm
57 void SetLteFfrSapUser(LteFfrSapUser* s) override;
59
60 void SetLteFfrRrcSapUser(LteFfrRrcSapUser* s) override;
62
63 /// let the forwarder class access the protected and private members
65 /// let the forwarder class access the protected and private members
67
68 protected:
69 // inherited from Object
70 void DoInitialize() override;
71 void DoDispose() override;
72
73 void Reconfigure() override;
74
75 // FFR SAP PROVIDER IMPLEMENTATION
76 std::vector<bool> DoGetAvailableDlRbg() override;
77 bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override;
78 std::vector<bool> DoGetAvailableUlRbg() override;
79 bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override;
84 void DoReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) override;
85 uint8_t DoGetTpc(uint16_t rnti) override;
86 uint16_t DoGetMinContinuousUlBandwidth() override;
87
88 // FFR SAP RRC PROVIDER IMPLEMENTATION
89 void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override;
91
92 private:
93 /**
94 * Set downlink configuration
95 *
96 * \param cellId the cell ID
97 * \param bandwidth the bandwidth
98 */
99 void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth);
100 /**
101 * Set uplink configuration
102 *
103 * \param cellId the cell ID
104 * \param bandwidth the bandwidth
105 */
106 void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth);
107 /**
108 * Initialize downlink RBG maps
109 */
111 /**
112 * Initialize uplink RBG maps
113 */
115
116 /**
117 * Initialize uplink RBG maps
118 *
119 * \param rnti the RNTI
120 * \param rb RB
121 * \param ulCqiMap UL CQI map
122 * \returns UL SINR
123 */
124 double EstimateUlSinr(uint16_t rnti,
125 uint16_t rb,
126 std::map<uint16_t, std::vector<double>> ulCqiMap);
127 /**
128 * Get CQI from spectral efficiency
129 *
130 * \param s spectral efficiency
131 * \returns CQI
132 */
133 int GetCqiFromSpectralEfficiency(double s);
134
135 // FFR SAP
136 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP user
137 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP provider
138
139 // FFR RRF SAP
140 LteFfrRrcSapUser* m_ffrRrcSapUser; ///< FFR RRC SAP user
141 LteFfrRrcSapProvider* m_ffrRrcSapProvider; ///< FFR RRC SAP provider
142
143 uint8_t m_dlSubBandOffset; ///< DL subband offset
144 uint8_t m_dlReuse3SubBandwidth; ///< DL reuse 3 subband bandwidth
145 uint8_t m_dlReuse1SubBandwidth; ///< DL reuse 1 subband bandwidth
146
147 uint8_t m_ulSubBandOffset; ///< UL subband offset
148 uint8_t m_ulReuse3SubBandwidth; ///< UL reuse 3 subbandwidth
149 uint8_t m_ulReuse1SubBandwidth; ///< UL reuse 1 subbandwidth
150
151 std::vector<bool> m_dlRbgMap; ///< DL RBG map
152 std::vector<bool> m_ulRbgMap; ///< UL RBG Map
153
154 std::vector<bool> m_dlReuse3RbgMap; ///< DL reuse 3 RBG map
155 std::vector<bool> m_dlReuse1RbgMap; ///< DL reuse 1 RBG map
156 std::vector<bool> m_dlPrimarySegmentRbgMap; ///< DL primary segment RBG map
157 std::vector<bool> m_dlSecondarySegmentRbgMap; ///< DL secondary segment RBG map
158
159 std::vector<bool> m_ulReuse3RbgMap; ///< UL reuse 3 RBG map
160 std::vector<bool> m_ulReuse1RbgMap; ///< UL reuse 1 RBG map
161 std::vector<bool> m_ulPrimarySegmentRbgMap; ///< UL primary segment RBG map
162 std::vector<bool> m_ulSecondarySegmentRbgMap; ///< UL secondary segment RBG map
163
164 /// UE Position enumeration
166 {
170 };
171
172 std::map<uint16_t, uint8_t> m_ues; ///< UEs
173
174 uint8_t m_rsrqThreshold; ///< RSRQ threshold
175
176 uint8_t m_centerAreaPowerOffset; ///< Center area power offset
177 uint8_t m_edgeAreaPowerOffset; ///< Edge area power offset
178
179 uint8_t m_centerAreaTpc; ///< Center area TPC
180 uint8_t m_edgeAreaTpc; ///< Edge are TPC
181
182 uint8_t m_dlCqiThreshold; ///< DL CQI threshold
183 /**
184 * Map of UE's DL CQI A30 received
185 */
186 std::map<uint16_t, SbMeasResult_s> m_dlCqi;
187 std::map<uint16_t, std::vector<bool>> m_dlRbgAvailableforUe; ///< DL RBG available for UE
188
189 uint8_t m_ulCqiThreshold; ///< UL CQI threshold
190 std::map<uint16_t, std::vector<int>> m_ulCqi; ///< UL CQI
191 std::map<uint16_t, std::vector<bool>> m_ulRbAvailableforUe; ///< UL RB available for UE
192
193 /// The expected measurement identity
194 uint8_t m_measId;
195
196}; // end of class LteFfrEnhancedAlgorithm
197
198} // end of namespace ns3
199
200#endif /* LTE_FFR_ENHANCED_ALGORITHM_H */
The abstract base class of a Frequency Reuse algorithm.
Enhanced Fractional Frequency Reuse algorithm implementation.
uint8_t m_ulSubBandOffset
UL subband offset.
void DoDispose() override
Destructor implementation.
void DoInitialize() override
Initialize() implementation.
void SetLteFfrSapUser(LteFfrSapUser *s) override
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
uint8_t m_measId
The expected measurement identity.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set downlink configuration.
void InitializeDownlinkRbgMaps()
Initialize downlink RBG maps.
std::vector< bool > m_dlRbgMap
DL RBG map.
std::map< uint16_t, std::vector< int > > m_ulCqi
UL CQI.
double EstimateUlSinr(uint16_t rnti, uint16_t rb, std::map< uint16_t, std::vector< double > > ulCqiMap)
Initialize uplink RBG maps.
static TypeId GetTypeId()
Get the type ID.
uint8_t m_dlSubBandOffset
DL subband offset.
uint8_t m_ulCqiThreshold
UL CQI threshold.
std::map< uint16_t, std::vector< bool > > m_dlRbgAvailableforUe
DL RBG available for UE.
void Reconfigure() override
Automatic FR reconfiguration.
std::vector< bool > m_dlSecondarySegmentRbgMap
DL secondary segment RBG map.
uint8_t m_centerAreaPowerOffset
Center area power offset.
uint8_t m_dlCqiThreshold
DL CQI threshold.
std::vector< bool > m_ulReuse1RbgMap
UL reuse 1 RBG map.
bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
std::vector< bool > m_dlPrimarySegmentRbgMap
DL primary segment RBG map.
std::vector< bool > DoGetAvailableUlRbg() override
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
LteFfrRrcSapProvider * GetLteFfrRrcSapProvider() override
Export the "provider" part of the LteFfrRrcSap interface.
std::vector< bool > m_ulPrimarySegmentRbgMap
UL primary segment RBG map.
LteFfrSapProvider * GetLteFfrSapProvider() override
Export the "provider" part of the LteFfrSap interface.
uint8_t m_dlReuse1SubBandwidth
DL reuse 1 subband bandwidth.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP user.
std::vector< bool > m_dlReuse3RbgMap
DL reuse 3 RBG map.
uint8_t DoGetTpc(uint16_t rnti) override
DoGetTpc for UE.
int GetCqiFromSpectralEfficiency(double s)
Get CQI from spectral efficiency.
std::vector< bool > m_ulReuse3RbgMap
UL reuse 3 RBG map.
std::map< uint16_t, SbMeasResult_s > m_dlCqi
Map of UE's DL CQI A30 received.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set uplink configuration.
uint8_t m_ulReuse1SubBandwidth
UL reuse 1 subbandwidth.
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
uint16_t DoGetMinContinuousUlBandwidth() override
DoGetMinContinuousUlBandwidth in number of RB.
LteFfrEnhancedAlgorithm()
Creates a trivial ffr algorithm instance.
std::map< uint16_t, uint8_t > m_ues
UEs.
void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params) override
DoRecvLoadInformation.
void DoReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params) override
DoReportUlCqiInfo.
std::map< uint16_t, std::vector< bool > > m_ulRbAvailableforUe
UL RB available for UE.
std::vector< bool > m_ulRbgMap
UL RBG Map.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP provider.
std::vector< bool > m_dlReuse1RbgMap
DL reuse 1 RBG map.
void InitializeUplinkRbgMaps()
Initialize uplink RBG maps.
void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s) override
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void DoReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params) override
DoReportDlCqiInfo.
uint8_t m_ulReuse3SubBandwidth
UL reuse 3 subbandwidth.
std::vector< bool > m_ulSecondarySegmentRbgMap
UL secondary segment RBG map.
uint8_t m_edgeAreaPowerOffset
Edge area power offset.
bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
uint8_t m_dlReuse3SubBandwidth
DL reuse 3 subband bandwidth.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
std::vector< bool > DoGetAvailableDlRbg() override
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
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 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