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