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> 54 #include <ns3/lte-common.h> 64 std::string path, uint16_t rnti, uint16_t cellId,
65 double rsrp,
double rsrq,
bool servingCell, uint8_t componentCarrierId)
72 std::string path, uint64_t imsi, uint16_t cellId,
84 :
TestSuite (
"lte-ue-measurements", SYSTEM)
115 double d1,
double d2,
123 m_rsrpDbmUeServingCell (rsrpDbmUe1),
124 m_rsrpDbmUeNeighborCell (rsrpDbmUe2),
125 m_rsrqDbUeServingCell (rsrqDbUe1),
126 m_rsrqDbUeNeighborCell (rsrqDbUe2)
128 NS_LOG_INFO (
"Test UE Measurements d1 = " << d1 <<
" m. and d2 = " << d2 <<
" m.");
171 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
173 positionAlloc->
Add (Vector (0.0,
m_d1, 0.0));
174 positionAlloc->
Add (Vector (
m_d2, 0.0, 0.0));
176 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
177 mobility.SetPositionAllocator (positionAlloc);
191 lteHelper->
Attach (ueDevs1, enbDevs.
Get (0));
192 lteHelper->
Attach (ueDevs2, enbDevs.
Get (1));
201 Config::Connect (
"/NodeList/2/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements",
203 Config::Connect (
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
206 Config::Connect (
"/NodeList/3/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements",
208 Config::Connect (
"/NodeList/1/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
212 Simulator::Stop (
Seconds (0.800));
215 Simulator::Destroy ();
221 double rsrp,
double rsrq,
251 NS_LOG_DEBUG (
this <<
"Serving Cell: received IMSI " << imsi <<
" CellId " << cellId <<
" RNTI " << rnti
265 NS_LOG_DEBUG (
this <<
"Neighbor cell: received IMSI " << imsi <<
" CellId " << cellId <<
" RNTI " << rnti
288 operator<< (std::vector<Time>& v,
const uint64_t& ms)
298 std::vector<uint8_t>&
299 operator<< (std::vector<uint8_t>& v,
const uint8_t& range)
311 :
TestSuite (
"lte-ue-measurements-piecewise-1", SYSTEM)
313 std::vector<Time> expectedTime;
314 std::vector<uint8_t> expectedRsrp;
320 config.
triggerType = LteRrcSap::ReportConfigEutra::EVENT;
321 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
326 expectedTime.clear ();
327 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1040 << 1160 << 1280
328 << 1400 << 1520 << 1640 << 1760 << 1880 << 2000 << 2120;
329 expectedRsrp.clear ();
330 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57
331 << 51 << 51 << 47 << 47 << 51 << 57 << 57;
333 config, expectedTime, expectedRsrp),
334 TestCase::EXTENSIVE);
338 expectedTime.clear ();
339 expectedTime << 200 << 320 << 440 << 560 << 680 << 1000 << 1120 << 1240 << 1360 << 2000
341 expectedRsrp.clear ();
342 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 66 << 66 << 57 << 57 << 57
345 config, expectedTime, expectedRsrp),
346 TestCase::EXTENSIVE);
350 expectedTime.clear ();
351 expectedTime << 264 << 384 << 504 << 624 << 744 << 1064 << 1184 << 1304 << 1424 << 2064
353 expectedRsrp.clear ();
354 expectedRsrp << 67 << 67 << 57 << 66 << 66 << 66 << 66 << 57 << 51 << 57
357 config, expectedTime, expectedRsrp),
362 expectedTime.clear ();
363 expectedTime << 328 << 448 << 568 << 688 << 808 << 1128 << 1248 << 1368 << 1488 << 2128;
364 expectedRsrp.clear ();
365 expectedRsrp << 67 << 57 << 57 << 66 << 47 << 66 << 57 << 57 << 51 << 57;
367 config, expectedTime, expectedRsrp),
368 TestCase::EXTENSIVE);
372 expectedTime.clear ();
373 expectedTime << 456 << 576 << 696 << 816 << 936 << 1056 << 1176 << 1296 << 1416 << 1536;
374 expectedRsrp.clear ();
375 expectedRsrp << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57 << 51 << 51;
377 config, expectedTime, expectedRsrp),
378 TestCase::EXTENSIVE);
383 expectedTime.clear ();
384 expectedTime << 200 << 320 << 440 << 560 << 680 << 1000 << 1120 << 1240 << 1360 << 1480
386 expectedRsrp.clear ();
387 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 66 << 66 << 57 << 57 << 51
390 config, expectedTime, expectedRsrp),
396 expectedTime.clear ();
397 expectedRsrp.clear ();
399 config, expectedTime, expectedRsrp),
400 TestCase::TAKES_FOREVER);
405 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
407 expectedTime.clear ();
408 expectedRsrp.clear ();
410 config, expectedTime, expectedRsrp),
411 TestCase::TAKES_FOREVER);
415 expectedTime.clear ();
416 expectedTime << 800 << 920 << 1400 << 1520 << 1640 << 1760 << 1880;
417 expectedRsrp.clear ();
418 expectedRsrp << 47 << 47 << 51 << 51 << 47 << 47 << 51;
420 config, expectedTime, expectedRsrp),
425 expectedTime.clear ();
426 expectedTime << 864 << 984 << 1464 << 1584 << 1704 << 1824 << 1944;
427 expectedRsrp.clear ();
428 expectedRsrp << 47 << 47 << 51 << 51 << 47 << 51 << 51;
430 config, expectedTime, expectedRsrp),
431 TestCase::EXTENSIVE);
435 expectedTime.clear ();
436 expectedTime << 928 << 1048 << 1528 << 1648 << 1768 << 1888 << 2008;
437 expectedRsrp.clear ();
438 expectedRsrp << 47 << 66 << 51 << 47 << 47 << 51 << 57;
440 config, expectedTime, expectedRsrp),
441 TestCase::TAKES_FOREVER);
445 expectedTime.clear ();
446 expectedTime << 1656 << 1776 << 1896 << 2016 << 2136;
447 expectedRsrp.clear ();
448 expectedRsrp << 47 << 47 << 51 << 57 << 57;
450 config, expectedTime, expectedRsrp),
456 expectedTime.clear ();
457 expectedTime << 800 << 920 << 1600 << 1720 << 1840 << 1960 << 2080;
458 expectedRsrp.clear ();
459 expectedRsrp << 47 << 47 << 47 << 47 << 51 << 51 << 57;
461 config, expectedTime, expectedRsrp),
462 TestCase::EXTENSIVE);
467 expectedTime.clear ();
468 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1040 << 1160 << 1280
469 << 1400 << 1520 << 1640 << 1760 << 1880 << 2000 << 2120;
470 expectedRsrp.clear ();
471 expectedRsrp << 67 << 67 << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57
472 << 51 << 51 << 47 << 47 << 51 << 57 << 57;
474 config, expectedTime, expectedRsrp),
475 TestCase::EXTENSIVE);
484 expectedTime.clear ();
485 expectedRsrp.clear ();
489 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
492 config, expectedTime, expectedRsrp),
493 TestCase::EXTENSIVE);
497 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
500 config, expectedTime, expectedRsrp),
501 TestCase::EXTENSIVE);
505 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
508 config, expectedTime, expectedRsrp),
509 TestCase::EXTENSIVE);
522 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp)
525 m_expectedTime (expectedTime),
526 m_expectedRsrp (expectedRsrp)
533 NS_FATAL_ERROR (
"Vectors of expected results are not of the same size");
554 StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
578 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
579 positionAlloc->
Add (Vector (100.0, 0.0, 0.0));
581 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
582 mobility.SetPositionAllocator (positionAlloc);
596 EnumValue (FfMacScheduler::PUSCH_UL_CQI));
613 Config::Connect (
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
648 Simulator::Stop (
Seconds (2.201));
650 Simulator::Destroy ();
660 "Reporting should have occurred at " <<
m_itExpectedTime->GetSeconds () <<
"s");
667 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
679 <<
" (" << EutranMeasurementMapping::RsrpRange2Dbm (measResults.
rsrpResult) <<
" dBm)" 680 <<
" rsrq=" << (uint16_t) measResults.
rsrqResult 681 <<
" (" << EutranMeasurementMapping::RsrqRange2Db (measResults.
rsrqResult) <<
" dB)");
683 "Report should not have neighboring cells information");
685 "Unexpected report size");
689 "Reporting should not have occurred at " 701 uint16_t observedRsrp = measResults.
rsrpResult;
706 "Reporting should not have occurred at this time");
708 "The RSRP observed differs with the reference RSRP");
751 :
TestSuite (
"lte-ue-measurements-piecewise-2", SYSTEM)
753 std::vector<Time> expectedTime;
754 std::vector<uint8_t> expectedRsrp;
765 config.
triggerType = LteRrcSap::ReportConfigEutra::EVENT;
766 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
771 expectedTime.clear ();
772 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
773 expectedRsrp.clear ();
774 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
776 config, expectedTime, expectedRsrp),
777 TestCase::EXTENSIVE);
781 expectedTime.clear ();
782 expectedTime << 200 << 440 << 680 << 1000 << 1240 << 2000;
783 expectedRsrp.clear ();
784 expectedRsrp << 73 << 63 << 72 << 72 << 59 << 59;
786 config, expectedTime, expectedRsrp),
787 TestCase::TAKES_FOREVER);
791 expectedTime.clear ();
792 expectedTime << 200 << 440 << 680 << 1000 << 1240 << 1480 << 2200;
793 expectedRsrp.clear ();
794 expectedRsrp << 73 << 63 << 72 << 72 << 59 << 56 << 72;
796 config, expectedTime, expectedRsrp),
797 TestCase::EXTENSIVE);
802 expectedTime.clear ();
803 expectedRsrp.clear ();
805 config, expectedTime, expectedRsrp),
806 TestCase::TAKES_FOREVER);
811 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
813 expectedTime.clear ();
814 expectedRsrp.clear ();
816 config, expectedTime, expectedRsrp),
817 TestCase::TAKES_FOREVER);
821 expectedTime.clear ();
822 expectedTime << 800 << 1400 << 1640 << 1880;
823 expectedRsrp.clear ();
824 expectedRsrp << 52 << 56 << 52 << 56;
826 config, expectedTime, expectedRsrp),
827 TestCase::TAKES_FOREVER);
831 expectedTime.clear ();
832 expectedTime << 800 << 1600 << 1840 << 2080;
833 expectedRsrp.clear ();
834 expectedRsrp << 52 << 52 << 56 << 59;
836 config, expectedTime, expectedRsrp),
837 TestCase::EXTENSIVE);
842 expectedTime.clear ();
843 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
844 expectedRsrp.clear ();
845 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
847 config, expectedTime, expectedRsrp),
848 TestCase::TAKES_FOREVER);
853 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
856 expectedTime.clear ();
857 expectedTime << 800 << 1600;
858 expectedRsrp.clear ();
859 expectedRsrp << 52 << 52;
861 config, expectedTime, expectedRsrp),
866 expectedTime.clear ();
867 expectedTime << 800 << 1400 << 1640 << 1880;
868 expectedRsrp.clear ();
869 expectedRsrp << 52 << 56 << 52 << 56;
871 config, expectedTime, expectedRsrp),
872 TestCase::EXTENSIVE);
876 expectedTime.clear ();
877 expectedTime << 960 << 1560 << 1800 << 2040;
878 expectedRsrp.clear ();
879 expectedRsrp << 52 << 56 << 56 << 59;
881 config, expectedTime, expectedRsrp),
882 TestCase::EXTENSIVE);
886 expectedTime.clear ();
887 expectedTime << 1720 << 1960 << 2200;
888 expectedRsrp.clear ();
889 expectedRsrp << 52 << 56 << 72;
891 config, expectedTime, expectedRsrp),
898 expectedTime.clear ();
899 expectedTime << 800 << 1000 << 1600 << 1840 << 2080 << 2200;
900 expectedRsrp.clear ();
901 expectedRsrp << 52 << 72 << 52 << 56 << 59 << 72;
903 config, expectedTime, expectedRsrp),
910 expectedTime.clear ();
911 expectedTime << 400 << 800 << 1200 << 1440 << 1680 << 1920 << 2160;
912 expectedRsrp.clear ();
913 expectedRsrp << 63 << 52 << 59 << 56 << 52 << 56 << 59;
915 config, expectedTime, expectedRsrp),
916 TestCase::EXTENSIVE);
921 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
924 expectedTime.clear ();
925 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
926 expectedRsrp.clear ();
927 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
929 config, expectedTime, expectedRsrp),
934 expectedTime.clear ();
935 expectedTime << 400 << 800 << 1400 << 1640 << 1880;
936 expectedRsrp.clear ();
937 expectedRsrp << 63 << 52 << 56 << 52 << 56;
939 config, expectedTime, expectedRsrp),
940 TestCase::EXTENSIVE);
944 expectedTime.clear ();
945 expectedTime << 560 << 960 << 1560 << 1800 << 2040;
946 expectedRsrp.clear ();
947 expectedRsrp << 63 << 52 << 56 << 56 << 59;
949 config, expectedTime, expectedRsrp),
954 expectedTime.clear ();
955 expectedTime << 1720 << 1960 << 2200;
956 expectedRsrp.clear ();
957 expectedRsrp << 52 << 56 << 72;
959 config, expectedTime, expectedRsrp),
960 TestCase::TAKES_FOREVER);
965 expectedTime.clear ();
966 expectedTime << 400 << 800 << 1600 << 1840 << 2080;
967 expectedRsrp.clear ();
968 expectedRsrp << 63 << 52 << 52 << 56 << 59;
970 config, expectedTime, expectedRsrp),
976 expectedTime.clear ();
977 expectedRsrp.clear ();
979 config, expectedTime, expectedRsrp),
980 TestCase::TAKES_FOREVER);
985 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
988 expectedTime.clear ();
989 expectedRsrp.clear ();
991 config, expectedTime, expectedRsrp),
992 TestCase::EXTENSIVE);
997 config, expectedTime, expectedRsrp),
998 TestCase::TAKES_FOREVER);
1003 config, expectedTime, expectedRsrp),
1004 TestCase::TAKES_FOREVER);
1009 expectedTime.clear ();
1010 expectedTime << 800 << 1400 << 1640 << 1880;
1011 expectedRsrp.clear ();
1012 expectedRsrp << 52 << 56 << 52 << 56;
1014 config, expectedTime, expectedRsrp),
1015 TestCase::EXTENSIVE);
1019 expectedTime.clear ();
1020 expectedTime << 800 << 1400 << 1640 << 1880;
1021 expectedRsrp.clear ();
1022 expectedRsrp << 52 << 56 << 52 << 56;
1024 config, expectedTime, expectedRsrp),
1025 TestCase::EXTENSIVE);
1029 expectedTime.clear ();
1030 expectedTime << 960 << 1560 << 1800 << 2040;
1031 expectedRsrp.clear ();
1032 expectedRsrp << 52 << 56 << 56 << 59;
1034 config, expectedTime, expectedRsrp),
1035 TestCase::TAKES_FOREVER);
1039 expectedTime.clear ();
1040 expectedTime << 1720 << 1960 << 2200;
1041 expectedRsrp.clear ();
1042 expectedRsrp << 52 << 56 << 72;
1044 config, expectedTime, expectedRsrp),
1050 expectedTime.clear ();
1051 expectedTime << 800 << 1600 << 1840 << 2080;
1052 expectedRsrp.clear ();
1053 expectedRsrp << 52 << 52 << 56 << 59;
1055 config, expectedTime, expectedRsrp),
1061 expectedTime.clear ();
1062 expectedRsrp.clear ();
1064 config, expectedTime, expectedRsrp),
1065 TestCase::TAKES_FOREVER);
1070 expectedTime.clear ();
1071 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1072 expectedRsrp.clear ();
1073 expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
1075 config, expectedTime, expectedRsrp),
1076 TestCase::EXTENSIVE);
1080 expectedTime.clear ();
1081 expectedTime << 400 << 800 << 1400 << 1640 << 1880;
1082 expectedRsrp.clear ();
1083 expectedRsrp << 63 << 52 << 56 << 52 << 56;
1085 config, expectedTime, expectedRsrp),
1086 TestCase::TAKES_FOREVER);
1090 expectedTime.clear ();
1091 expectedRsrp.clear ();
1093 config, expectedTime, expectedRsrp),
1094 TestCase::EXTENSIVE);
1107 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp)
1110 m_expectedTime (expectedTime),
1111 m_expectedRsrp (expectedRsrp)
1118 NS_FATAL_ERROR (
"Vectors of expected results are not of the same size");
1139 StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
1163 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1164 positionAlloc->
Add (Vector (600.0, 0.0, 0.0));
1165 positionAlloc->
Add (Vector (50.0, 0.0, 0.0));
1167 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1168 mobility.SetPositionAllocator (positionAlloc);
1182 EnumValue (FfMacScheduler::PUSCH_UL_CQI));
1203 Config::Connect (
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1238 Simulator::Stop (
Seconds (2.201));
1240 Simulator::Destroy ();
1250 "Reporting should have occurred at " <<
m_itExpectedTime->GetSeconds () <<
"s");
1257 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
1269 <<
" rsrp=" << (uint16_t) measResults.
rsrpResult 1270 <<
" (" << EutranMeasurementMapping::RsrpRange2Dbm (measResults.
rsrpResult) <<
" dBm)" 1271 <<
" rsrq=" << (uint16_t) measResults.
rsrqResult 1272 <<
" (" << EutranMeasurementMapping::RsrqRange2Db (measResults.
rsrqResult) <<
" dB)");
1278 "Unexpected report content");
1283 "Unexpected report content");
1284 std::list<LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
1288 "Report contains cgi-info, which is not supported");
1290 "Report does not contain measured RSRP result");
1292 "Report does not contain measured RSRQ result");
1293 NS_LOG_DEBUG (
this <<
" Neighbour cellId=" << it->physCellId
1294 <<
" rsrp=" << (uint16_t) it->rsrpResult
1295 <<
" (" << EutranMeasurementMapping::RsrpRange2Dbm (it->rsrpResult) <<
" dBm)" 1296 <<
" rsrq=" << (uint16_t) it->rsrqResult
1297 <<
" (" << EutranMeasurementMapping::RsrqRange2Db (it->rsrqResult) <<
" dB)");
1304 "Reporting should not have occurred at " 1316 uint16_t observedRsrp = measResults.
rsrpResult;
1321 "Reporting should not have occurred at this time");
1323 "The RSRP observed differs with the reference RSRP");
1367 :
TestSuite (
"lte-ue-measurements-piecewise-3", SYSTEM)
1369 std::vector<Time> expectedTime;
1384 config.
triggerType = LteRrcSap::ReportConfigEutra::EVENT;
1385 config.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1390 expectedTime.clear ();
1391 expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1394 config, expectedTime),TestCase::QUICK);
1406 std::vector<Time> expectedTime)
1409 m_expectedTime (expectedTime)
1430 StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
1456 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1457 positionAlloc->
Add (Vector (200.0, 0.0, 0.0));
1458 positionAlloc->
Add (Vector (1000700.0, 0.0, 0.0));
1459 positionAlloc->
Add (Vector (50.0, 0.0, 0.0));
1461 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1462 mobility.SetPositionAllocator (positionAlloc);
1476 EnumValue (FfMacScheduler::PUSCH_UL_CQI));
1499 Config::Connect (
"/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1513 Simulator::Stop (
Seconds (2.201));
1515 Simulator::Destroy ();
1525 "Reporting should have occurred at " <<
m_itExpectedTime->GetSeconds () <<
"s");
1530 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
1542 <<
" rsrp=" << (uint16_t) measResults.
rsrpResult 1543 <<
" (" << EutranMeasurementMapping::RsrpRange2Dbm (measResults.
rsrpResult) <<
" dBm)" 1544 <<
" rsrq=" << (uint16_t) measResults.
rsrqResult 1545 <<
" (" << EutranMeasurementMapping::RsrqRange2Db (measResults.
rsrqResult) <<
" dB)");
1551 "Unexpected report content");
1556 "Unexpected report content");
1557 std::list<LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
1561 NS_ASSERT (it.physCellId == 2 || it.physCellId == 3);
1563 "Report contains cgi-info, which is not supported");
1565 "Report does not contain measured RSRP result");
1567 "Report does not contain measured RSRQ result");
1568 NS_LOG_DEBUG (
this <<
" Neighbour cellId=" << it.physCellId
1569 <<
" rsrp=" << (uint16_t) it.rsrpResult
1570 <<
" (" << EutranMeasurementMapping::RsrpRange2Dbm (it.rsrpResult) <<
" dBm)" 1571 <<
" rsrq=" << (uint16_t) it.rsrqResult
1572 <<
" (" << EutranMeasurementMapping::RsrqRange2Db (it.rsrqResult) <<
" dB)");
1580 "Reporting should not have occurred at " 1591 "Reporting should not have occurred at this time");
1614 :
TestSuite (
"lte-ue-measurements-handover", SYSTEM)
1616 std::list<LteRrcSap::ReportConfigEutra> sourceConfigList;
1617 std::list<LteRrcSap::ReportConfigEutra> targetConfigList;
1618 std::vector<Time> expectedTime;
1619 std::vector<uint8_t> expectedRsrp;
1622 sourceConfig.
triggerType = LteRrcSap::ReportConfigEutra::EVENT;
1623 sourceConfig.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1624 sourceConfig.
threshold1.
choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRP;
1627 sourceConfig.
reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1628 sourceConfigList.push_back (sourceConfig);
1631 targetConfig.
triggerType = LteRrcSap::ReportConfigEutra::EVENT;
1632 targetConfig.
eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1633 targetConfig.
threshold1.
choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRP;
1636 targetConfig.
reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1637 targetConfigList.push_back (targetConfig);
1642 sourceConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS480;
1643 targetConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1644 expectedTime.clear ();
1645 expectedTime << 200 << 680 << 1200 << 1440 << 1680 << 1920;
1646 expectedRsrp.clear ();
1647 expectedRsrp << 55 << 55 << 53 << 53 << 53 << 53;
1649 sourceConfigList, targetConfigList,
1650 expectedTime, expectedRsrp,
1652 TestCase::TAKES_FOREVER);
1655 sourceConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS120;
1656 targetConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS640;
1657 expectedTime.clear ();
1658 expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1200 << 1840;
1659 expectedRsrp.clear ();
1660 expectedRsrp << 55 << 55 << 55 << 55 << 55 << 55 << 55 << 53 << 53;
1662 sourceConfigList, targetConfigList,
1663 expectedTime, expectedRsrp,
1669 sourceConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1670 targetConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1671 sourceConfigList.front ().threshold1.range = 54;
1672 sourceConfigList.front ().threshold2.range = 54;
1673 sourceConfigList.front ().a3Offset = 1;
1674 targetConfigList.front ().threshold1.range = 54;
1675 targetConfigList.front ().threshold2.range = 54;
1676 targetConfigList.front ().a3Offset = 1;
1679 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1680 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1681 expectedTime.clear ();
1682 expectedTime << 200 << 440 << 680 << 920 << 1200 << 1440 << 1680 << 1920;
1683 expectedRsrp.clear ();
1684 expectedRsrp << 55 << 55 << 55 << 55 << 53 << 53 << 53 << 53;
1686 sourceConfigList, targetConfigList,
1687 expectedTime, expectedRsrp,
1689 TestCase::EXTENSIVE);
1692 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1693 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1694 expectedTime.clear ();
1695 expectedRsrp.clear ();
1697 sourceConfigList, targetConfigList,
1698 expectedTime, expectedRsrp,
1700 TestCase::TAKES_FOREVER);
1703 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1704 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1705 expectedTime.clear ();
1706 expectedTime << 1200 << 1440 << 1680 << 1920;
1707 expectedRsrp.clear ();
1708 expectedRsrp << 53 << 53 << 53 << 53;
1710 sourceConfigList, targetConfigList,
1711 expectedTime, expectedRsrp,
1713 TestCase::TAKES_FOREVER);
1716 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1717 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1718 expectedTime.clear ();
1719 expectedTime << 1200 << 1440 << 1680 << 1920;
1720 expectedRsrp.clear ();
1721 expectedRsrp << 53 << 53 << 53 << 53;
1723 sourceConfigList, targetConfigList,
1724 expectedTime, expectedRsrp,
1729 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1730 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1731 expectedTime.clear ();
1732 expectedTime << 1200 << 1440 << 1680 << 1920;
1733 expectedRsrp.clear ();
1734 expectedRsrp << 53 << 53 << 53 << 53;
1736 sourceConfigList, targetConfigList,
1737 expectedTime, expectedRsrp,
1739 TestCase::EXTENSIVE);
1742 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1743 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1744 expectedTime.clear ();
1745 expectedTime << 1200 << 1440 << 1680 << 1920;
1746 expectedRsrp.clear ();
1747 expectedRsrp << 53 << 53 << 53 << 53;
1749 sourceConfigList, targetConfigList,
1750 expectedTime, expectedRsrp,
1752 TestCase::TAKES_FOREVER);
1755 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1756 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
1757 expectedTime.clear ();
1758 expectedTime << 1200 << 1440 << 1680 << 1920;
1759 expectedRsrp.clear ();
1760 expectedRsrp << 53 << 53 << 53 << 53;
1762 sourceConfigList, targetConfigList,
1763 expectedTime, expectedRsrp,
1765 TestCase::TAKES_FOREVER);
1768 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
1769 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1770 expectedTime.clear ();
1771 expectedTime << 1200 << 1440 << 1680 << 1920;
1772 expectedRsrp.clear ();
1773 expectedRsrp << 53 << 53 << 53 << 53;
1775 sourceConfigList, targetConfigList,
1776 expectedTime, expectedRsrp,
1778 TestCase::EXTENSIVE);
1782 sourceConfigList.front ().threshold1.range = 52;
1783 targetConfigList.front ().threshold1.range = 56;
1786 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1787 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1788 expectedTime.clear ();
1789 expectedTime << 200 << 440 << 680 << 920;
1790 expectedRsrp.clear ();
1791 expectedRsrp << 55 << 55 << 55 << 55;
1793 sourceConfigList, targetConfigList,
1794 expectedTime, expectedRsrp,
1796 TestCase::EXTENSIVE);
1799 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1800 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1801 expectedTime.clear ();
1802 expectedTime << 1200 << 1440 << 1680 << 1920;
1803 expectedRsrp.clear ();
1804 expectedRsrp << 53 << 53 << 53 << 53;
1806 sourceConfigList, targetConfigList,
1807 expectedTime, expectedRsrp,
1812 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1813 sourceConfigList.front ().a3Offset = -30;
1814 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1815 targetConfigList.front ().a3Offset = 30;
1816 expectedTime.clear ();
1817 expectedTime << 200 << 440 << 680 << 920;
1818 expectedRsrp.clear ();
1819 expectedRsrp << 55 << 55 << 55 << 55;
1821 sourceConfigList, targetConfigList,
1822 expectedTime, expectedRsrp,
1827 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1828 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1829 expectedTime.clear ();
1830 expectedTime << 200 << 440 << 680 << 920;
1831 expectedRsrp.clear ();
1832 expectedRsrp << 55 << 55 << 55 << 55;
1834 sourceConfigList, targetConfigList,
1835 expectedTime, expectedRsrp,
1837 TestCase::EXTENSIVE);
1840 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
1841 sourceConfigList.front ().threshold2.range = 52;
1842 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
1843 targetConfigList.front ().threshold2.range = 56;
1844 expectedTime.clear ();
1845 expectedRsrp.clear ();
1847 sourceConfigList, targetConfigList,
1848 expectedTime, expectedRsrp,
1850 TestCase::EXTENSIVE);
1854 sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1855 sourceConfigList.front ().a3Offset = 1;
1856 sourceConfigList.front ().threshold1.range = 0;
1857 sourceConfigList.front ().threshold2.range = 0;
1858 targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1859 targetConfigList.front ().a3Offset = 1;
1860 targetConfigList.front ().threshold1.range = 0;
1861 targetConfigList.front ().threshold2.range = 0;
1864 sourceConfigList.front ().timeToTrigger = 1024;
1865 targetConfigList.front ().timeToTrigger = 100;
1866 expectedTime.clear ();
1867 expectedTime << 1300 << 1540 << 1780;
1868 expectedRsrp.clear ();
1869 expectedRsrp << 53 << 53 << 53;
1871 sourceConfigList, targetConfigList,
1872 expectedTime, expectedRsrp,
1877 sourceConfigList.front ().timeToTrigger = 1024;
1878 targetConfigList.front ().timeToTrigger = 640;
1879 expectedTime.clear ();
1880 expectedTime << 1224 << 1464 << 1704 << 1944 << 2840 << 3080 << 3320 << 3560 << 3800 << 4040;
1881 expectedRsrp.clear ();
1882 expectedRsrp << 55 << 55 << 55 << 55 << 53 << 53 << 53 << 53 << 53 << 53;
1884 sourceConfigList, targetConfigList,
1885 expectedTime, expectedRsrp,
1887 TestCase::EXTENSIVE);
1900 std::list<LteRrcSap::ReportConfigEutra> sourceConfigList,
1901 std::list<LteRrcSap::ReportConfigEutra> targetConfigList,
1902 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp,
1905 m_sourceConfigList (sourceConfigList),
1906 m_targetConfigList (targetConfigList),
1907 m_expectedTime (expectedTime),
1908 m_expectedRsrp (expectedRsrp),
1909 m_duration (duration)
1916 NS_FATAL_ERROR (
"Vectors of expected results are not of the same size");
1939 StringValue (
"ns3::FriisSpectrumPropagationLossModel"));
1962 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1963 positionAlloc->
Add (Vector (900.0, 0.0, 0.0));
1964 positionAlloc->
Add (Vector (400.0, 0.0, 0.0));
1966 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1967 mobility.SetPositionAllocator (positionAlloc);
1972 Ptr<Node> pgw = epcHelper->GetPgwNode ();
1976 remoteHostContainer.
Create (1);
1979 internet.
Install (remoteHostContainer);
1988 ipv4h.
SetBase (
"1.0.0.0",
"255.0.0.0");
2012 std::list<LteRrcSap::ReportConfigEutra>::const_iterator itReportConfig;
2036 for (uint32_t u = 0; u < ueNodes.
GetN (); ++u)
2041 ueStaticRouting->
SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
2051 Config::Connect (
"/NodeList/3/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
2056 Config::Connect (
"/NodeList/4/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
2062 ueDevs.
Get (0), enbDevs.
Get (0), enbDevs.
Get (1));
2067 Simulator::Destroy ();
2077 "Reporting should have occurred at " <<
m_itExpectedTime->GetSeconds () <<
"s");
2084 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
2090 bool isCorrectMeasId;
2096 else if (cellId == 2)
2106 if (isCorrectMeasId)
2111 <<
" rsrp=" << (uint16_t) measResults.
rsrpResult 2112 <<
" (" << EutranMeasurementMapping::RsrpRange2Dbm (measResults.
rsrpResult) <<
" dBm)" 2113 <<
" rsrq=" << (uint16_t) measResults.
rsrqResult 2114 <<
" (" << EutranMeasurementMapping::RsrqRange2Db (measResults.
rsrqResult) <<
" dB)");
2120 "Unexpected report content");
2125 "Unexpected report content");
2126 std::list<LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
2131 "Report contains cgi-info, which is not supported");
2133 "Report does not contain measured RSRP result");
2135 "Report does not contain measured RSRQ result");
2136 NS_LOG_DEBUG (
this <<
" Neighbour cellId=" << it->physCellId
2137 <<
" rsrp=" << (uint16_t) it->rsrpResult
2138 <<
" (" << EutranMeasurementMapping::RsrpRange2Dbm (it->rsrpResult) <<
" dBm)" 2139 <<
" rsrq=" << (uint16_t) it->rsrqResult
2140 <<
" (" << EutranMeasurementMapping::RsrqRange2Db (it->rsrqResult) <<
" dB)");
2147 "Reporting should not have occurred at " 2159 uint16_t observedRsrp = measResults.
rsrpResult;
2164 "Reporting should not have occurred at this time");
2166 "The RSRP observed differs with the reference RSRP");
void TeleportVeryNear()
Teleport very near function.
void TeleportNear()
Teleport near function.
enum ns3::LteRrcSap::ThresholdEutra::@63 choice
Threshold enumeration.
Ptr< MobilityModel > m_ueMobility
the mobility model
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint8_t m_expectedMeasId
The measurement identity being tested.
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in piecewise configuration and 24...
MeasurementReport structure.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
AttributeValue implementation for Boolean.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
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...
holds a vector of std::pair of Ptr<Ipv4> and interface index.
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
std::list< LteRrcSap::ReportConfigEutra > m_sourceConfigList
The list of active report triggering configuration for the source eNodeB.
Hold variables of type string.
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition...
void HandoverRequest(Time hoTime, Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
Manually trigger an X2-based handover.
NetDeviceContainer Install(NodeContainer c)
a class to represent an Ipv4 address mask
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
void ReportUeMeasurementsCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell, uint8_t componentCarrierId)
Specifies criteria for triggering of an E-UTRA measurement reporting event.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
aggregate IP/TCP/UDP functionality to existing Nodes.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
Build a set of PointToPointNetDevice objects.
enum ns3::LteRrcSap::ReportConfigEutra::@66 triggerQuantity
Trigger type enumeration.
Ptr< MobilityModel > m_enbMobility
the mobility model
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
static LteUeMeasurementsPiecewiseTestSuite2 lteUeMeasurementsPiecewiseTestSuite2
virtual ~LteUeMeasurementsPiecewiseTestCase2()
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
Testing UE measurements in LTE with simulation of 1 eNodeB and 1 UE in piecewise configuration and 12...
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...
Test that UE Measurements (see 36.214) calculation works fine in a multi-cell interference scenario...
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
void TeleportVeryFar()
Teleport very far function.
Class for representing data rates.
uint8_t rsrpResult
RSRP result.
Keep track of the current position and velocity of an object.
std::set< uint8_t > m_expectedTargetCellMeasId
The list of measurement identities being tested in the target cell.
uint8_t AddUeMeasReportConfig(LteRrcSap::ReportConfigEutra config)
Add a new UE measurement reporting configuration.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
Test that UE measurements calculation works properly in a scenario with 2 eNodeBs and 2UEs...
double m_rsrpDbmUeNeighborCell
RSRP in dBm UE 2.
static const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
static LteUeMeasurementsTestSuite lteUeMeasurementsTestSuite
Hold variables of type enum.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsHandoverTestCase.
MeasResults measResults
measure results
AttributeValue implementation for Time.
LteUeMeasurementsPiecewiseTestSuite3()
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Hold an unsigned integer type.
LteUeMeasurementsPiecewiseTestSuite2()
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
virtual ~LteUeMeasurementsPiecewiseTestCase1()
#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.
holds a vector of ns3::NetDevice pointers
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
enum ns3::LteRrcSap::ReportConfigEutra::@68 reportInterval
Report interval enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@65 eventId
Event enumeration.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
double m_rsrqDbUeServingCell
RSRQ in dBm UE 1.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
void TeleportNear()
Teleport near function.
#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...
void Connect(std::string path, const CallbackBase &cb)
void TeleportVeryFar()
Teleport far function.
LteUeMeasurementsPiecewiseTestCase1(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
Constructor.
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
Access to the IPv4 forwarding table, interfaces, and configuration.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
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.
void RecvMeasurementReport(uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Reeive measurement report function.
bool reportOnLeave
Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving c...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
virtual void DoTeardown()
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.
static LteUeMeasurementsPiecewiseTestSuite3 lteUeMeasurementsPiecewiseTestSuite3
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
bool haveMeasResultNeighCells
have measure result neighbor cells
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
virtual ~LteUeMeasurementsTestCase()
double m_d2
distance between UE and other ENB node
uint8_t range
Value range used in RSRP/RSRQ 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)
Constructor.
double m_rsrqDbUeNeighborCell
RSRQ in dBm UE 2.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase1...
This class contains the specification of EPS Bearers.
virtual void DoRun(void)
Implementation to actually run this TestCase.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
void TeleportFar()
Teleport far function.
LteUeMeasurementsPiecewiseTestSuite1()
void TeleportVeryNear()
Teleport very near function.
void SetPosition(const Vector &position)
std::list< LteRrcSap::ReportConfigEutra > m_targetConfigList
The list of active report triggering configuration for the target eNodeB.
LteUeMeasurementsTestCase(std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2)
Constructor.
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.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
static LteUeMeasurementsPiecewiseTestSuite1 lteUeMeasurementsPiecewiseTestSuite1
Helper class used to assign positions and mobility models to nodes.
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
double m_rsrpDbmUeServingCell
RSRP in dBm UE 1.
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration...
Ptr< MobilityModel > m_ueMobility
the mobility model
Ipv4 addresses are stored in host order in this class.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
std::set< uint8_t > m_expectedSourceCellMeasId
The list of measurement identities being tested in the source cell.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
std::string GetName(void) const
void SetEpcHelper(Ptr< EpcHelper > h)
Set the EpcHelper to be used to setup the EPC network in conjunction with the setup of the LTE radio ...
uint8_t m_expectedMeasId
The measurement identity being tested.
Helper class that adds ns3::Ipv4StaticRouting objects.
AttributeValue implementation for DataRate.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
LteUeMeasurementsPiecewiseTestCase3(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime)
Constructor.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
void TeleportEnbNear()
Teleport the eNb near function.
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetDefault(std::string name, const AttributeValue &value)
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase3...
double m_d1
distance between UE and ENB node pair
void Add(Vector v)
Add a position to the list of positions.
void ReportUeMeasurements(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
Report UE measurements function.
LteUeMeasurementsHandoverTestSuite()
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
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(LteUeMeasurementsTestCase *testcase, std::string path, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Testing UE measurements in LTE with simulation of 3 eNodeB and 1 UE in piecewise configuration and 24...
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase2...
LteUeMeasurementsTestSuite()
virtual ~LteUeMeasurementsPiecewiseTestCase3()
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
virtual ~LteUeMeasurementsHandoverTestCase()
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 Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void TeleportFar()
Teleport far function.
uint8_t rsrqResult
RSRQ result.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
uint8_t m_expectedMeasId
The measurement identity being tested.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
The eNodeB device implementation.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
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...
static LteUeMeasurementsHandoverTestSuite lteUeMeasurementsHandoverTestSuite
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
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...
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
LteUeMeasurementsPiecewiseTestCase2(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
Constructor.
enum ns3::LteRrcSap::ReportConfigEutra::@64 triggerType
Trigger enumeration.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
ThresholdEutra threshold2
Threshold for event A5.