A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ue-power-control.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Piotr Gawlowicz
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
18 *
19 */
20
21#ifndef LTE_UE_POWER_CONTROL_H
22#define LTE_UE_POWER_CONTROL_H
23
24#include <ns3/object.h>
25#include <ns3/ptr.h>
26#include <ns3/traced-callback.h>
27
28#include <vector>
29
30namespace ns3
31{
32
33/**
34 * \brief This class realizes Uplink Power Control functionality
35 *
36 * When LteUePhy is about sending PUSCH/PUCCH/SRS it should ask
37 * LteUePowerControl for current channel TX power level and then
38 * use it while creating SpectrumValue for Uplink Transmission
39 *
40 * LteUePowerControl computes TX power level for PUSCH and SRS.
41 * PUCCH is realized in ideal way and PUSCH do not use any resources,
42 * so there is no need to compute power for that channel
43 *
44 * LteUePowerControlcomputes TX power based on some preconfigured
45 * parameters and current Path-loss. Path-loss is computed as difference
46 * between current RSRP and referenceSignalPower level. Current RSRP
47 * is passed to LteUePowerControl by LteUePhy. referenceSignalPower is
48 * configurable by attribute system
49 *
50 * Moreover, LteUePhy pass all received TPC values to LteUePowerControl,
51 * what is a part of Closed Loop Power Control functionality
52 */
53
55{
56 public:
58 ~LteUePowerControl() override;
59
60 /**
61 * \brief Get the type ID.
62 * \return the object TypeId
63 */
64 static TypeId GetTypeId();
65 // inherited from Object
66 void DoInitialize() override;
67 void DoDispose() override;
68
69 /**
70 * \brief Set PC maximum function
71 *
72 * \param value the PC maximum value
73 */
74 void SetPcmax(double value);
75 /**
76 * \brief Get PC maximum function
77 *
78 * \returns the PC maximum value
79 */
80 double GetPcmax();
81
82 /**
83 * \brief Set transmit power function
84 *
85 * \param value the transmit power value
86 */
87 void SetTxPower(double value);
88 /**
89 * \brief Configure reference signal power (dBm) function
90 *
91 * \param referenceSignalPower the reference signal power
92 */
93 void ConfigureReferenceSignalPower(int8_t referenceSignalPower);
94
95 /**
96 * \brief Set the cell ID function
97 *
98 * \param cellId the cell ID
99 */
100 void SetCellId(uint16_t cellId);
101 /**
102 * \brief Set the RNTI function
103 *
104 * \param rnti the RNTI
105 */
106 void SetRnti(uint16_t rnti);
107
108 /**
109 * \brief Set PO nominal PUSCH function
110 *
111 * \param value the value to set
112 */
113 void SetPoNominalPusch(int16_t value);
114 /**
115 * \brief Set PO UE PUSCH function
116 *
117 * \param value the value to set
118 */
119 void SetPoUePusch(int16_t value);
120 /**
121 * \brief Set alpha function
122 *
123 * \param value the alpha value to set
124 */
125 void SetAlpha(double value);
126
127 /**
128 * \brief Set RSRP function
129 *
130 * \param value the RSRP (dBm) value to set
131 */
132 void SetRsrp(double value);
133 /**
134 * \brief Set RSRP function
135 *
136 * \param rsrpFilterCoefficient value. Determines the strength of
137 * smoothing effect induced by layer 3 filtering of RSRP
138 * used for uplink power control in all attached UE.
139 * If equals to 0, no layer 3 filtering is applicable.
140 */
141 void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient);
142 /**
143 * \brief Set RSRP function
144 *
145 * \param tpc the TPC to report
146 */
147 void ReportTpc(uint8_t tpc);
148
149 /// Calculate PUSCH transmit power function
151 /// Calculate PUCCH transmit power function
153 /// Calculate SRS transmit power function
154 void CalculateSrsTxPower();
155
156 /**
157 * \brief Get PUSCH transmit power function
158 *
159 * \param rb the DL RB list
160 * \returns the PUSCH transmit power
161 */
162 double GetPuschTxPower(std::vector<int> rb);
163 /**
164 * \brief Get PUCCH transmit power function
165 *
166 * \param rb unused
167 * \returns the PUCCH transmit power
168 */
169 double GetPucchTxPower(std::vector<int> rb);
170 /**
171 * \brief Get SRS transmit power function
172 *
173 * \param rb the DL RB list
174 * \returns the SRS transmit power
175 */
176 double GetSrsTxPower(std::vector<int> rb);
177
178 /**
179 * TracedCallback signature for uplink transmit power.
180 *
181 * \param [in] cellId Cell identifier.
182 * \param [in] rnti The C-RNTI identifying the UE.
183 * \param [in] power The current TX power.
184 */
185 typedef void (*TxPowerTracedCallback)(uint16_t cellId, uint16_t rnti, double power);
186
187 private:
188 /**
189 * Set subchannel mask function
190 *
191 * \param [in] mask the subchannel mask
192 */
193 void SetSubChannelMask(std::vector<int> mask);
194
195 double m_txPower; ///< transmit power
196 double m_Pcmax; ///< PC maximum
197 double m_Pcmin; ///< PC minimum
198
199 double m_curPuschTxPower; ///< current PUSCH transmit power
200 double m_curPucchTxPower; ///< current PUCCH transmit power
201 double m_curSrsTxPower; ///< current SRS transmit power
202
203 double m_referenceSignalPower; ///< reference signal power in dBm
204 bool m_rsrpSet; ///< is RSRP set?
205 double m_rsrp; ///< RSRP value in dBm
206
207 std::vector<int16_t> m_PoNominalPusch; ///< PO nominal PUSCH
208 std::vector<int16_t> m_PoUePusch; ///< PO US PUSCH
209
210 int16_t m_PsrsOffset; ///< PSRS offset
211
212 uint16_t m_M_Pusch; ///< size of DL RB list
213 std::vector<double> m_alpha; ///< alpha values
214 double m_pathLoss; ///< path loss value in dB
215 double m_deltaTF; ///< delta TF
216
217 std::vector<int8_t> m_deltaPusch; ///< delta PUSCH
218 double m_fc; ///< FC
219
220 uint16_t m_srsBandwidth; ///< SRS bandwidth
221
222 bool m_closedLoop; ///< is closed loop
223 bool m_accumulationEnabled; ///< accumulation enabled
224
225 uint16_t m_cellId; ///< cell ID
226 uint16_t m_rnti; ///< RNTI
227 /**
228 * The `RsrpFilterCoefficient` attribute. Determines the strength of
229 * smoothing effect induced by layer 3 filtering of RSRP in all attached UE.
230 * If equals to 0, no layer 3 filtering is applicable.
231 */
233 /**
234 * Trace information regarding Uplink TxPower
235 * uint16_t cellId, uint16_t rnti, double txPower
236 */
238 /**
239 * Trace information regarding Uplink TxPower
240 * uint16_t cellId, uint16_t rnti, double txPower
241 */
243 /**
244 * Trace information regarding Uplink TxPower
245 * uint16_t cellId, uint16_t rnti, double txPower
246 */
248};
249
250} // namespace ns3
251
252#endif /* LTE_UE_POWER_CONTROL_H */
This class realizes Uplink Power Control functionality.
void SetPoNominalPusch(int16_t value)
Set PO nominal PUSCH function.
bool m_closedLoop
is closed loop
double m_referenceSignalPower
reference signal power in dBm
TracedCallback< uint16_t, uint16_t, double > m_reportSrsTxPower
Trace information regarding Uplink TxPower uint16_t cellId, uint16_t rnti, double txPower.
void DoDispose() override
Destructor implementation.
TracedCallback< uint16_t, uint16_t, double > m_reportPucchTxPower
Trace information regarding Uplink TxPower uint16_t cellId, uint16_t rnti, double txPower.
void SetCellId(uint16_t cellId)
Set the cell ID function.
double m_txPower
transmit power
double m_curPucchTxPower
current PUCCH transmit power
void SetPoUePusch(int16_t value)
Set PO UE PUSCH function.
void(* TxPowerTracedCallback)(uint16_t cellId, uint16_t rnti, double power)
TracedCallback signature for uplink transmit power.
std::vector< double > m_alpha
alpha values
std::vector< int16_t > m_PoUePusch
PO US PUSCH.
void SetRsrp(double value)
Set RSRP function.
void SetPcmax(double value)
Set PC maximum function.
double m_pathLoss
path loss value in dB
void ConfigureReferenceSignalPower(int8_t referenceSignalPower)
Configure reference signal power (dBm) function.
void DoInitialize() override
Initialize() implementation.
std::vector< int16_t > m_PoNominalPusch
PO nominal PUSCH.
void SetRnti(uint16_t rnti)
Set the RNTI function.
double GetPucchTxPower(std::vector< int > rb)
Get PUCCH transmit power function.
int16_t m_PsrsOffset
PSRS offset.
static TypeId GetTypeId()
Get the type ID.
double m_curPuschTxPower
current PUSCH transmit power
void SetTxPower(double value)
Set transmit power function.
std::vector< int8_t > m_deltaPusch
delta PUSCH
void CalculatePuschTxPower()
Calculate PUSCH transmit power function.
double GetPcmax()
Get PC maximum function.
void SetSubChannelMask(std::vector< int > mask)
Set subchannel mask function.
void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
Set RSRP function.
uint16_t m_srsBandwidth
SRS bandwidth.
uint8_t m_pcRsrpFilterCoefficient
The RsrpFilterCoefficient attribute.
void CalculatePucchTxPower()
Calculate PUCCH transmit power function.
double GetPuschTxPower(std::vector< int > rb)
Get PUSCH transmit power function.
uint16_t m_M_Pusch
size of DL RB list
void ReportTpc(uint8_t tpc)
Set RSRP function.
double GetSrsTxPower(std::vector< int > rb)
Get SRS transmit power function.
void SetAlpha(double value)
Set alpha function.
double m_rsrp
RSRP value in dBm.
void CalculateSrsTxPower()
Calculate SRS transmit power function.
double m_curSrsTxPower
current SRS transmit power
TracedCallback< uint16_t, uint16_t, double > m_reportPuschTxPower
Trace information regarding Uplink TxPower uint16_t cellId, uint16_t rnti, double txPower.
bool m_accumulationEnabled
accumulation enabled
A base class which provides memory management and object aggregation.
Definition: object.h:89
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.