A Discrete-Event Network Simulator
API
lte-ffr-enhanced-algorithm.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Piotr Gawlowicz
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
19  *
20  */
21 
22 #ifndef LTE_FFR_ENHANCED_ALGORITHM_H
23 #define LTE_FFR_ENHANCED_ALGORITHM_H
24 
25 #include <ns3/lte-ffr-algorithm.h>
26 #include <ns3/lte-ffr-sap.h>
27 #include <ns3/lte-ffr-rrc-sap.h>
28 #include <ns3/lte-rrc-sap.h>
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 
41 {
42 public:
47  virtual ~LteFfrEnhancedAlgorithm ();
48 
53  static TypeId GetTypeId ();
54 
55  // inherited from LteFfrAlgorithm
56  virtual void SetLteFfrSapUser (LteFfrSapUser* s);
58 
59  virtual void SetLteFfrRrcSapUser (LteFfrRrcSapUser* s);
61 
66 
67 protected:
68  // inherited from Object
69  virtual void DoInitialize ();
70  virtual void DoDispose ();
71 
72  virtual void Reconfigure ();
73 
74  // FFR SAP PROVIDER IMPLEMENTATION
75  virtual std::vector <bool> DoGetAvailableDlRbg ();
76  virtual bool DoIsDlRbgAvailableForUe (int i, uint16_t rnti);
77  virtual std::vector <bool> DoGetAvailableUlRbg ();
78  virtual bool DoIsUlRbgAvailableForUe (int i, uint16_t rnti);
81  virtual void DoReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ulCqiMap );
82  virtual uint8_t DoGetTpc (uint16_t rnti);
83  virtual uint16_t DoGetMinContinuousUlBandwidth ();
84 
85  // FFR SAP RRC PROVIDER IMPLEMENTATION
86  virtual void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
88 
89 private:
96  void SetDownlinkConfiguration (uint16_t cellId, uint8_t bandwidth);
103  void SetUplinkConfiguration (uint16_t cellId, uint8_t bandwidth);
111  void InitializeUplinkRbgMaps ();
112 
121  double EstimateUlSinr (uint16_t rnti, uint16_t rb, std::map <uint16_t, std::vector <double> > ulCqiMap);
128  int GetCqiFromSpectralEfficiency (double s);
129 
130  // FFR SAP
133 
134  // FFR RRF SAP
137 
141 
145 
146  std::vector <bool> m_dlRbgMap;
147  std::vector <bool> m_ulRbgMap;
148 
149  std::vector <bool> m_dlReuse3RbgMap;
150  std::vector <bool> m_dlReuse1RbgMap;
151  std::vector <bool> m_dlPrimarySegmentRbgMap;
152  std::vector <bool> m_dlSecondarySegmentRbgMap;
153 
154  std::vector <bool> m_ulReuse3RbgMap;
155  std::vector <bool> m_ulReuse1RbgMap;
156  std::vector <bool> m_ulPrimarySegmentRbgMap;
157  std::vector <bool> m_ulSecondarySegmentRbgMap;
158 
161  {
164  EdgeArea
165  };
166 
167  std::map< uint16_t, uint8_t > m_ues;
168 
169  uint8_t m_rsrqThreshold;
170 
173 
174  uint8_t m_centerAreaTpc;
175  uint8_t m_edgeAreaTpc;
176 
177 
179 
182  std::map <uint16_t,SbMeasResult_s> m_dlCqi;
183  std::map <uint16_t, std::vector<bool> > m_dlRbgAvailableforUe;
184 
186  std::map <uint16_t, std::vector<int> > m_ulCqi;
187  std::map <uint16_t, std::vector<bool> > m_ulRbAvailableforUe;
188 
190  uint8_t m_measId;
191 
192 }; // end of class LteFfrEnhancedAlgorithm
193 
194 } // end of namespace ns3
195 
196 #endif /* LTE_FFR_ENHANCED_ALGORITHM_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::LteFfrEnhancedAlgorithm::m_dlReuse3SubBandwidth
uint8_t m_dlReuse3SubBandwidth
DL reuse 3 subband bandwidth.
Definition: lte-ffr-enhanced-algorithm.h:139
ns3::LteFfrSapUser
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:139
ns3::LteFfrEnhancedAlgorithm::DoReportUlCqiInfo
virtual void DoReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
DoReportUlCqiInfo.
Definition: lte-ffr-enhanced-algorithm.cc:740
ns3::LteFfrEnhancedAlgorithm::DoReportDlCqiInfo
virtual void DoReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
DoReportDlCqiInfo.
Definition: lte-ffr-enhanced-algorithm.cc:635
ns3::LteFfrEnhancedAlgorithm::m_dlReuse1RbgMap
std::vector< bool > m_dlReuse1RbgMap
DL reuse 1 RBG map.
Definition: lte-ffr-enhanced-algorithm.h:150
ns3::FfMacSchedSapProvider::SchedDlCqiInfoReqParameters
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Definition: ff-mac-sched-sap.h:125
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::LteFfrEnhancedAlgorithm::SetUplinkConfiguration
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set uplink configuration.
Definition: lte-ffr-enhanced-algorithm.cc:292
ns3::LteFfrEnhancedAlgorithm::DoGetMinContinuousUlBandwidth
virtual uint16_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
Definition: lte-ffr-enhanced-algorithm.cc:835
ns3::FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
Definition: ff-mac-sched-sap.h:186
ns3::LteFfrEnhancedAlgorithm::UePosition
UePosition
UE Position enumeration.
Definition: lte-ffr-enhanced-algorithm.h:161
ns3::LteFfrEnhancedAlgorithm::m_dlPrimarySegmentRbgMap
std::vector< bool > m_dlPrimarySegmentRbgMap
DL primary segment RBG map.
Definition: lte-ffr-enhanced-algorithm.h:151
ns3::LteFfrEnhancedAlgorithm::m_dlRbgAvailableforUe
std::map< uint16_t, std::vector< bool > > m_dlRbgAvailableforUe
DL RBG available for UE.
Definition: lte-ffr-enhanced-algorithm.h:183
ns3::LteFfrEnhancedAlgorithm::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition: lte-ffr-enhanced-algorithm.cc:124
ns3::LteFfrEnhancedAlgorithm::DoRecvLoadInformation
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)
DoRecvLoadInformation.
Definition: lte-ffr-enhanced-algorithm.cc:907
ns3::LteFfrEnhancedAlgorithm::m_ulRbgMap
std::vector< bool > m_ulRbgMap
UL RBG Map.
Definition: lte-ffr-enhanced-algorithm.h:147
ns3::LteFfrEnhancedAlgorithm::m_dlReuse3RbgMap
std::vector< bool > m_dlReuse3RbgMap
DL reuse 3 RBG map.
Definition: lte-ffr-enhanced-algorithm.h:149
ns3::LteFfrEnhancedAlgorithm::m_ulCqiThreshold
uint8_t m_ulCqiThreshold
UL CQI threshold.
Definition: lte-ffr-enhanced-algorithm.h:185
ns3::LteFfrEnhancedAlgorithm::m_ffrRrcSapProvider
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP provider.
Definition: lte-ffr-enhanced-algorithm.h:136
ns3::LteFfrEnhancedAlgorithm::DoInitialize
virtual void DoInitialize()
Initialize() implementation.
Definition: lte-ffr-enhanced-algorithm.cc:236
ns3::LteFfrEnhancedAlgorithm
Enhanced Fractional Frequency Reuse algorithm implementation.
Definition: lte-ffr-enhanced-algorithm.h:41
ns3::LteFfrEnhancedAlgorithm::m_measId
uint8_t m_measId
The expected measurement identity.
Definition: lte-ffr-enhanced-algorithm.h:190
ns3::LteFfrEnhancedAlgorithm::m_ulReuse1SubBandwidth
uint8_t m_ulReuse1SubBandwidth
UL reuse 1 subbandwidth.
Definition: lte-ffr-enhanced-algorithm.h:144
ns3::LteFfrEnhancedAlgorithm::m_rsrqThreshold
uint8_t m_rsrqThreshold
RSRQ threshold.
Definition: lte-ffr-enhanced-algorithm.h:169
ns3::LteFfrEnhancedAlgorithm::m_ues
std::map< uint16_t, uint8_t > m_ues
UEs.
Definition: lte-ffr-enhanced-algorithm.h:167
ns3::LteFfrEnhancedAlgorithm::m_ulReuse3RbgMap
std::vector< bool > m_ulReuse3RbgMap
UL reuse 3 RBG map.
Definition: lte-ffr-enhanced-algorithm.h:154
ns3::LteFfrEnhancedAlgorithm::m_dlCqiThreshold
uint8_t m_dlCqiThreshold
DL CQI threshold.
Definition: lte-ffr-enhanced-algorithm.h:178
ns3::LteFfrEnhancedAlgorithm::m_centerAreaPowerOffset
uint8_t m_centerAreaPowerOffset
Center area power offset.
Definition: lte-ffr-enhanced-algorithm.h:171
ns3::LteFfrEnhancedAlgorithm::InitializeDownlinkRbgMaps
void InitializeDownlinkRbgMaps()
Initialize downlink RBG maps.
Definition: lte-ffr-enhanced-algorithm.cc:322
ns3::LteFfrEnhancedAlgorithm::GetCqiFromSpectralEfficiency
int GetCqiFromSpectralEfficiency(double s)
Get CQI from spectral efficiency.
Definition: lte-ffr-enhanced-algorithm.cc:308
ns3::MemberLteFfrRrcSapProvider
Template for the implementation of the LteFfrRrcSapProvider as a member of an owner class of type C t...
Definition: lte-ffr-rrc-sap.h:144
ns3::LteFfrEnhancedAlgorithm::LteFfrEnhancedAlgorithm
LteFfrEnhancedAlgorithm()
Creates a trivial ffr algorithm instance.
Definition: lte-ffr-enhanced-algorithm.cc:97
ns3::LteFfrRrcSapUser
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-rrc-sap.h:89
ns3::LteFfrEnhancedAlgorithm::m_ulSecondarySegmentRbgMap
std::vector< bool > m_ulSecondarySegmentRbgMap
UL secondary segment RBG map.
Definition: lte-ffr-enhanced-algorithm.h:157
ns3::LteFfrEnhancedAlgorithm::m_edgeAreaTpc
uint8_t m_edgeAreaTpc
Edge are TPC.
Definition: lte-ffr-enhanced-algorithm.h:175
ns3::LteFfrEnhancedAlgorithm::~LteFfrEnhancedAlgorithm
virtual ~LteFfrEnhancedAlgorithm()
Definition: lte-ffr-enhanced-algorithm.cc:108
ns3::LteFfrEnhancedAlgorithm::CenterArea
@ CenterArea
Definition: lte-ffr-enhanced-algorithm.h:163
ns3::LteFfrEnhancedAlgorithm::DoIsDlRbgAvailableForUe
virtual bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
Definition: lte-ffr-enhanced-algorithm.cc:475
ns3::LteFfrEnhancedAlgorithm::SetLteFfrRrcSapUser
virtual void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s)
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
Definition: lte-ffr-enhanced-algorithm.cc:220
ns3::LteFfrSapProvider
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition: lte-ffr-sap.h:40
ns3::LteFfrEnhancedAlgorithm::GetLteFfrSapProvider
virtual LteFfrSapProvider * GetLteFfrSapProvider()
Export the "provider" part of the LteFfrSap interface.
Definition: lte-ffr-enhanced-algorithm.cc:213
ns3::LteFfrEnhancedAlgorithm::m_dlReuse1SubBandwidth
uint8_t m_dlReuse1SubBandwidth
DL reuse 1 subband bandwidth.
Definition: lte-ffr-enhanced-algorithm.h:140
ns3::LteFfrEnhancedAlgorithm::m_ulPrimarySegmentRbgMap
std::vector< bool > m_ulPrimarySegmentRbgMap
UL primary segment RBG map.
Definition: lte-ffr-enhanced-algorithm.h:156
ns3::LteFfrEnhancedAlgorithm::m_ulReuse1RbgMap
std::vector< bool > m_ulReuse1RbgMap
UL reuse 1 RBG map.
Definition: lte-ffr-enhanced-algorithm.h:155
ns3::LteFfrEnhancedAlgorithm::m_ulRbAvailableforUe
std::map< uint16_t, std::vector< bool > > m_ulRbAvailableforUe
UL RB available for UE.
Definition: lte-ffr-enhanced-algorithm.h:187
ns3::LteFfrEnhancedAlgorithm::EdgeArea
@ EdgeArea
Definition: lte-ffr-enhanced-algorithm.h:164
ns3::LteFfrEnhancedAlgorithm::m_dlCqi
std::map< uint16_t, SbMeasResult_s > m_dlCqi
Map of UE's DL CQI A30 received.
Definition: lte-ffr-enhanced-algorithm.h:182
ns3::LteFfrEnhancedAlgorithm::DoGetAvailableUlRbg
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
Definition: lte-ffr-enhanced-algorithm.cc:536
ns3::LteFfrEnhancedAlgorithm::Reconfigure
virtual void Reconfigure()
Automatic FR reconfiguration.
Definition: lte-ffr-enhanced-algorithm.cc:262
ns3::LteFfrEnhancedAlgorithm::m_ffrRrcSapUser
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP user.
Definition: lte-ffr-enhanced-algorithm.h:135
ns3::LteFfrEnhancedAlgorithm::GetLteFfrRrcSapProvider
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.
Definition: lte-ffr-enhanced-algorithm.cc:228
ns3::LteFfrEnhancedAlgorithm::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition: lte-ffr-enhanced-algorithm.cc:115
ns3::LteRrcSap::MeasResults
MeasResults structure.
Definition: lte-rrc-sap.h:679
ns3::LteFfrEnhancedAlgorithm::EstimateUlSinr
double EstimateUlSinr(uint16_t rnti, uint16_t rb, std::map< uint16_t, std::vector< double > > ulCqiMap)
Initialize uplink RBG maps.
Definition: lte-ffr-enhanced-algorithm.cc:767
ns3::EpcX2Sap::LoadInformationParams
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:304
ns3::LteFfrEnhancedAlgorithm::m_centerAreaTpc
uint8_t m_centerAreaTpc
Center area TPC.
Definition: lte-ffr-enhanced-algorithm.h:174
ns3::LteFfrEnhancedAlgorithm::InitializeUplinkRbgMaps
void InitializeUplinkRbgMaps()
Initialize uplink RBG maps.
Definition: lte-ffr-enhanced-algorithm.cc:378
ns3::LteFfrEnhancedAlgorithm::m_ffrSapUser
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
Definition: lte-ffr-enhanced-algorithm.h:131
ns3::LteFfrEnhancedAlgorithm::AreaUnset
@ AreaUnset
Definition: lte-ffr-enhanced-algorithm.h:162
ns3::LteFfrAlgorithm
The abstract base class of a Frequency Reuse algorithm.
Definition: lte-ffr-algorithm.h:58
ns3::LteFfrEnhancedAlgorithm::DoGetTpc
virtual uint8_t DoGetTpc(uint16_t rnti)
DoGetTpc for UE.
Definition: lte-ffr-enhanced-algorithm.cc:797
ns3::LteFfrEnhancedAlgorithm::m_dlSecondarySegmentRbgMap
std::vector< bool > m_dlSecondarySegmentRbgMap
DL secondary segment RBG map.
Definition: lte-ffr-enhanced-algorithm.h:152
ns3::LteFfrEnhancedAlgorithm::m_ulCqi
std::map< uint16_t, std::vector< int > > m_ulCqi
UL CQI.
Definition: lte-ffr-enhanced-algorithm.h:186
ns3::LteFfrEnhancedAlgorithm::DoReportUeMeas
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
Definition: lte-ffr-enhanced-algorithm.cc:859
ns3::LteFfrEnhancedAlgorithm::DoIsUlRbgAvailableForUe
virtual bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
Definition: lte-ffr-enhanced-algorithm.cc:571
ns3::LteFfrEnhancedAlgorithm::m_dlSubBandOffset
uint8_t m_dlSubBandOffset
DL subband offset.
Definition: lte-ffr-enhanced-algorithm.h:138
ns3::MemberLteFfrSapProvider
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
ns3::LteFfrEnhancedAlgorithm::m_ulReuse3SubBandwidth
uint8_t m_ulReuse3SubBandwidth
UL reuse 3 subbandwidth.
Definition: lte-ffr-enhanced-algorithm.h:143
ns3::LteFfrEnhancedAlgorithm::m_ulSubBandOffset
uint8_t m_ulSubBandOffset
UL subband offset.
Definition: lte-ffr-enhanced-algorithm.h:142
ns3::LteFfrEnhancedAlgorithm::m_ffrSapProvider
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
Definition: lte-ffr-enhanced-algorithm.h:132
ns3::LteFfrEnhancedAlgorithm::m_edgeAreaPowerOffset
uint8_t m_edgeAreaPowerOffset
Edge area power offset.
Definition: lte-ffr-enhanced-algorithm.h:172
ns3::LteFfrRrcSapProvider
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
Definition: lte-ffr-rrc-sap.h:39
ns3::LteFfrEnhancedAlgorithm::SetLteFfrSapUser
virtual void SetLteFfrSapUser(LteFfrSapUser *s)
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
Definition: lte-ffr-enhanced-algorithm.cc:205
ns3::LteFfrEnhancedAlgorithm::DoGetAvailableDlRbg
virtual std::vector< bool > DoGetAvailableDlRbg()
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
Definition: lte-ffr-enhanced-algorithm.cc:440
ns3::LteFfrEnhancedAlgorithm::m_dlRbgMap
std::vector< bool > m_dlRbgMap
DL RBG map.
Definition: lte-ffr-enhanced-algorithm.h:146
ns3::LteFfrEnhancedAlgorithm::SetDownlinkConfiguration
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set downlink configuration.
Definition: lte-ffr-enhanced-algorithm.cc:276