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