5G-LENA nr-v4.0
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-test-ue-measurements.h
1// Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4//
5// Author: Manuel Requena <manuel.requena@cttc.es>
6// Nicola Baldo <nbaldo@cttc.es>
7// Marco Miozzo <mmiozzo@cttc.es>
8// adapt lte-test-interference.cc to lte-ue-measurements.cc
9// Budiarto Herman <budiarto.herman@magister.fi>
10
11#ifndef NR_TEST_UE_MEASUREMENTS_H
12#define NR_TEST_UE_MEASUREMENTS_H
13
14#include "ns3/nr-rrc-sap.h"
15#include "ns3/nstime.h"
16#include "ns3/test.h"
17
18#include <list>
19#include <set>
20#include <vector>
21
22namespace ns3
23{
24
25class MobilityModel;
26
27}
28
29using namespace ns3;
30
31// ===== NR-UE-MEASUREMENTS TEST SUITE ==================================== //
32
39class NrUeMeasurementsTestSuite : public TestSuite
40{
41 public:
43};
44
52class NrUeMeasurementsTestCase : public TestCase
53{
54 public:
66 NrUeMeasurementsTestCase(std::string name,
67 double d1,
68 double d2,
69 double rsrpDbmUe1,
70 double rsrpDbmUe2,
71 double rsrqDbUe1,
72 double rsrqDbUe2);
74
83 void ReportUeMeasurements(uint16_t rnti,
84 uint16_t cellId,
85 double rsrp,
86 double rsrq,
87 bool servingCell);
88
96 void RecvMeasurementReport(uint64_t imsi,
97 uint16_t cellId,
98 uint16_t rnti,
100
101 private:
102 void DoRun() override;
103
104 double m_d1;
105 double m_d2;
106 double m_rsrpDbmUeServingCell;
107 double m_rsrpDbmUeNeighborCell;
108 double m_rsrqDbUeServingCell;
109 double m_rsrqDbUeNeighborCell;
110};
111
112// ===== NR-UE-MEASUREMENTS-PIECEWISE-1 TEST SUITE ======================== //
113
121{
122 public:
124};
125
144{
145 public:
154 NrUeMeasurementsPiecewiseTestCase1(std::string name,
156 std::vector<Time> expectedTime,
157 std::vector<uint8_t> expectedRsrp);
158
160
177 void RecvMeasurementReportCallback(std::string context,
178 uint64_t imsi,
179 uint16_t cellId,
180 uint16_t rnti,
182
183 private:
190 void DoRun() override;
191
196 void DoTeardown() override;
197
199 void TeleportVeryNear();
201 void TeleportNear();
203 void TeleportFar();
205 void TeleportVeryFar();
206
211
216 std::vector<Time> m_expectedTime;
217
222 std::vector<uint8_t> m_expectedRsrp;
223
228 std::vector<Time>::iterator m_itExpectedTime;
229
234 std::vector<uint8_t>::iterator m_itExpectedRsrp;
235
241 uint8_t m_expectedMeasId;
242
243 Ptr<MobilityModel> m_ueMobility;
244
245}; // end of class NrUeMeasurementsPiecewiseTestCase1
246
247// ===== NR-UE-MEASUREMENTS-PIECEWISE-2 TEST SUITE ======================== //
248
256{
257 public:
259};
260
279{
280 public:
289 NrUeMeasurementsPiecewiseTestCase2(std::string name,
291 std::vector<Time> expectedTime,
292 std::vector<uint8_t> expectedRsrp);
293
295
312 void RecvMeasurementReportCallback(std::string context,
313 uint64_t imsi,
314 uint16_t cellId,
315 uint16_t rnti,
317
318 private:
325 void DoRun() override;
326
331 void DoTeardown() override;
332
334 void TeleportVeryNear();
336 void TeleportNear();
338 void TeleportFar();
340 void TeleportVeryFar();
341
346
351 std::vector<Time> m_expectedTime;
352
357 std::vector<uint8_t> m_expectedRsrp;
358
363 std::vector<Time>::iterator m_itExpectedTime;
364
369 std::vector<uint8_t>::iterator m_itExpectedRsrp;
370
376 uint8_t m_expectedMeasId;
377
378 Ptr<MobilityModel> m_ueMobility;
379
380}; // end of class NrUeMeasurementsPiecewiseTestCase2
381
382// ===== NR-UE-MEASUREMENTS-PIECEWISE-3 TEST SUITE ======================== //
383
391{
392 public:
394};
395
432{
433 public:
441 NrUeMeasurementsPiecewiseTestCase3(std::string name,
443 std::vector<Time> expectedTime);
444
446
463 void RecvMeasurementReportCallback(std::string context,
464 uint64_t imsi,
465 uint16_t cellId,
466 uint16_t rnti,
468
469 private:
476 void DoRun() override;
477
482 void DoTeardown() override;
483
485 void TeleportGnbNear();
486
491
496 std::vector<Time> m_expectedTime;
497
502 std::vector<Time>::iterator m_itExpectedTime;
503
509 uint8_t m_expectedMeasId;
510
511 Ptr<MobilityModel> m_gnbMobility;
512
513}; // end of class NrUeMeasurementsPiecewiseTestCase3
514
515// ===== NR-UE-MEASUREMENTS-HANDOVER TEST SUITE =========================== //
516
523class NrUeMeasurementsHandoverTestSuite : public TestSuite
524{
525 public:
527};
528
546class NrUeMeasurementsHandoverTestCase : public TestCase
547{
548 public:
559 NrUeMeasurementsHandoverTestCase(std::string name,
560 std::list<NrRrcSap::ReportConfigEutra> sourceConfigList,
561 std::list<NrRrcSap::ReportConfigEutra> targetConfigList,
562 std::vector<Time> expectedTime,
563 std::vector<uint8_t> expectedRsrp,
564 Time duration);
565
567
584 void RecvMeasurementReportCallback(std::string context,
585 uint64_t imsi,
586 uint16_t cellId,
587 uint16_t rnti,
589
590 private:
597 void DoRun() override;
598
603 void DoTeardown() override;
604
609 std::list<NrRrcSap::ReportConfigEutra> m_sourceConfigList;
610
615 std::list<NrRrcSap::ReportConfigEutra> m_targetConfigList;
616
621 std::vector<Time> m_expectedTime;
622
627 std::vector<uint8_t> m_expectedRsrp;
628
633 std::vector<Time>::iterator m_itExpectedTime;
634
639 std::vector<uint8_t>::iterator m_itExpectedRsrp;
640
644 Time m_duration;
645
651 std::set<uint8_t> m_expectedSourceCellMeasId;
652
658 std::set<uint8_t> m_expectedTargetCellMeasId;
659
660}; // end of class NrUeMeasurementsHandoverTestCase
661
662#endif /* NR_TEST_UE_MEASUREMENTS_H */
Testing UE measurements in NR with simulation of 2 eNodeB and 1 UE in a handover configuration.
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, NrRrcSap::MeasurementReport report)
Triggers when either one of the eNodeBs receives measurement report from UE, then perform verificatio...
Test suite for generating calls to UE measurements test case ns3::NrUeMeasurementsHandoverTestCase.
Testing UE measurements in NR with simulation of 1 eNodeB and 1 UE in piecewise configuration and 120...
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, NrRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it.
Testing UE measurements in NR with simulation of 2 eNodeB and 1 UE in piecewise configuration and 240...
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, NrRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it.
Testing UE measurements in NR with simulation of 3 eNodeB and 1 UE in piecewise configuration and 240...
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, NrRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it.
Test suite for generating calls to UE measurements test case ns3::NrUeMeasurementsPiecewiseTestCase1.
Test suite for generating calls to UE measurements test case ns3::NrUeMeasurementsPiecewiseTestCase2.
Test suite for generating calls to UE measurements test case ns3::NrUeMeasurementsPiecewiseTestCase3.
Test that UE measurements calculation works properly in a scenario with 2 eNodeBs and 2UEs....
void RecvMeasurementReport(uint64_t imsi, uint16_t cellId, uint16_t rnti, NrRrcSap::MeasurementReport meas)
void ReportUeMeasurements(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
Test that UE Measurements (see 36.214) calculation works fine in a multi-cell interference scenario.
MeasurementReport structure.
Definition nr-rrc-sap.h:954
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition nr-rrc-sap.h:360