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 
49  // inherited from Object
50  static TypeId GetTypeId ();
51 
52  // inherited from LteFfrAlgorithm
53  virtual void SetLteFfrSapUser (LteFfrSapUser* s);
55 
56  virtual void SetLteFfrRrcSapUser (LteFfrRrcSapUser* s);
58 
59  // let the forwarder class access the protected and private members
62 
63 protected:
64  // inherited from Object
65  virtual void DoInitialize ();
66  virtual void DoDispose ();
67 
68  virtual void Reconfigure ();
69 
70  // FFR SAP PROVIDER IMPLEMENTATION
71  virtual std::vector <bool> DoGetAvailableDlRbg ();
72  virtual bool DoIsDlRbgAvailableForUe (int i, uint16_t rnti);
73  virtual std::vector <bool> DoGetAvailableUlRbg ();
74  virtual bool DoIsUlRbgAvailableForUe (int i, uint16_t rnti);
77  virtual void DoReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ulCqiMap );
78  virtual uint8_t DoGetTpc (uint16_t rnti);
79  virtual uint8_t DoGetMinContinuousUlBandwidth ();
80 
81  // FFR SAP RRC PROVIDER IMPLEMENTATION
82  virtual void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
84 
85 private:
86  void SetDownlinkConfiguration (uint16_t cellId, uint8_t bandwidth);
87  void SetUplinkConfiguration (uint16_t cellId, uint8_t bandwidth);
90 
91  double EstimateUlSinr (uint16_t rnti, uint16_t rb, std::map <uint16_t, std::vector <double> > ulCqiMap);
92  int GetCqiFromSpectralEfficiency (double s);
93 
94  // FFR SAP
97 
98  // FFR RRF SAP
101 
105 
109 
110  std::vector <bool> m_dlRbgMap;
111  std::vector <bool> m_ulRbgMap;
112 
113  std::vector <bool> m_dlReuse3RbgMap;
114  std::vector <bool> m_dlReuse1RbgMap;
115  std::vector <bool> m_dlPrimarySegmentRbgMap;
116  std::vector <bool> m_dlSecondarySegmentRbgMap;
117 
118  std::vector <bool> m_ulReuse3RbgMap;
119  std::vector <bool> m_ulReuse1RbgMap;
120  std::vector <bool> m_ulPrimarySegmentRbgMap;
121  std::vector <bool> m_ulSecondarySegmentRbgMap;
122 
124  {
128  };
129 
130  std::map< uint16_t, uint8_t > m_ues;
131 
133 
136 
138  uint8_t m_edgeAreaTpc;
139 
140 
142  /*
143  * Map of UE's DL CQI A30 received
144  */
145  std::map <uint16_t,SbMeasResult_s> m_dlCqi;
146  std::map <uint16_t, std::vector<bool> > m_dlRbgAvailableforUe;
147 
149  std::map <uint16_t, std::vector<int> > m_ulCqi;
150  std::map <uint16_t, std::vector<bool> > m_ulRbAvailableforUe;
151 
152  // The expected measurement identity
153  uint8_t m_measId;
154 
155 }; // end of class LteFfrEnhancedAlgorithm
156 
157 } // end of namespace ns3
158 
159 #endif /* LTE_FFR_ENHANCED_ALGORITHM_H */
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
virtual uint8_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
Template for the implementation of the LteFfrRrcSapProvider as a member of an owner class of type C t...
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:132
std::map< uint16_t, std::vector< bool > > m_dlRbgAvailableforUe
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
LteFfrEnhancedAlgorithm()
Creates a trivial ffr algorithm instance.
virtual bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
virtual void SetLteFfrSapUser(LteFfrSapUser *s)
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
virtual void DoReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
DoReportDlCqiInfo.
virtual void DoDispose()
Destructor implementation.
Template for the implementation of the LteFfrSapProvider as a member of an owner class of type C to w...
Definition: lte-ffr-sap.h:146
virtual uint8_t DoGetTpc(uint16_t rnti)
DoGetTpc for UE.
std::map< uint16_t, SbMeasResult_s > m_dlCqi
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition: lte-ffr-sap.h:39
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
double EstimateUlSinr(uint16_t rnti, uint16_t rb, std::map< uint16_t, std::vector< double > > ulCqiMap)
virtual void DoReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
DoReportUlCqiInfo.
virtual void DoInitialize()
Initialize() implementation.
virtual std::vector< bool > DoGetAvailableDlRbg()
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The abstract base class of a Frequency Reuse algorithm.
std::map< uint16_t, std::vector< int > > m_ulCqi
Enhanced Fractional Frequency Reuse algorithm implementation.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)
DoRecvLoadInformation.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
virtual void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s)
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
std::map< uint16_t, uint8_t > m_ues
virtual LteFfrSapProvider * GetLteFfrSapProvider()
Export the "provider" part of the LteFfrSap interface.
virtual bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:300
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
a unique identifier for an interface.
Definition: type-id.h:58
virtual void Reconfigure()
Automatic FR reconfiguration.
std::map< uint16_t, std::vector< bool > > m_ulRbAvailableforUe