24 #include <ns3/simulator.h>
26 #include <ns3/callback.h>
27 #include <ns3/config.h>
28 #include <ns3/string.h>
29 #include <ns3/double.h>
31 #include <ns3/boolean.h>
33 #include <ns3/mobility-helper.h>
34 #include <ns3/lte-helper.h>
35 #include <ns3/point-to-point-epc-helper.h>
36 #include <ns3/internet-stack-helper.h>
37 #include <ns3/point-to-point-helper.h>
38 #include <ns3/ipv4-address-helper.h>
39 #include <ns3/ipv4-static-routing-helper.h>
41 #include <ns3/node-container.h>
42 #include <ns3/net-device-container.h>
43 #include <ns3/ipv4-interface-container.h>
45 #include <ns3/ff-mac-scheduler.h>
46 #include <ns3/lte-enb-net-device.h>
47 #include <ns3/lte-enb-phy.h>
48 #include <ns3/lte-enb-rrc.h>
49 #include <ns3/lte-ue-net-device.h>
50 #include <ns3/lte-ue-phy.h>
51 #include <ns3/lte-ue-rrc.h>
55 #include <ns3/lte-common.h>
66 std::string path, uint16_t rnti, uint16_t cellId,
67 double rsrp,
double rsrq,
bool servingCell)
74 std::string path, uint64_t imsi, uint16_t cellId,
86 :
TestSuite (
"lte-ue-measurements", SYSTEM)
117 double d1,
double d2,
125 m_rsrpDbmUeServingCell (rsrpDbmUe1),
126 m_rsrpDbmUeNeighborCell (rsrpDbmUe2),
127 m_rsrqDbUeServingCell (rsrqDbUe1),
128 m_rsrqDbUeNeighborCell (rsrqDbUe2)
130 NS_LOG_INFO (
"Test UE Measurements d1 = " << d1 <<
" m. and d2 = " << d2 <<
" m.");
147 lteHelper->SetAttribute (
"PathlossModel",
StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
148 lteHelper->SetAttribute (
"UseIdealRrc",
BooleanValue (
false));
170 positionAlloc->Add (
Vector (0.0, 0.0, 0.0));
183 lteHelper->SetSchedulerType (
"ns3::RrFfMacScheduler");
185 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
186 ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
187 ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
190 lteHelper->Attach (ueDevs1, enbDevs.
Get (0));
191 lteHelper->Attach (ueDevs2, enbDevs.
Get (1));
196 lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
197 lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
205 ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1);
209 enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1);
211 Config::Connect (
"/NodeList/2/DeviceList/0/LteUePhy/ReportUeMeasurements",
213 Config::Connect (
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
220 ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2);
224 enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2);
226 Config::Connect (
"/NodeList/3/DeviceList/0/LteUePhy/ReportUeMeasurements",
228 Config::Connect (
"/NodeList/1/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
241 double rsrp,
double rsrq,
271 NS_LOG_DEBUG (
this <<
"Serving Cell: received IMSI " << imsi <<
" CellId " << cellId <<
" RNTI " << rnti
285 NS_LOG_DEBUG (
this <<
"Neighbor cell: received IMSI " << imsi <<
" CellId " << cellId <<
" RNTI " << rnti
308 operator<< (std::vector<Time>& v,
const uint64_t& ms)
318 std::vector<uint8_t>&
319 operator<< (std::vector<uint8_t>& v,
const uint8_t& range)
331 :
TestSuite (
"lte-ue-measurements-piecewise-1", SYSTEM)
333 std::vector<Time> expectedTime;
334 std::vector<uint8_t> expectedRsrp;
346 expectedTime.clear ();
347 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1040 << 1160 << 1280
348 << 1400 << 1520 << 1640 << 1760 << 1880 << 2000 << 2120;
349 expectedRsrp.clear ();
350 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57
351 << 51 << 51 << 47 << 47 << 51 << 57 << 57;
353 config, expectedTime, expectedRsrp),
358 expectedTime.clear ();
359 expectedTime << 200 << 320 << 440 << 560 << 680 << 1000 << 1120 << 1240 << 1360 << 2000
361 expectedRsrp.clear ();
362 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 66 << 66 << 57 << 57 << 57
365 config, expectedTime, expectedRsrp),
370 expectedTime.clear ();
371 expectedTime << 264 << 384 << 504 << 624 << 744 << 1064 << 1184 << 1304 << 1424 << 2064
373 expectedRsrp.clear ();
374 expectedRsrp << 67 << 67 << 57 << 66 << 66 << 66 << 66 << 57 << 51 << 57
377 config, expectedTime, expectedRsrp),
382 expectedTime.clear ();
383 expectedTime << 328 << 448 << 568 << 688 << 808 << 1128 << 1248 << 1368 << 1488 << 2128;
384 expectedRsrp.clear ();
385 expectedRsrp << 67 << 57 << 57 << 66 << 47 << 66 << 57 << 57 << 51 << 57;
387 config, expectedTime, expectedRsrp),
392 expectedTime.clear ();
393 expectedTime << 456 << 576 << 696 << 816 << 936 << 1056 << 1176 << 1296 << 1416 << 1536;
394 expectedRsrp.clear ();
395 expectedRsrp << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57 << 51 << 51;
397 config, expectedTime, expectedRsrp),
403 expectedTime.clear ();
404 expectedTime << 200 << 320 << 440 << 560 << 680 << 1000 << 1120 << 1240 << 1360 << 1480
406 expectedRsrp.clear ();
407 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 66 << 66 << 57 << 57 << 51
410 config, expectedTime, expectedRsrp),
416 expectedTime.clear ();
417 expectedRsrp.clear ();
419 config, expectedTime, expectedRsrp),
427 expectedTime.clear ();
428 expectedRsrp.clear ();
430 config, expectedTime, expectedRsrp),
435 expectedTime.clear ();
436 expectedTime << 800 << 920 << 1400 << 1520 << 1640 << 1760 << 1880;
437 expectedRsrp.clear ();
438 expectedRsrp << 47 << 47 << 51 << 51 << 47 << 47 << 51;
440 config, expectedTime, expectedRsrp),
445 expectedTime.clear ();
446 expectedTime << 864 << 984 << 1464 << 1584 << 1704 << 1824 << 1944;
447 expectedRsrp.clear ();
448 expectedRsrp << 47 << 47 << 51 << 51 << 47 << 51 << 51;
450 config, expectedTime, expectedRsrp),
455 expectedTime.clear ();
456 expectedTime << 928 << 1048 << 1528 << 1648 << 1768 << 1888 << 2008;
457 expectedRsrp.clear ();
458 expectedRsrp << 47 << 66 << 51 << 47 << 47 << 51 << 57;
460 config, expectedTime, expectedRsrp),
465 expectedTime.clear ();
466 expectedTime << 1656 << 1776 << 1896 << 2016 << 2136;
467 expectedRsrp.clear ();
468 expectedRsrp << 47 << 47 << 51 << 57 << 57;
470 config, expectedTime, expectedRsrp),
476 expectedTime.clear ();
477 expectedTime << 800 << 920 << 1600 << 1720 << 1840 << 1960 << 2080;
478 expectedRsrp.clear ();
479 expectedRsrp << 47 << 47 << 47 << 47 << 51 << 51 << 57;
481 config, expectedTime, expectedRsrp),
487 expectedTime.clear ();
488 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1040 << 1160 << 1280
489 << 1400 << 1520 << 1640 << 1760 << 1880 << 2000 << 2120;
490 expectedRsrp.clear ();
491 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57
492 << 51 << 51 << 47 << 47 << 51 << 57 << 57;
494 config, expectedTime, expectedRsrp),
504 expectedTime.clear ();
505 expectedRsrp.clear ();
512 config, expectedTime, expectedRsrp),
520 config, expectedTime, expectedRsrp),
528 config, expectedTime, expectedRsrp),
542 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp)
545 m_expectedTime (expectedTime),
546 m_expectedRsrp (expectedRsrp)
553 NS_FATAL_ERROR (
"Vectors of expected results are not of the same size");
573 lteHelper->SetAttribute (
"PathlossModel",
574 StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
575 lteHelper->SetAttribute (
"UseIdealRrc",
BooleanValue (
true));
595 positionAlloc->Add (
Vector (0.0, 0.0, 0.0));
596 positionAlloc->Add (
Vector (100.0, 0.0, 0.0));
611 lteHelper->SetSchedulerType (
"ns3::RrFfMacScheduler");
612 lteHelper->SetSchedulerAttribute (
"UlCqiFilter",
614 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
615 ueDevs = lteHelper->InstallUeDevice (ueNodes);
622 lteHelper->Attach (ueDevs.
Get (0), enbDevs.
Get (0));
627 lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
630 Config::Connect (
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
677 "Reporting should have occurred at " <<
m_itExpectedTime->GetSeconds () <<
"s");
684 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
697 <<
" rsrq=" << (uint16_t) measResults.
rsrqResult
700 "Report should not have neighboring cells information");
702 "Unexpected report size");
706 "Reporting should not have occurred at "
718 uint16_t observedRsrp = measResults.
rsrpResult;
723 "Reporting should not have occurred at this time");
725 "The RSRP observed differs with the reference RSRP");
768 :
TestSuite (
"lte-ue-measurements-piecewise-2", SYSTEM)
770 std::vector<Time> expectedTime;
771 std::vector<uint8_t> expectedRsrp;
788 expectedTime.clear ();
789 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
790 expectedRsrp.clear ();
791 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
793 config, expectedTime, expectedRsrp),
798 expectedTime.clear ();
799 expectedTime << 200 << 440 << 680 << 1000 << 1240 << 2000;
800 expectedRsrp.clear ();
801 expectedRsrp << 73 << 63 << 72 << 72 << 59 << 59;
803 config, expectedTime, expectedRsrp),
808 expectedTime.clear ();
809 expectedTime << 200 << 440 << 680 << 1000 << 1240 << 1480 << 2200;
810 expectedRsrp.clear ();
811 expectedRsrp << 73 << 63 << 72 << 72 << 59 << 56 << 72;
813 config, expectedTime, expectedRsrp),
819 expectedTime.clear ();
820 expectedRsrp.clear ();
822 config, expectedTime, expectedRsrp),
830 expectedTime.clear ();
831 expectedRsrp.clear ();
833 config, expectedTime, expectedRsrp),
838 expectedTime.clear ();
839 expectedTime << 800 << 1400 << 1640 << 1880;
840 expectedRsrp.clear ();
841 expectedRsrp << 52 << 56 << 52 << 56;
843 config, expectedTime, expectedRsrp),
848 expectedTime.clear ();
849 expectedTime << 800 << 1600 << 1840 << 2080;
850 expectedRsrp.clear ();
851 expectedRsrp << 52 << 52 << 56 << 59;
853 config, expectedTime, expectedRsrp),
859 expectedTime.clear ();
860 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
861 expectedRsrp.clear ();
862 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
864 config, expectedTime, expectedRsrp),
873 expectedTime.clear ();
874 expectedTime << 800 << 1600;
875 expectedRsrp.clear ();
876 expectedRsrp << 52 << 52;
878 config, expectedTime, expectedRsrp),
883 expectedTime.clear ();
884 expectedTime << 800 << 1400 << 1640 << 1880;
885 expectedRsrp.clear ();
886 expectedRsrp << 52 << 56 << 52 << 56;
888 config, expectedTime, expectedRsrp),
893 expectedTime.clear ();
894 expectedTime << 960 << 1560 << 1800 << 2040;
895 expectedRsrp.clear ();
896 expectedRsrp << 52 << 56 << 56 << 59;
898 config, expectedTime, expectedRsrp),
903 expectedTime.clear ();
904 expectedTime << 1720 << 1960 << 2200;
905 expectedRsrp.clear ();
906 expectedRsrp << 52 << 56 << 72;
908 config, expectedTime, expectedRsrp),
915 expectedTime.clear ();
916 expectedTime << 800 << 1000 << 1600 << 1840 << 2080 << 2200;
917 expectedRsrp.clear ();
918 expectedRsrp << 52 << 72 << 52 << 56 << 59 << 72;
920 config, expectedTime, expectedRsrp),
927 expectedTime.clear ();
928 expectedTime << 400 << 800 << 1200 << 1440 << 1680 << 1920 << 2160;
929 expectedRsrp.clear ();
930 expectedRsrp << 63 << 52 << 59 << 56 << 52 << 56 << 59;
932 config, expectedTime, expectedRsrp),
941 expectedTime.clear ();
942 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
943 expectedRsrp.clear ();
944 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
946 config, expectedTime, expectedRsrp),
951 expectedTime.clear ();
952 expectedTime << 400 << 800 << 1400 << 1640 << 1880;
953 expectedRsrp.clear ();
954 expectedRsrp << 63 << 52 << 56 << 52 << 56;
956 config, expectedTime, expectedRsrp),
961 expectedTime.clear ();
962 expectedTime << 560 << 960 << 1560 << 1800 << 2040;
963 expectedRsrp.clear ();
964 expectedRsrp << 63 << 52 << 56 << 56 << 59;
966 config, expectedTime, expectedRsrp),
971 expectedTime.clear ();
972 expectedTime << 1720 << 1960 << 2200;
973 expectedRsrp.clear ();
974 expectedRsrp << 52 << 56 << 72;
976 config, expectedTime, expectedRsrp),
982 expectedTime.clear ();
983 expectedTime << 400 << 800 << 1600 << 1840 << 2080;
984 expectedRsrp.clear ();
985 expectedRsrp << 63 << 52 << 52 << 56 << 59;
987 config, expectedTime, expectedRsrp),
993 expectedTime.clear ();
994 expectedRsrp.clear ();
996 config, expectedTime, expectedRsrp),
1005 expectedTime.clear ();
1006 expectedRsrp.clear ();
1008 config, expectedTime, expectedRsrp),
1014 config, expectedTime, expectedRsrp),
1020 config, expectedTime, expectedRsrp),
1026 expectedTime.clear ();
1027 expectedTime << 800 << 1400 << 1640 << 1880;
1028 expectedRsrp.clear ();
1029 expectedRsrp << 52 << 56 << 52 << 56;
1031 config, expectedTime, expectedRsrp),
1036 expectedTime.clear ();
1037 expectedTime << 800 << 1400 << 1640 << 1880;
1038 expectedRsrp.clear ();
1039 expectedRsrp << 52 << 56 << 52 << 56;
1041 config, expectedTime, expectedRsrp),
1046 expectedTime.clear ();
1047 expectedTime << 960 << 1560 << 1800 << 2040;
1048 expectedRsrp.clear ();
1049 expectedRsrp << 52 << 56 << 56 << 59;
1051 config, expectedTime, expectedRsrp),
1056 expectedTime.clear ();
1057 expectedTime << 1720 << 1960 << 2200;
1058 expectedRsrp.clear ();
1059 expectedRsrp << 52 << 56 << 72;
1061 config, expectedTime, expectedRsrp),
1067 expectedTime.clear ();
1068 expectedTime << 800 << 1600 << 1840 << 2080;
1069 expectedRsrp.clear ();
1070 expectedRsrp << 52 << 52 << 56 << 59;
1072 config, expectedTime, expectedRsrp),
1078 expectedTime.clear ();
1079 expectedRsrp.clear ();
1081 config, expectedTime, expectedRsrp),
1087 expectedTime.clear ();
1088 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1089 expectedRsrp.clear ();
1090 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
1092 config, expectedTime, expectedRsrp),
1097 expectedTime.clear ();
1098 expectedTime << 400 << 800 << 1400 << 1640 << 1880;
1099 expectedRsrp.clear ();
1100 expectedRsrp << 63 << 52 << 56 << 52 << 56;
1102 config, expectedTime, expectedRsrp),
1107 expectedTime.clear ();
1108 expectedRsrp.clear ();
1110 config, expectedTime, expectedRsrp),
1124 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp)
1127 m_expectedTime (expectedTime),
1128 m_expectedRsrp (expectedRsrp)
1135 NS_FATAL_ERROR (
"Vectors of expected results are not of the same size");
1155 lteHelper->SetAttribute (
"PathlossModel",
1156 StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
1157 lteHelper->SetAttribute (
"UseIdealRrc",
BooleanValue (
true));
1177 positionAlloc->Add (
Vector (0.0, 0.0, 0.0));
1178 positionAlloc->Add (
Vector (600.0, 0.0, 0.0));
1179 positionAlloc->Add (
Vector (50.0, 0.0, 0.0));
1194 lteHelper->SetSchedulerType (
"ns3::RrFfMacScheduler");
1195 lteHelper->SetSchedulerAttribute (
"UlCqiFilter",
1197 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
1198 ueDevs = lteHelper->InstallUeDevice (ueNodes);
1206 enbRrc2->SetAttribute (
"AdmitHandoverRequest",
BooleanValue (
false));
1209 lteHelper->Attach (ueDevs.
Get (0), enbDevs.
Get (0));
1214 lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
1217 Config::Connect (
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1264 "Reporting should have occurred at " <<
m_itExpectedTime->GetSeconds () <<
"s");
1271 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
1283 <<
" rsrp=" << (uint16_t) measResults.
rsrpResult
1285 <<
" rsrq=" << (uint16_t) measResults.
rsrqResult
1292 "Unexpected report content");
1297 "Unexpected report content");
1298 std::list<LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
1302 "Report contains cgi-info, which is not supported");
1304 "Report does not contain measured RSRP result");
1306 "Report does not contain measured RSRQ result");
1307 NS_LOG_DEBUG (
this <<
" Neighbour cellId=" << it->physCellId
1308 <<
" rsrp=" << (uint16_t) it->rsrpResult
1310 <<
" rsrq=" << (uint16_t) it->rsrqResult
1318 "Reporting should not have occurred at "
1330 uint16_t observedRsrp = measResults.
rsrpResult;
1335 "Reporting should not have occurred at this time");
1337 "The RSRP observed differs with the reference RSRP");
1381 :
TestSuite (
"lte-ue-measurements-handover", SYSTEM)
1383 std::list<LteRrcSap::ReportConfigEutra> sourceConfigList;
1384 std::list<LteRrcSap::ReportConfigEutra> targetConfigList;
1385 std::vector<Time> expectedTime;
1386 std::vector<uint8_t> expectedRsrp;
1395 sourceConfigList.push_back (sourceConfig);
1404 targetConfigList.push_back (targetConfig);
1411 expectedTime.clear ();
1412 expectedTime << 200 << 680 << 1200 << 1440 << 1680 << 1920;
1413 expectedRsrp.clear ();
1414 expectedRsrp << 55 << 55 << 53 << 53 << 53 << 53;
1416 sourceConfigList, targetConfigList,
1417 expectedTime, expectedRsrp,
1424 expectedTime.clear ();
1425 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1200 << 1840;
1426 expectedRsrp.clear ();
1427 expectedRsrp << 55 << 55 << 55 << 55 << 55 << 55 << 55 << 53 << 53;
1429 sourceConfigList, targetConfigList,
1430 expectedTime, expectedRsrp,
1438 sourceConfigList.front ().threshold1.range = 54;
1439 sourceConfigList.front ().threshold2.range = 54;
1440 sourceConfigList.front ().a3Offset = 1;
1441 targetConfigList.front ().threshold1.range = 54;
1442 targetConfigList.front ().threshold2.range = 54;
1443 targetConfigList.front ().a3Offset = 1;
1448 expectedTime.clear ();
1449 expectedTime << 200 << 440 << 680 << 920 << 1200 << 1440 << 1680 << 1920;
1450 expectedRsrp.clear ();
1451 expectedRsrp << 55 << 55 << 55 << 55 << 53 << 53 << 53 << 53;
1453 sourceConfigList, targetConfigList,
1454 expectedTime, expectedRsrp,
1461 expectedTime.clear ();
1462 expectedRsrp.clear ();
1464 sourceConfigList, targetConfigList,
1465 expectedTime, expectedRsrp,
1472 expectedTime.clear ();
1473 expectedTime << 1200 << 1440 << 1680 << 1920;
1474 expectedRsrp.clear ();
1475 expectedRsrp << 53 << 53 << 53 << 53;
1477 sourceConfigList, targetConfigList,
1478 expectedTime, expectedRsrp,
1485 expectedTime.clear ();
1486 expectedTime << 1200 << 1440 << 1680 << 1920;
1487 expectedRsrp.clear ();
1488 expectedRsrp << 53 << 53 << 53 << 53;
1490 sourceConfigList, targetConfigList,
1491 expectedTime, expectedRsrp,
1498 expectedTime.clear ();
1499 expectedTime << 1200 << 1440 << 1680 << 1920;
1500 expectedRsrp.clear ();
1501 expectedRsrp << 53 << 53 << 53 << 53;
1503 sourceConfigList, targetConfigList,
1504 expectedTime, expectedRsrp,
1511 expectedTime.clear ();
1512 expectedTime << 1200 << 1440 << 1680 << 1920;
1513 expectedRsrp.clear ();
1514 expectedRsrp << 53 << 53 << 53 << 53;
1516 sourceConfigList, targetConfigList,
1517 expectedTime, expectedRsrp,
1524 expectedTime.clear ();
1525 expectedTime << 1200 << 1440 << 1680 << 1920;
1526 expectedRsrp.clear ();
1527 expectedRsrp << 53 << 53 << 53 << 53;
1529 sourceConfigList, targetConfigList,
1530 expectedTime, expectedRsrp,
1537 expectedTime.clear ();
1538 expectedTime << 1200 << 1440 << 1680 << 1920;
1539 expectedRsrp.clear ();
1540 expectedRsrp << 53 << 53 << 53 << 53;
1542 sourceConfigList, targetConfigList,
1543 expectedTime, expectedRsrp,
1549 sourceConfigList.front ().threshold1.range = 52;
1550 targetConfigList.front ().threshold1.range = 56;
1555 expectedTime.clear ();
1556 expectedTime << 200 << 440 << 680 << 920;
1557 expectedRsrp.clear ();
1558 expectedRsrp << 55 << 55 << 55 << 55;
1560 sourceConfigList, targetConfigList,
1561 expectedTime, expectedRsrp,
1568 expectedTime.clear ();
1569 expectedTime << 1200 << 1440 << 1680 << 1920;
1570 expectedRsrp.clear ();
1571 expectedRsrp << 53 << 53 << 53 << 53;
1573 sourceConfigList, targetConfigList,
1574 expectedTime, expectedRsrp,
1580 sourceConfigList.front ().a3Offset = -30;
1582 targetConfigList.front ().a3Offset = 30;
1583 expectedTime.clear ();
1584 expectedTime << 200 << 440 << 680 << 920;
1585 expectedRsrp.clear ();
1586 expectedRsrp << 55 << 55 << 55 << 55;
1588 sourceConfigList, targetConfigList,
1589 expectedTime, expectedRsrp,
1596 expectedTime.clear ();
1597 expectedTime << 200 << 440 << 680 << 920;
1598 expectedRsrp.clear ();
1599 expectedRsrp << 55 << 55 << 55 << 55;
1601 sourceConfigList, targetConfigList,
1602 expectedTime, expectedRsrp,
1608 sourceConfigList.front ().threshold2.range = 52;
1610 targetConfigList.front ().threshold2.range = 56;
1611 expectedTime.clear ();
1612 expectedRsrp.clear ();
1614 sourceConfigList, targetConfigList,
1615 expectedTime, expectedRsrp,
1622 sourceConfigList.front ().a3Offset = 1;
1623 sourceConfigList.front ().threshold1.range = 0;
1624 sourceConfigList.front ().threshold2.range = 0;
1626 targetConfigList.front ().a3Offset = 1;
1627 targetConfigList.front ().threshold1.range = 0;
1628 targetConfigList.front ().threshold2.range = 0;
1631 sourceConfigList.front ().timeToTrigger = 1024;
1632 targetConfigList.front ().timeToTrigger = 100;
1633 expectedTime.clear ();
1634 expectedTime << 1300 << 1540 << 1780;
1635 expectedRsrp.clear ();
1636 expectedRsrp << 53 << 53 << 53;
1638 sourceConfigList, targetConfigList,
1639 expectedTime, expectedRsrp,
1644 sourceConfigList.front ().timeToTrigger = 1024;
1645 targetConfigList.front ().timeToTrigger = 640;
1646 expectedTime.clear ();
1647 expectedTime << 1224 << 1464 << 1704 << 1944 << 2840 << 3080 << 3320 << 3560 << 3800 << 4040;
1648 expectedRsrp.clear ();
1649 expectedRsrp << 55 << 55 << 55 << 55 << 53 << 53 << 53 << 53 << 53 << 53;
1651 sourceConfigList, targetConfigList,
1652 expectedTime, expectedRsrp,
1667 std::list<LteRrcSap::ReportConfigEutra> sourceConfigList,
1668 std::list<LteRrcSap::ReportConfigEutra> targetConfigList,
1669 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp,
1672 m_sourceConfigList (sourceConfigList),
1673 m_targetConfigList (targetConfigList),
1674 m_expectedTime (expectedTime),
1675 m_expectedRsrp (expectedRsrp),
1676 m_duration (duration)
1683 NS_FATAL_ERROR (
"Vectors of expected results are not of the same size");
1704 lteHelper->SetEpcHelper (epcHelper);
1705 lteHelper->SetAttribute (
"PathlossModel",
1706 StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
1707 lteHelper->SetAttribute (
"UseIdealRrc",
BooleanValue (
true));
1725 positionAlloc->Add (
Vector (0.0, 0.0, 0.0));
1726 positionAlloc->Add (
Vector (900.0, 0.0, 0.0));
1727 positionAlloc->Add (
Vector (400.0, 0.0, 0.0));
1735 Ptr<Node> pgw = epcHelper->GetPgwNode ();
1739 remoteHostContainer.
Create (1);
1742 internet.
Install (remoteHostContainer);
1751 ipv4h.
SetBase (
"1.0.0.0",
"255.0.0.0");
1757 remoteHostStaticRouting->AddNetworkRouteTo (
Ipv4Address (
"7.0.0.0"),
Ipv4Mask (
"255.0.0.0"), 1);
1770 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
1771 ueDevs = lteHelper->InstallUeDevice (ueNodes);
1775 std::list<LteRrcSap::ReportConfigEutra>::const_iterator itReportConfig;
1782 measId = enbRrc1->AddUeMeasReportConfig (*itReportConfig);
1789 measId = enbRrc2->AddUeMeasReportConfig (*itReportConfig);
1799 for (uint32_t u = 0; u < ueNodes.
GetN (); ++u)
1804 ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
1808 lteHelper->Attach (ueDevs.
Get (0), enbDevs.
Get (0));
1811 lteHelper->AddX2Interface (enbNodes);
1814 Config::Connect (
"/NodeList/1/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1819 Config::Connect (
"/NodeList/2/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1825 ueDevs.
Get (0), enbDevs.
Get (0), enbDevs.
Get (1));
1840 "Reporting should have occurred at " <<
m_itExpectedTime->GetSeconds () <<
"s");
1847 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
1853 bool isCorrectMeasId;
1859 else if (cellId == 2)
1869 if (isCorrectMeasId)
1874 <<
" rsrp=" << (uint16_t) measResults.
rsrpResult
1876 <<
" rsrq=" << (uint16_t) measResults.
rsrqResult
1883 "Unexpected report content");
1888 "Unexpected report content");
1889 std::list<LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
1894 "Report contains cgi-info, which is not supported");
1896 "Report does not contain measured RSRP result");
1898 "Report does not contain measured RSRQ result");
1899 NS_LOG_DEBUG (
this <<
" Neighbour cellId=" << it->physCellId
1900 <<
" rsrp=" << (uint16_t) it->rsrpResult
1902 <<
" rsrq=" << (uint16_t) it->rsrqResult
1910 "Reporting should not have occurred at "
1922 uint16_t observedRsrp = measResults.
rsrpResult;
1927 "Reporting should not have occurred at this time");
1929 "The RSRP observed differs with the reference RSRP");
std::list< LteRrcSap::ReportConfigEutra > m_sourceConfigList
The list of active report triggering configuration for the source eNodeB.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration...
RSRP is used for the threshold.
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)
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...
holds a vector of std::pair of Ptr and interface index.
double m_rsrpDbmUeServingCell
hold variables of type string
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition...
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
NetDeviceContainer Install(NodeContainer c)
#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...
a class to represent an Ipv4 address mask
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
enum ns3::LteRrcSap::ReportConfigEutra::@70 eventId
Choice of E-UTRA event triggered reporting criteria.
void RecvMeasurementReportCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
LteUeMeasurementsPiecewiseTestSuite2()
std::list< MeasResultEutra > measResultListEutra
enum ns3::LteRrcSap::ReportConfigEutra::@69 triggerType
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Build bound Callbacks which take varying numbers of arguments, and potentially returning a value...
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
Specifies criteria for triggering of an E-UTRA measurement reporting event.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
#define NS_ASSERT(condition)
static void Run(void)
Run the simulation until one of:
aggregate IP/TCP/UDP functionality to existing Nodes.
Test that UE Measurements (see 36.214) calculation works fine in a multi-cell interference scenario...
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...
Build a set of PointToPointNetDevice objects.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
virtual ~LteUeMeasurementsPiecewiseTestCase2()
void Connect(std::string path, const CallbackBase &cb)
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
NS_LOG_COMPONENT_DEFINE("LteUeMeasurementsTest")
static LteUeMeasurementsPiecewiseTestSuite2 lteUeMeasurementsPiecewiseTestSuite2
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
std::set< uint8_t > m_expectedSourceCellMeasId
The list of measurement identities being tested in the source cell.
uint8_t m_expectedMeasId
The measurement identity being tested.
#define NS_FATAL_ERROR(msg)
fatal error handling
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
virtual ~LteUeMeasurementsHandoverTestCase()
uint32_t GetN(void) const
Get the number of Ptr stored in this container.
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 ...
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
Class for representing data rates.
Keep track of the current position and velocity of an object.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
This class contains the specification of EPS Bearers.
double m_rsrqDbUeServingCell
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
static const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
hold variables of type 'enum'
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
hold objects of type ns3::Time
LteUeMeasurementsHandoverTestSuite()
static LteUeMeasurementsHandoverTestSuite lteUeMeasurementsHandoverTestSuite
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
Hold an unsigned integer type.
static LteUeMeasurementsTestSuite lteUeMeasurementsTestSuite
double m_rsrpDbmUeNeighborCell
holds a vector of ns3::NetDevice pointers
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
Ptr< MobilityModel > m_ueMobility
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
std::list< LteRrcSap::ReportConfigEutra > m_targetConfigList
The list of active report triggering configuration for the target eNodeB.
LteUeMeasurementsPiecewiseTestSuite1()
void ReportUeMeasurements(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
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...
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
Access to the Ipv4 forwarding table, interfaces, and configuration.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
Event A2: Serving becomes worse than absolute threshold.
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in piecewise configuration and 24...
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase2...
void SetDefault(std::string name, const AttributeValue &value)
bool reportOnLeave
Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving c...
keep track of a set of node pointers.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
uint8_t m_expectedMeasId
The measurement identity being tested.
std::set< uint8_t > m_expectedTargetCellMeasId
The list of measurement identities being tested in the target cell.
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
LteUeMeasurementsPiecewiseTestCase1(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
bool haveMeasResultNeighCells
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
uint8_t range
Value range used in RSRP/RSRQ threshold.
static Time Now(void)
Return the "current simulation time".
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
LteUeMeasurementsTestSuite()
void SetPosition(const Vector &position)
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
enum ns3::LteRrcSap::ReportConfigEutra::@72 triggerQuantity
The quantities used to evaluate the triggering condition for the event, see 3GPP TS 36...
int8_t a3Offset
Offset value for Event A3. An integer between -30 and 30. The actual value is (value * 0...
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
Time m_duration
Duration of simulation.
Helper class used to assign positions and mobility models to nodes.
Ipv4 addresses are stored in host order in this class.
static uint8_t Dbm2RsrpRange(double dbm)
convert an RSRP value in dBm to the corresponding range as per 3GPP TS 36.133 section 9...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
Event A3: Neighbour becomes amount of offset better than PCell.
LteUeMeasurementsTestCase(std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2)
Helper class that adds ns3::Ipv4StaticRouting objects.
double m_rsrqDbUeNeighborCell
hold objects of type ns3::DataRate
enum ns3::LteRrcSap::ThresholdEutra::@68 choice
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
Testing UE measurements in LTE with simulation of 1 eNodeB and 1 UE in piecewise configuration and 12...
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase1...
#define NS_LOG_DEBUG(msg)
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
enum ns3::LteRrcSap::ReportConfigEutra::@74 reportInterval
Indicates the interval between periodical reports.
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
Event A4: Neighbour becomes better than absolute threshold.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
Ptr< MobilityModel > m_ueMobility
std::string GetName(void) const
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Reference Signal Received Power.
virtual ~LteUeMeasurementsPiecewiseTestCase1()
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void RecvMeasurementReport(uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsHandoverTestCase.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
static uint8_t Db2RsrqRange(double db)
convert an RSRQ value in dB to the corresponding range as per 3GPP TS 36.133 section 9...
Hold a floating point type.
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...
virtual ~LteUeMeasurementsTestCase()
The eNodeB device implementation.
Ptr< T > GetObject(void) const
LteUeMeasurementsPiecewiseTestCase2(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
int64_t GetMilliSeconds(void) const
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
The LtePhy models the physical layer of LTE.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
#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.
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 ...
void ReportUeMeasurementsCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
Event A1: Serving becomes better than absolute threshold.
ThresholdEutra threshold2
Threshold for event A5.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
The LteUeNetDevice class implements the UE net device.
static LteUeMeasurementsPiecewiseTestSuite1 lteUeMeasurementsPiecewiseTestSuite1