27 #include <ns3/fatal-error.h>
29 #include <ns3/object-map.h>
30 #include <ns3/object-factory.h>
31 #include <ns3/simulator.h>
33 #include <ns3/lte-rlc.h>
34 #include <ns3/lte-rlc-tm.h>
35 #include <ns3/lte-rlc-um.h>
36 #include <ns3/lte-rlc-am.h>
37 #include <ns3/lte-pdcp.h>
38 #include <ns3/lte-radio-bearer-info.h>
103 "IDLE_WAIT_MIB_SIB1",
106 "IDLE_CAMPED_NORMALLY",
108 "IDLE_RANDOM_ACCESS",
110 "CONNECTED_NORMALLY",
111 "CONNECTED_HANDOVER",
112 "CONNECTED_PHY_PROBLEM",
113 "CONNECTED_REESTABLISHING"
122 return g_ueRrcStateName[s];
134 : m_cmacSapProvider (0),
136 m_macSapProvider (0),
138 m_ccmRrcSapProvider (0),
139 m_state (IDLE_START),
144 m_connectionPending (false),
145 m_hasReceivedMib (false),
146 m_hasReceivedSib1 (false),
147 m_hasReceivedSib2 (false),
194 .SetGroupName (
"Lte")
196 .AddAttribute (
"DataRadioBearerMap",
"List of UE RadioBearerInfo for Data Radio Bearers by LCID.",
199 MakeObjectMapChecker<LteDataRadioBearerInfo> ())
200 .AddAttribute (
"Srb0",
"SignalingRadioBearerInfo for SRB0",
203 MakePointerChecker<LteSignalingRadioBearerInfo> ())
204 .AddAttribute (
"Srb1",
"SignalingRadioBearerInfo for SRB1",
207 MakePointerChecker<LteSignalingRadioBearerInfo> ())
208 .AddAttribute (
"CellId",
209 "Serving cell identifier",
212 MakeUintegerChecker<uint16_t> ())
213 .AddAttribute (
"C-RNTI",
214 "Cell Radio Network Temporary Identifier",
217 MakeUintegerChecker<uint16_t> ())
218 .AddAttribute (
"T300",
219 "Timer for the RRC Connection Establishment procedure "
220 "(i.e., the procedure is deemed as failed if it takes longer than this)",
224 .AddTraceSource (
"MibReceived",
225 "trace fired upon reception of Master Information Block",
227 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
228 .AddTraceSource (
"Sib1Received",
229 "trace fired upon reception of System Information Block Type 1",
231 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
232 .AddTraceSource (
"Sib2Received",
233 "trace fired upon reception of System Information Block Type 2",
235 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
236 .AddTraceSource (
"StateTransition",
237 "trace fired upon every UE RRC state transition",
239 "ns3::LteUeRrc::StateTracedCallback")
240 .AddTraceSource (
"InitialCellSelectionEndOk",
241 "trace fired upon successful initial cell selection procedure",
243 "ns3::LteUeRrc::CellSelectionTracedCallback")
244 .AddTraceSource (
"InitialCellSelectionEndError",
245 "trace fired upon failed initial cell selection procedure",
247 "ns3::LteUeRrc::CellSelectionTracedCallback")
248 .AddTraceSource (
"RandomAccessSuccessful",
249 "trace fired upon successful completion of the random access procedure",
251 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
252 .AddTraceSource (
"RandomAccessError",
253 "trace fired upon failure of the random access procedure",
255 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
256 .AddTraceSource (
"ConnectionEstablished",
257 "trace fired upon successful RRC connection establishment",
259 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
260 .AddTraceSource (
"ConnectionTimeout",
261 "trace fired upon timeout RRC connection establishment because of T300",
263 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
264 .AddTraceSource (
"ConnectionReconfiguration",
265 "trace fired upon RRC connection reconfiguration",
267 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
268 .AddTraceSource (
"HandoverStart",
269 "trace fired upon start of a handover procedure",
271 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
272 .AddTraceSource (
"HandoverEndOk",
273 "trace fired upon successful termination of a handover procedure",
275 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
276 .AddTraceSource (
"HandoverEndError",
277 "trace fired upon failure of a handover procedure",
279 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
466 Ptr<LteRlc> rlc = CreateObject<LteRlcTm> ()->GetObject<LteRlc> ();
471 m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
473 m_srb0->m_srbIdentity = 0;
491 if (m_numberOfComponentCarriers < MIN_NO_CC || m_numberOfComponentCarriers >
MAX_NO_CC)
521 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it =
m_drbMap.find (drbid);
527 params.lcid = it->second->m_logicalChannelIdentity;
530 <<
" on DRBID " << (uint32_t) drbid
531 <<
" (LCID " << (uint32_t) params.lcid <<
")"
532 <<
" (" << packet->
GetSize () <<
" bytes)");
533 it->second->m_pdcp->GetLtePdcpSapProvider ()->TransmitPdcpSdu (params);
618 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
811 "Cell identity in SIB1 does not match with the originating cell");
826 "Cell identity in SIB1 does not match with the originating cell");
849 bool triggering =
true;
850 std::vector <LteUeCphySapUser::UeMeasurementsElement>::iterator newMeasIt;
860 newMeasIt->m_rsrq, useLayer3Filtering,
866 newMeasIt->m_rsrq, useLayer3Filtering);
879 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
1125 uint16_t maxRsrpCellId = 0;
1126 double maxRsrp = -std::numeric_limits<double>::infinity ();
1128 std::map<uint16_t, MeasValues>::iterator it;
1135 if (maxRsrp < it->
second.rsrp)
1137 std::set<uint16_t>::const_iterator itCell;
1141 maxRsrpCellId = it->first;
1142 maxRsrp = it->second.rsrp;
1147 if (maxRsrpCellId == 0)
1149 NS_LOG_WARN (
this <<
" Cell search is unable to detect surrounding cell to attach to");
1154 <<
" is the strongest untried surrounding cell");
1173 bool isSuitableCell =
false;
1174 bool isAcceptableCell =
false;
1175 std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.find (cellId);
1176 double qRxLevMeas = storedMeasIt->second.rsrp;
1178 NS_LOG_LOGIC (
this <<
" cell selection to cellId=" << cellId
1179 <<
" qrxlevmeas=" << qRxLevMeas <<
" dBm"
1180 <<
" qrxlevmin=" << qRxLevMin <<
" dBm");
1182 if (qRxLevMeas - qRxLevMin > 0)
1184 isAcceptableCell =
true;
1189 isSuitableCell = (cellCsgIndication ==
false) || (cellCsgId ==
m_csgWhiteList);
1192 << cellCsgId <<
"/" << cellCsgIndication);
1213 if (isAcceptableCell)
1286 std::list<LteRrcSap::SrbToAddMod>::const_iterator stamIt = rrcd.
srbToAddModList.begin ();
1294 NS_ASSERT_MSG (stamIt->srbIdentity == 1,
"only SRB1 supported");
1296 const uint8_t lcid = 1;
1305 pdcp->SetLcId (lcid);
1310 m_srb1 = CreateObject<LteSignalingRadioBearerInfo> ();
1313 m_srb1->m_srbIdentity = 1;
1315 m_srb1->m_logicalChannelConfig.priority = stamIt->logicalChannelConfig.priority;
1316 m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = stamIt->logicalChannelConfig.prioritizedBitRateKbps;
1317 m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = stamIt->logicalChannelConfig.bucketSizeDurationMs;
1318 m_srb1->m_logicalChannelConfig.logicalChannelGroup = stamIt->logicalChannelConfig.logicalChannelGroup;
1321 lcConfig.
priority = stamIt->logicalChannelConfig.priority;
1331 ueParams.srb1SapProvider =
m_srb1->m_pdcp->GetLtePdcpSapProvider ();
1336 NS_LOG_INFO (
"request to modify SRB1 (skipping as currently not implemented)");
1342 std::list<LteRrcSap::DrbToAddMod>::const_iterator dtamIt;
1347 NS_LOG_INFO (
this <<
" IMSI " <<
m_imsi <<
" adding/modifying DRBID " << (uint32_t) dtamIt->drbIdentity <<
" LC " << (uint32_t) dtamIt->logicalChannelIdentity);
1348 NS_ASSERT_MSG (dtamIt->logicalChannelIdentity > 2,
"LCID value " << dtamIt->logicalChannelIdentity <<
" is reserved for SRBs");
1350 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbMapIt =
m_drbMap.find (dtamIt->drbIdentity);
1362 switch (dtamIt->rlcConfig.choice)
1383 rlc->
SetLcId (dtamIt->logicalChannelIdentity);
1386 drbInfo->m_rlc = rlc;
1387 drbInfo->m_epsBearerIdentity = dtamIt->epsBearerIdentity;
1388 drbInfo->m_logicalChannelIdentity = dtamIt->logicalChannelIdentity;
1389 drbInfo->m_drbIdentity = dtamIt->drbIdentity;
1397 pdcp->SetLcId (dtamIt->logicalChannelIdentity);
1401 drbInfo->m_pdcp = pdcp;
1410 lcConfig.
priority = dtamIt->logicalChannelConfig.priority;
1431 std::list<uint8_t>::iterator dtdmIt;
1436 uint8_t drbid = *dtdmIt;
1437 NS_LOG_INFO (
this <<
" IMSI " <<
m_imsi <<
" releasing DRB " << (uint32_t) drbid << drbid);
1438 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it =
m_drbMap.find (drbid);
1463 uint8_t measObjectId = *it;
1464 NS_LOG_LOGIC (
this <<
" deleting measObjectId " << (uint32_t) measObjectId);
1469 if (measIdIt->second.measObjectId == measObjectId)
1471 uint8_t measId = measIdIt->second.measId;
1473 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId <<
" because referring to measObjectId " << (uint32_t) measObjectId);
1492 NS_ASSERT_MSG (it->measObjectEutra.cellsToRemoveList.empty (),
"cellsToRemoveList not supported");
1493 NS_ASSERT_MSG (it->measObjectEutra.cellsToAddModList.empty (),
"cellsToAddModList not supported");
1494 NS_ASSERT_MSG (it->measObjectEutra.cellsToRemoveList.empty (),
"blackCellsToRemoveList not supported");
1495 NS_ASSERT_MSG (it->measObjectEutra.blackCellsToAddModList.empty (),
"blackCellsToAddModList not supported");
1496 NS_ASSERT_MSG (it->measObjectEutra.haveCellForWhichToReportCGI ==
false,
"cellForWhichToReportCGI is not supported");
1498 uint8_t measObjectId = it->measObjectId;
1502 NS_LOG_LOGIC (
"measObjectId " << (uint32_t) measObjectId <<
" exists, updating entry");
1503 measObjectIt->second = *it;
1504 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1509 if (measIdIt->second.measObjectId == measObjectId)
1511 uint8_t measId = measIdIt->second.measId;
1512 NS_LOG_LOGIC (
this <<
" found measId " << (uint32_t) measId <<
" referring to measObjectId " << (uint32_t) measObjectId);
1519 NS_LOG_LOGIC (
"measObjectId " << (uint32_t) measObjectId <<
" is new, adding entry");
1530 uint8_t reportConfigId = *it;
1531 NS_LOG_LOGIC (
this <<
" deleting reportConfigId " << (uint32_t) reportConfigId);
1536 if (measIdIt->second.reportConfigId == reportConfigId)
1538 uint8_t measId = measIdIt->second.measId;
1540 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId <<
" because referring to reportConfigId " << (uint32_t) reportConfigId);
1560 "only trigger type EVENT is supported");
1562 uint8_t reportConfigId = it->reportConfigId;
1566 NS_LOG_LOGIC (
"reportConfigId " << (uint32_t) reportConfigId <<
" exists, updating entry");
1568 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1573 if (measIdIt->second.reportConfigId == reportConfigId)
1575 uint8_t measId = measIdIt->second.measId;
1576 NS_LOG_LOGIC (
this <<
" found measId " << (uint32_t) measId <<
" referring to reportConfigId " << (uint32_t) reportConfigId);
1583 NS_LOG_LOGIC (
"reportConfigId " << (uint32_t) reportConfigId <<
" is new, adding entry");
1599 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1613 uint8_t measId = *it;
1614 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId);
1624 for (std::list<LteRrcSap::MeasIdToAddMod>::iterator it = mc.
measIdToAddModList.begin ();
1628 NS_LOG_LOGIC (
this <<
" measId " << (uint32_t) it->measId
1629 <<
" (measObjectId=" << (uint32_t) it->measObjectId
1630 <<
", reportConfigId=" << (uint32_t) it->reportConfigId
1637 std::map<uint8_t, VarMeasReport>::iterator measReportIt =
m_varMeasReportList.find (it->measId);
1640 measReportIt->second.periodicReportTimer.Cancel ();
1647 std::list<PendingTrigger_t> s;
1670 bool useLayer3Filtering)
1672 NS_LOG_FUNCTION (
this << cellId << rsrp << rsrq << useLayer3Filtering);
1674 std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.find (cellId);
1678 if (useLayer3Filtering)
1684 if (std::isnan (storedMeasIt->second.rsrq))
1687 storedMeasIt->second.rsrq = rsrq;
1697 storedMeasIt->second.rsrp = rsrp;
1698 storedMeasIt->second.rsrq = rsrq;
1707 std::pair<uint16_t, MeasValues> val (cellId, v);
1708 std::pair<std::map<uint16_t, MeasValues>::iterator,
bool>
1710 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
1711 storedMeasIt = ret.first;
1716 <<
", new RSRP " << rsrp <<
" stored " << storedMeasIt->second.rsrp
1717 <<
", new RSRQ " << rsrq <<
" stored " << storedMeasIt->second.rsrq);
1727 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt =
1730 NS_ASSERT (measIdIt->first == measIdIt->second.measId);
1732 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>::iterator
1737 std::map<uint8_t, LteRrcSap::MeasObjectToAddMod>::iterator
1742 std::map<uint8_t, VarMeasReport>::iterator
1750 "only triggerType == event is supported");
1753 NS_LOG_LOGIC (
this <<
" considering measId " << (uint32_t) measId);
1754 bool eventEntryCondApplicable =
false;
1755 bool eventLeavingCondApplicable =
false;
1759 switch (reportConfigEutra.eventId)
1773 switch (reportConfigEutra.triggerQuantity)
1777 NS_ASSERT (reportConfigEutra.threshold1.choice
1783 NS_ASSERT (reportConfigEutra.threshold1.choice
1793 bool entryCond = ms - hys > thresh;
1797 if (!isMeasIdInReportList)
1799 concernedCellsEntry.push_back (
m_cellId);
1800 eventEntryCondApplicable =
true;
1809 != measReportIt->second.cellsTriggeredList.end ());
1812 else if (reportConfigEutra.timeToTrigger > 0)
1818 bool leavingCond = ms + hys < thresh;
1822 if (isMeasIdInReportList)
1829 != measReportIt->second.cellsTriggeredList.end ());
1830 concernedCellsLeaving.push_back (
m_cellId);
1831 eventLeavingCondApplicable =
true;
1834 else if (reportConfigEutra.timeToTrigger > 0)
1840 <<
" ms=" << ms <<
" thresh=" << thresh
1841 <<
" entryCond=" << entryCond
1842 <<
" leavingCond=" << leavingCond);
1860 switch (reportConfigEutra.triggerQuantity)
1864 NS_ASSERT (reportConfigEutra.threshold1.choice
1870 NS_ASSERT (reportConfigEutra.threshold1.choice
1880 bool entryCond = ms + hys < thresh;
1884 if (!isMeasIdInReportList)
1886 concernedCellsEntry.push_back (
m_cellId);
1887 eventEntryCondApplicable =
true;
1896 != measReportIt->second.cellsTriggeredList.end ());
1899 else if (reportConfigEutra.timeToTrigger > 0)
1905 bool leavingCond = ms - hys > thresh;
1909 if (isMeasIdInReportList)
1916 != measReportIt->second.cellsTriggeredList.end ());
1917 concernedCellsLeaving.push_back (
m_cellId);
1918 eventLeavingCondApplicable =
true;
1921 else if (reportConfigEutra.timeToTrigger > 0)
1927 <<
" ms=" << ms <<
" thresh=" << thresh
1928 <<
" entryCond=" << entryCond
1929 <<
" leavingCond=" << leavingCond);
1943 double ofn = measObjectEutra.offsetFreq;
1946 double ofp = measObjectEutra.offsetFreq;
1953 switch (reportConfigEutra.triggerQuantity)
1957 NS_ASSERT (reportConfigEutra.threshold1.choice
1962 NS_ASSERT (reportConfigEutra.threshold1.choice
1970 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
1974 uint16_t cellId = storedMeasIt->first;
1980 switch (reportConfigEutra.triggerQuantity)
1983 mn = storedMeasIt->second.rsrp;
1986 mn = storedMeasIt->second.rsrq;
1993 bool hasTriggered = isMeasIdInReportList
1994 && (measReportIt->second.cellsTriggeredList.find (cellId)
1995 != measReportIt->second.cellsTriggeredList.end ());
1998 bool entryCond = mn + ofn + ocn - hys > mp + ofp + ocp + off;
2004 concernedCellsEntry.push_back (cellId);
2005 eventEntryCondApplicable =
true;
2008 else if (reportConfigEutra.timeToTrigger > 0)
2014 bool leavingCond = mn + ofn + ocn + hys < mp + ofp + ocp + off;
2020 concernedCellsLeaving.push_back (cellId);
2021 eventLeavingCondApplicable =
true;
2024 else if (reportConfigEutra.timeToTrigger > 0)
2029 NS_LOG_LOGIC (
this <<
" event A3: neighbor cell " << cellId
2030 <<
" mn=" << mn <<
" mp=" << mp <<
" offset=" << off
2031 <<
" entryCond=" << entryCond
2032 <<
" leavingCond=" << leavingCond);
2048 double ofn = measObjectEutra.offsetFreq;
2054 switch (reportConfigEutra.triggerQuantity)
2057 NS_ASSERT (reportConfigEutra.threshold1.choice
2062 NS_ASSERT (reportConfigEutra.threshold1.choice
2071 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2075 uint16_t cellId = storedMeasIt->first;
2081 switch (reportConfigEutra.triggerQuantity)
2084 mn = storedMeasIt->second.rsrp;
2087 mn = storedMeasIt->second.rsrq;
2094 bool hasTriggered = isMeasIdInReportList
2095 && (measReportIt->second.cellsTriggeredList.find (cellId)
2096 != measReportIt->second.cellsTriggeredList.end ());
2099 bool entryCond = mn + ofn + ocn - hys > thresh;
2105 concernedCellsEntry.push_back (cellId);
2106 eventEntryCondApplicable =
true;
2109 else if (reportConfigEutra.timeToTrigger > 0)
2115 bool leavingCond = mn + ofn + ocn + hys < thresh;
2121 concernedCellsLeaving.push_back (cellId);
2122 eventLeavingCondApplicable =
true;
2125 else if (reportConfigEutra.timeToTrigger > 0)
2130 NS_LOG_LOGIC (
this <<
" event A4: neighbor cell " << cellId
2131 <<
" mn=" << mn <<
" thresh=" << thresh
2132 <<
" entryCond=" << entryCond
2133 <<
" leavingCond=" << leavingCond);
2151 double ofn = measObjectEutra.offsetFreq;
2158 switch (reportConfigEutra.triggerQuantity)
2162 NS_ASSERT (reportConfigEutra.threshold1.choice
2164 NS_ASSERT (reportConfigEutra.threshold2.choice
2171 NS_ASSERT (reportConfigEutra.threshold1.choice
2173 NS_ASSERT (reportConfigEutra.threshold2.choice
2184 bool entryCond = mp + hys < thresh1;
2188 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2192 uint16_t cellId = storedMeasIt->first;
2198 switch (reportConfigEutra.triggerQuantity)
2201 mn = storedMeasIt->second.rsrp;
2204 mn = storedMeasIt->second.rsrq;
2211 bool hasTriggered = isMeasIdInReportList
2212 && (measReportIt->second.cellsTriggeredList.find (cellId)
2213 != measReportIt->second.cellsTriggeredList.end ());
2217 entryCond = mn + ofn + ocn - hys > thresh2;
2223 concernedCellsEntry.push_back (cellId);
2224 eventEntryCondApplicable =
true;
2227 else if (reportConfigEutra.timeToTrigger > 0)
2232 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2233 <<
" mn=" << mn <<
" mp=" << mp
2234 <<
" thresh2=" << thresh2
2235 <<
" thresh1=" << thresh1
2236 <<
" entryCond=" << entryCond);
2244 <<
" mp=" << mp <<
" thresh1=" << thresh1
2245 <<
" entryCond=" << entryCond);
2247 if (reportConfigEutra.timeToTrigger > 0)
2253 if (isMeasIdInReportList)
2256 bool leavingCond = mp - hys > thresh1;
2260 if (reportConfigEutra.timeToTrigger == 0)
2264 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2268 uint16_t cellId = storedMeasIt->first;
2274 if (measReportIt->second.cellsTriggeredList.find (cellId)
2275 != measReportIt->second.cellsTriggeredList.end ())
2277 concernedCellsLeaving.push_back (cellId);
2278 eventLeavingCondApplicable =
true;
2286 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2290 uint16_t cellId = storedMeasIt->first;
2296 if (measReportIt->second.cellsTriggeredList.find (cellId)
2297 != measReportIt->second.cellsTriggeredList.end ())
2299 switch (reportConfigEutra.triggerQuantity)
2302 mn = storedMeasIt->second.rsrp;
2305 mn = storedMeasIt->second.rsrq;
2314 leavingCond = mn + ofn + ocn + hys < thresh2;
2326 concernedCellsLeaving.push_back (cellId);
2327 eventLeavingCondApplicable =
true;
2329 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2330 <<
" mn=" << mn <<
" mp=" << mp
2331 <<
" thresh2=" << thresh2
2332 <<
" thresh1=" << thresh1
2333 <<
" leavingCond=" << leavingCond);
2343 <<
" mp=" << mp <<
" thresh1=" << thresh1
2344 <<
" leavingCond=" << leavingCond);
2349 if (reportConfigEutra.timeToTrigger > 0)
2356 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2360 uint16_t cellId = storedMeasIt->first;
2366 if (measReportIt->second.cellsTriggeredList.find (cellId)
2367 != measReportIt->second.cellsTriggeredList.end ())
2369 switch (reportConfigEutra.triggerQuantity)
2372 mn = storedMeasIt->second.rsrp;
2375 mn = storedMeasIt->second.rsrq;
2383 leavingCond = mn + ofn + ocn + hys < thresh2;
2387 concernedCellsLeaving.push_back (cellId);
2388 eventLeavingCondApplicable =
true;
2391 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2392 <<
" mn=" << mn <<
" mp=" << mp
2393 <<
" thresh2=" << thresh2
2394 <<
" thresh1=" << thresh1
2395 <<
" leavingCond=" << leavingCond);
2411 NS_FATAL_ERROR (
"unsupported eventId " << reportConfigEutra.eventId);
2416 NS_LOG_LOGIC (
this <<
" eventEntryCondApplicable=" << eventEntryCondApplicable
2417 <<
" eventLeavingCondApplicable=" << eventLeavingCondApplicable);
2419 if (eventEntryCondApplicable)
2421 if (reportConfigEutra.timeToTrigger == 0)
2432 measId, concernedCellsEntry);
2433 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2436 enteringTriggerIt->second.push_back (t);
2440 if (eventLeavingCondApplicable)
2444 && reportConfigEutra.reportOnLeave;
2446 if (reportConfigEutra.timeToTrigger == 0)
2457 measId, concernedCellsLeaving, reportOnLeave);
2458 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2461 leavingTriggerIt->second.push_back (t);
2472 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2476 if (!it1->second.empty ())
2478 std::list<PendingTrigger_t>::iterator it2;
2479 for (it2 = it1->second.begin (); it2 != it1->second.end (); ++it2)
2482 NS_LOG_LOGIC (
this <<
" canceling entering time-to-trigger event at "
2487 it1->second.clear ();
2496 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2500 std::list<PendingTrigger_t>::iterator it2 = it1->second.begin ();
2501 while (it2 != it1->second.end ())
2505 ConcernedCells_t::iterator it3;
2506 for (it3 = it2->concernedCells.begin ();
2507 it3 != it2->concernedCells.end (); ++it3)
2511 it3 = it2->concernedCells.erase (it3);
2515 if (it2->concernedCells.empty ())
2517 NS_LOG_LOGIC (
this <<
" canceling entering time-to-trigger event at "
2520 it2 = it1->second.erase (it2);
2534 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2538 if (!it1->second.empty ())
2540 std::list<PendingTrigger_t>::iterator it2;
2541 for (it2 = it1->second.begin (); it2 != it1->second.end (); ++it2)
2544 NS_LOG_LOGIC (
this <<
" canceling leaving time-to-trigger event at "
2549 it1->second.clear ();
2558 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2562 std::list<PendingTrigger_t>::iterator it2 = it1->second.begin ();
2563 while (it2 != it1->second.end ())
2567 ConcernedCells_t::iterator it3;
2568 for (it3 = it2->concernedCells.begin ();
2569 it3 != it2->concernedCells.end (); ++it3)
2573 it3 = it2->concernedCells.erase (it3);
2577 if (it2->concernedCells.empty ())
2579 NS_LOG_LOGIC (
this <<
" canceling leaving time-to-trigger event at "
2582 it2 = it1->second.erase (it2);
2597 std::map<uint8_t, VarMeasReport>::iterator
2604 std::pair<uint8_t, VarMeasReport> val (measId, r);
2605 std::pair<std::map<uint8_t, VarMeasReport>::iterator,
bool>
2607 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
2608 measReportIt = ret.first;
2613 for (ConcernedCells_t::const_iterator it = enteringCells.begin ();
2614 it != enteringCells.end ();
2617 measReportIt->second.cellsTriggeredList.insert (*it);
2620 NS_ASSERT (!measReportIt->second.cellsTriggeredList.empty ());
2621 measReportIt->second.numberOfReportsSent = 0;
2622 measReportIt->second.periodicReportTimer
2627 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2630 if (!enteringTriggerIt->second.empty ())
2638 enteringTriggerIt->second.pop_front ();
2640 if (!enteringTriggerIt->second.empty ())
2647 for (ConcernedCells_t::const_iterator it = enteringCells.begin ();
2648 it != enteringCells.end (); ++it)
2665 std::map<uint8_t, VarMeasReport>::iterator
2669 for (ConcernedCells_t::const_iterator it = leavingCells.begin ();
2670 it != leavingCells.end ();
2673 measReportIt->second.cellsTriggeredList.erase (*it);
2682 if (measReportIt->second.cellsTriggeredList.empty ())
2684 measReportIt->second.periodicReportTimer.Cancel ();
2688 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2691 if (!leavingTriggerIt->second.empty ())
2699 leavingTriggerIt->second.pop_front ();
2701 if (!leavingTriggerIt->second.empty ())
2708 for (ConcernedCells_t::const_iterator it = leavingCells.begin ();
2709 it != leavingCells.end (); ++it)
2725 std::map<uint8_t, VarMeasReport>::iterator
2729 NS_LOG_LOGIC (
this <<
" deleting existing report for measId " << (uint16_t) measId);
2730 measReportIt->second.periodicReportTimer.Cancel ();
2744 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator
2748 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>::iterator
2755 measResults.
measId = measId;
2762 "RSRP " << (uint32_t) measResults.
rsrpResult <<
" (" << servingMeasIt->second.rsrp <<
" dBm) "
2763 "RSRQ " << (uint32_t) measResults.
rsrqResult <<
" (" << servingMeasIt->second.rsrq <<
" dB)");
2765 std::map<uint8_t, VarMeasReport>::iterator measReportIt =
m_varMeasReportList.find (measId);
2768 NS_LOG_ERROR (
"no entry found in m_varMeasReportList for measId " << (uint32_t) measId);
2772 if (!(measReportIt->second.cellsTriggeredList.empty ()))
2774 std::multimap<double, uint16_t> sortedNeighCells;
2775 for (std::set<uint16_t>::iterator cellsTriggeredIt = measReportIt->second.cellsTriggeredList.begin ();
2776 cellsTriggeredIt != measReportIt->second.cellsTriggeredList.end ();
2779 uint16_t cellId = *cellsTriggeredIt;
2782 std::map<uint16_t, MeasValues>::iterator neighborMeasIt =
m_storedMeasValues.find (cellId);
2783 double triggerValue;
2784 switch (reportConfigEutra.triggerQuantity)
2787 triggerValue = neighborMeasIt->second.rsrp;
2790 triggerValue = neighborMeasIt->second.rsrq;
2796 sortedNeighCells.insert (std::pair<double, uint16_t> (triggerValue, cellId));
2800 std::multimap<double, uint16_t>::reverse_iterator sortedNeighCellsIt;
2802 for (sortedNeighCellsIt = sortedNeighCells.rbegin (), count = 0;
2803 sortedNeighCellsIt != sortedNeighCells.rend () && count < reportConfigEutra.maxReportCells;
2804 ++sortedNeighCellsIt, ++count)
2806 uint16_t cellId = sortedNeighCellsIt->second;
2807 std::map<uint16_t, MeasValues>::iterator neighborMeasIt =
m_storedMeasValues.find (cellId);
2811 measResultEutra.haveCgiInfo =
false;
2812 measResultEutra.haveRsrpResult =
true;
2814 measResultEutra.haveRsrqResult =
true;
2816 NS_LOG_INFO (
this <<
" reporting neighbor cell " << (uint32_t) measResultEutra.physCellId
2817 <<
" RSRP " << (uint32_t) measResultEutra.rsrpResult
2818 <<
" (" << neighborMeasIt->second.rsrp <<
" dBm)"
2819 <<
" RSRQ " << (uint32_t) measResultEutra.rsrqResult
2820 <<
" (" << neighborMeasIt->second.rsrq <<
" dB)");
2827 NS_LOG_WARN (
this <<
" cellsTriggeredList is empty");
2843 measResultScell.
servFreqId = sCellsMeasIt->first;
2857 measReportIt->second.numberOfReportsSent++;
2858 measReportIt->second.periodicReportTimer.Cancel ();
2860 Time reportInterval;
2861 switch (reportConfigEutra.reportInterval)
2888 reportInterval =
Seconds (60);
2891 reportInterval =
Seconds (360);
2894 reportInterval =
Seconds (720);
2897 reportInterval =
Seconds (1800);
2900 reportInterval =
Seconds (3600);
2903 NS_FATAL_ERROR (
"Unsupported reportInterval " << (uint16_t) reportConfigEutra.reportInterval);
2908 measReportIt->second.periodicReportTimer
2935 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it;
2967 std::map<uint8_t, uint8_t>::iterator it =
m_bid2DrbidMap.find (bid);
3037 bool useLayer3Filtering, uint16_t componentCarrierId)
3039 NS_LOG_FUNCTION (
this << sCellId << componentCarrierId << rsrp << rsrq << useLayer3Filtering);
3047 if (useLayer3Filtering)
3053 if (std::isnan (storedMeasIt->second.rsrq))
3056 storedMeasIt->second.rsrq = rsrq;
3066 storedMeasIt->second.rsrp = rsrp;
3067 storedMeasIt->second.rsrq = rsrq;
3076 std::pair<uint16_t, MeasValues> val (componentCarrierId, v);
3077 std::pair<std::map<uint16_t, MeasValues>::iterator,
bool>
3079 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
3080 storedMeasIt = ret.first;
3084 <<
", measured cell " << sCellId
3085 <<
", carrier component Id " << componentCarrierId
3086 <<
", new RSRP " << rsrp <<
" stored " << storedMeasIt->second.rsrp
3087 <<
", new RSRQ " << rsrq <<
" stored " << storedMeasIt->second.rsrq);
3092 NS_LOG_DEBUG (
this <<
" IMSI " <<
m_imsi <<
"measurement on SCC from not serving cell ");
uint32_t sCellIndex
SCell index.
std::map< uint16_t, MeasValues > m_storedScellMeasValues
Internal storage of the latest measurement results from all detected detected Secondary carrier compo...
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
MemberLteUeCcmRrcSapUser class.
RrcConnectionRequest structure.
uint8_t numberOfRaPreambles
number of RA preambles
PhysicalConfigDedicated structure.
bool haveNonCriticalExtension
have critical extension?
LtePdcpSapProvider * srb1SapProvider
SRB1 SAP provider.
Simulation virtual time values and global simulation resolution.
uint8_t raResponseWindowSize
RA response window size.
RadioResourceConfigCommonSCell radioResourceConfigCommonSCell
radio resource config common SCell
CarrierFreqEutra carrierFreq
carrier frequency
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Event A1: Serving becomes better than absolute threshold.
Part of the RRC protocol.
void DoRecvRrcConnectionSetup(LteRrcSap::RrcConnectionSetup msg)
Part of the RRC protocol.
uint8_t m_componentCarrierId
component carrier ID
void DoRecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock msg)
Receive master information block function.
MeasurementReport structure.
std::map< uint8_t, LteRrcSap::MeasObjectToAddMod > measObjectList
measure object list
std::vector< struct UeMeasurementsElement > m_ueMeasurementsList
UE measurement list.
UeMemberLteUeCmacSapUser class.
void CancelEnteringTrigger(uint8_t measId)
Clear all the waiting triggers in m_enteringTriggerQueue which are associated with the given measurem...
void DoRecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 msg)
Receive system information block type 1 function.
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
void DoComponentCarrierEnabling(std::vector< uint8_t > res)
RRC CCM SAP USER Method.
static TypeId GetTypeId(void)
Get the type ID.
MobilityControlInfo structure.
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
std::list< MeasObjectToAddMod > measObjectToAddModList
measure object to add mod list
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
LtePdcpSapUser * m_drbPdcpSapUser
DRB PDCP SAP user.
void DoRecvSystemInformation(LteRrcSap::SystemInformation msg)
Part of the RRC protocol.
uint16_t bucketSizeDurationMs
bucket size duration ms
uint8_t numberOfRaPreambles
number of RA preambles
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Convert PDSCH config dedicated function.
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
static TypeId GetTypeId(void)
Get the type ID.
void SetAsSapUser(LteAsSapUser *s)
Set the AS SAP user to interact with the NAS entity.
void MeasurementReportTriggering(uint8_t measId)
Evaluate the reporting criteria of a measurement identity and invoke some reporting actions based on ...
QuantityConfig quantityConfig
quantity config
void DoRecvRrcConnectionReject(LteRrcSap::RrcConnectionReject msg)
Part of the RRC protocol.
std::list< uint8_t > reportConfigToRemoveList
report config to remove list
bool m_hasReceivedSib2
True if SIB2 was received for the current cell.
MeasObjectEutra structure.
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
int8_t qRxLevMin
INTEGER (-70..-22), actual value = IE value * 2 [dBm].
std::map< uint8_t, Ptr< LteDataRadioBearerInfo > > m_drbMap
The DataRadioBearerMap attribute.
void ApplyMeasConfig(LteRrcSap::MeasConfig mc)
Update the current measurement configuration m_varMeasConfig.
Specifies criteria for triggering of an E-UTRA measurement reporting event.
virtual void DoDispose(void)
Destructor implementation.
void SetUseRlcSm(bool val)
virtual void SendRrcConnectionReconfigurationCompleted(RrcConnectionReconfigurationCompleted msg)=0
Send an RRCConnectionReconfigurationComplete message to the serving eNodeB during an RRC connection r...
uint16_t m_numberOfComponentCarriers
The number of component carriers.
uint8_t measId
The measurement identity which raised the trigger.
RadioResourceConfigDedicatedSCell radioResourceConfigDedicateSCell
radio resource config dedicated SCell
LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated
the PDSCH condig dedicated
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
std::list< SrbToAddMod > srbToAddModList
SRB to add mod list.
void DoSetTemporaryCellRnti(uint16_t rnti)
Set temporary cell rnti function.
Represents a single triggered event from a measurement identity which reporting criteria have been fu...
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
EventId m_connectionTimeout
Invokes ConnectionEstablishmentTimeout() if RRC connection establishment procedure for this UE takes ...
LteUeRrc()
create an RRC instance for use within an ue
#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.
std::list< uint8_t > measObjectToRemoveList
measure object to remove list
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
std::vector< LteUeCmacSapProvider * > m_cmacSapProvider
UE CMac SAP provider.
PdschConfigCommon pdschConfigCommon
4: Physical configuration, physical channels pdsch-ConfigCommon-r10
virtual ~LteUeRrc()
Destructor.
uint16_t srsConfigIndex
SRS config index.
uint16_t m_cellId
The CellId attribute.
EventId timer
The pending reporting event, scheduled at the end of the time-to-trigger.
void CancelLeavingTrigger(uint8_t measId)
Clear all the waiting triggers in m_leavingTriggerQueue which are associated with the given measureme...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
virtual void NotifyRandomAccessSuccessful()
Notify the RRC that the MAC Random Access procedure completed successfully.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual void NotifyConnectionSuccessful()=0
Notify the NAS that RRC Connection Establishment was successful.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
bool haveCarrierFreq
have carrier frequency?
bool m_hasReceivedMib
True if MIB was received for the current cell.
RachConfigDedicated rachConfigDedicated
RACH config dedicated.
RSRP is used for the threshold.
SetupParameters structure.
bool haveSmeasure
have S measure?
void DoRecvRrcConnectionReestablishmentReject(LteRrcSap::RrcConnectionReestablishmentReject msg)
Part of the RRC protocol.
uint32_t m_dlEarfcn
Downlink carrier frequency.
MeasConfig measConfig
measure config
void SetRnti(uint16_t rnti)
bool m_connectionPending
True if a connection request by upper layers is pending.
LtePdcpSapUser * srb1SapUser
SRB1 SAP user.
uint8_t rsrpResult
the RSRP result
void DoStartCellSelection(uint32_t dlEarfcn)
Start cell selection function.
uint32_t ulCarrierFreq
UL carrier frequency.
bool m_hasReceivedSib1
True if SIB1 was received for the current cell.
LteMacSapProvider * m_macSapProvider
MAC SAP provider.
bool haveRadioResourceConfigDedicated
have radio resource config dedicated
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
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 ...
virtual void SendRrcConnectionSetupCompleted(RrcConnectionSetupCompleted msg)=0
Send an RRCConnectionSetupComplete message to the serving eNodeB during an RRC connection establishme...
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Ptr< Packet > pdcpSdu
the RRC PDU
uint8_t Bid2Drbid(uint8_t bid)
Bid 2 DR bid.
PreambleInfo preambleInfo
preamble info
uint8_t rsrpResult
RSRP result.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
CellIdentification cellIdentification
cell identification
LteUeCmacSapUser * GetLteUeCmacSapUser()
This function is overloaded to maintain backward compatibility.
uint8_t preambleTransMax
preamble transmit maximum
static const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
LteRrcSap::QuantityConfig quantityConfig
quantity config
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
std::vector< LteUeCphySapProvider * > m_cphySapProvider
UE CPhy SAP provider.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
void SetLteUeRrcSapUser(LteUeRrcSapUser *s)
set the RRC SAP this RRC should interact with
LteUeRrcSapUser * m_rrcSapUser
RRC SAP user.
uint8_t preambleTransMax
preamble transmit maximum
MeasResults measResults
measure results
FreqInfo ulFreqInfo
UL frequency info.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
MeasResultScell structure.
State m_state
The current UE RRC state.
AttributeValue implementation for Time.
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
ConcernedCells_t concernedCells
The list of cells responsible for this trigger.
uint64_t ueIdentity
UE identity.
static TypeId GetTypeId(void)
Get the type ID.
int8_t referenceSignalPower
INTEGER (-60..50),.
RrcConnectionReestablishment structure.
Represents a measurement result from a certain cell.
void DisposeOldSrb1()
Dispose old SRB1.
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
The HandoverStart trace source.
uint8_t rsrqResult
the RSRQ result
void DoRecvRrcConnectionReconfiguration(LteRrcSap::RrcConnectionReconfiguration msg)
Part of the RRC protocol.
void DoRecvRrcConnectionReestablishment(LteRrcSap::RrcConnectionReestablishment msg)
Part of the RRC protocol.
uint8_t m_dlBandwidth
Downlink bandwidth in RBs.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
Hold an unsigned integer type.
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessErrorTrace
The RandomAccessError trace source.
bool haveMeasurementResultsNeighCell
always false since not implemented
Service Access Point (SAP) offered by the UE RRC to the UE CCM.
NonUlConfiguration nonUlConfiguration
non UL configuration
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
TracedCallback< uint64_t, uint16_t, uint16_t > m_sib2ReceivedTrace
The Sib2Received trace source.
LteUeRrc * m_rrc
the RRC class
void ConnectionTimeout()
Invoked after timer T300 expires, notifying upper layers that RRC connection establishment procedure ...
uint32_t dlCarrierFreq
ARFCN - valueEUTRA.
bool haveMeasGapConfig
have measure gap config?
void EvaluateCellForSelection()
Performs cell selection evaluation to the current serving cell.
MeasResultEutra structure.
std::list< MeasResultScell > measResultScell
measure results Scells
RrcConnectionReconfiguration structure.
std::list< MeasIdToAddMod > measIdToAddModList
measure ID to add mod list
bool haveRachConfigDedicated
Have RACH config dedicated?
uint8_t raPrachMaskIndex
RA PRACH mask index.
virtual void DoInitialize(void)
Initialize() implementation.
std::map< uint16_t, MeasValues > m_storedMeasValues
Internal storage of the latest measurement results from all detected detected cells, indexed by the cell ID where the measurement was taken from.
void SetLteCcmRrcSapProvider(LteUeCcmRrcSapProvider *s)
set the Component Carrier Management SAP this RRC should interact with
PhysicalConfigDedicated physicalConfigDedicated
physical config dedicated
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
uint8_t filterCoefficientRSRP
filter coefficient RSRP
uint8_t GetUlBandwidth() const
bool haveRsrpResult
have RSRP result?
void SetLteUeCmacSapProvider(LteUeCmacSapProvider *s)
set the CMAC SAP this RRC should interact with
RrcConnectionReconfigurationCompleted structure.
bool m_useRlcSm
True if RLC SM is to be used, false if RLC UM/AM are to be used.
MeasResultServFreqList measScellResultList
measure SCell result list
RSRQ is used for the threshold.
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
std::list< SCellToAddMod > sCellsToAddModList
SCell to add mod list.
Template for the implementation of the LteAsSapProvider as a member of an owner class of type C to wh...
LteMacSapUser * GetLteMacSapUser()
uint32_t m_csgWhiteList
List of CSG ID which this UE entity has access to.
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
std::map< uint8_t, LteRrcSap::MeasIdToAddMod > measIdList
measure ID list
LogicalChannelConfig structure.
std::map< uint8_t, uint8_t > m_bid2DrbidMap
bid to DR bid map
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
RrcConnectionSetupCompleted structure.
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndOkTrace
The InitialCellSelectionEndOk trace source.
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
RrcConnectionSetup structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
void SetLteUeCphySapProvider(LteUeCphySapProvider *s)
set the CPHY SAP this RRC should use to interact with the PHY
void SwitchToState(State s)
Switch the UE RRC to the given state.
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
uint8_t raPreambleIndex
RA preamble index.
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndErrorTrace
The InitialCellSelectionEndError trace source.
VarMeasConfig m_varMeasConfig
Includes the accumulated configuration of the measurements to be performed by the UE...
std::map< uint8_t, std::list< PendingTrigger_t > > m_leavingTriggerQueue
List of triggers that were raised because leaving condition have been true, but are still delayed fro...
std::vector< LteUeCphySapUser * > m_cphySapUser
UE CPhy SAP user.
std::map< uint8_t, LteRrcSap::ReportConfigToAddMod > reportConfigList
report config list
uint16_t servFreqId
service frequency ID
virtual void Setup(SetupParameters params)=0
Setup function.
uint16_t physCellId
Phy cell ID.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool haveQuantityConfig
have quantity config?
Hold objects of type Ptr.
Event A2: Serving becomes worse than absolute threshold.
Ptr< Packet > pdcpSdu
the RRC PDU
void SetLteRlcSapUser(LteRlcSapUser *s)
uint16_t targetPhysCellId
target Phy cell ID
RrcConnectionReject structure.
LteAsSapUser * m_asSapUser
AS SAP user.
PhysicalConfigDedicatedSCell physicalConfigDedicatedSCell
physical config dedicated SCell
Template for the implementation of the LteUeRrcSapProvider as a member of an owner class of type C to...
uint32_t GetUlEarfcn() const
bool haveMobilityControlInfo
have mobility control info
void DoNotifyRandomAccessSuccessful()
Notify random access successful function.
void SaveScellUeMeasurements(uint16_t cellId, double rsrp, double rsrq, bool useLayer3Filtering, uint16_t componentCarrierId)
keep the given measurement result as the latest measurement figures, to be utilised by UE RRC functio...
uint8_t GetDlBandwidth() const
LteUeCcmRrcSapUser * m_ccmRrcSapUser
CCM RRC SAP user.
bool haveMeasResultNeighCells
have measure result neighbor cells
uint16_t dlBandwidth
1: Cell characteristics
uint32_t physCellId
physical cell ID
uint8_t filterCoefficientRSRQ
filter coefficient RSRQ
bool havePdschConfigDedicated
have PDSCH config dedicated?
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_sib1ReceivedTrace
The Sib1Received trace source.
uint16_t newUeIdentity
new UE identity
double rsrq
Measured RSRQ in dB.
uint8_t ulBandwidth
UL bandwidth.
void DoSendData(Ptr< Packet > packet, uint8_t bid)
Send data function.
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
void DoForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)
Force camped on ENB function.
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
LtePdcpSpecificLtePdcpSapUser class.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
RrcConnectionReestablishmentReject structure.
static Time Now(void)
Return the current simulation virtual time.
LteRlcSapUser * srb0SapUser
SRB0 SAP user.
void SetLcId(uint8_t lcId)
void DoRecvRrcConnectionRelease(LteRrcSap::RrcConnectionRelease msg)
Part of the RRC protocol.
double rsrp
Measured RSRP in dBm.
void VarMeasReportListErase(uint8_t measId, ConcernedCells_t leavingCells, bool reportOnLeave)
Remove some cells from an existing reporting entry in m_varMeasReportList.
LteUeCcmRrcSapUser * GetLteCcmRrcSapUser()
Get the Component Carrier Management SAP offered by this RRC.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
uint32_t dlCarrierFreq
DL carrier frequency.
CarrierBandwidthEutra carrierBandwidth
carrier bandwidth
LteUeCcmRrcSapProvider * m_ccmRrcSapProvider
Interface to the LteUeComponentCarrierManage instance.
uint8_t m_ulBandwidth
Uplink bandwidth in RBs.
Event A4: Neighbour becomes better than absolute threshold.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
LteUeCphySapUser * GetLteUeCphySapUser()
Reference Signal Received Quality.
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
The ConnectionReconfiguration trace source.
Ptr< LteSignalingRadioBearerInfo > m_srb1Old
SRB1 configuration before RRC connection reconfiguration.
virtual void SendMeasurementReport(MeasurementReport msg)=0
Send a MeasurementReport message to the serving eNodeB during a measurement reporting procedure (Sect...
State
The states of the UE RRC entity.
uint64_t GetImsi(void) const
RachConfigCommon rachConfigCommon
RACH config common.
void StartConnection()
Start connetion function.
Instantiate subclasses of ns3::Object.
static uint8_t Dbm2RsrpRange(double dbm)
convert an RSRP value in dBm to the corresponding range as per 3GPP TS 36.133 section 9...
uint8_t raResponseWindowSize
RA response window size.
void SaveUeMeasurements(uint16_t cellId, double rsrp, double rsrq, bool useLayer3Filtering)
Keep the given measurement result as the latest measurement figures, to be utilised by UE RRC functio...
uint16_t prioritizedBitRateKbps
prioritize bit rate Kbps
Service Access Point (SAP) offered by the UE component carrier manager to the UE RRC.
bool haveCarrierBandwidth
have carrier bandwidth?
bool haveAntennaInfoDedicated
have antenna info dedicated?
uint8_t ulBandwidth
UL bandwidth.
static const std::string & ToString(EpcUeNas::State s)
void DoSetCsgWhiteList(uint32_t csgId)
Set CSG white list function.
std::vector< LteUeCmacSapUser * > m_cmacSapUser
UE CMac SAP user.
void DoNotifyRandomAccessFailed()
Notify random access failed function.
NonCriticalExtensionConfiguration nonCriticalExtension
3GPP TS 36.331 v.11.10 R11 Sec. 6.2.2 pag. 147 (also known as ETSI TS 136 331 v.11.10 Feb-2015)
void DoCompleteSetup(LteUeRrcSapProvider::CompleteSetupParameters params)
Part of the RRC protocol.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
LteUeRrcSapProvider * m_rrcSapProvider
RRC SAP provider.
void DoConnect()
Connect function.
bool haveSpeedStatePars
have speed state parameters?
void ApplyRadioResourceConfigDedicated(LteRrcSap::RadioResourceConfigDedicated rrcd)
Apply radio resoure config dedicated.
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
uint16_t GetCellId() const
std::list< DrbToAddMod > drbToAddModList
DRB to add mod list.
virtual void NotifyConnectionReleased()=0
Notify the NAS that RRC Connection was released.
std::map< uint8_t, VarMeasReport > m_varMeasReportList
The list of active reporting entries, indexed by the measurement identity which triggered the reporti...
virtual void NotifyConnectionFailed()=0
Notify the NAS that RRC Connection Establishment failed.
LteAsSapProvider * m_asSapProvider
AS SAP provider.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.
Reference Signal Received Power.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_mibReceivedTrace
The MibReceived trace source.
uint16_t m_rnti
The C-RNTI attribute.
uint64_t m_imsi
The unique UE identifier.
uint8_t transmissionMode
transmission mode
void ApplyRadioResourceConfigDedicatedSecondaryCarrier(LteRrcSap::NonCriticalExtensionConfiguration nonCec)
Apply radio resoure config dedicated secondary carrier.
UeMeasurementsParameters structure.
Event A3: Neighbour becomes amount of offset better than PCell.
std::set< uint16_t > m_acceptableCell
List of cell ID of acceptable cells for cell selection that have been detected.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
LteAsSapProvider * GetAsSapProvider()
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
void DoReportUeMeasurements(LteUeCphySapUser::UeMeasurementsParameters params)
Report UE measurements function.
MobilityControlInfo mobilityControlInfo
mobility control info
bool haveMeasConfig
have measure config
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionTimeoutTrace
The ConnectionTimeout trace source.
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Represents a single measurement reporting entry., which includes information about a measurement for ...
bool haveRsrqResult
have RSRQ result?
CompleteSetupParameters structure.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
AntennaInfoDedicated antennaInfo
antenna info
LteRlcSapProvider * GetLteRlcSapProvider()
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
void SendMeasurementReport(uint8_t measId)
Produce a proper measurement report from the given measurement identity's reporting entry in m_varMea...
uint8_t rsrqResult
RSRQ result.
A base class which provides memory management and object aggregation.
PdschConfigCommon pdschConfigCommon
PDSCH config common.
void SynchronizeToStrongestCell()
Go through the list of measurement results, choose the one with the strongest RSRP, and tell PHY to synchronize to it.
Container for a set of ns3::Object pointers.
void InitializeSap(void)
Initiaize SAP.
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
virtual void SendRrcConnectionRequest(RrcConnectionRequest msg)=0
Send an _RRCConnectionRequest message to the serving eNodeB during an RRC connection establishment pr...
Part of the RRC protocol.
uint8_t dlBandwidth
DL bandwidth.
NonCriticalExtensionConfiguration structure.
uint32_t GetDlEarfcn() const
RrcConnectionRelease structure.
static uint8_t Db2RsrqRange(double db)
convert an RSRQ value in dB to the corresponding range as per 3GPP TS 36.133 section 9...
PdschConfigDedicated structure.
virtual void RecvData(Ptr< Packet > packet)=0
receive a data packet
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
UeMemberLteUeCmacSapUser(LteUeRrc *rrc)
Constructor.
LteUeRrcSapProvider * GetLteUeRrcSapProvider()
static const std::string g_ueRrcStateName[LteUeRrc::NUM_STATES]
Map each of UE RRC states to its string representation.
std::list< uint16_t > ConcernedCells_t
List of cell IDs which are responsible for a certain trigger.
Time m_t300
The T300 attribute.
UlConfiguration ulConfiguration
UL configuration.
void VarMeasReportListAdd(uint8_t measId, ConcernedCells_t enteringCells)
Compose a new reporting entry of the given measurement identity, insert it into m_varMeasReportList, and set it up for submission to eNodeB.
void DoDisconnect()
Disconnect function.
virtual void SetTemporaryCellRnti(uint16_t rnti)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessSuccessfulTrace
The RandomAccessSuccessful trace source.
std::map< uint8_t, std::list< PendingTrigger_t > > m_enteringTriggerQueue
List of triggers that were raised because entering condition have been true, but are still delayed fr...
std::list< uint8_t > measIdToRemoveList
measure ID to remove list
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE...
a unique identifier for an interface.
std::list< ReportConfigToAddMod > reportConfigToAddModList
report config to add mod list
TypeId SetParent(TypeId tid)
Set the parent TypeId.
std::list< uint8_t > drbToReleaseList
DRB to release list.
static TypeId GetTypeId(void)
Get the type ID.
void SetImsi(uint64_t imsi)
uint8_t m_lastRrcTransactionIdentifier
last RRC transaction identifier
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
void VarMeasReportListClear(uint8_t measId)
Remove the reporting entry of the given measurement identity from m_varMeasReportList.
void LeaveConnectedMode()
Leave connected mode.
uint32_t m_ulEarfcn
Uplink carrier frequency.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndErrorTrace
The HandoverEndError trace source.
RaSupervisionInfo raSupervisionInfo
RA supervision info.
LteRrcSap::SystemInformationBlockType1 m_lastSib1
Stored content of the last SIB1 received.
void SetLteMacSapProvider(LteMacSapProvider *s)
bool haveScellsMeas
has SCells measure
bool haveMeasurementResultsServingSCells
have measure results serving Scells
AntennaInfoDedicated antennaInfo
antenna info dedicated
virtual void NotifyRandomAccessFailed()
Notify the RRC that the MAC Random Access procedure failed.
RadioResourceConfigDedicated structure.
uint32_t ulCarrierFreq
UL carrier frequency.
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 ...
uint8_t logicalChannelGroup
logical channel group