A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-test-frequency-reuse.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_FR_H
22#define LTE_TEST_DOWNLINK_FR_H
23
24#include "ns3/lte-spectrum-value-helper.h"
25#include "ns3/node.h"
26#include "ns3/spectrum-test.h"
27#include "ns3/spectrum-value.h"
28#include "ns3/test.h"
29#include <ns3/lte-rrc-sap.h>
30
31namespace ns3
32{
33class MobilityModel;
34}
35
36using namespace ns3;
37
38/**
39 * \ingroup lte-test
40 *
41 * \brief Test the fractional frequency reuse algorithms.
42 */
44{
45 public:
47};
48
49/**
50 * \ingroup lte-test
51 *
52 * \brief Test frequency reuse algorithm. Test fails if the muted frequencies
53 * are being used.
54 */
55class LteFrTestCase : public TestCase
56{
57 public:
58 /**
59 * Constructor
60 *
61 * \param name the reference name
62 * \param userNum the number of UE nodes
63 * \param dlBandwidth the DL bandwidth
64 * \param ulBandwidth the UL bandwidth
65 * \param availableDlRb the available DL per RB
66 * \param availableUlRb the available UL per RB
67 */
68 LteFrTestCase(std::string name,
69 uint32_t userNum,
70 uint16_t dlBandwidth,
71 uint16_t ulBandwidth,
72 std::vector<bool> availableDlRb,
73 std::vector<bool> availableUlRb);
74 ~LteFrTestCase() override;
75
76 /**
77 * DL data receive start function
78 * \param spectrumValue the DL data receive spectrum value
79 */
80 void DlDataRxStart(Ptr<const SpectrumValue> spectrumValue);
81 /**
82 * UL data receive start function
83 * \param spectrumValue the UL data receive spectrum value
84 */
85 void UlDataRxStart(Ptr<const SpectrumValue> spectrumValue);
86
87 protected:
88 void DoRun() override;
89
90 uint32_t m_userNum; ///< the number of UE nodes
91 uint16_t m_dlBandwidth; ///< the DL bandwidth
92 uint16_t m_ulBandwidth; ///< the UL bandwidth
93
94 std::vector<bool> m_availableDlRb; ///< the available DL for each RB
95 bool m_usedMutedDlRbg; ///< used muted DL RBG?
96
97 std::vector<bool> m_availableUlRb; ///< the available UL for each RB
98 bool m_usedMutedUlRbg; ///< used muted UL RBG?
99};
100
101/**
102 * \ingroup lte-test
103 *
104 * \brief Test hard frequency reuse algorithm. Test fails if the muted
105 * frequencies are being used.
106 */
108{
109 public:
110 /**
111 * Constructor
112 *
113 * \param name the reference name
114 * \param userNum the number of UE nodes
115 * \param schedulerType the scheduler type
116 * \param dlBandwidth the DL bandwidth
117 * \param ulBandwidth the UL bandwidth
118 * \param dlSubBandOffset DL subband offset
119 * \param dlSubBandwidth DL subbandwidth
120 * \param ulSubBandOffset UL subband offset
121 * \param ulSubBandwidth UL subbandwidth
122 * \param availableDlRb the available DL per RB
123 * \param availableUlRb the available UL per RB
124 */
125 LteHardFrTestCase(std::string name,
126 uint32_t userNum,
127 std::string schedulerType,
128 uint16_t dlBandwidth,
129 uint16_t ulBandwidth,
130 uint8_t dlSubBandOffset,
131 uint16_t dlSubBandwidth,
132 uint8_t ulSubBandOffset,
133 uint16_t ulSubBandwidth,
134 std::vector<bool> availableDlRb,
135 std::vector<bool> availableUlRb);
136 ~LteHardFrTestCase() override;
137
138 private:
139 void DoRun() override;
140
141 std::string m_schedulerType; ///< the scheduler type
142
143 uint8_t m_dlSubBandOffset; ///< the DL subband offset
144 uint8_t m_dlSubBandwidth; ///< the DL subband width
145
146 uint8_t m_ulSubBandOffset; ///< UL subband offset
147 uint8_t m_ulSubBandwidth; ///< UL subband offset
148};
149
150/**
151 * \ingroup lte-test
152 *
153 * \brief Test strict frequency reuse algorithm. Test fails if the muted frequencies
154 * are being used.
155 */
157{
158 public:
159 /**
160 * Constructor
161 *
162 * \param name the reference name
163 * \param userNum the number of UE nodes
164 * \param schedulerType the scheduler type
165 * \param dlBandwidth the DL bandwidth
166 * \param ulBandwidth the UL bandwidth
167 * \param dlCommonSubBandwidth DL common bandwidth
168 * \param dlEdgeSubBandOffset DL edge subband offset
169 * \param dlEdgeSubBandwidth DL edge subbandwidth
170 * \param ulCommonSubBandwidth UL common subbandwidth
171 * \param ulEdgeSubBandOffset UL subband offset
172 * \param ulEdgeSubBandwidth UL subbandwidth
173 * \param availableDlRb the available DL per RB
174 * \param availableUlRb the available UL per RB
175 */
176 LteStrictFrTestCase(std::string name,
177 uint32_t userNum,
178 std::string schedulerType,
179 uint16_t dlBandwidth,
180 uint16_t ulBandwidth,
181 uint16_t dlCommonSubBandwidth,
182 uint8_t dlEdgeSubBandOffset,
183 uint16_t dlEdgeSubBandwidth,
184 uint16_t ulCommonSubBandwidth,
185 uint8_t ulEdgeSubBandOffset,
186 uint16_t ulEdgeSubBandwidth,
187 std::vector<bool> availableDlRb,
188 std::vector<bool> availableUlRb);
189 ~LteStrictFrTestCase() override;
190
191 private:
192 void DoRun() override;
193
194 std::string m_schedulerType; ///< scheduler type
195
196 uint16_t m_dlCommonSubBandwidth; ///< DL common subbandwidth
197 uint8_t m_dlEdgeSubBandOffset; ///< DL edge subband offset
198 uint16_t m_dlEdgeSubBandwidth; ///< DL edge subbandwidth
199
200 uint16_t m_ulCommonSubBandwidth; ///< UL common subbandwidth
201 uint8_t m_ulEdgeSubBandOffset; ///< UL edge subband offset
202 uint16_t m_ulEdgeSubBandwidth; ///< UL edge subbandwidth
203};
204
205/**
206 * \ingroup lte-test
207 *
208 * \brief Test frequency reuse algorithm by teleporting UEs to different
209 * parts of area and checking if the frequency is used according to the
210 * frequency pattern for different parts of area. Test fails if the muted
211 * frequencies for a given part of area are being used by UE.
212 */
214{
215 public:
216 /**
217 * Constructor
218 *
219 * \param name the reference name
220 * \param schedulerType the scheduler type
221 */
222 LteFrAreaTestCase(std::string name, std::string schedulerType);
223 ~LteFrAreaTestCase() override;
224
225 /**
226 * DL data receive start function
227 * \param spectrumValue the DL receive spectrum value
228 */
229 void DlDataRxStart(Ptr<const SpectrumValue> spectrumValue);
230 /**
231 * UL data receive start function
232 * \param spectrumValue the UL receive spectrum value
233 */
234 void UlDataRxStart(Ptr<const SpectrumValue> spectrumValue);
235
236 /**
237 * Simple teleport UE function
238 * \param x the X position
239 * \param y the Y position
240 */
242 /**
243 * Teleport UE function
244 * \param x the X position
245 * \param y the Y position
246 * \param expectedPower the expected power
247 * \param expectedDlRb the expected DL pwr RB
248 */
249 void TeleportUe(uint32_t x, uint32_t y, double expectedPower, std::vector<bool> expectedDlRb);
250 /**
251 * Teleport UE 2 function
252 * \param ueNode the UE node
253 * \param x the X position
254 * \param y the Y position
255 * \param expectedPower the expected power
256 * \param expectedDlRb the expected DL pwr RB
257 */
258 void TeleportUe2(Ptr<Node> ueNode,
259 uint32_t x,
260 uint32_t y,
261 double expectedPower,
262 std::vector<bool> expectedDlRb);
263
264 /**
265 * Set DL expected values function
266 * \param expectedPower the expected power
267 * \param expectedDlRb the expected DL pwr RB
268 */
269 void SetDlExpectedValues(double expectedPower, std::vector<bool> expectedDlRb);
270 /**
271 * Set UL expected values function
272 * \param expectedPower the expected power
273 * \param expectedDlRb the expected DL pwr RB
274 */
275 void SetUlExpectedValues(double expectedPower, std::vector<bool> expectedDlRb);
276
277 protected:
278 void DoRun() override;
279
280 std::string m_schedulerType; ///< the scheduler type
281
282 uint16_t m_dlBandwidth; ///< the DL bandwidth
283 uint16_t m_ulBandwidth; ///< the UL bandwidth
284
285 Time m_teleportTime; ///< the teleport time
286 Ptr<MobilityModel> m_ueMobility; ///< the UE mobility model
287
288 double m_expectedDlPower; ///< the expected DL power
289 std::vector<bool> m_expectedDlRb; ///< the expected DL per RB
290 bool m_usedWrongDlRbg; ///< used wrong DL RBG?
291 bool m_usedWrongDlPower; ///< used wrong DL power?
292
293 double m_expectedUlPower; ///< expected UL power
294 std::vector<bool> m_expectedUlRb; ///< expected UL per RB
295 bool m_usedWrongUlRbg; ///< used wrong UL RBG?
296 bool m_usedWrongUlPower; ///< used wrong UL power?
297};
298
299/**
300 * \ingroup lte-test
301 *
302 * \brief Lte Fr Area Test Case
303 */
305{
306 public:
307 /**
308 * Constructor
309 *
310 * \param name the reference name
311 * \param schedulerType the scheduler type
312 */
313 LteStrictFrAreaTestCase(std::string name, std::string schedulerType);
314 ~LteStrictFrAreaTestCase() override;
315
316 private:
317 void DoRun() override;
318};
319
320/**
321 * \ingroup lte-test
322 *
323 * \brief Lte Soft Fr Area Test Case
324 */
326{
327 public:
328 /**
329 * Constructor
330 *
331 * \param name the reference name
332 * \param schedulerType the scheduler type
333 */
334 LteSoftFrAreaTestCase(std::string name, std::string schedulerType);
335 ~LteSoftFrAreaTestCase() override;
336
337 private:
338 void DoRun() override;
339};
340
341/**
342 * \ingroup lte-test
343 *
344 * \brief Lte Soft Ffr Area Test Case
345 */
347{
348 public:
349 /**
350 * Constructor
351 *
352 * \param name the reference name
353 * \param schedulerType the scheduler type
354 */
355 LteSoftFfrAreaTestCase(std::string name, std::string schedulerType);
356 ~LteSoftFfrAreaTestCase() override;
357
358 private:
359 void DoRun() override;
360};
361
362/**
363 * \ingroup lte-test
364 *
365 * \brief Lte Enhanced Ffr Area Test Case
366 */
368{
369 public:
370 /**
371 * Constructor
372 *
373 * \param name the reference name
374 * \param schedulerType the scheduler type
375 */
376 LteEnhancedFfrAreaTestCase(std::string name, std::string schedulerType);
378
379 private:
380 void DoRun() override;
381};
382
383/**
384 * \ingroup lte-test
385 *
386 * \brief Lte Distributed Ffr Area Test Case
387 */
389{
390 public:
391 /**
392 * Constructor
393 *
394 * \param name the reference name
395 * \param schedulerType the scheduler type
396 */
397 LteDistributedFfrAreaTestCase(std::string name, std::string schedulerType);
399
400 private:
401 void DoRun() override;
402};
403
404#endif /* LTE_TEST_DOWNLINK_FR_H */
Lte Distributed Ffr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
Lte Enhanced Ffr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
Test frequency reuse algorithm by teleporting UEs to different parts of area and checking if the freq...
Time m_teleportTime
the teleport time
bool m_usedWrongUlRbg
used wrong UL RBG?
std::vector< bool > m_expectedDlRb
the expected DL per RB
void SimpleTeleportUe(uint32_t x, uint32_t y)
Simple teleport UE function.
uint16_t m_ulBandwidth
the UL bandwidth
uint16_t m_dlBandwidth
the DL bandwidth
std::vector< bool > m_expectedUlRb
expected UL per RB
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
UL data receive start function.
void TeleportUe2(Ptr< Node > ueNode, uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Teleport UE 2 function.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
DL data receive start function.
double m_expectedUlPower
expected UL power
std::string m_schedulerType
the scheduler type
void SetUlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Set UL expected values function.
bool m_usedWrongUlPower
used wrong UL power?
double m_expectedDlPower
the expected DL power
void SetDlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Set DL expected values function.
bool m_usedWrongDlRbg
used wrong DL RBG?
void TeleportUe(uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Teleport UE function.
Ptr< MobilityModel > m_ueMobility
the UE mobility model
bool m_usedWrongDlPower
used wrong DL power?
void DoRun() override
Implementation to actually run this TestCase.
Test frequency reuse algorithm.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
DL data receive start function.
uint32_t m_userNum
the number of UE nodes
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
UL data receive start function.
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_dlBandwidth
the DL bandwidth
uint16_t m_ulBandwidth
the UL bandwidth
bool m_usedMutedDlRbg
used muted DL RBG?
std::vector< bool > m_availableDlRb
the available DL for each RB
std::vector< bool > m_availableUlRb
the available UL for each RB
bool m_usedMutedUlRbg
used muted UL RBG?
Test the fractional frequency reuse algorithms.
Test hard frequency reuse algorithm.
uint8_t m_dlSubBandOffset
the DL subband offset
uint8_t m_ulSubBandwidth
UL subband offset.
uint8_t m_ulSubBandOffset
UL subband offset.
void DoRun() override
Implementation to actually run this TestCase.
uint8_t m_dlSubBandwidth
the DL subband width
std::string m_schedulerType
the scheduler type
Lte Soft Ffr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
Lte Soft Fr Area Test Case.
void DoRun() override
Implementation to actually run this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
Test strict frequency reuse algorithm.
uint16_t m_ulCommonSubBandwidth
UL common subbandwidth.
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_dlCommonSubBandwidth
DL common subbandwidth.
uint8_t m_dlEdgeSubBandOffset
DL edge subband offset.
uint8_t m_ulEdgeSubBandOffset
UL edge subband offset.
std::string m_schedulerType
scheduler type
uint16_t m_dlEdgeSubBandwidth
DL edge subbandwidth.
uint16_t m_ulEdgeSubBandwidth
UL edge subbandwidth.
Keep track of the current position and velocity of an object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
encapsulates test code
Definition: test.h:1061
A suite of tests to run.
Definition: test.h:1268
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Every class exported by the ns3 library is enclosed in the ns3 namespace.