A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ffr-enhanced-algorithm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Piotr Gawlowicz
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
7 *
8 */
9
10#ifndef LTE_FFR_ENHANCED_ALGORITHM_H
11#define LTE_FFR_ENHANCED_ALGORITHM_H
12
13#include "lte-ffr-algorithm.h"
14#include "lte-ffr-rrc-sap.h"
15#include "lte-ffr-sap.h"
16#include "lte-rrc-sap.h"
17
18#include <map>
19
20// value for SINR outside the range defined by FF-API, used to indicate that there
21// is no CQI for this element
22#define NO_SINR -5000
23
24namespace ns3
25{
26
27/**
28 * \brief Enhanced Fractional Frequency Reuse algorithm implementation
29 */
31{
32 public:
33 /**
34 * \brief Creates a trivial ffr algorithm instance.
35 */
37 ~LteFfrEnhancedAlgorithm() override;
38
39 /**
40 * \brief Get the type ID.
41 * \return the object TypeId
42 */
43 static TypeId GetTypeId();
44
45 // inherited from LteFfrAlgorithm
46 void SetLteFfrSapUser(LteFfrSapUser* s) override;
48
49 void SetLteFfrRrcSapUser(LteFfrRrcSapUser* s) override;
51
52 /// let the forwarder class access the protected and private members
54 /// let the forwarder class access the protected and private members
56
57 protected:
58 // inherited from Object
59 void DoInitialize() override;
60 void DoDispose() override;
61
62 void Reconfigure() override;
63
64 // FFR SAP PROVIDER IMPLEMENTATION
65 std::vector<bool> DoGetAvailableDlRbg() override;
66 bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override;
67 std::vector<bool> DoGetAvailableUlRbg() override;
68 bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override;
73 void DoReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) override;
74 uint8_t DoGetTpc(uint16_t rnti) override;
75 uint16_t DoGetMinContinuousUlBandwidth() override;
76
77 // FFR SAP RRC PROVIDER IMPLEMENTATION
78 void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override;
80
81 private:
82 /**
83 * Set downlink configuration
84 *
85 * \param cellId the cell ID
86 * \param bandwidth the bandwidth
87 */
88 void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth);
89 /**
90 * Set uplink configuration
91 *
92 * \param cellId the cell ID
93 * \param bandwidth the bandwidth
94 */
95 void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth);
96 /**
97 * Initialize downlink RBG maps
98 */
100 /**
101 * Initialize uplink RBG maps
102 */
104
105 /**
106 * Initialize uplink RBG maps
107 *
108 * \param rnti the RNTI
109 * \param rb RB
110 * \param ulCqiMap UL CQI map
111 * \returns UL SINR
112 */
113 double EstimateUlSinr(uint16_t rnti,
114 uint16_t rb,
115 std::map<uint16_t, std::vector<double>> ulCqiMap);
116 /**
117 * Get CQI from spectral efficiency
118 *
119 * \param s spectral efficiency
120 * \returns CQI
121 */
122 int GetCqiFromSpectralEfficiency(double s);
123
124 // FFR SAP
125 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP user
126 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP provider
127
128 // FFR RRF SAP
129 LteFfrRrcSapUser* m_ffrRrcSapUser; ///< FFR RRC SAP user
130 LteFfrRrcSapProvider* m_ffrRrcSapProvider; ///< FFR RRC SAP provider
131
132 uint8_t m_dlSubBandOffset; ///< DL subband offset
133 uint8_t m_dlReuse3SubBandwidth; ///< DL reuse 3 subband bandwidth
134 uint8_t m_dlReuse1SubBandwidth; ///< DL reuse 1 subband bandwidth
135
136 uint8_t m_ulSubBandOffset; ///< UL subband offset
137 uint8_t m_ulReuse3SubBandwidth; ///< UL reuse 3 subbandwidth
138 uint8_t m_ulReuse1SubBandwidth; ///< UL reuse 1 subbandwidth
139
140 std::vector<bool> m_dlRbgMap; ///< DL RBG map
141 std::vector<bool> m_ulRbgMap; ///< UL RBG Map
142
143 std::vector<bool> m_dlReuse3RbgMap; ///< DL reuse 3 RBG map
144 std::vector<bool> m_dlReuse1RbgMap; ///< DL reuse 1 RBG map
145 std::vector<bool> m_dlPrimarySegmentRbgMap; ///< DL primary segment RBG map
146 std::vector<bool> m_dlSecondarySegmentRbgMap; ///< DL secondary segment RBG map
147
148 std::vector<bool> m_ulReuse3RbgMap; ///< UL reuse 3 RBG map
149 std::vector<bool> m_ulReuse1RbgMap; ///< UL reuse 1 RBG map
150 std::vector<bool> m_ulPrimarySegmentRbgMap; ///< UL primary segment RBG map
151 std::vector<bool> m_ulSecondarySegmentRbgMap; ///< UL secondary segment RBG map
152
153 /// UE Position enumeration
160
161 std::map<uint16_t, uint8_t> m_ues; ///< UEs
162
163 uint8_t m_rsrqThreshold; ///< RSRQ threshold
164
165 uint8_t m_centerAreaPowerOffset; ///< Center area power offset
166 uint8_t m_edgeAreaPowerOffset; ///< Edge area power offset
167
168 uint8_t m_centerAreaTpc; ///< Center area TPC
169 uint8_t m_edgeAreaTpc; ///< Edge are TPC
170
171 uint8_t m_dlCqiThreshold; ///< DL CQI threshold
172 /**
173 * Map of UE's DL CQI A30 received
174 */
175 std::map<uint16_t, SbMeasResult_s> m_dlCqi;
176 std::map<uint16_t, std::vector<bool>> m_dlRbgAvailableforUe; ///< DL RBG available for UE
177
178 uint8_t m_ulCqiThreshold; ///< UL CQI threshold
179 std::map<uint16_t, std::vector<int>> m_ulCqi; ///< UL CQI
180 std::map<uint16_t, std::vector<bool>> m_ulRbAvailableforUe; ///< UL RB available for UE
181
182 /// The expected measurement identity
183 uint8_t m_measId;
184
185}; // end of class LteFfrEnhancedAlgorithm
186
187} // end of namespace ns3
188
189#endif /* LTE_FFR_ENHANCED_ALGORITHM_H */
The abstract base class of a Frequency Reuse algorithm.
Enhanced Fractional Frequency Reuse algorithm implementation.
uint8_t m_ulSubBandOffset
UL subband offset.
void DoDispose() override
Destructor implementation.
void DoInitialize() override
Initialize() implementation.
void SetLteFfrSapUser(LteFfrSapUser *s) override
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
uint8_t m_measId
The expected measurement identity.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set downlink configuration.
void InitializeDownlinkRbgMaps()
Initialize downlink RBG maps.
std::vector< bool > m_dlRbgMap
DL RBG map.
std::map< uint16_t, std::vector< int > > m_ulCqi
UL CQI.
double EstimateUlSinr(uint16_t rnti, uint16_t rb, std::map< uint16_t, std::vector< double > > ulCqiMap)
Initialize uplink RBG maps.
static TypeId GetTypeId()
Get the type ID.
uint8_t m_dlSubBandOffset
DL subband offset.
uint8_t m_ulCqiThreshold
UL CQI threshold.
std::map< uint16_t, std::vector< bool > > m_dlRbgAvailableforUe
DL RBG available for UE.
void Reconfigure() override
Automatic FR reconfiguration.
std::vector< bool > m_dlSecondarySegmentRbgMap
DL secondary segment RBG map.
uint8_t m_centerAreaPowerOffset
Center area power offset.
uint8_t m_dlCqiThreshold
DL CQI threshold.
std::vector< bool > m_ulReuse1RbgMap
UL reuse 1 RBG map.
bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
std::vector< bool > m_dlPrimarySegmentRbgMap
DL primary segment RBG map.
std::vector< bool > DoGetAvailableUlRbg() override
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
LteFfrRrcSapProvider * GetLteFfrRrcSapProvider() override
Export the "provider" part of the LteFfrRrcSap interface.
std::vector< bool > m_ulPrimarySegmentRbgMap
UL primary segment RBG map.
LteFfrSapProvider * GetLteFfrSapProvider() override
Export the "provider" part of the LteFfrSap interface.
uint8_t m_dlReuse1SubBandwidth
DL reuse 1 subband bandwidth.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP user.
std::vector< bool > m_dlReuse3RbgMap
DL reuse 3 RBG map.
uint8_t DoGetTpc(uint16_t rnti) override
DoGetTpc for UE.
int GetCqiFromSpectralEfficiency(double s)
Get CQI from spectral efficiency.
std::vector< bool > m_ulReuse3RbgMap
UL reuse 3 RBG map.
std::map< uint16_t, SbMeasResult_s > m_dlCqi
Map of UE's DL CQI A30 received.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set uplink configuration.
uint8_t m_ulReuse1SubBandwidth
UL reuse 1 subbandwidth.
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
uint16_t DoGetMinContinuousUlBandwidth() override
DoGetMinContinuousUlBandwidth in number of RB.
LteFfrEnhancedAlgorithm()
Creates a trivial ffr algorithm instance.
std::map< uint16_t, uint8_t > m_ues
UEs.
void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params) override
DoRecvLoadInformation.
void DoReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params) override
DoReportUlCqiInfo.
std::map< uint16_t, std::vector< bool > > m_ulRbAvailableforUe
UL RB available for UE.
std::vector< bool > m_ulRbgMap
UL RBG Map.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP provider.
std::vector< bool > m_dlReuse1RbgMap
DL reuse 1 RBG map.
void InitializeUplinkRbgMaps()
Initialize uplink RBG maps.
void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s) override
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void DoReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params) override
DoReportDlCqiInfo.
uint8_t m_ulReuse3SubBandwidth
UL reuse 3 subbandwidth.
std::vector< bool > m_ulSecondarySegmentRbgMap
UL secondary segment RBG map.
uint8_t m_edgeAreaPowerOffset
Edge area power offset.
bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
uint8_t m_dlReuse3SubBandwidth
DL reuse 3 subband bandwidth.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
std::vector< bool > DoGetAvailableDlRbg() override
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
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:29
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
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...
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the LOAD INFORMATION message.
Definition epc-x2-sap.h:295
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
MeasResults structure.