14#include "ns3/boolean.h"
15#include "ns3/callback.h"
16#include "ns3/config.h"
17#include "ns3/double.h"
19#include "ns3/ff-mac-scheduler.h"
20#include "ns3/internet-stack-helper.h"
21#include "ns3/ipv4-address-helper.h"
22#include "ns3/ipv4-interface-container.h"
23#include "ns3/ipv4-static-routing-helper.h"
25#include "ns3/lte-common.h"
26#include "ns3/lte-enb-net-device.h"
27#include "ns3/lte-enb-phy.h"
28#include "ns3/lte-enb-rrc.h"
29#include "ns3/lte-helper.h"
30#include "ns3/lte-ue-net-device.h"
31#include "ns3/lte-ue-phy.h"
32#include "ns3/lte-ue-rrc.h"
33#include "ns3/mobility-helper.h"
34#include "ns3/net-device-container.h"
35#include "ns3/node-container.h"
36#include "ns3/point-to-point-epc-helper.h"
37#include "ns3/point-to-point-helper.h"
38#include "ns3/simulator.h"
39#include "ns3/string.h"
55 uint8_t componentCarrierId)
68 testcase->RecvMeasurementReport(imsi, cellId, rnti,
meas);
85 TestCase::Duration::EXTENSIVE);
93 TestCase::Duration::EXTENSIVE);
101 TestCase::Duration::EXTENSIVE);
109 TestCase::Duration::EXTENSIVE);
117 TestCase::Duration::EXTENSIVE);
125 TestCase::Duration::EXTENSIVE);
133 TestCase::Duration::EXTENSIVE);
141 TestCase::Duration::EXTENSIVE);
149 TestCase::Duration::EXTENSIVE);
157 TestCase::Duration::EXTENSIVE);
165 TestCase::Duration::QUICK);
173 TestCase::Duration::EXTENSIVE);
181 TestCase::Duration::EXTENSIVE);
189 TestCase::Duration::EXTENSIVE);
197 TestCase::Duration::EXTENSIVE);
205 TestCase::Duration::EXTENSIVE);
213 TestCase::Duration::EXTENSIVE);
221 TestCase::Duration::EXTENSIVE);
249 NS_LOG_INFO(
"Test UE Measurements d1 = " <<
d1 <<
" m. and d2 = " <<
d2 <<
" m.");
266 lteHelper->SetAttribute(
"PathlossModel",
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
297 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
305 lteHelper->SetSchedulerType(
"ns3::RrFfMacScheduler");
322 "/NodeList/2/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements",
324 Config::Connect(
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
328 "/NodeList/3/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements",
330 Config::Connect(
"/NodeList/1/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
353 NS_LOG_DEBUG(
"UE serving cellId " << cellId <<
" Rxed RSRP " << rsrp <<
" thr "
361 NS_LOG_DEBUG(
"UE neighbor cellId " << cellId <<
" Rxed RSRP " << rsrp <<
" thr "
383 this <<
"Serving Cell: received IMSI " << imsi <<
" CellId " << cellId <<
" RNTI "
386 <<
" RSRP " << (uint16_t)
meas.measResults.measResultPCell.rsrpResult
387 <<
" RSRQ " << (uint16_t)
meas.measResults.measResultPCell.rsrqResult <<
" thr "
399 this <<
"Neighbor cell: received IMSI " << imsi <<
" CellId " << cellId <<
" RNTI "
402 <<
" RSRP " << (uint16_t)
meas.measResults.measResultPCell.rsrpResult
403 <<
" RSRQ " << (uint16_t)
meas.measResults.measResultPCell.rsrqResult <<
" thr "
433operator<<(std::vector<uint8_t>& v,
const uint8_t& range)
460 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1040 << 1160 << 1280 << 1400
461 << 1520 << 1640 << 1760 << 1880 << 2000 << 2120;
463 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57 << 51 << 51 << 47 << 47
466 "Piecewise test case 1 - Event A1 with very low threshold",
470 TestCase::Duration::EXTENSIVE);
475 expectedTime << 200 << 320 << 440 << 560 << 680 << 1000 << 1120 << 1240 << 1360 << 2000 << 2120;
477 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 66 << 66 << 57 << 57 << 57 << 57;
479 "Piecewise test case 1 - Event A1 with normal threshold",
483 TestCase::Duration::EXTENSIVE);
488 expectedTime << 264 << 384 << 504 << 624 << 744 << 1064 << 1184 << 1304 << 1424 << 2064 << 2184;
490 expectedRsrp << 67 << 67 << 57 << 66 << 66 << 66 << 66 << 57 << 51 << 57 << 57;
492 "Piecewise test case 1 - Event A1 with short time-to-trigger",
496 TestCase::Duration::QUICK);
501 expectedTime << 328 << 448 << 568 << 688 << 808 << 1128 << 1248 << 1368 << 1488 << 2128;
503 expectedRsrp << 67 << 57 << 57 << 66 << 47 << 66 << 57 << 57 << 51 << 57;
505 "Piecewise test case 1 - Event A1 with long time-to-trigger",
509 TestCase::Duration::EXTENSIVE);
514 expectedTime << 456 << 576 << 696 << 816 << 936 << 1056 << 1176 << 1296 << 1416 << 1536;
516 expectedRsrp << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57 << 51 << 51;
518 "Piecewise test case 1 - Event A1 with super time-to-trigger",
522 TestCase::Duration::EXTENSIVE);
528 expectedTime << 200 << 320 << 440 << 560 << 680 << 1000 << 1120 << 1240 << 1360 << 1480 << 2200;
530 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 66 << 66 << 57 << 57 << 51 << 67;
536 TestCase::Duration::QUICK);
544 "Piecewise test case 1 - Event A1 with very high threshold",
548 TestCase::Duration::TAKES_FOREVER);
558 "Piecewise test case 1 - Event A2 with very low threshold",
562 TestCase::Duration::TAKES_FOREVER);
567 expectedTime << 800 << 920 << 1400 << 1520 << 1640 << 1760 << 1880;
571 "Piecewise test case 1 - Event A2 with normal threshold",
575 TestCase::Duration::QUICK);
580 expectedTime << 864 << 984 << 1464 << 1584 << 1704 << 1824 << 1944;
584 "Piecewise test case 1 - Event A2 with short time-to-trigger",
588 TestCase::Duration::EXTENSIVE);
593 expectedTime << 928 << 1048 << 1528 << 1648 << 1768 << 1888 << 2008;
597 "Piecewise test case 1 - Event A2 with long time-to-trigger",
601 TestCase::Duration::TAKES_FOREVER);
610 "Piecewise test case 1 - Event A2 with super time-to-trigger",
614 TestCase::Duration::QUICK);
620 expectedTime << 800 << 920 << 1600 << 1720 << 1840 << 1960 << 2080;
628 TestCase::Duration::EXTENSIVE);
634 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1040 << 1160 << 1280 << 1400
635 << 1520 << 1640 << 1760 << 1880 << 2000 << 2120;
637 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57 << 51 << 51 << 47 << 47
640 "Piecewise test case 1 - Event A2 with very high threshold",
644 TestCase::Duration::EXTENSIVE);
664 TestCase::Duration::EXTENSIVE);
674 TestCase::Duration::EXTENSIVE);
685 TestCase::Duration::EXTENSIVE);
714 NS_FATAL_ERROR(
"Vectors of expected results are not of the same size");
734 lteHelper->SetAttribute(
"PathlossModel",
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
761 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
773 lteHelper->SetSchedulerType(
"ns3::RrFfMacScheduler");
792 "/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
879 "Report should not have neighboring cells information");
885 "Reporting should not have occurred at "
903 "Reporting should not have occurred at this time");
906 "The RSRP observed differs with the reference RSRP");
969 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
971 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
973 "Piecewise test case 2 - Event A1 with very low threshold",
977 TestCase::Duration::EXTENSIVE);
982 expectedTime << 200 << 440 << 680 << 1000 << 1240 << 2000;
986 "Piecewise test case 2 - Event A1 with normal threshold",
990 TestCase::Duration::TAKES_FOREVER);
995 expectedTime << 200 << 440 << 680 << 1000 << 1240 << 1480 << 2200;
1003 TestCase::Duration::EXTENSIVE);
1011 "Piecewise test case 2 - Event A1 with very high threshold",
1015 TestCase::Duration::TAKES_FOREVER);
1025 "Piecewise test case 2 - Event A2 with very low threshold",
1029 TestCase::Duration::TAKES_FOREVER);
1038 "Piecewise test case 2 - Event A2 with normal threshold",
1042 TestCase::Duration::TAKES_FOREVER);
1055 TestCase::Duration::EXTENSIVE);
1061 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1063 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
1065 "Piecewise test case 2 - Event A2 with very high threshold",
1069 TestCase::Duration::TAKES_FOREVER);
1082 "Piecewise test case 2 - Event A3 with positive offset",
1086 TestCase::Duration::QUICK);
1099 TestCase::Duration::EXTENSIVE);
1108 "Piecewise test case 2 - Event A3 with short time-to-trigger",
1112 TestCase::Duration::EXTENSIVE);
1121 "Piecewise test case 2 - Event A3 with super time-to-trigger",
1125 TestCase::Duration::QUICK);
1132 expectedTime << 800 << 1000 << 1600 << 1840 << 2080 << 2200;
1140 TestCase::Duration::QUICK);
1147 expectedTime << 400 << 800 << 1200 << 1440 << 1680 << 1920 << 2160;
1149 expectedRsrp << 63 << 52 << 59 << 56 << 52 << 56 << 59;
1151 "Piecewise test case 2 - Event A3 with negative offset",
1155 TestCase::Duration::EXTENSIVE);
1164 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1166 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
1168 "Piecewise test case 2 - Event A4 with very low threshold",
1172 TestCase::Duration::QUICK);
1181 "Piecewise test case 2 - Event A4 with normal threshold",
1185 TestCase::Duration::EXTENSIVE);
1194 "Piecewise test case 2 - Event A4 with short time-to-trigger",
1198 TestCase::Duration::QUICK);
1207 "Piecewise test case 2 - Event A4 with super time-to-trigger",
1211 TestCase::Duration::TAKES_FOREVER);
1225 TestCase::Duration::QUICK);
1233 "Piecewise test case 2 - Event A4 with very high threshold",
1237 TestCase::Duration::TAKES_FOREVER);
1249 "Piecewise test case 2 - Event A5 with low-low threshold",
1253 TestCase::Duration::EXTENSIVE);
1258 "Piecewise test case 2 - Event A5 with low-normal threshold",
1262 TestCase::Duration::TAKES_FOREVER);
1267 "Piecewise test case 2 - Event A5 with low-high threshold",
1271 TestCase::Duration::TAKES_FOREVER);
1281 "Piecewise test case 2 - Event A5 with normal-low threshold",
1285 TestCase::Duration::EXTENSIVE);
1294 "Piecewise test case 2 - Event A5 with normal-normal threshold",
1298 TestCase::Duration::EXTENSIVE);
1307 "Piecewise test case 2 - Event A5 with short time-to-trigger",
1311 TestCase::Duration::TAKES_FOREVER);
1320 "Piecewise test case 2 - Event A5 with super time-to-trigger",
1324 TestCase::Duration::QUICK);
1338 TestCase::Duration::QUICK);
1346 "Piecewise test case 2 - Event A5 with normal-high threshold",
1350 TestCase::Duration::TAKES_FOREVER);
1356 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1358 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
1360 "Piecewise test case 2 - Event A5 with high-low threshold",
1364 TestCase::Duration::EXTENSIVE);
1373 "Piecewise test case 2 - Event A5 with high-normal threshold",
1377 TestCase::Duration::TAKES_FOREVER);
1384 "Piecewise test case 2 - Event A5 with high-high threshold",
1388 TestCase::Duration::EXTENSIVE);
1417 NS_FATAL_ERROR(
"Vectors of expected results are not of the same size");
1437 lteHelper->SetAttribute(
"PathlossModel",
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
1465 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1477 lteHelper->SetSchedulerType(
"ns3::RrFfMacScheduler");
1500 "/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1564 std::string context,
1582 this <<
" Serving cellId=" << cellId
1595 "Unexpected report content");
1601 "Unexpected report content");
1607 "Report contains cgi-info, which is not supported");
1610 "Report does not contain measured RSRP result");
1613 "Report does not contain measured RSRQ result");
1615 <<
" rsrp=" << (uint16_t)
it->rsrpResult <<
" ("
1617 <<
" rsrq=" << (uint16_t)
it->rsrqResult <<
" ("
1646 "Reporting should not have occurred at this time");
1649 "The RSRP observed differs with the reference RSRP");
1688 :
TestSuite(
"lte-ue-measurements-piecewise-3",
Type::SYSTEM)
1712 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1717 TestCase::Duration::QUICK);
1756 lteHelper->SetAttribute(
"PathlossModel",
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
1787 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1799 lteHelper->SetSchedulerType(
"ns3::RrFfMacScheduler");
1824 "/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1857 std::string context,
1875 this <<
" Serving cellId=" << cellId
1888 "Unexpected report content");
1894 "Unexpected report content");
1902 "Report contains cgi-info, which is not supported");
1905 "Report does not contain measured RSRP result");
1908 "Report does not contain measured RSRQ result");
1910 <<
" rsrp=" << (uint16_t)
it.rsrpResult <<
" ("
1912 <<
" rsrq=" << (uint16_t)
it.rsrqResult <<
" ("
1922 "Reporting should not have occurred at " <<
Simulator::Now().GetSeconds()
1936 "Reporting should not have occurred at this time");
1985 expectedTime << 200 << 680 << 1200 << 1440 << 1680 << 1920;
1995 TestCase::Duration::TAKES_FOREVER);
2001 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1200 << 1840;
2003 expectedRsrp << 55 << 55 << 55 << 55 << 55 << 55 << 55 << 53 << 53;
2011 TestCase::Duration::QUICK);
2028 expectedTime << 200 << 440 << 680 << 920 << 1200 << 1440 << 1680 << 1920;
2030 expectedRsrp << 55 << 55 << 55 << 55 << 53 << 53 << 53 << 53;
2037 TestCase::Duration::EXTENSIVE);
2050 TestCase::Duration::TAKES_FOREVER);
2065 TestCase::Duration::TAKES_FOREVER);
2080 TestCase::Duration::QUICK);
2095 TestCase::Duration::EXTENSIVE);
2110 TestCase::Duration::TAKES_FOREVER);
2125 TestCase::Duration::TAKES_FOREVER);
2140 TestCase::Duration::EXTENSIVE);
2161 TestCase::Duration::EXTENSIVE);
2177 TestCase::Duration::QUICK);
2195 TestCase::Duration::QUICK);
2211 TestCase::Duration::EXTENSIVE);
2227 TestCase::Duration::EXTENSIVE);
2253 TestCase::Duration::QUICK);
2259 expectedTime << 1224 << 1464 << 1704 << 1944 << 2840 << 3080 << 3320 << 3560 << 3800 << 4040;
2261 expectedRsrp << 55 << 55 << 55 << 55 << 53 << 53 << 53 << 53 << 53 << 53;
2268 TestCase::Duration::EXTENSIVE);
2294 m_duration(duration)
2301 NS_FATAL_ERROR(
"Vectors of expected results are not of the same size");
2323 lteHelper->SetAttribute(
"PathlossModel",
StringValue(
"ns3::FriisSpectrumPropagationLossModel"));
2349 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2401 measId =
enbRrc1->AddUeMeasReportConfig(*itReportConfig).at(0);
2409 measId =
enbRrc2->AddUeMeasReportConfig(*itReportConfig).at(0);
2436 "/NodeList/3/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
2441 "/NodeList/4/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
2471 std::string context,
2477 uint8_t measId =
report.measResults.measId;
2486 else if (cellId == 2)
2504 this <<
" Serving cellId=" << cellId
2517 "Unexpected report content");
2523 "Unexpected report content");
2530 "Report contains cgi-info, which is not supported");
2533 "Report does not contain measured RSRP result");
2536 "Report does not contain measured RSRQ result");
2538 <<
" rsrp=" << (uint16_t)
it->rsrpResult <<
" ("
2540 <<
" rsrq=" << (uint16_t)
it->rsrqResult <<
" ("
2569 "Reporting should not have occurred at this time");
2572 "The RSRP observed differs with the reference RSRP");
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration.
~LteUeMeasurementsHandoverTestCase() override
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
std::list< LteRrcSap::ReportConfigEutra > m_sourceConfigList
The list of active report triggering configuration for the source eNodeB.
void DoRun() override
Setup the simulation with the intended UE measurement reporting configuration, run it,...
std::set< uint8_t > m_expectedTargetCellMeasId
The list of measurement identities being tested in the target cell.
LteUeMeasurementsHandoverTestCase(std::string name, std::list< LteRrcSap::ReportConfigEutra > sourceConfigList, std::list< LteRrcSap::ReportConfigEutra > targetConfigList, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp, Time duration)
Constructor.
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
Triggers when either one of the eNodeBs receives measurement report from UE, then perform verificatio...
void DoTeardown() override
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
Time m_duration
Duration of simulation.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
std::list< LteRrcSap::ReportConfigEutra > m_targetConfigList
The list of active report triggering configuration for the target eNodeB.
std::set< uint8_t > m_expectedSourceCellMeasId
The list of measurement identities being tested in the source cell.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsHandoverTestCase.
LteUeMeasurementsHandoverTestSuite()
Testing UE measurements in LTE with simulation of 1 eNodeB and 1 UE in piecewise configuration and 12...
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
void TeleportVeryFar()
Teleport far function.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
uint8_t m_expectedMeasId
The measurement identity being tested.
LteUeMeasurementsPiecewiseTestCase1(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
Constructor.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
~LteUeMeasurementsPiecewiseTestCase1() override
void TeleportFar()
Teleport far function.
Ptr< MobilityModel > m_ueMobility
the mobility model
void TeleportVeryNear()
Teleport very near function.
void TeleportNear()
Teleport near function.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
void DoTeardown() override
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it.
void DoRun() override
Setup the simulation with the intended UE measurement reporting configuration, run it,...
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in piecewise configuration and 24...
Ptr< MobilityModel > m_ueMobility
the mobility model
~LteUeMeasurementsPiecewiseTestCase2() override
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
void TeleportVeryNear()
Teleport very near function.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
void DoTeardown() override
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
LteUeMeasurementsPiecewiseTestCase2(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
Constructor.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
void TeleportFar()
Teleport far function.
void DoRun() override
Setup the simulation with the intended UE measurement reporting configuration, run it,...
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it.
void TeleportVeryFar()
Teleport very far function.
void TeleportNear()
Teleport near function.
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
uint8_t m_expectedMeasId
The measurement identity being tested.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
Testing UE measurements in LTE with simulation of 3 eNodeB and 1 UE in piecewise configuration and 24...
Ptr< MobilityModel > m_enbMobility
the mobility model
LteUeMeasurementsPiecewiseTestCase3(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime)
Constructor.
void DoTeardown() override
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
void DoRun() override
Setup the simulation with the intended UE measurement reporting configuration, run it,...
~LteUeMeasurementsPiecewiseTestCase3() override
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
uint8_t m_expectedMeasId
The measurement identity being tested.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
void TeleportEnbNear()
Teleport the eNb near function.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase1...
LteUeMeasurementsPiecewiseTestSuite1()
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase2...
LteUeMeasurementsPiecewiseTestSuite2()
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase3...
LteUeMeasurementsPiecewiseTestSuite3()
Test that UE measurements calculation works properly in a scenario with 2 eNodeBs and 2UEs.
double m_d1
distance between UE and ENB node pair
double m_rsrqDbUeServingCell
RSRQ in dBm UE 1.
double m_rsrpDbmUeServingCell
RSRP in dBm UE 1.
LteUeMeasurementsTestCase(std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2)
Constructor.
void ReportUeMeasurements(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
Report UE measurements function.
void DoRun() override
Implementation to actually run this TestCase.
double m_rsrqDbUeNeighborCell
RSRQ in dBm UE 2.
double m_d2
distance between UE and other ENB node
double m_rsrpDbmUeNeighborCell
RSRP in dBm UE 2.
~LteUeMeasurementsTestCase() override
void RecvMeasurementReport(uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Reeive measurement report function.
Test that UE Measurements (see 36.214) calculation works fine in a multi-cell interference scenario.
LteUeMeasurementsTestSuite()
AttributeValue implementation for Boolean.
Class for representing data rates.
AttributeValue implementation for DataRate.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
This class contains the specification of EPS Bearers.
@ GBR_CONV_VOICE
GBR Conversational Voice.
static uint8_t Dbm2RsrpRange(double dbm)
convert an RSRP value in dBm to the corresponding range as per 3GPP TS 36.133 section 9....
static double RsrpRange2Dbm(uint8_t range)
converts an RSRP range to dBm as per 3GPP TS 36.133 section 9.1.4 RSRP Measurement Report Mapping
static double RsrqRange2Db(uint8_t range)
converts an RSRQ range to dB as per 3GPP TS 36.133 section 9.1.7 RSRQ Measurement Report Mapping
static uint8_t Db2RsrqRange(double db)
convert an RSRQ value in dB to the corresponding range as per 3GPP TS 36.133 section 9....
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4 addresses are stored in host order in this class.
Access to the IPv4 forwarding table, interfaces, and configuration.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
a class to represent an Ipv4 address mask
Helper class that adds ns3::Ipv4StaticRouting objects.
The eNodeB device implementation.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Hold variables of type string.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
std::string GetName() const
Simulation virtual time values and global simulation resolution.
int64_t GetMilliSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
void SetDefault(std::string name, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
static LteUeMeasurementsPiecewiseTestSuite2 lteUeMeasurementsPiecewiseTestSuite2
Static variable for test initialization.
static LteUeMeasurementsHandoverTestSuite lteUeMeasurementsHandoverTestSuite
Static variable for test initialization.
static LteUeMeasurementsTestSuite lteUeMeasurementsTestSuite
Static variable for test initialization.
static LteUeMeasurementsPiecewiseTestSuite1 lteUeMeasurementsPiecewiseTestSuite1
Static variable for test initialization.
static LteUeMeasurementsPiecewiseTestSuite3 lteUeMeasurementsPiecewiseTestSuite3
Static variable for test initialization.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
void ReportUeMeasurementsCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell, uint8_t componentCarrierId)
void RecvMeasurementReportCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
std::ostream & operator<<(std::ostream &os, const Angles &a)
const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
uint8_t rsrqResult
the RSRQ result
uint8_t rsrpResult
the RSRP result
bool haveMeasResultNeighCells
have measure result neighbor cells
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
MeasResultPCell measResultPCell
measurement result primary cell
MeasurementReport structure.
Specifies criteria for triggering of an E-UTRA measurement reporting event.
bool reportOnLeave
Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving c...
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition.
ThresholdEutra threshold2
Threshold for event A5.
enum ns3::LteRrcSap::ReportConfigEutra::@63 triggerType
Trigger enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@64 eventId
Event enumeration.
@ EVENT_A2
Event A2: Serving becomes worse than absolute threshold.
@ EVENT_A3
Event A3: Neighbour becomes amount of offset better than PCell.
@ EVENT_A4
Event A4: Neighbour becomes better than absolute threshold.
@ EVENT_A1
Event A1: Serving becomes better than absolute threshold.
@ EVENT_A5
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
enum ns3::LteRrcSap::ReportConfigEutra::@67 reportInterval
Report interval enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@65 triggerQuantity
Trigger type enumeration.
@ RSRP
Reference Signal Received Power.
int8_t a3Offset
Offset value for Event A3.
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...
enum ns3::LteRrcSap::ThresholdEutra::@62 choice
Threshold enumeration.
@ THRESHOLD_RSRP
RSRP is used for the threshold.
uint8_t range
Value range used in RSRP/RSRQ threshold.