A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-test-downlink-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_TEST_DOWNLINK_POWER_CONTROL_H
22#define LTE_TEST_DOWNLINK_POWER_CONTROL_H
23
24#include "ns3/lte-spectrum-value-helper.h"
25#include "ns3/spectrum-test.h"
26#include "ns3/spectrum-value.h"
27#include "ns3/test.h"
28#include <ns3/lte-rrc-sap.h>
29
30using namespace ns3;
31
32/**
33 * \ingroup lte-test
34 *
35 * \brief Test suite for the LteDownlinkPowerControlSpectrumValueTestCase.
36 *
37 */
39{
40 public:
42
43 /**
44 * \brief Calculate RB transmit power function
45 * \param txPower the transmit power
46 * \param pa the PA
47 * \returns RB transmit power
48 */
49 double CalculateRbTxPower(double txPower, uint8_t pa);
50};
51
52/**
53 * \ingroup lte-test
54 *
55 * \brief Test SINR calculation in the downlink when power control is used.
56 * Test if the difference in power levels are corresponding to the estamated values.
57 */
59{
60 public:
61 /**
62 * \brief Constructor
63 *
64 * \param name the reference name
65 * \param earfcn the EARFCN
66 * \param bw the bandwidth
67 * \param powerTx
68 * \param powerTxMap
69 * \param activeRbs
70 * \param expected the expected Tx Power Spectral Density
71 */
73 uint16_t earfcn,
74 uint16_t bw,
75 double powerTx,
76 std::map<int, double> powerTxMap,
77 std::vector<int> activeRbs,
78 SpectrumValue& expected);
80
81 private:
82 void DoRun() override;
83 Ptr<SpectrumValue> m_actual; ///< actual Tx Power Spectral Density
84 Ptr<SpectrumValue> m_expected; ///< expected Tx Power Spectral Density
85};
86
87/**
88 * \ingroup lte-test
89 *
90 * \brief Test SINR calculation in the downlink when the power control is used.
91 * Test the power control by comparing the downlink data and ctrl power
92 * difference with the estimated value based on the specified change in power.
93 */
95{
96 public:
97 /**
98 * \brief Constructor
99 *
100 * \param changePower
101 * \param pa
102 * \param name the reference name
103 */
104 LteDownlinkPowerControlTestCase(bool changePower, uint8_t pa, std::string name);
106
107 private:
108 void DoRun() override;
109
110 bool m_changePdschConfigDedicated; ///< PDSCH config dedicated change
112 double m_expectedPowerDiff; ///< expected power difference
113};
114
115/**
116 * \ingroup lte-test
117 *
118 * \brief Test if RRC connection reconfiguration messages are properly
119 * generated upon the change in the downlink power.
120 *
121 */
123{
124 public:
125 /**
126 * \brief Constructor
127 *
128 * \param useIdealRrc if true use ideal RRC
129 * \param name the reference name
130 */
131 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase(bool useIdealRrc, std::string name);
133
134 /**
135 * \brief Connection Reconfiguration ENB
136 *
137 * \param context the context name
138 * \param imsi the IMSI
139 * \param cellid the cell ID
140 * \param rnti the RNTI
141 */
142 void ConnectionReconfigurationEnb(std::string context,
143 uint64_t imsi,
144 uint16_t cellid,
145 uint16_t rnti);
146
147 /**
148 * \brief Connection Reconfiguration UE
149 *
150 * \param context the context name
151 * \param imsi the IMSI
152 * \param cellid the cell ID
153 * \param rnti the RNTI
154 */
155 void ConnectionReconfigurationUe(std::string context,
156 uint64_t imsi,
157 uint16_t cellid,
158 uint16_t rnti);
159
160 /**
161 * \brief Change PDSCH config dedicated
162 *
163 * \param rnti the RNTI
164 * \param pa the PA
165 */
166 void ChangePdschConfigDedicated(uint16_t rnti, uint8_t pa);
167
168 private:
169 void DoRun() override;
170 bool m_useIdealRrc; ///< use ideal RRC?
171
172 bool m_changePdschConfigDedicatedTriggered; ///< change PDSCH config dedicated triggered?
173 bool m_connectionReconfigurationUeReceived; ///< connection reconfiguration UE received?
174 bool m_connectionReconfigurationEnbCompleted; ///< connection reconfiguration ENB completed?
175};
176
177#endif /* LTE_TEST_DOWNLINK_POWER_CONTROL_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Set of values corresponding to a given SpectrumModel.
encapsulates test code
Definition: test.h:1061
A suite of tests to run.
Definition: test.h:1268
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PdschConfigDedicated structure.
Definition: lte-rrc-sap.h:163