LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 NS_LOG_COMPONENT_DEFINE ("LteUeMeasurementsTest"); | 58 NS_LOG_COMPONENT_DEFINE ("LteUeMeasurementsTest"); |
59 | 59 |
60 // ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== // | 60 // ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== // |
61 | 61 |
62 void | 62 void |
63 ReportUeMeasurementsCallback (LteUeMeasurementsTestCase *testcase, | 63 ReportUeMeasurementsCallback (LteUeMeasurementsTestCase *testcase, |
64 std::string path, uint16_t rnti, uint16_t cellId, | 64 std::string path, uint16_t rnti, uint16_t cellId, |
65 double rsrp, double rsrq, bool servingCell, uint8_
t componentCarrierId) | 65 double rsrp, double rsrq, bool servingCell, uint8_
t componentCarrierId) |
66 { | 66 { |
| 67 NS_UNUSED(componentCarrierId); |
67 testcase->ReportUeMeasurements (rnti, cellId, rsrp, rsrq, servingCell); | 68 testcase->ReportUeMeasurements (rnti, cellId, rsrp, rsrq, servingCell); |
68 } | 69 } |
69 | 70 |
70 void | 71 void |
71 RecvMeasurementReportCallback (LteUeMeasurementsTestCase *testcase, | 72 RecvMeasurementReportCallback (LteUeMeasurementsTestCase *testcase, |
72 std::string path, uint64_t imsi, uint16_t cellId, | 73 std::string path, uint64_t imsi, uint16_t cellId, |
73 uint16_t rnti, LteRrcSap::MeasurementReport meas) | 74 uint16_t rnti, LteRrcSap::MeasurementReport meas) |
74 { | 75 { |
75 testcase->RecvMeasurementReport (imsi, cellId, rnti, meas); | 76 testcase->RecvMeasurementReport (imsi, cellId, rnti, meas); |
76 } | 77 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue
(false)); | 142 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue
(false)); |
142 Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); | 143 Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); |
143 Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); | 144 Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); |
144 Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); | 145 Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); |
145 lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumProp
agationLossModel")); | 146 lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumProp
agationLossModel")); |
146 lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (false)); | 147 lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (false)); |
147 | 148 |
148 //Disable Uplink Power Control | 149 //Disable Uplink Power Control |
149 Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (f
alse)); | 150 Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (f
alse)); |
150 | 151 |
151 // LogComponentEnable ("LteUeMeasurementsTest", LOG_LEVEL_ALL); | 152 #if 0 |
| 153 LogComponentEnable ("LteUeMeasurementsTest", LOG_LEVEL_ALL); |
| 154 #endif |
152 | 155 |
153 // Create Nodes: eNodeB and UE | 156 // Create Nodes: eNodeB and UE |
154 NodeContainer enbNodes; | 157 NodeContainer enbNodes; |
155 NodeContainer ueNodes1; | 158 NodeContainer ueNodes1; |
156 NodeContainer ueNodes2; | 159 NodeContainer ueNodes2; |
157 enbNodes.Create (2); | 160 enbNodes.Create (2); |
158 ueNodes1.Create (1); | 161 ueNodes1.Create (1); |
159 ueNodes2.Create (1); | 162 ueNodes2.Create (1); |
160 NodeContainer allNodes = NodeContainer (enbNodes, ueNodes1, ueNodes2); | 163 NodeContainer allNodes = NodeContainer (enbNodes, ueNodes1, ueNodes2); |
161 | 164 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 217 |
215 Simulator::Destroy (); | 218 Simulator::Destroy (); |
216 | 219 |
217 } | 220 } |
218 | 221 |
219 void | 222 void |
220 LteUeMeasurementsTestCase::ReportUeMeasurements (uint16_t rnti, uint16_t cellId, | 223 LteUeMeasurementsTestCase::ReportUeMeasurements (uint16_t rnti, uint16_t cellId, |
221 double rsrp, double rsrq, | 224 double rsrp, double rsrq, |
222 bool servingCell) | 225 bool servingCell) |
223 { | 226 { |
| 227 NS_UNUSED(rnti); |
224 // need to allow for RRC connection establishment + CQI feedback reception + U
E measurements filtering (200 ms) | 228 // need to allow for RRC connection establishment + CQI feedback reception + U
E measurements filtering (200 ms) |
225 if (Simulator::Now () > MilliSeconds (400)) | 229 if (Simulator::Now () > MilliSeconds (400)) |
226 { | 230 { |
227 if (servingCell) | 231 if (servingCell) |
228 { | 232 { |
229 NS_LOG_DEBUG ("UE serving cellId " << cellId << " Rxed RSRP " << rsrp
<< " thr " << m_rsrpDbmUeServingCell << " RSRQ " << rsrq << " thr " << m_rsrqDbU
eServingCell); | 233 NS_LOG_DEBUG ("UE serving cellId " << cellId << " Rxed RSRP " << rsrp
<< " thr " << m_rsrpDbmUeServingCell << " RSRQ " << rsrq << " thr " << m_rsrqDbU
eServingCell); |
230 NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrpDbmUeServingCell, rsrp, 0.2, "Wrong R
SRP UE 1"); | 234 NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrpDbmUeServingCell, rsrp, 0.2, "Wrong R
SRP UE 1"); |
231 NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrqDbUeServingCell, rsrq, 0.2, "Wrong RS
RQ UE 1"); | 235 NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrqDbUeServingCell, rsrq, 0.2, "Wrong RS
RQ UE 1"); |
232 } | 236 } |
233 else | 237 else |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 523 |
520 LteUeMeasurementsPiecewiseTestCase1::LteUeMeasurementsPiecewiseTestCase1 ( | 524 LteUeMeasurementsPiecewiseTestCase1::LteUeMeasurementsPiecewiseTestCase1 ( |
521 std::string name, LteRrcSap::ReportConfigEutra config, | 525 std::string name, LteRrcSap::ReportConfigEutra config, |
522 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp) | 526 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp) |
523 : TestCase (name), | 527 : TestCase (name), |
524 m_config (config), | 528 m_config (config), |
525 m_expectedTime (expectedTime), | 529 m_expectedTime (expectedTime), |
526 m_expectedRsrp (expectedRsrp) | 530 m_expectedRsrp (expectedRsrp) |
527 { | 531 { |
528 // input sanity check | 532 // input sanity check |
529 uint16_t size = m_expectedTime.size (); | 533 uint16_t size = static_cast<uint16_t>(m_expectedTime.size ()); |
530 | 534 |
531 if (size != m_expectedRsrp.size ()) | 535 if (size != m_expectedRsrp.size ()) |
532 { | 536 { |
533 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); | 537 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); |
534 } | 538 } |
535 | 539 |
536 m_itExpectedTime = m_expectedTime.begin (); | 540 m_itExpectedTime = m_expectedTime.begin (); |
537 m_itExpectedRsrp = m_expectedRsrp.begin (); | 541 m_itExpectedRsrp = m_expectedRsrp.begin (); |
538 | 542 |
539 NS_LOG_INFO (this << " name=" << name); | 543 NS_LOG_INFO (this << " name=" << name); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); | 665 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); |
662 NS_ASSERT (hasEnded); | 666 NS_ASSERT (hasEnded); |
663 } | 667 } |
664 | 668 |
665 void | 669 void |
666 LteUeMeasurementsPiecewiseTestCase1::RecvMeasurementReportCallback ( | 670 LteUeMeasurementsPiecewiseTestCase1::RecvMeasurementReportCallback ( |
667 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, | 671 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, |
668 LteRrcSap::MeasurementReport report) | 672 LteRrcSap::MeasurementReport report) |
669 { | 673 { |
670 NS_LOG_FUNCTION (this << context); | 674 NS_LOG_FUNCTION (this << context); |
| 675 NS_UNUSED(imsi); |
671 NS_ASSERT (rnti == 1); | 676 NS_ASSERT (rnti == 1); |
| 677 (void)rnti; // make compiler happy |
672 NS_ASSERT (cellId == 1); | 678 NS_ASSERT (cellId == 1); |
| 679 (void)cellId; //make compiler happy |
673 | 680 |
674 if (report.measResults.measId == m_expectedMeasId) | 681 if (report.measResults.measId == m_expectedMeasId) |
675 { | 682 { |
676 // verifying the report completeness | 683 // verifying the report completeness |
677 LteRrcSap::MeasResults measResults = report.measResults; | 684 LteRrcSap::MeasResults measResults = report.measResults; |
678 NS_LOG_DEBUG (this << " rsrp=" << (uint16_t) measResults.rsrpResult | 685 NS_LOG_DEBUG (this << " rsrp=" << (uint16_t) measResults.rsrpResult |
679 << " (" << EutranMeasurementMapping::RsrpRange2Dbm (mea
sResults.rsrpResult) << " dBm)" | 686 << " (" << EutranMeasurementMapping::RsrpRange2Dbm (mea
sResults.rsrpResult) << " dBm)" |
680 << " rsrq=" << (uint16_t) measResults.rsrqResult | 687 << " rsrq=" << (uint16_t) measResults.rsrqResult |
681 << " (" << EutranMeasurementMapping::RsrqRange2Db (meas
Results.rsrqResult) << " dB)"); | 688 << " (" << EutranMeasurementMapping::RsrqRange2Db (meas
Results.rsrqResult) << " dB)"); |
682 NS_TEST_ASSERT_MSG_EQ (measResults.haveMeasResultNeighCells, false, | 689 NS_TEST_ASSERT_MSG_EQ (measResults.haveMeasResultNeighCells, false, |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 | 1111 |
1105 LteUeMeasurementsPiecewiseTestCase2::LteUeMeasurementsPiecewiseTestCase2 ( | 1112 LteUeMeasurementsPiecewiseTestCase2::LteUeMeasurementsPiecewiseTestCase2 ( |
1106 std::string name, LteRrcSap::ReportConfigEutra config, | 1113 std::string name, LteRrcSap::ReportConfigEutra config, |
1107 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp) | 1114 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp) |
1108 : TestCase (name), | 1115 : TestCase (name), |
1109 m_config (config), | 1116 m_config (config), |
1110 m_expectedTime (expectedTime), | 1117 m_expectedTime (expectedTime), |
1111 m_expectedRsrp (expectedRsrp) | 1118 m_expectedRsrp (expectedRsrp) |
1112 { | 1119 { |
1113 // input sanity check | 1120 // input sanity check |
1114 uint16_t size = m_expectedTime.size (); | 1121 uint16_t size = static_cast<uint16_t>(m_expectedTime.size ()); |
1115 | 1122 |
1116 if (size != m_expectedRsrp.size ()) | 1123 if (size != m_expectedRsrp.size ()) |
1117 { | 1124 { |
1118 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); | 1125 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); |
1119 } | 1126 } |
1120 | 1127 |
1121 m_itExpectedTime = m_expectedTime.begin (); | 1128 m_itExpectedTime = m_expectedTime.begin (); |
1122 m_itExpectedRsrp = m_expectedRsrp.begin (); | 1129 m_itExpectedRsrp = m_expectedRsrp.begin (); |
1123 | 1130 |
1124 NS_LOG_INFO (this << " name=" << name); | 1131 NS_LOG_INFO (this << " name=" << name); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); | 1258 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); |
1252 NS_ASSERT (hasEnded); | 1259 NS_ASSERT (hasEnded); |
1253 } | 1260 } |
1254 | 1261 |
1255 void | 1262 void |
1256 LteUeMeasurementsPiecewiseTestCase2::RecvMeasurementReportCallback ( | 1263 LteUeMeasurementsPiecewiseTestCase2::RecvMeasurementReportCallback ( |
1257 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, | 1264 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, |
1258 LteRrcSap::MeasurementReport report) | 1265 LteRrcSap::MeasurementReport report) |
1259 { | 1266 { |
1260 NS_LOG_FUNCTION (this << context); | 1267 NS_LOG_FUNCTION (this << context); |
| 1268 NS_UNUSED(imsi); |
1261 NS_ASSERT (rnti == 1); | 1269 NS_ASSERT (rnti == 1); |
| 1270 (void)rnti; // make compiler happy |
1262 NS_ASSERT (cellId == 1); | 1271 NS_ASSERT (cellId == 1); |
| 1272 (void)cellId; // make compiler happy |
1263 | 1273 |
1264 if (report.measResults.measId == m_expectedMeasId) | 1274 if (report.measResults.measId == m_expectedMeasId) |
1265 { | 1275 { |
1266 // verifying the report completeness | 1276 // verifying the report completeness |
1267 LteRrcSap::MeasResults measResults = report.measResults; | 1277 LteRrcSap::MeasResults measResults = report.measResults; |
1268 NS_LOG_DEBUG (this << " Serving cellId=" << cellId | 1278 NS_LOG_DEBUG (this << " Serving cellId=" << cellId |
1269 << " rsrp=" << (uint16_t) measResults.rsrpResult | 1279 << " rsrp=" << (uint16_t) measResults.rsrpResult |
1270 << " (" << EutranMeasurementMapping::RsrpRange2Dbm (mea
sResults.rsrpResult) << " dBm)" | 1280 << " (" << EutranMeasurementMapping::RsrpRange2Dbm (mea
sResults.rsrpResult) << " dBm)" |
1271 << " rsrq=" << (uint16_t) measResults.rsrqResult | 1281 << " rsrq=" << (uint16_t) measResults.rsrqResult |
1272 << " (" << EutranMeasurementMapping::RsrqRange2Db (meas
Results.rsrqResult) << " dB)"); | 1282 << " (" << EutranMeasurementMapping::RsrqRange2Db (meas
Results.rsrqResult) << " dB)"); |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp, | 1665 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp, |
1656 Time duration) | 1666 Time duration) |
1657 : TestCase (name), | 1667 : TestCase (name), |
1658 m_sourceConfigList (sourceConfigList), | 1668 m_sourceConfigList (sourceConfigList), |
1659 m_targetConfigList (targetConfigList), | 1669 m_targetConfigList (targetConfigList), |
1660 m_expectedTime (expectedTime), | 1670 m_expectedTime (expectedTime), |
1661 m_expectedRsrp (expectedRsrp), | 1671 m_expectedRsrp (expectedRsrp), |
1662 m_duration (duration) | 1672 m_duration (duration) |
1663 { | 1673 { |
1664 // input sanity check | 1674 // input sanity check |
1665 uint16_t size = m_expectedTime.size (); | 1675 uint16_t size = static_cast<uint16_t>(m_expectedTime.size ()); |
1666 | 1676 |
1667 if (size != m_expectedRsrp.size ()) | 1677 if (size != m_expectedRsrp.size ()) |
1668 { | 1678 { |
1669 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); | 1679 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); |
1670 } | 1680 } |
1671 | 1681 |
1672 m_itExpectedTime = m_expectedTime.begin (); | 1682 m_itExpectedTime = m_expectedTime.begin (); |
1673 m_itExpectedRsrp = m_expectedRsrp.begin (); | 1683 m_itExpectedRsrp = m_expectedRsrp.begin (); |
1674 | 1684 |
1675 NS_LOG_INFO (this << " name=" << name); | 1685 NS_LOG_INFO (this << " name=" << name); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 "Reporting should have occurred at " << m_itExpectedTim
e->GetSeconds () << "s"); | 1840 "Reporting should have occurred at " << m_itExpectedTim
e->GetSeconds () << "s"); |
1831 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); | 1841 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); |
1832 NS_ASSERT (hasEnded); | 1842 NS_ASSERT (hasEnded); |
1833 } | 1843 } |
1834 | 1844 |
1835 void | 1845 void |
1836 LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallback ( | 1846 LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallback ( |
1837 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, | 1847 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, |
1838 LteRrcSap::MeasurementReport report) | 1848 LteRrcSap::MeasurementReport report) |
1839 { | 1849 { |
| 1850 NS_UNUSED(imsi); |
| 1851 NS_UNUSED(rnti); |
1840 uint8_t measId = report.measResults.measId; | 1852 uint8_t measId = report.measResults.measId; |
1841 NS_LOG_FUNCTION (this << context << (uint16_t) measId); | 1853 NS_LOG_FUNCTION (this << context << (uint16_t) measId); |
1842 | 1854 |
1843 bool isCorrectMeasId; | 1855 bool isCorrectMeasId; |
1844 if (cellId == 1) | 1856 if (cellId == 1) |
1845 { | 1857 { |
1846 std::set<uint8_t>::iterator itMeasId = m_expectedSourceCellMeasId.find (me
asId); | 1858 std::set<uint8_t>::iterator itMeasId = m_expectedSourceCellMeasId.find (me
asId); |
1847 isCorrectMeasId = (itMeasId != m_expectedSourceCellMeasId.end ()); | 1859 isCorrectMeasId = (itMeasId != m_expectedSourceCellMeasId.end ()); |
1848 } | 1860 } |
1849 else if (cellId == 2) | 1861 else if (cellId == 2) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 NS_TEST_ASSERT_MSG_EQ (timeNowMs, timeExpectedMs, | 1928 NS_TEST_ASSERT_MSG_EQ (timeNowMs, timeExpectedMs, |
1917 "Reporting should not have occurred at this tim
e"); | 1929 "Reporting should not have occurred at this tim
e"); |
1918 NS_TEST_ASSERT_MSG_EQ (observedRsrp, referenceRsrp, | 1930 NS_TEST_ASSERT_MSG_EQ (observedRsrp, referenceRsrp, |
1919 "The RSRP observed differs with the reference R
SRP"); | 1931 "The RSRP observed differs with the reference R
SRP"); |
1920 | 1932 |
1921 } // end of if (!hasEnded) | 1933 } // end of if (!hasEnded) |
1922 | 1934 |
1923 } // end of if (report.measResults.measId == correctMeasId) | 1935 } // end of if (report.measResults.measId == correctMeasId) |
1924 | 1936 |
1925 } // end of void LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallbac
k | 1937 } // end of void LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallbac
k |
LEFT | RIGHT |