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  {
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 */
uint8_t m_edgeSubBandRsrqThreshold
edge sub band RSRQ threshold
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Template for the implementation of the LteFfrRrcSapProvider as a member of an owner class of type C t...
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
LteFfrSapUser * m_ffrSapUser
FFR SAP User.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:138
uint8_t m_rsrpDifferenceThreshold
RSRP difference threshold.
std::vector< bool > m_dlEdgeRbgMap
DL edge RBG map.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP User.
Distributed Fractional Frequency Reuse algorithm implementation.
void SendLoadInformation(uint16_t targetCellId)
Send load information function.
MeasurementTable_t m_ueMeasures
UE measures.
std::map< uint16_t, std::vector< bool > > m_rntp
RNTP.
std::vector< uint16_t > m_neigborCell
neighbor cell
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
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.
virtual bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
Template for the implementation of the LteFfrSapProvider as a member of an owner class of type C to w...
Definition: lte-ffr-sap.h:152
virtual uint16_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
MeasResults structure.
Definition: lte-rrc-sap.h:678
void InitializeDownlinkRbgMaps()
Initialize down link RGB maps function.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition: lte-ffr-sap.h:39
virtual LteFfrSapProvider * GetLteFfrSapProvider()
Export the "provider" part of the LteFfrSap interface.
virtual void Reconfigure()
Automatic FR reconfiguration.
Measurements reported by a UE for a cell ID.
std::map< uint16_t, uint8_t > m_ues
UEs map.
virtual void DoDispose()
Destructor implementation.
virtual std::vector< bool > DoGetAvailableDlRbg()
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
virtual bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
virtual void DoReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params)
DoReportUlCqiInfo.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The abstract base class of a Frequency Reuse algorithm.
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)
Set up link configuration function.
std::vector< bool > m_dlRbgMap
DL RBG map.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set down link configuration function.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq)
Initialize up link RGB maps function.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
An identifier for simulation events.
Definition: event-id.h:53
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP Provider.
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)
DoRecvLoadInformation.
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:303
std::map< uint16_t, uint32_t > m_cellWeightMap
cell weight map
std::map< uint16_t, Ptr< UeMeasure > > MeasurementRow_t
Cell Id is used as the key for the following map.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP Provider.
uint8_t m_centerPowerOffset
center power offset
virtual void DoInitialize()
Initialize() implementation.
virtual void SetLteFfrSapUser(LteFfrSapUser *s)
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
std::vector< bool > m_ulRbgMap
UL RBG map.
A template-based reference counting class.
virtual void DoReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params)
DoReportDlCqiInfo.
a unique identifier for an interface.
Definition: type-id.h:58
virtual uint8_t DoGetTpc(uint16_t rnti)
DoGetTpc for UE.
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.
void InitializeUplinkRbgMaps()
Initialize up link RGB maps function.