24 #include <ns3/fatal-error.h>
26 #include <ns3/object-map.h>
27 #include <ns3/object-factory.h>
28 #include <ns3/simulator.h>
30 #include <ns3/lte-rlc.h>
31 #include <ns3/lte-rlc-tm.h>
32 #include <ns3/lte-rlc-um.h>
33 #include <ns3/lte-rlc-am.h>
34 #include <ns3/lte-pdcp.h>
35 #include <ns3/lte-radio-bearer-info.h>
97 "IDLE_CAMPED_NORMALLY",
101 "CONNECTED_NORMALLY",
102 "CONNECTED_HANDOVER",
103 "CONNECTED_PHY_PROBLEM",
104 "CONNECTED_REESTABLISHING"
113 return g_ueRrcStateName[
s];
125 : m_cphySapProvider (0),
126 m_cmacSapProvider (0),
128 m_macSapProvider (0),
130 m_state (IDLE_START),
135 m_connectionPending (false),
136 m_hasReceivedMib (false),
137 m_hasReceivedSib1 (false),
138 m_hasReceivedSib2 (false),
172 .AddConstructor<LteUeRrc> ()
173 .AddAttribute (
"DataRadioBearerMap",
"List of UE RadioBearerInfo for Data Radio Bearers by LCID.",
176 MakeObjectMapChecker<LteDataRadioBearerInfo> ())
177 .AddAttribute (
"Srb0",
"SignalingRadioBearerInfo for SRB0",
180 MakePointerChecker<LteSignalingRadioBearerInfo> ())
181 .AddAttribute (
"Srb1",
"SignalingRadioBearerInfo for SRB1",
184 MakePointerChecker<LteSignalingRadioBearerInfo> ())
185 .AddAttribute (
"CellId",
186 "Serving cell identifier",
189 MakeUintegerChecker<uint16_t> ())
190 .AddAttribute (
"C-RNTI",
191 "Cell Radio Network Temporary Identifier",
194 MakeUintegerChecker<uint16_t> ())
195 .AddAttribute (
"T300",
196 "Timer for the RRC Connection Establishment procedure "
197 "(i.e., the procedure is deemed as failed if it takes longer than this)",
201 .AddTraceSource (
"MibReceived",
202 "trace fired upon reception of Master Information Block",
204 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
205 .AddTraceSource (
"Sib1Received",
206 "trace fired upon reception of System Information Block Type 1",
208 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
209 .AddTraceSource (
"Sib2Received",
210 "trace fired upon reception of System Information Block Type 2",
212 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
213 .AddTraceSource (
"StateTransition",
214 "trace fired upon every UE RRC state transition",
216 "ns3::LteUeRrc::StateTracedCallback")
217 .AddTraceSource (
"InitialCellSelectionEndOk",
218 "trace fired upon successful initial cell selection procedure",
220 "ns3::LteUeRrc::CellSelectionTracedCallback")
221 .AddTraceSource (
"InitialCellSelectionEndError",
222 "trace fired upon failed initial cell selection procedure",
224 "ns3::LteUeRrc::CellSelectionTracedCallback")
225 .AddTraceSource (
"RandomAccessSuccessful",
226 "trace fired upon successful completion of the random access procedure",
228 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
229 .AddTraceSource (
"RandomAccessError",
230 "trace fired upon failure of the random access procedure",
232 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
233 .AddTraceSource (
"ConnectionEstablished",
234 "trace fired upon successful RRC connection establishment",
236 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
237 .AddTraceSource (
"ConnectionTimeout",
238 "trace fired upon timeout RRC connection establishment because of T300",
240 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
241 .AddTraceSource (
"ConnectionReconfiguration",
242 "trace fired upon RRC connection reconfiguration",
244 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
245 .AddTraceSource (
"HandoverStart",
246 "trace fired upon start of a handover procedure",
248 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
249 .AddTraceSource (
"HandoverEndOk",
250 "trace fired upon successful termination of a handover procedure",
252 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
253 .AddTraceSource (
"HandoverEndError",
254 "trace fired upon failure of a handover procedure",
256 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
401 Ptr<LteRlc> rlc = CreateObject<LteRlcTm> ()->GetObject<LteRlc> ();
406 m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
408 m_srb0->m_srbIdentity = 0;
435 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it =
m_drbMap.find (drbid);
441 params.lcid = it->second->m_logicalChannelIdentity;
444 <<
" on DRBID " << (uint32_t) drbid
445 <<
" (LCID " << (uint32_t) params.lcid <<
")"
446 <<
" (" << packet->
GetSize () <<
" bytes)");
447 it->second->m_pdcp->GetLtePdcpSapProvider ()->TransmitPdcpSdu (params);
532 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
724 "Cell identity in SIB1 does not match with the originating cell");
739 "Cell identity in SIB1 does not match with the originating cell");
763 std::vector <LteUeCphySapUser::UeMeasurementsElement>::iterator newMeasIt;
768 newMeasIt->m_rsrq, useLayer3Filtering);
778 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
1017 uint16_t maxRsrpCellId = 0;
1018 double maxRsrp = -std::numeric_limits<double>::infinity ();
1020 std::map<uint16_t, MeasValues>::iterator it;
1027 if (maxRsrp < it->second.rsrp)
1029 std::set<uint16_t>::const_iterator itCell;
1033 maxRsrpCellId = it->first;
1034 maxRsrp = it->second.rsrp;
1039 if (maxRsrpCellId == 0)
1041 NS_LOG_WARN (
this <<
" Cell search is unable to detect surrounding cell to attach to");
1046 <<
" is the strongest untried surrounding cell");
1065 bool isSuitableCell =
false;
1066 bool isAcceptableCell =
false;
1067 std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.find (cellId);
1068 double qRxLevMeas = storedMeasIt->second.rsrp;
1070 NS_LOG_LOGIC (
this <<
" cell selection to cellId=" << cellId
1071 <<
" qrxlevmeas=" << qRxLevMeas <<
" dBm"
1072 <<
" qrxlevmin=" << qRxLevMin <<
" dBm");
1074 if (qRxLevMeas - qRxLevMin > 0)
1076 isAcceptableCell =
true;
1081 isSuitableCell = (cellCsgIndication ==
false) || (cellCsgId ==
m_csgWhiteList);
1084 << cellCsgId <<
"/" << cellCsgIndication);
1105 if (isAcceptableCell)
1144 std::list<LteRrcSap::SrbToAddMod>::const_iterator stamIt = rrcd.
srbToAddModList.begin ();
1152 NS_ASSERT_MSG (stamIt->srbIdentity == 1,
"only SRB1 supported");
1154 const uint8_t lcid = 1;
1163 pdcp->SetLcId (lcid);
1168 m_srb1 = CreateObject<LteSignalingRadioBearerInfo> ();
1171 m_srb1->m_srbIdentity = 1;
1173 m_srb1->m_logicalChannelConfig.priority = stamIt->logicalChannelConfig.priority;
1174 m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = stamIt->logicalChannelConfig.prioritizedBitRateKbps;
1175 m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = stamIt->logicalChannelConfig.bucketSizeDurationMs;
1176 m_srb1->m_logicalChannelConfig.logicalChannelGroup = stamIt->logicalChannelConfig.logicalChannelGroup;
1179 lcConfig.
priority = stamIt->logicalChannelConfig.priority;
1191 ueParams.srb1SapProvider =
m_srb1->m_pdcp->GetLtePdcpSapProvider ();
1196 NS_LOG_INFO (
"request to modify SRB1 (skipping as currently not implemented)");
1202 std::list<LteRrcSap::DrbToAddMod>::const_iterator dtamIt;
1207 NS_LOG_INFO (
this <<
" IMSI " <<
m_imsi <<
" adding/modifying DRBID " << (uint32_t) dtamIt->drbIdentity <<
" LC " << (uint32_t) dtamIt->logicalChannelIdentity);
1208 NS_ASSERT_MSG (dtamIt->logicalChannelIdentity > 2,
"LCID value " << dtamIt->logicalChannelIdentity <<
" is reserved for SRBs");
1210 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbMapIt =
m_drbMap.find (dtamIt->drbIdentity);
1222 switch (dtamIt->rlcConfig.choice)
1243 rlc->
SetLcId (dtamIt->logicalChannelIdentity);
1246 drbInfo->m_rlc = rlc;
1247 drbInfo->m_epsBearerIdentity = dtamIt->epsBearerIdentity;
1248 drbInfo->m_logicalChannelIdentity = dtamIt->logicalChannelIdentity;
1249 drbInfo->m_drbIdentity = dtamIt->drbIdentity;
1257 pdcp->SetLcId (dtamIt->logicalChannelIdentity);
1261 drbInfo->m_pdcp = pdcp;
1270 lcConfig.
priority = dtamIt->logicalChannelConfig.priority;
1288 std::list<uint8_t>::iterator dtdmIt;
1293 uint8_t drbid = *dtdmIt;
1294 NS_LOG_INFO (
this <<
" IMSI " <<
m_imsi <<
" releasing DRB " << (uint32_t) drbid << drbid);
1295 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it =
m_drbMap.find (drbid);
1317 uint8_t measObjectId = *it;
1318 NS_LOG_LOGIC (
this <<
" deleting measObjectId " << (uint32_t) measObjectId);
1323 if (measIdIt->second.measObjectId == measObjectId)
1325 uint8_t measId = measIdIt->second.measId;
1327 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId <<
" because referring to measObjectId " << (uint32_t) measObjectId);
1346 NS_ASSERT_MSG (it->measObjectEutra.cellsToRemoveList.empty (),
"cellsToRemoveList not supported");
1347 NS_ASSERT_MSG (it->measObjectEutra.cellsToAddModList.empty (),
"cellsToAddModList not supported");
1348 NS_ASSERT_MSG (it->measObjectEutra.cellsToRemoveList.empty (),
"blackCellsToRemoveList not supported");
1349 NS_ASSERT_MSG (it->measObjectEutra.blackCellsToAddModList.empty (),
"blackCellsToAddModList not supported");
1350 NS_ASSERT_MSG (it->measObjectEutra.haveCellForWhichToReportCGI ==
false,
"cellForWhichToReportCGI is not supported");
1352 uint8_t measObjectId = it->measObjectId;
1356 NS_LOG_LOGIC (
"measObjectId " << (uint32_t) measObjectId <<
" exists, updating entry");
1357 measObjectIt->second = *it;
1358 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1363 if (measIdIt->second.measObjectId == measObjectId)
1365 uint8_t measId = measIdIt->second.measId;
1366 NS_LOG_LOGIC (
this <<
" found measId " << (uint32_t) measId <<
" referring to measObjectId " << (uint32_t) measObjectId);
1373 NS_LOG_LOGIC (
"measObjectId " << (uint32_t) measObjectId <<
" is new, adding entry");
1384 uint8_t reportConfigId = *it;
1385 NS_LOG_LOGIC (
this <<
" deleting reportConfigId " << (uint32_t) reportConfigId);
1390 if (measIdIt->second.reportConfigId == reportConfigId)
1392 uint8_t measId = measIdIt->second.measId;
1394 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId <<
" because referring to reportConfigId " << (uint32_t) reportConfigId);
1414 "only trigger type EVENT is supported");
1416 uint8_t reportConfigId = it->reportConfigId;
1420 NS_LOG_LOGIC (
"reportConfigId " << (uint32_t) reportConfigId <<
" exists, updating entry");
1422 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1427 if (measIdIt->second.reportConfigId == reportConfigId)
1429 uint8_t measId = measIdIt->second.measId;
1430 NS_LOG_LOGIC (
this <<
" found measId " << (uint32_t) measId <<
" referring to reportConfigId " << (uint32_t) reportConfigId);
1437 NS_LOG_LOGIC (
"reportConfigId " << (uint32_t) reportConfigId <<
" is new, adding entry");
1453 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1467 uint8_t measId = *it;
1468 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId);
1478 for (std::list<LteRrcSap::MeasIdToAddMod>::iterator it = mc.
measIdToAddModList.begin ();
1482 NS_LOG_LOGIC (
this <<
" measId " << (uint32_t) it->measId
1483 <<
" (measObjectId=" << (uint32_t) it->measObjectId
1484 <<
", reportConfigId=" << (uint32_t) it->reportConfigId
1491 std::map<uint8_t, VarMeasReport>::iterator measReportIt =
m_varMeasReportList.find (it->measId);
1494 measReportIt->second.periodicReportTimer.Cancel ();
1501 std::list<PendingTrigger_t>
s;
1524 bool useLayer3Filtering)
1526 NS_LOG_FUNCTION (
this << cellId << rsrp << rsrq << useLayer3Filtering);
1528 std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.find (cellId);
1532 if (useLayer3Filtering)
1538 if (std::isnan (storedMeasIt->second.rsrq))
1541 storedMeasIt->second.rsrq = rsrq;
1551 storedMeasIt->second.rsrp = rsrp;
1552 storedMeasIt->second.rsrq = rsrq;
1561 std::pair<uint16_t, MeasValues> val (cellId, v);
1562 std::pair<std::map<uint16_t, MeasValues>::iterator,
bool>
1564 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
1565 storedMeasIt = ret.first;
1570 <<
", new RSRP " << rsrp <<
" stored " << storedMeasIt->second.rsrp
1571 <<
", new RSRQ " << rsrq <<
" stored " << storedMeasIt->second.rsrq);
1581 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt =
1584 NS_ASSERT (measIdIt->first == measIdIt->second.measId);
1586 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>::iterator
1591 std::map<uint8_t, LteRrcSap::MeasObjectToAddMod>::iterator
1596 std::map<uint8_t, VarMeasReport>::iterator
1604 "only triggerType == event is supported");
1607 NS_LOG_LOGIC (
this <<
" considering measId " << (uint32_t) measId);
1608 bool eventEntryCondApplicable =
false;
1609 bool eventLeavingCondApplicable =
false;
1613 switch (reportConfigEutra.eventId)
1627 switch (reportConfigEutra.triggerQuantity)
1631 NS_ASSERT (reportConfigEutra.threshold1.choice
1637 NS_ASSERT (reportConfigEutra.threshold1.choice
1647 bool entryCond = ms - hys > thresh;
1651 if (!isMeasIdInReportList)
1653 concernedCellsEntry.push_back (
m_cellId);
1654 eventEntryCondApplicable =
true;
1663 != measReportIt->second.cellsTriggeredList.end ());
1666 else if (reportConfigEutra.timeToTrigger > 0)
1672 bool leavingCond = ms + hys < thresh;
1676 if (isMeasIdInReportList)
1683 != measReportIt->second.cellsTriggeredList.end ());
1684 concernedCellsLeaving.push_back (
m_cellId);
1685 eventLeavingCondApplicable =
true;
1688 else if (reportConfigEutra.timeToTrigger > 0)
1694 <<
" ms=" << ms <<
" thresh=" << thresh
1695 <<
" entryCond=" << entryCond
1696 <<
" leavingCond=" << leavingCond);
1714 switch (reportConfigEutra.triggerQuantity)
1718 NS_ASSERT (reportConfigEutra.threshold1.choice
1724 NS_ASSERT (reportConfigEutra.threshold1.choice
1734 bool entryCond = ms + hys < thresh;
1738 if (!isMeasIdInReportList)
1740 concernedCellsEntry.push_back (
m_cellId);
1741 eventEntryCondApplicable =
true;
1750 != measReportIt->second.cellsTriggeredList.end ());
1753 else if (reportConfigEutra.timeToTrigger > 0)
1759 bool leavingCond = ms - hys > thresh;
1763 if (isMeasIdInReportList)
1770 != measReportIt->second.cellsTriggeredList.end ());
1771 concernedCellsLeaving.push_back (
m_cellId);
1772 eventLeavingCondApplicable =
true;
1775 else if (reportConfigEutra.timeToTrigger > 0)
1781 <<
" ms=" << ms <<
" thresh=" << thresh
1782 <<
" entryCond=" << entryCond
1783 <<
" leavingCond=" << leavingCond);
1797 double ofn = measObjectEutra.offsetFreq;
1800 double ofp = measObjectEutra.offsetFreq;
1807 switch (reportConfigEutra.triggerQuantity)
1811 NS_ASSERT (reportConfigEutra.threshold1.choice
1816 NS_ASSERT (reportConfigEutra.threshold1.choice
1824 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
1828 uint16_t cellId = storedMeasIt->first;
1834 switch (reportConfigEutra.triggerQuantity)
1837 mn = storedMeasIt->second.rsrp;
1840 mn = storedMeasIt->second.rsrq;
1847 bool hasTriggered = isMeasIdInReportList
1848 && (measReportIt->second.cellsTriggeredList.find (cellId)
1849 != measReportIt->second.cellsTriggeredList.end ());
1852 bool entryCond = mn + ofn + ocn - hys > mp + ofp + ocp + off;
1858 concernedCellsEntry.push_back (cellId);
1859 eventEntryCondApplicable =
true;
1862 else if (reportConfigEutra.timeToTrigger > 0)
1868 bool leavingCond = mn + ofn + ocn + hys < mp + ofp + ocp + off;
1874 concernedCellsLeaving.push_back (cellId);
1875 eventLeavingCondApplicable =
true;
1878 else if (reportConfigEutra.timeToTrigger > 0)
1883 NS_LOG_LOGIC (
this <<
" event A3: neighbor cell " << cellId
1884 <<
" mn=" << mn <<
" mp=" << mp <<
" offset=" << off
1885 <<
" entryCond=" << entryCond
1886 <<
" leavingCond=" << leavingCond);
1902 double ofn = measObjectEutra.offsetFreq;
1908 switch (reportConfigEutra.triggerQuantity)
1911 NS_ASSERT (reportConfigEutra.threshold1.choice
1916 NS_ASSERT (reportConfigEutra.threshold1.choice
1925 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
1929 uint16_t cellId = storedMeasIt->first;
1935 switch (reportConfigEutra.triggerQuantity)
1938 mn = storedMeasIt->second.rsrp;
1941 mn = storedMeasIt->second.rsrq;
1948 bool hasTriggered = isMeasIdInReportList
1949 && (measReportIt->second.cellsTriggeredList.find (cellId)
1950 != measReportIt->second.cellsTriggeredList.end ());
1953 bool entryCond = mn + ofn + ocn - hys > thresh;
1959 concernedCellsEntry.push_back (cellId);
1960 eventEntryCondApplicable =
true;
1963 else if (reportConfigEutra.timeToTrigger > 0)
1969 bool leavingCond = mn + ofn + ocn + hys < thresh;
1975 concernedCellsLeaving.push_back (cellId);
1976 eventLeavingCondApplicable =
true;
1979 else if (reportConfigEutra.timeToTrigger > 0)
1984 NS_LOG_LOGIC (
this <<
" event A4: neighbor cell " << cellId
1985 <<
" mn=" << mn <<
" thresh=" << thresh
1986 <<
" entryCond=" << entryCond
1987 <<
" leavingCond=" << leavingCond);
2005 double ofn = measObjectEutra.offsetFreq;
2012 switch (reportConfigEutra.triggerQuantity)
2016 NS_ASSERT (reportConfigEutra.threshold1.choice
2018 NS_ASSERT (reportConfigEutra.threshold2.choice
2025 NS_ASSERT (reportConfigEutra.threshold1.choice
2027 NS_ASSERT (reportConfigEutra.threshold2.choice
2038 bool entryCond = mp + hys < thresh1;
2042 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2046 uint16_t cellId = storedMeasIt->first;
2052 switch (reportConfigEutra.triggerQuantity)
2055 mn = storedMeasIt->second.rsrp;
2058 mn = storedMeasIt->second.rsrq;
2065 bool hasTriggered = isMeasIdInReportList
2066 && (measReportIt->second.cellsTriggeredList.find (cellId)
2067 != measReportIt->second.cellsTriggeredList.end ());
2071 entryCond = mn + ofn + ocn - hys > thresh2;
2077 concernedCellsEntry.push_back (cellId);
2078 eventEntryCondApplicable =
true;
2081 else if (reportConfigEutra.timeToTrigger > 0)
2086 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2087 <<
" mn=" << mn <<
" mp=" << mp
2088 <<
" thresh2=" << thresh2
2089 <<
" thresh1=" << thresh1
2090 <<
" entryCond=" << entryCond);
2098 <<
" mp=" << mp <<
" thresh1=" << thresh1
2099 <<
" entryCond=" << entryCond);
2101 if (reportConfigEutra.timeToTrigger > 0)
2107 if (isMeasIdInReportList)
2110 bool leavingCond = mp - hys > thresh1;
2114 if (reportConfigEutra.timeToTrigger == 0)
2118 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2122 uint16_t cellId = storedMeasIt->first;
2128 if (measReportIt->second.cellsTriggeredList.find (cellId)
2129 != measReportIt->second.cellsTriggeredList.end ())
2131 concernedCellsLeaving.push_back (cellId);
2132 eventLeavingCondApplicable =
true;
2140 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2144 uint16_t cellId = storedMeasIt->first;
2150 if (measReportIt->second.cellsTriggeredList.find (cellId)
2151 != measReportIt->second.cellsTriggeredList.end ())
2153 switch (reportConfigEutra.triggerQuantity)
2156 mn = storedMeasIt->second.rsrp;
2159 mn = storedMeasIt->second.rsrq;
2168 leavingCond = mn + ofn + ocn + hys < thresh2;
2180 concernedCellsLeaving.push_back (cellId);
2181 eventLeavingCondApplicable =
true;
2183 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2184 <<
" mn=" << mn <<
" mp=" << mp
2185 <<
" thresh2=" << thresh2
2186 <<
" thresh1=" << thresh1
2187 <<
" leavingCond=" << leavingCond);
2197 <<
" mp=" << mp <<
" thresh1=" << thresh1
2198 <<
" leavingCond=" << leavingCond);
2203 if (reportConfigEutra.timeToTrigger > 0)
2210 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2214 uint16_t cellId = storedMeasIt->first;
2220 if (measReportIt->second.cellsTriggeredList.find (cellId)
2221 != measReportIt->second.cellsTriggeredList.end ())
2223 switch (reportConfigEutra.triggerQuantity)
2226 mn = storedMeasIt->second.rsrp;
2229 mn = storedMeasIt->second.rsrq;
2237 leavingCond = mn + ofn + ocn + hys < thresh2;
2241 concernedCellsLeaving.push_back (cellId);
2242 eventLeavingCondApplicable =
true;
2245 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2246 <<
" mn=" << mn <<
" mp=" << mp
2247 <<
" thresh2=" << thresh2
2248 <<
" thresh1=" << thresh1
2249 <<
" leavingCond=" << leavingCond);
2265 NS_FATAL_ERROR (
"unsupported eventId " << reportConfigEutra.eventId);
2270 NS_LOG_LOGIC (
this <<
" eventEntryCondApplicable=" << eventEntryCondApplicable
2271 <<
" eventLeavingCondApplicable=" << eventLeavingCondApplicable);
2273 if (eventEntryCondApplicable)
2275 if (reportConfigEutra.timeToTrigger == 0)
2286 measId, concernedCellsEntry);
2287 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2290 enteringTriggerIt->second.push_back (t);
2294 if (eventLeavingCondApplicable)
2298 && reportConfigEutra.reportOnLeave;
2300 if (reportConfigEutra.timeToTrigger == 0)
2311 measId, concernedCellsLeaving, reportOnLeave);
2312 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2315 leavingTriggerIt->second.push_back (t);
2326 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2330 if (!it1->second.empty ())
2332 std::list<PendingTrigger_t>::iterator it2;
2333 for (it2 = it1->second.begin (); it2 != it1->second.end (); ++it2)
2336 NS_LOG_LOGIC (
this <<
" canceling entering time-to-trigger event at "
2341 it1->second.clear ();
2350 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2354 std::list<PendingTrigger_t>::iterator it2 = it1->second.begin ();
2355 while (it2 != it1->second.end ())
2359 ConcernedCells_t::iterator it3;
2360 for (it3 = it2->concernedCells.begin ();
2361 it3 != it2->concernedCells.end (); ++it3)
2365 it3 = it2->concernedCells.erase (it3);
2369 if (it2->concernedCells.empty ())
2371 NS_LOG_LOGIC (
this <<
" canceling entering time-to-trigger event at "
2374 it2 = it1->second.erase (it2);
2388 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2392 if (!it1->second.empty ())
2394 std::list<PendingTrigger_t>::iterator it2;
2395 for (it2 = it1->second.begin (); it2 != it1->second.end (); ++it2)
2398 NS_LOG_LOGIC (
this <<
" canceling leaving time-to-trigger event at "
2403 it1->second.clear ();
2412 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2416 std::list<PendingTrigger_t>::iterator it2 = it1->second.begin ();
2417 while (it2 != it1->second.end ())
2421 ConcernedCells_t::iterator it3;
2422 for (it3 = it2->concernedCells.begin ();
2423 it3 != it2->concernedCells.end (); ++it3)
2427 it3 = it2->concernedCells.erase (it3);
2431 if (it2->concernedCells.empty ())
2433 NS_LOG_LOGIC (
this <<
" canceling leaving time-to-trigger event at "
2436 it2 = it1->second.erase (it2);
2451 std::map<uint8_t, VarMeasReport>::iterator
2458 std::pair<uint8_t, VarMeasReport> val (measId, r);
2459 std::pair<std::map<uint8_t, VarMeasReport>::iterator,
bool>
2461 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
2462 measReportIt = ret.first;
2467 for (ConcernedCells_t::const_iterator it = enteringCells.begin ();
2468 it != enteringCells.end ();
2471 measReportIt->second.cellsTriggeredList.insert (*it);
2474 NS_ASSERT (!measReportIt->second.cellsTriggeredList.empty ());
2475 measReportIt->second.numberOfReportsSent = 0;
2476 measReportIt->second.periodicReportTimer
2481 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2484 if (!enteringTriggerIt->second.empty ())
2492 enteringTriggerIt->second.pop_front ();
2494 if (!enteringTriggerIt->second.empty ())
2501 for (ConcernedCells_t::const_iterator it = enteringCells.begin ();
2502 it != enteringCells.end (); ++it)
2519 std::map<uint8_t, VarMeasReport>::iterator
2523 for (ConcernedCells_t::const_iterator it = leavingCells.begin ();
2524 it != leavingCells.end ();
2527 measReportIt->second.cellsTriggeredList.erase (*it);
2536 if (measReportIt->second.cellsTriggeredList.empty ())
2538 measReportIt->second.periodicReportTimer.Cancel ();
2542 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2545 if (!leavingTriggerIt->second.empty ())
2553 leavingTriggerIt->second.pop_front ();
2555 if (!leavingTriggerIt->second.empty ())
2562 for (ConcernedCells_t::const_iterator it = leavingCells.begin ();
2563 it != leavingCells.end (); ++it)
2579 std::map<uint8_t, VarMeasReport>::iterator
2583 NS_LOG_LOGIC (
this <<
" deleting existing report for measId " << (uint16_t) measId);
2584 measReportIt->second.periodicReportTimer.Cancel ();
2598 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator
2602 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>::iterator
2609 measResults.
measId = measId;
2616 "RSRP " << (uint32_t) measResults.
rsrpResult <<
" (" << servingMeasIt->second.rsrp <<
" dBm) "
2617 "RSRQ " << (uint32_t) measResults.
rsrqResult <<
" (" << servingMeasIt->second.rsrq <<
" dB)");
2619 std::map<uint8_t, VarMeasReport>::iterator measReportIt =
m_varMeasReportList.find (measId);
2622 NS_LOG_ERROR (
"no entry found in m_varMeasReportList for measId " << (uint32_t) measId);
2626 if (!(measReportIt->second.cellsTriggeredList.empty ()))
2628 std::multimap<double, uint16_t> sortedNeighCells;
2629 for (std::set<uint16_t>::iterator cellsTriggeredIt = measReportIt->second.cellsTriggeredList.begin ();
2630 cellsTriggeredIt != measReportIt->second.cellsTriggeredList.end ();
2633 uint16_t cellId = *cellsTriggeredIt;
2636 std::map<uint16_t, MeasValues>::iterator neighborMeasIt =
m_storedMeasValues.find (cellId);
2637 double triggerValue;
2638 switch (reportConfigEutra.triggerQuantity)
2641 triggerValue = neighborMeasIt->second.rsrp;
2644 triggerValue = neighborMeasIt->second.rsrq;
2650 sortedNeighCells.insert (std::pair<double, uint16_t> (triggerValue, cellId));
2654 std::multimap<double, uint16_t>::reverse_iterator sortedNeighCellsIt;
2656 for (sortedNeighCellsIt = sortedNeighCells.rbegin (), count = 0;
2657 sortedNeighCellsIt != sortedNeighCells.rend () && count < reportConfigEutra.maxReportCells;
2658 ++sortedNeighCellsIt, ++count)
2660 uint16_t cellId = sortedNeighCellsIt->second;
2661 std::map<uint16_t, MeasValues>::iterator neighborMeasIt =
m_storedMeasValues.find (cellId);
2665 measResultEutra.haveCgiInfo =
false;
2666 measResultEutra.haveRsrpResult =
true;
2668 measResultEutra.haveRsrqResult =
true;
2670 NS_LOG_INFO (
this <<
" reporting neighbor cell " << (uint32_t) measResultEutra.physCellId
2671 <<
" RSRP " << (uint32_t) measResultEutra.rsrpResult
2672 <<
" (" << neighborMeasIt->second.rsrp <<
" dBm)"
2673 <<
" RSRQ " << (uint32_t) measResultEutra.rsrqResult
2674 <<
" (" << neighborMeasIt->second.rsrq <<
" dB)");
2681 NS_LOG_WARN (
this <<
" cellsTriggeredList is empty");
2689 measReportIt->second.numberOfReportsSent++;
2690 measReportIt->second.periodicReportTimer.Cancel ();
2692 Time reportInterval;
2693 switch (reportConfigEutra.reportInterval)
2720 reportInterval =
Seconds (60);
2723 reportInterval =
Seconds (360);
2726 reportInterval =
Seconds (720);
2729 reportInterval =
Seconds (1800);
2732 reportInterval =
Seconds (3600);
2735 NS_FATAL_ERROR (
"Unsupported reportInterval " << (uint16_t) reportConfigEutra.reportInterval);
2740 measReportIt->second.periodicReportTimer
2767 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it;
2799 std::map<uint8_t, uint8_t>::iterator it =
m_bid2DrbidMap.find (bid);
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
uint8_t numberOfRaPreambles
LtePdcpSapProvider * srb1SapProvider
Simulation virtual time values and global simulation resolution.
uint8_t raResponseWindowSize
virtual void Reset()=0
reset the PHY
CarrierFreqEutra carrierFreq
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
PdschConfigDedicated pdschConfigDedicated
Part of the RRC protocol.
void DoRecvRrcConnectionSetup(LteRrcSap::RrcConnectionSetup msg)
Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionSetup interface...
void DoRecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock msg)
std::map< uint8_t, LteRrcSap::MeasObjectToAddMod > measObjectList
std::vector< struct UeMeasurementsElement > m_ueMeasurementsList
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)
static TypeId GetTypeId(void)
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
std::list< MeasObjectToAddMod > measObjectToAddModList
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
LtePdcpSapUser * m_drbPdcpSapUser
void DoRecvSystemInformation(LteRrcSap::SystemInformation msg)
Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvSystemInformation interface...
uint16_t bucketSizeDurationMs
uint8_t numberOfRaPreambles
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
static TypeId GetTypeId(void)
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
void DoRecvRrcConnectionReject(LteRrcSap::RrcConnectionReject msg)
Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionReject interface...
std::list< uint8_t > reportConfigToRemoveList
bool m_hasReceivedSib2
True if SIB2 was received for the current cell.
std::list< MeasResultEutra > measResultListEutra
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...
virtual void Reset()=0
reset the MAC
uint8_t measId
The measurement identity which raised the trigger.
RSRP is used for the threshold.
LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated
#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
void DoSetTemporaryCellRnti(uint16_t rnti)
virtual void SetPa(double pa)=0
Represents a single triggered event from a measurement identity which reporting criteria have been fu...
RadioResourceConfigDedicated radioResourceConfigDedicated
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
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
virtual void StartContentionBasedRandomAccessProcedure()=0
tell the MAC to start a contention-based random access procedure, e.g., to perform RRC connection est...
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.
virtual void SynchronizeWithEnb(uint16_t cellId)=0
Tell the PHY entity to synchronize with a given eNodeB over the currently active EARFCN for communica...
virtual ~LteUeRrc()
Destructor.
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)
Fatal error handling.
virtual void SetRnti(uint16_t rnti)=0
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...
uint16_t GetUlEarfcn() const
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Event A2: Serving becomes worse than absolute threshold.
virtual void RemoveLc(uint8_t lcId)=0
remove an existing LC
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
bool m_hasReceivedMib
True if MIB was received for the current cell.
RachConfigDedicated rachConfigDedicated
void DoRecvRrcConnectionReestablishmentReject(LteRrcSap::RrcConnectionReestablishmentReject msg)
Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionReestablishmentReject i...
void SetRnti(uint16_t rnti)
bool m_connectionPending
True if a connection request by upper layers is pending.
LtePdcpSapUser * srb1SapUser
RSRQ is used for the threshold.
bool m_hasReceivedSib1
True if SIB1 was received for the current cell.
LteMacSapProvider * m_macSapProvider
bool haveRadioResourceConfigDedicated
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
Ptr< Packet > pdcpSdu
the RRC PDU
uint8_t Bid2Drbid(uint8_t bid)
PreambleInfo preambleInfo
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
LteUeCmacSapUser * GetLteUeCmacSapUser()
friend class UeMemberLteUeCmacSapUser
static const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
Reference Signal Received Quality.
LteRrcSap::QuantityConfig quantityConfig
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void SetLteUeRrcSapUser(LteUeRrcSapUser *s)
set the RRC SAP this RRC should interact with
LteUeRrcSapUser * m_rrcSapUser
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
State m_state
The current UE RRC state.
uint16_t m_dlEarfcn
Downlink carrier frequency.
AttributeValue implementation for Time.
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
virtual void ConfigureReferenceSignalPower(int8_t referenceSignalPower)=0
Configure referenceSignalPower.
ConcernedCells_t concernedCells
The list of cells responsible for this trigger.
static TypeId GetTypeId(void)
int8_t referenceSignalPower
Represents a measurement result from a certain cell.
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.
void DoRecvRrcConnectionReconfiguration(LteRrcSap::RrcConnectionReconfiguration msg)
Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionReconfiguration interfa...
void DoRecvRrcConnectionReestablishment(LteRrcSap::RrcConnectionReestablishment msg)
Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionReestablishment interfa...
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.
uint8_t rrcTransactionIdentifier
TracedCallback< uint64_t, uint16_t, uint16_t > m_sib2ReceivedTrace
The Sib2Received trace source.
void ConnectionTimeout()
Invoked after timer T300 expires, notifying upper layers that RRC connection establishment procedure ...
void EvaluateCellForSelection()
Performs cell selection evaluation to the current serving cell.
std::list< MeasIdToAddMod > measIdToAddModList
bool haveRachConfigDedicated
Event A4: Neighbour becomes better than absolute threshold.
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.
PhysicalConfigDedicated physicalConfigDedicated
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
LteUeCphySapProvider * m_cphySapProvider
uint8_t filterCoefficientRSRP
uint8_t GetUlBandwidth() const
void SetLteUeCmacSapProvider(LteUeCmacSapProvider *s)
set the CMAC SAP this RRC should interact with
bool m_useRlcSm
True if RLC SM is to be used, false if RLC UM/AM are to be used.
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
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
std::map< uint8_t, LteRrcSap::MeasIdToAddMod > measIdList
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
std::map< uint8_t, uint8_t > m_bid2DrbidMap
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndOkTrace
The InitialCellSelectionEndOk trace source.
RadioResourceConfigDedicated radioResourceConfigDedicated
uint8_t rrcTransactionIdentifier
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.
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::map< uint8_t, LteRrcSap::ReportConfigToAddMod > reportConfigList
LteUeCphySapUser * m_cphySapUser
virtual void Setup(SetupParameters params)=0
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void SetSrsConfigurationIndex(uint16_t srcCi)=0
Hold objects of type Ptr.
Ptr< Packet > pdcpSdu
the RRC PDU
void SetLteRlcSapUser(LteRlcSapUser *s)
uint16_t targetPhysCellId
LteAsSapUser * m_asSapUser
Template for the implementation of the LteUeRrcSapProvider as a member of an owner class of type C to...
bool haveMobilityControlInfo
virtual void StartCellSearch(uint16_t dlEarfcn)=0
Tell the PHY entity to listen to PSS from surrounding cells and measure the RSRP. ...
void DoNotifyRandomAccessSuccessful()
uint8_t GetDlBandwidth() const
uint16_t GetDlEarfcn() const
bool haveMeasResultNeighCells
uint8_t filterCoefficientRSRQ
bool havePdschConfigDedicated
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_sib1ReceivedTrace
The Sib1Received trace source.
double rsrq
Measured RSRQ in dB.
void DoSendData(Ptr< Packet > packet, uint8_t bid)
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
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.
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
uint16_t m_ulEarfcn
Uplink carrier frequency.
static Time Now(void)
Return the current simulation virtual time.
LteRlcSapUser * srb0SapUser
void SetLcId(uint8_t lcId)
void DoRecvRrcConnectionRelease(LteRrcSap::RrcConnectionRelease msg)
Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionRelease interface...
Event A3: Neighbour becomes amount of offset better than PCell.
double rsrp
Measured RSRP in dBm.
virtual void AddLc(uint8_t lcId, LogicalChannelConfig lcConfig, LteMacSapUser *msu)=0
add a new Logical Channel (LC)
void VarMeasReportListErase(uint8_t measId, ConcernedCells_t leavingCells, bool reportOnLeave)
Remove some cells from an existing reporting entry in m_varMeasReportList.
CarrierBandwidthEutra carrierBandwidth
uint8_t m_ulBandwidth
Uplink bandwidth in RBs.
#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()
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
The ConnectionReconfiguration trace source.
Reference Signal Received Power.
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.
virtual void StartNonContentionBasedRandomAccessProcedure(uint16_t rnti, uint8_t rapId, uint8_t prachMask)=0
tell the MAC to start a non-contention-based random access procedure, e.g., as a consequence of hando...
virtual void SetDlBandwidth(uint8_t dlBandwidth)=0
uint64_t GetImsi(void) const
RachConfigCommon rachConfigCommon
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
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
bool haveCarrierBandwidth
virtual void SetTransmissionMode(uint8_t txMode)=0
bool haveAntennaInfoDedicated
static const std::string & ToString(EpcUeNas::State s)
void DoSetCsgWhiteList(uint32_t csgId)
void DoNotifyRandomAccessFailed()
void DoCompleteSetup(LteUeRrcSapProvider::CompleteSetupParameters params)
Part of the RRC protocol. Implement the LteUeRrcSapProvider::CompleteSetup interface.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
LteUeRrcSapProvider * m_rrcSapProvider
void ApplyRadioResourceConfigDedicated(LteRrcSap::RadioResourceConfigDedicated rrcd)
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
uint16_t GetCellId() const
std::list< DrbToAddMod > drbToAddModList
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
#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
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_mibReceivedTrace
The MibReceived trace source.
LteUeCmacSapProvider * m_cmacSapProvider
uint16_t m_rnti
The C-RNTI attribute.
uint64_t m_imsi
The unique UE identifier.
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)
MobilityControlInfo mobilityControlInfo
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionTimeoutTrace
The ConnectionTimeout trace source.
void DoStartCellSelection(uint16_t dlEarfcn)
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Represents a single measurement reporting entry., which includes information about a measurement for ...
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
AntennaInfoDedicated antennaInfo
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...
A base class which provides memory management and object aggregation.
PdschConfigCommon pdschConfigCommon
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 DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
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.
static uint8_t Db2RsrqRange(double db)
convert an RSRQ value in dB to the corresponding range as per 3GPP TS 36.133 section 9...
virtual void RecvData(Ptr< Packet > packet)=0
receive a data packet
UeMemberLteUeCmacSapUser(LteUeRrc *rrc)
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.
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.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
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.
Event A1: Serving becomes better than absolute threshold.
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
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE...
a unique identifier for an interface.
virtual void ConfigureUplink(uint16_t ulEarfcn, uint8_t ulBandwidth)=0
Configure uplink (normally done after reception of SIB2)
std::list< ReportConfigToAddMod > reportConfigToAddModList
virtual void ConfigureRach(RachConfig rc)=0
TypeId SetParent(TypeId tid)
std::list< uint8_t > drbToReleaseList
static TypeId GetTypeId(void)
void SetImsi(uint64_t imsi)
uint8_t m_lastRrcTransactionIdentifier
void VarMeasReportListClear(uint8_t measId)
Remove the reporting entry of the given measurement identity from m_varMeasReportList.
void LeaveConnectedMode()
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndErrorTrace
The HandoverEndError trace source.
RaSupervisionInfo raSupervisionInfo
LteRrcSap::SystemInformationBlockType1 m_lastSib1
Stored content of the last SIB1 received.
void SetLteMacSapProvider(LteMacSapProvider *s)
virtual void NotifyRandomAccessFailed()
Notify the RRC that the MAC Random Access procedure failed.
LteUeCmacSapUser * m_cmacSapUser
static double RsrpRange2Dbm(uint8_t range)
converts an RSRP range to dBm as per 3GPP TS 36.133 section 9.1.4 RSRP Measurement Report Mapping ...
void DoForceCampedOnEnb(uint16_t cellId, uint16_t dlEarfcn)
uint8_t logicalChannelGroup