A Discrete-Event Network Simulator
API
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 
35 namespace ns3
36 {
37 
42 {
43  public:
48  ~LteFfrEnhancedAlgorithm() override;
49 
54  static TypeId GetTypeId();
55 
56  // inherited from LteFfrAlgorithm
57  void SetLteFfrSapUser(LteFfrSapUser* s) override;
59 
60  void SetLteFfrRrcSapUser(LteFfrRrcSapUser* s) override;
62 
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;
80  void DoReportDlCqiInfo(
82  void DoReportUlCqiInfo(
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:
99  void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth);
106  void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth);
115 
124  double EstimateUlSinr(uint16_t rnti,
125  uint16_t rb,
126  std::map<uint16_t, std::vector<double>> ulCqiMap);
133  int GetCqiFromSpectralEfficiency(double s);
134 
135  // FFR SAP
138 
139  // FFR RRF SAP
142 
146 
150 
151  std::vector<bool> m_dlRbgMap;
152  std::vector<bool> m_ulRbgMap;
153 
154  std::vector<bool> m_dlReuse3RbgMap;
155  std::vector<bool> m_dlReuse1RbgMap;
156  std::vector<bool> m_dlPrimarySegmentRbgMap;
157  std::vector<bool> m_dlSecondarySegmentRbgMap;
158 
159  std::vector<bool> m_ulReuse3RbgMap;
160  std::vector<bool> m_ulReuse1RbgMap;
161  std::vector<bool> m_ulPrimarySegmentRbgMap;
162  std::vector<bool> m_ulSecondarySegmentRbgMap;
163 
166  {
169  EdgeArea
170  };
171 
172  std::map<uint16_t, uint8_t> m_ues;
173 
174  uint8_t m_rsrqThreshold;
175 
178 
179  uint8_t m_centerAreaTpc;
180  uint8_t m_edgeAreaTpc;
181 
186  std::map<uint16_t, SbMeasResult_s> m_dlCqi;
187  std::map<uint16_t, std::vector<bool>> m_dlRbgAvailableforUe;
188 
190  std::map<uint16_t, std::vector<int>> m_ulCqi;
191  std::map<uint16_t, std::vector<bool>> m_ulRbAvailableforUe;
192 
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.
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.
double EstimateUlSinr(uint16_t rnti, uint16_t rb, std::map< uint16_t, std::vector< double >> ulCqiMap)
Initialize uplink RBG maps.
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.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
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