A Discrete-Event Network Simulator
API
lte-ffr-distributed-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_DISTRIBUTED_ALGORITHM_H
23 #define LTE_FFR_DISTRIBUTED_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 
30 namespace ns3 {
31 
36 {
37 public:
39  virtual ~LteFfrDistributedAlgorithm ();
40 
45  static TypeId GetTypeId ();
46 
47  // inherited from LteFfrAlgorithm
48  virtual void SetLteFfrSapUser (LteFfrSapUser* s);
50 
51  virtual void SetLteFfrRrcSapUser (LteFfrRrcSapUser* s);
53 
58 
59 protected:
60  // inherited from Object
61  virtual void DoInitialize ();
62  virtual void DoDispose ();
63 
64  virtual void Reconfigure ();
65 
66  // FFR SAP PROVIDER IMPLEMENTATION
67  virtual std::vector <bool> DoGetAvailableDlRbg ();
68  virtual bool DoIsDlRbgAvailableForUe (int i, uint16_t rnti);
69  virtual std::vector <bool> DoGetAvailableUlRbg ();
70  virtual bool DoIsUlRbgAvailableForUe (int i, uint16_t rnti);
73  virtual void DoReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ulCqiMap );
74  virtual uint8_t DoGetTpc (uint16_t rnti);
75  virtual uint16_t DoGetMinContinuousUlBandwidth ();
76 
77  // FFR SAP RRC PROVIDER IMPLEMENTATION
78  virtual void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
80 
81 private:
88  void SetDownlinkConfiguration (uint16_t cellId, uint8_t bandwidth);
95  void SetUplinkConfiguration (uint16_t cellId, uint8_t bandwidth);
103  void InitializeUplinkRbgMaps ();
104 
113  void UpdateNeighbourMeasurements (uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq);
114 
116  void Calculate ();
122  void SendLoadInformation (uint16_t targetCellId);
123 
124  // FFR SAP
127 
128  // FFR RRF SAP
131 
132  std::vector <bool> m_dlRbgMap;
133  std::vector <bool> m_ulRbgMap;
134 
135  uint8_t m_edgeRbNum;
136  std::vector <bool> m_dlEdgeRbgMap;
137  std::vector <bool> m_ulEdgeRbgMap;
138 
141  {
144  EdgeArea
145  };
146 
147  std::map< uint16_t, uint8_t > m_ues;
148 
150 
153 
154  uint8_t m_centerAreaTpc;
155  uint8_t m_edgeAreaTpc;
156 
159 
160  // The expected measurement identity
161  uint8_t m_rsrqMeasId;
162  uint8_t m_rsrpMeasId;
163 
169  class UeMeasure : public SimpleRefCount<UeMeasure>
170  {
171  public:
172  uint16_t m_cellId;
173  uint8_t m_rsrp;
174  uint8_t m_rsrq;
175  };
176 
178  typedef std::map<uint16_t, Ptr<UeMeasure> > MeasurementRow_t;
180  typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t;
182 
183  std::vector<uint16_t> m_neigborCell;
184 
186 
187  std::map<uint16_t, uint32_t> m_cellWeightMap;
188 
189  std::map<uint16_t, std::vector <bool> > m_rntp;
190 
191 }; // end of class LteFfrDistributedAlgorithm
192 
193 } // end of namespace ns3
194 
195 #endif /* LTE_FR_DISTRIBUTED_ALGORITHM_H */
An identifier for simulation events.
Definition: event-id.h:54
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.
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.
virtual void DoInitialize()
Initialize() implementation.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP Provider.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP Provider.
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq)
Initialize up link RGB maps function.
std::map< uint16_t, uint8_t > m_ues
UEs map.
std::map< uint16_t, std::vector< bool > > m_rntp
RNTP.
virtual void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s)
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
uint8_t m_rsrpDifferenceThreshold
RSRP difference threshold.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP User.
virtual LteFfrSapProvider * GetLteFfrSapProvider()
Export the "provider" part of the LteFfrSap interface.
std::map< uint16_t, uint32_t > m_cellWeightMap
cell weight map
virtual std::vector< bool > DoGetAvailableDlRbg()
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set up link configuration function.
virtual bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
MeasurementTable_t m_ueMeasures
UE measures.
virtual void DoDispose()
Destructor implementation.
std::vector< uint16_t > m_neigborCell
neighbor cell
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)
DoRecvLoadInformation.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set down link configuration function.
virtual bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
std::vector< bool > m_ulRbgMap
UL RBG map.
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
virtual uint16_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
uint8_t m_edgeSubBandRsrqThreshold
edge sub band RSRQ threshold
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
virtual uint8_t DoGetTpc(uint16_t rnti)
DoGetTpc for UE.
static TypeId GetTypeId()
Get the type ID.
std::map< uint16_t, MeasurementRow_t > MeasurementTable_t
RNTI is used as the key for the following map.
std::vector< bool > m_dlRbgMap
DL RBG map.
virtual void SetLteFfrSapUser(LteFfrSapUser *s)
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
uint8_t m_centerPowerOffset
center power offset
void InitializeUplinkRbgMaps()
Initialize up link RGB maps function.
std::vector< bool > m_dlEdgeRbgMap
DL edge RBG map.
virtual void Reconfigure()
Automatic FR reconfiguration.
virtual void DoReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
DoReportDlCqiInfo.
void SendLoadInformation(uint16_t targetCellId)
Send load information function.
void InitializeDownlinkRbgMaps()
Initialize down link RGB maps function.
virtual void DoReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
DoReportUlCqiInfo.
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:139
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:103
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:304
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:680