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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
7 *
8 */
9
10#ifndef LTE_UE_POWER_CONTROL_H
11#define LTE_UE_POWER_CONTROL_H
12
13#include <ns3/object.h>
14#include <ns3/ptr.h>
15#include <ns3/traced-callback.h>
16
17#include <vector>
18
19namespace ns3
20{
21
22/**
23 * \brief This class realizes Uplink Power Control functionality
24 *
25 * When LteUePhy is about sending PUSCH/PUCCH/SRS it should ask
26 * LteUePowerControl for current channel TX power level and then
27 * use it while creating SpectrumValue for Uplink Transmission
28 *
29 * LteUePowerControl computes TX power level for PUSCH and SRS.
30 * PUCCH is realized in ideal way and PUSCH do not use any resources,
31 * so there is no need to compute power for that channel
32 *
33 * LteUePowerControlcomputes TX power based on some preconfigured
34 * parameters and current Path-loss. Path-loss is computed as difference
35 * between current RSRP and referenceSignalPower level. Current RSRP
36 * is passed to LteUePowerControl by LteUePhy. referenceSignalPower is
37 * configurable by attribute system
38 *
39 * Moreover, LteUePhy pass all received TPC values to LteUePowerControl,
40 * what is a part of Closed Loop Power Control functionality
41 */
42
44{
45 public:
47 ~LteUePowerControl() override;
48
49 /**
50 * \brief Get the type ID.
51 * \return the object TypeId
52 */
53 static TypeId GetTypeId();
54 // inherited from Object
55 void DoInitialize() override;
56 void DoDispose() override;
57
58 /**
59 * \brief Set PC maximum function
60 *
61 * \param value the PC maximum value
62 */
63 void SetPcmax(double value);
64 /**
65 * \brief Get PC maximum function
66 *
67 * \returns the PC maximum value
68 */
69 double GetPcmax();
70
71 /**
72 * \brief Set transmit power function
73 *
74 * \param value the transmit power value
75 */
76 void SetTxPower(double value);
77 /**
78 * \brief Configure reference signal power (dBm) function
79 *
80 * \param referenceSignalPower the reference signal power
81 */
82 void ConfigureReferenceSignalPower(int8_t referenceSignalPower);
83
84 /**
85 * \brief Set the cell ID function
86 *
87 * \param cellId the cell ID
88 */
89 void SetCellId(uint16_t cellId);
90 /**
91 * \brief Set the RNTI function
92 *
93 * \param rnti the RNTI
94 */
95 void SetRnti(uint16_t rnti);
96
97 /**
98 * \brief Set PO nominal PUSCH function
99 *
100 * \param value the value to set
101 */
102 void SetPoNominalPusch(int16_t value);
103 /**
104 * \brief Set PO UE PUSCH function
105 *
106 * \param value the value to set
107 */
108 void SetPoUePusch(int16_t value);
109 /**
110 * \brief Set alpha function
111 *
112 * \param value the alpha value to set
113 */
114 void SetAlpha(double value);
115
116 /**
117 * \brief Set RSRP function
118 *
119 * \param value the RSRP (dBm) value to set
120 */
121 void SetRsrp(double value);
122 /**
123 * \brief Set RSRP function
124 *
125 * \param rsrpFilterCoefficient value. Determines the strength of
126 * smoothing effect induced by layer 3 filtering of RSRP
127 * used for uplink power control in all attached UE.
128 * If equals to 0, no layer 3 filtering is applicable.
129 */
130 void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient);
131 /**
132 * \brief Set RSRP function
133 *
134 * \param tpc the TPC to report
135 */
136 void ReportTpc(uint8_t tpc);
137
138 /// Calculate PUSCH transmit power function
140 /// Calculate PUCCH transmit power function
142 /// Calculate SRS transmit power function
143 void CalculateSrsTxPower();
144
145 /**
146 * \brief Get PUSCH transmit power function
147 *
148 * \param rb the DL RB list
149 * \returns the PUSCH transmit power
150 */
151 double GetPuschTxPower(std::vector<int> rb);
152 /**
153 * \brief Get PUCCH transmit power function
154 *
155 * \param rb unused
156 * \returns the PUCCH transmit power
157 */
158 double GetPucchTxPower(std::vector<int> rb);
159 /**
160 * \brief Get SRS transmit power function
161 *
162 * \param rb the DL RB list
163 * \returns the SRS transmit power
164 */
165 double GetSrsTxPower(std::vector<int> rb);
166
167 /**
168 * TracedCallback signature for uplink transmit power.
169 *
170 * \param [in] cellId Cell identifier.
171 * \param [in] rnti The C-RNTI identifying the UE.
172 * \param [in] power The current TX power.
173 */
174 typedef void (*TxPowerTracedCallback)(uint16_t cellId, uint16_t rnti, double power);
175
176 private:
177 /**
178 * Set subchannel mask function
179 *
180 * \param [in] mask the subchannel mask
181 */
182 void SetSubChannelMask(std::vector<int> mask);
183
184 double m_txPower; ///< transmit power
185 double m_Pcmax; ///< PC maximum
186 double m_Pcmin; ///< PC minimum
187
188 double m_curPuschTxPower; ///< current PUSCH transmit power
189 double m_curPucchTxPower; ///< current PUCCH transmit power
190 double m_curSrsTxPower; ///< current SRS transmit power
191
192 double m_referenceSignalPower; ///< reference signal power in dBm
193 bool m_rsrpSet; ///< is RSRP set?
194 double m_rsrp; ///< RSRP value in dBm
195
196 std::vector<int16_t> m_PoNominalPusch; ///< PO nominal PUSCH
197 std::vector<int16_t> m_PoUePusch; ///< PO US PUSCH
198
199 int16_t m_PsrsOffset; ///< PSRS offset
200
201 uint16_t m_M_Pusch; ///< size of DL RB list
202 std::vector<double> m_alpha; ///< alpha values
203 double m_pathLoss; ///< path loss value in dB
204 double m_deltaTF; ///< delta TF
205
206 std::vector<int8_t> m_deltaPusch; ///< delta PUSCH
207 double m_fc; ///< FC
208
209 uint16_t m_srsBandwidth; ///< SRS bandwidth
210
211 bool m_closedLoop; ///< is closed loop
212 bool m_accumulationEnabled; ///< accumulation enabled
213
214 uint16_t m_cellId; ///< cell ID
215 uint16_t m_rnti; ///< RNTI
216 /**
217 * The `RsrpFilterCoefficient` attribute. Determines the strength of
218 * smoothing effect induced by layer 3 filtering of RSRP in all attached UE.
219 * If equals to 0, no layer 3 filtering is applicable.
220 */
222 /**
223 * Trace information regarding Uplink TxPower
224 * uint16_t cellId, uint16_t rnti, double txPower
225 */
227 /**
228 * Trace information regarding Uplink TxPower
229 * uint16_t cellId, uint16_t rnti, double txPower
230 */
232 /**
233 * Trace information regarding Uplink TxPower
234 * uint16_t cellId, uint16_t rnti, double txPower
235 */
237};
238
239} // namespace ns3
240
241#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:78
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.