A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ffr-distributed-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_DISTRIBUTED_ALGORITHM_H
11#define LTE_FFR_DISTRIBUTED_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
18namespace ns3
19{
20
21/**
22 * \brief Distributed Fractional Frequency Reuse algorithm implementation.
23 */
25{
26 public:
29
30 /**
31 * \brief Get the type ID.
32 * \return the object TypeId
33 */
34 static TypeId GetTypeId();
35
36 // inherited from LteFfrAlgorithm
37 void SetLteFfrSapUser(LteFfrSapUser* s) override;
39
40 void SetLteFfrRrcSapUser(LteFfrRrcSapUser* s) override;
42
43 /// let the forwarder class access the protected and private members
45 /// let the forwarder class access the protected and private members
47
48 protected:
49 // inherited from Object
50 void DoInitialize() override;
51 void DoDispose() override;
52
53 void Reconfigure() override;
54
55 // FFR SAP PROVIDER IMPLEMENTATION
56 std::vector<bool> DoGetAvailableDlRbg() override;
57 bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override;
58 std::vector<bool> DoGetAvailableUlRbg() override;
59 bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override;
64 void DoReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) override;
65 uint8_t DoGetTpc(uint16_t rnti) override;
66 uint16_t DoGetMinContinuousUlBandwidth() override;
67
68 // FFR SAP RRC PROVIDER IMPLEMENTATION
69 void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override;
71
72 private:
73 /**
74 * Set down link configuration function
75 *
76 * \param cellId cell ID
77 * \param bandwidth the bandwidth
78 */
79 void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth);
80 /**
81 * Set up link configuration function
82 *
83 * \param cellId cell ID
84 * \param bandwidth the bandwidth
85 */
86 void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth);
87 /**
88 * Initialize down link RBG maps function
89 */
91 /**
92 * Initialize up link RBG maps function
93 */
95
96 /**
97 * Initialize up link RBG maps function
98 *
99 * \param rnti the RNTI
100 * \param cellId the cell ID
101 * \param rsrp the RSRP
102 * \param rsrq the RSRQ
103 */
104 void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq);
105
106 /// Calculate function
107 void Calculate();
108 /**
109 * Send load information function
110 *
111 * \param targetCellId the cell ID
112 */
113 void SendLoadInformation(uint16_t targetCellId);
114
115 // FFR SAP
116 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP User
117 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP Provider
118
119 // FFR RRF SAP
120 LteFfrRrcSapUser* m_ffrRrcSapUser; ///< FFR RRC SAP User
121 LteFfrRrcSapProvider* m_ffrRrcSapProvider; ///< FFR RRC SAP Provider
122
123 std::vector<bool> m_dlRbgMap; ///< DL RBG map
124 std::vector<bool> m_ulRbgMap; ///< UL RBG map
125
126 uint8_t m_edgeRbNum; ///< edge RB number
127 std::vector<bool> m_dlEdgeRbgMap; ///< DL edge RBG map
128 std::vector<bool> m_ulEdgeRbgMap; ///< UL edge RBG map
129
130 /// UePosition enumeration
137
138 std::map<uint16_t, uint8_t> m_ues; ///< UEs map
139
140 uint8_t m_edgeSubBandRsrqThreshold; ///< edge sub band RSRQ threshold
141
142 uint8_t m_centerPowerOffset; ///< center power offset
143 uint8_t m_edgePowerOffset; ///< edge power offset
144
145 uint8_t m_centerAreaTpc; ///< center area TPC
146 uint8_t m_edgeAreaTpc; ///< edge area TCP
147
148 Time m_calculationInterval; ///< calculation interval
149 EventId m_calculationEvent; ///< calculation event
150
151 // The expected measurement identity
152 uint8_t m_rsrqMeasId; ///< RSRQ measurement ID
153 uint8_t m_rsrpMeasId; ///< RSRP measurement ID
154
155 /**
156 * \brief Measurements reported by a UE for a cell ID.
157 *
158 * The values are quantized according 3GPP TS 36.133 section 9.1.4 and 9.1.7.
159 */
160 class UeMeasure : public SimpleRefCount<UeMeasure>
161 {
162 public:
163 uint16_t m_cellId; ///< Cell ID
164 uint8_t m_rsrp; ///< RSRP
165 uint8_t m_rsrq; ///< RSRQ
166 };
167
168 /// Cell Id is used as the key for the following map
169 typedef std::map<uint16_t, Ptr<UeMeasure>> MeasurementRow_t;
170 /// RNTI is used as the key for the following map
171 typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t;
173
174 std::vector<uint16_t> m_neighborCell; ///< neighbor cell
175
176 uint8_t m_rsrpDifferenceThreshold; ///< RSRP difference threshold
177
178 std::map<uint16_t, uint32_t> m_cellWeightMap; ///< cell weight map
179
180 std::map<uint16_t, std::vector<bool>> m_rntp; ///< RNTP
181
182}; // end of class LteFfrDistributedAlgorithm
183
184} // end of namespace ns3
185
186#endif /* LTE_FR_DISTRIBUTED_ALGORITHM_H */
An identifier for simulation events.
Definition event-id.h:45
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.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
uint8_t DoGetTpc(uint16_t rnti) override
DoGetTpc for UE.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP Provider.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP Provider.
std::map< uint16_t, uint8_t > m_ues
UEs map.
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq)
Initialize up link RBG maps function.
uint8_t m_rsrpDifferenceThreshold
RSRP difference threshold.
void DoDispose() override
Destructor implementation.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP User.
std::map< uint16_t, uint32_t > m_cellWeightMap
cell weight map
bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set up link configuration function.
void DoInitialize() override
Initialize() implementation.
void DoReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params) override
DoReportDlCqiInfo.
uint16_t DoGetMinContinuousUlBandwidth() override
DoGetMinContinuousUlBandwidth in number of RB.
void SetLteFfrSapUser(LteFfrSapUser *s) override
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params) override
DoRecvLoadInformation.
MeasurementTable_t m_ueMeasures
UE measures.
std::vector< bool > DoGetAvailableDlRbg() override
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
std::map< uint16_t, std::vector< bool > > m_rntp
RNTP.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set down link configuration function.
std::vector< uint16_t > m_neighborCell
neighbor cell
std::vector< bool > m_ulRbgMap
UL RBG map.
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
uint8_t m_edgeSubBandRsrqThreshold
edge sub band RSRQ threshold
std::vector< bool > DoGetAvailableUlRbg() override
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
static TypeId GetTypeId()
Get the type ID.
LteFfrSapProvider * GetLteFfrSapProvider() override
Export the "provider" part of the LteFfrSap interface.
std::map< uint16_t, MeasurementRow_t > MeasurementTable_t
RNTI is used as the key for the following map.
LteFfrRrcSapProvider * GetLteFfrRrcSapProvider() override
Export the "provider" part of the LteFfrRrcSap interface.
std::vector< bool > m_dlRbgMap
DL RBG map.
void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s) override
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void Reconfigure() override
Automatic FR reconfiguration.
void InitializeUplinkRbgMaps()
Initialize up link RBG maps function.
std::vector< bool > m_dlEdgeRbgMap
DL edge RBG map.
void DoReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params) override
DoReportUlCqiInfo.
void SendLoadInformation(uint16_t targetCellId)
Send load information function.
void InitializeDownlinkRbgMaps()
Initialize down link RBG maps function.
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 template-based reference counting class.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
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.