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 
41  // inherited from Object
42  static TypeId GetTypeId ();
43 
44  // inherited from LteFfrAlgorithm
45  virtual void SetLteFfrSapUser (LteFfrSapUser* s);
47 
48  virtual void SetLteFfrRrcSapUser (LteFfrRrcSapUser* s);
50 
51  // let the forwarder class access the protected and private members
54 
55 protected:
56  // inherited from Object
57  virtual void DoInitialize ();
58  virtual void DoDispose ();
59 
60  virtual void Reconfigure ();
61 
62  // FFR SAP PROVIDER IMPLEMENTATION
63  virtual std::vector <bool> DoGetAvailableDlRbg ();
64  virtual bool DoIsDlRbgAvailableForUe (int i, uint16_t rnti);
65  virtual std::vector <bool> DoGetAvailableUlRbg ();
66  virtual bool DoIsUlRbgAvailableForUe (int i, uint16_t rnti);
69  virtual void DoReportUlCqiInfo ( std::map <uint16_t, std::vector <double> > ulCqiMap );
70  virtual uint8_t DoGetTpc (uint16_t rnti);
71  virtual uint8_t DoGetMinContinuousUlBandwidth ();
72 
73  // FFR SAP RRC PROVIDER IMPLEMENTATION
74  virtual void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
76 
77 private:
78  void SetDownlinkConfiguration (uint16_t cellId, uint8_t bandwidth);
79  void SetUplinkConfiguration (uint16_t cellId, uint8_t bandwidth);
82 
83  void UpdateNeighbourMeasurements (uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq);
84 
85  void Calculate ();
86  void SendLoadInformation (uint16_t targetCellId);
87 
88  // FFR SAP
91 
92  // FFR RRF SAP
95 
96  std::vector <bool> m_dlRbgMap;
97  std::vector <bool> m_ulRbgMap;
98 
99  uint8_t m_edgeRbNum;
100  std::vector <bool> m_dlEdgeRbgMap;
101  std::vector <bool> m_ulEdgeRbgMap;
102 
104  {
108  };
109 
110  std::map< uint16_t, uint8_t > m_ues;
111 
113 
116 
118  uint8_t m_edgeAreaTpc;
119 
122 
123  // The expected measurement identity
124  uint8_t m_rsrqMeasId;
125  uint8_t m_rsrpMeasId;
126 
132  class UeMeasure : public SimpleRefCount<UeMeasure>
133  {
134 public:
135  uint16_t m_cellId;
136  uint8_t m_rsrp;
137  uint8_t m_rsrq;
138  };
139 
140  // cellId
141  typedef std::map<uint16_t, Ptr<UeMeasure> > MeasurementRow_t;
142  // rnti
143  typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t;
144  MeasurementTable_t m_ueMeasures;
145 
146  std::vector<uint16_t> m_neigborCell;
147 
149 
150  std::map<uint16_t, uint32_t> m_cellWeightMap;
151 
152  std::map<uint16_t, std::vector <bool> > m_rntp;
153 
154 }; // end of class LteFfrDistributedAlgorithm
155 
156 } // end of namespace ns3
157 
158 #endif /* LTE_FR_DISTRIBUTED_ALGORITHM_H */
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:102
Template for the implementation of the LteFfrRrcSapProvider as a member of an owner class of type C t...
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:132
Distributed Fractional Frequency Reuse algorithm implementation.
void SendLoadInformation(uint16_t targetCellId)
std::map< uint16_t, std::vector< bool > > m_rntp
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
std::map< uint16_t, MeasurementRow_t > MeasurementTable_t
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:146
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.
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)
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
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)
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
An identifier for simulation events.
Definition: event-id.h:53
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)
DoRecvLoadInformation.
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:300
std::map< uint16_t, uint32_t > m_cellWeightMap
std::map< uint16_t, Ptr< UeMeasure > > MeasurementRow_t
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...
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 uint8_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.