29 #include <ns3/fatal-error.h>
31 #include <ns3/object-map.h>
32 #include <ns3/object-factory.h>
33 #include <ns3/simulator.h>
35 #include <ns3/lte-rlc.h>
36 #include <ns3/lte-rlc-tm.h>
37 #include <ns3/lte-rlc-um.h>
38 #include <ns3/lte-rlc-am.h>
39 #include <ns3/lte-pdcp.h>
40 #include <ns3/lte-radio-bearer-info.h>
104 "IDLE_WAIT_MIB_SIB1",
107 "IDLE_CAMPED_NORMALLY",
109 "IDLE_RANDOM_ACCESS",
111 "CONNECTED_NORMALLY",
112 "CONNECTED_HANDOVER",
113 "CONNECTED_PHY_PROBLEM",
114 "CONNECTED_REESTABLISHING"
135 : m_cmacSapProvider (0),
137 m_macSapProvider (0),
139 m_ccmRrcSapProvider (0),
140 m_state (IDLE_START),
145 m_connectionPending (false),
146 m_hasReceivedMib (false),
147 m_hasReceivedSib1 (false),
148 m_hasReceivedSib2 (false),
150 m_noOfSyncIndications (0),
151 m_leaveConnectedMode (false),
152 m_previousCellId (0),
153 m_connEstFailCountLimit (0),
154 m_connEstFailCount (0),
200 .SetGroupName (
"Lte")
202 .AddAttribute (
"DataRadioBearerMap",
"List of UE RadioBearerInfo for Data Radio Bearers by LCID.",
205 MakeObjectMapChecker<LteDataRadioBearerInfo> ())
206 .AddAttribute (
"Srb0",
"SignalingRadioBearerInfo for SRB0",
209 MakePointerChecker<LteSignalingRadioBearerInfo> ())
210 .AddAttribute (
"Srb1",
"SignalingRadioBearerInfo for SRB1",
213 MakePointerChecker<LteSignalingRadioBearerInfo> ())
214 .AddAttribute (
"CellId",
215 "Serving cell identifier",
218 MakeUintegerChecker<uint16_t> ())
219 .AddAttribute (
"C-RNTI",
220 "Cell Radio Network Temporary Identifier",
223 MakeUintegerChecker<uint16_t> ())
224 .AddAttribute (
"T300",
225 "Timer for the RRC Connection Establishment procedure "
226 "(i.e., the procedure is deemed as failed if it takes longer than this). "
227 "Standard values: 100ms, 200ms, 300ms, 400ms, 600ms, 1000ms, 1500ms, 2000ms",
231 .AddAttribute (
"T310",
232 "Timer for detecting the Radio link failure "
233 "(i.e., the radio link is deemed as failed if this timer expires). "
234 "Standard values: 0ms 50ms, 100ms, 200ms, 500ms, 1000ms, 2000ms",
238 .AddAttribute (
"N310",
239 "This specifies the maximum number of out-of-sync indications. "
240 "Standard values: 1, 2, 3, 4, 6, 8, 10, 20",
243 MakeUintegerChecker<uint8_t> (1, 20))
244 .AddAttribute (
"N311",
245 "This specifies the maximum number of in-sync indications. "
246 "Standard values: 1, 2, 3, 4, 5, 6, 8, 10",
249 MakeUintegerChecker<uint8_t> (1, 10))
250 .AddTraceSource (
"MibReceived",
251 "trace fired upon reception of Master Information Block",
253 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
254 .AddTraceSource (
"Sib1Received",
255 "trace fired upon reception of System Information Block Type 1",
257 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
258 .AddTraceSource (
"Sib2Received",
259 "trace fired upon reception of System Information Block Type 2",
261 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
262 .AddTraceSource (
"StateTransition",
263 "trace fired upon every UE RRC state transition",
265 "ns3::LteUeRrc::StateTracedCallback")
266 .AddTraceSource (
"InitialCellSelectionEndOk",
267 "trace fired upon successful initial cell selection procedure",
269 "ns3::LteUeRrc::CellSelectionTracedCallback")
270 .AddTraceSource (
"InitialCellSelectionEndError",
271 "trace fired upon failed initial cell selection procedure",
273 "ns3::LteUeRrc::CellSelectionTracedCallback")
274 .AddTraceSource (
"RandomAccessSuccessful",
275 "trace fired upon successful completion of the random access procedure",
277 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
278 .AddTraceSource (
"RandomAccessError",
279 "trace fired upon failure of the random access procedure",
281 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
282 .AddTraceSource (
"ConnectionEstablished",
283 "trace fired upon successful RRC connection establishment",
285 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
286 .AddTraceSource (
"ConnectionTimeout",
287 "trace fired upon timeout RRC connection establishment because of T300",
289 "ns3::LteUeRrc::ImsiCidRntiCountTracedCallback")
290 .AddTraceSource (
"ConnectionReconfiguration",
291 "trace fired upon RRC connection reconfiguration",
293 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
294 .AddTraceSource (
"HandoverStart",
295 "trace fired upon start of a handover procedure",
297 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
298 .AddTraceSource (
"HandoverEndOk",
299 "trace fired upon successful termination of a handover procedure",
301 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
302 .AddTraceSource (
"HandoverEndError",
303 "trace fired upon failure of a handover procedure",
305 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
306 .AddTraceSource (
"SCarrierConfigured",
307 "trace fired after configuring secondary carriers",
309 "ns3::LteUeRrc::SCarrierConfiguredTracedCallback")
310 .AddTraceSource (
"Srb1Created",
311 "trace fired after SRB1 is created",
313 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
314 .AddTraceSource (
"DrbCreated",
315 "trace fired after DRB is created",
317 "ns3::LteUeRrc::ImsiCidRntiLcIdTracedCallback")
318 .AddTraceSource (
"RadioLinkFailure",
319 "trace fired upon failure of radio link",
321 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
322 .AddTraceSource (
"PhySyncDetection",
323 "trace fired upon receiving in Sync or out of Sync indications from UE PHY",
325 "ns3::LteUeRrc::PhySyncDetectionTracedCallback")
538 m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
540 m_srb0->m_srbIdentity = 0;
559 if (m_numberOfComponentCarriers < MIN_NO_CC || m_numberOfComponentCarriers >
MAX_NO_CC)
589 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it =
m_drbMap.find (drbid);
595 params.
lcid = it->second->m_logicalChannelIdentity;
598 <<
" on DRBID " << (uint32_t) drbid
599 <<
" (LCID " << (uint32_t) params.
lcid <<
")"
600 <<
" (" << packet->
GetSize () <<
" bytes)");
601 it->second->m_pdcp->GetLtePdcpSapProvider ()->TransmitPdcpSdu (params);
686 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
880 "Cell identity in SIB1 does not match with the originating cell");
895 "Cell identity in SIB1 does not match with the originating cell");
918 bool triggering =
true;
919 std::vector <LteUeCphySapUser::UeMeasurementsElement>::iterator newMeasIt;
929 newMeasIt->m_rsrq, useLayer3Filtering,
935 newMeasIt->m_rsrq, useLayer3Filtering);
948 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
1003 "SIB2 msg contains wrong value "
1102 NS_LOG_DEBUG (
this <<
"RNTI " <<
m_rnti <<
" Handover. Configuring secondary carriers");
1224 uint16_t maxRsrpCellId = 0;
1225 double maxRsrp = -std::numeric_limits<double>::infinity ();
1226 double minRsrp = -140.0;
1228 std::map<uint16_t, MeasValues>::iterator it;
1235 if (maxRsrp < it->
second.rsrp && it->second.rsrp > minRsrp)
1237 std::set<uint16_t>::const_iterator itCell;
1241 maxRsrpCellId = it->first;
1242 maxRsrp = it->second.rsrp;
1247 if (maxRsrpCellId == 0)
1249 NS_LOG_WARN (
this <<
" Cell search is unable to detect surrounding cell to attach to");
1254 <<
" is the strongest untried surrounding cell");
1273 bool isSuitableCell =
false;
1274 bool isAcceptableCell =
false;
1275 std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.find (cellId);
1276 double qRxLevMeas = storedMeasIt->second.rsrp;
1278 NS_LOG_LOGIC (
this <<
" cell selection to cellId=" << cellId
1279 <<
" qrxlevmeas=" << qRxLevMeas <<
" dBm"
1280 <<
" qrxlevmin=" << qRxLevMin <<
" dBm");
1282 if (qRxLevMeas - qRxLevMin > 0)
1284 isAcceptableCell =
true;
1289 isSuitableCell = (cellCsgIndication ==
false) || (cellCsgId ==
m_csgWhiteList);
1292 << cellCsgId <<
"/" << cellCsgIndication);
1327 if (isAcceptableCell)
1404 std::list<LteRrcSap::SrbToAddMod>::const_iterator stamIt = rrcd.
srbToAddModList.begin ();
1412 NS_ASSERT_MSG (stamIt->srbIdentity == 1,
"only SRB1 supported");
1414 const uint8_t lcid = 1;
1423 pdcp->SetLcId (lcid);
1428 m_srb1 = CreateObject<LteSignalingRadioBearerInfo> ();
1431 m_srb1->m_srbIdentity = 1;
1434 m_srb1->m_logicalChannelConfig.priority = stamIt->logicalChannelConfig.priority;
1435 m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = stamIt->logicalChannelConfig.prioritizedBitRateKbps;
1436 m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = stamIt->logicalChannelConfig.bucketSizeDurationMs;
1437 m_srb1->m_logicalChannelConfig.logicalChannelGroup = stamIt->logicalChannelConfig.logicalChannelGroup;
1440 lcConfig.
priority = stamIt->logicalChannelConfig.priority;
1456 NS_LOG_INFO (
"request to modify SRB1 (skipping as currently not implemented)");
1462 std::list<LteRrcSap::DrbToAddMod>::const_iterator dtamIt;
1467 NS_LOG_INFO (
this <<
" IMSI " <<
m_imsi <<
" adding/modifying DRBID " << (uint32_t) dtamIt->drbIdentity <<
" LC " << (uint32_t) dtamIt->logicalChannelIdentity);
1468 NS_ASSERT_MSG (dtamIt->logicalChannelIdentity > 2,
"LCID value " << dtamIt->logicalChannelIdentity <<
" is reserved for SRBs");
1470 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbMapIt =
m_drbMap.find (dtamIt->drbIdentity);
1482 switch (dtamIt->rlcConfig.choice)
1503 rlc->
SetLcId (dtamIt->logicalChannelIdentity);
1506 drbInfo->m_rlc = rlc;
1507 drbInfo->m_epsBearerIdentity = dtamIt->epsBearerIdentity;
1508 drbInfo->m_logicalChannelIdentity = dtamIt->logicalChannelIdentity;
1509 drbInfo->m_drbIdentity = dtamIt->drbIdentity;
1517 pdcp->SetLcId (dtamIt->logicalChannelIdentity);
1521 drbInfo->m_pdcp = pdcp;
1532 lcConfig.
priority = dtamIt->logicalChannelConfig.priority;
1541 NS_LOG_DEBUG (
"Size of lcOnCcMapping vector " << lcOnCcMapping.size ());
1542 std::vector<LteUeCcmRrcSapProvider::LcsConfig>::iterator itLcOnCcMapping = lcOnCcMapping.begin ();
1543 NS_ASSERT_MSG (itLcOnCcMapping != lcOnCcMapping.end (),
"Component carrier manager failed to add LC for data radio bearer");
1545 for (itLcOnCcMapping = lcOnCcMapping.begin (); itLcOnCcMapping != lcOnCcMapping.end (); ++itLcOnCcMapping)
1548 <<
" LCG id " << (uint16_t) itLcOnCcMapping->lcConfig.logicalChannelGroup
1549 <<
" ComponentCarrierId " << (uint16_t) itLcOnCcMapping->componentCarrierId);
1550 uint8_t index = itLcOnCcMapping->componentCarrierId;
1553 m_cmacSapProvider.at (index)->AddLc (dtamIt->logicalChannelIdentity, lcConfigFromCcm, msu);
1566 std::list<uint8_t>::iterator dtdmIt;
1571 uint8_t drbid = *dtdmIt;
1572 NS_LOG_INFO (
this <<
" IMSI " <<
m_imsi <<
" releasing DRB " << (uint32_t) drbid);
1573 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it =
m_drbMap.find (drbid);
1598 uint8_t measObjectId = *it;
1599 NS_LOG_LOGIC (
this <<
" deleting measObjectId " << (uint32_t) measObjectId);
1604 if (measIdIt->second.measObjectId == measObjectId)
1606 uint8_t measId = measIdIt->second.measId;
1608 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId <<
" because referring to measObjectId " << (uint32_t) measObjectId);
1627 NS_ASSERT_MSG (it->measObjectEutra.cellsToRemoveList.empty (),
"cellsToRemoveList not supported");
1628 NS_ASSERT_MSG (it->measObjectEutra.cellsToAddModList.empty (),
"cellsToAddModList not supported");
1629 NS_ASSERT_MSG (it->measObjectEutra.cellsToRemoveList.empty (),
"blackCellsToRemoveList not supported");
1630 NS_ASSERT_MSG (it->measObjectEutra.blackCellsToAddModList.empty (),
"blackCellsToAddModList not supported");
1631 NS_ASSERT_MSG (it->measObjectEutra.haveCellForWhichToReportCGI ==
false,
"cellForWhichToReportCGI is not supported");
1633 uint8_t measObjectId = it->measObjectId;
1637 NS_LOG_LOGIC (
"measObjectId " << (uint32_t) measObjectId <<
" exists, updating entry");
1638 measObjectIt->second = *it;
1639 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1644 if (measIdIt->second.measObjectId == measObjectId)
1646 uint8_t measId = measIdIt->second.measId;
1647 NS_LOG_LOGIC (
this <<
" found measId " << (uint32_t) measId <<
" referring to measObjectId " << (uint32_t) measObjectId);
1654 NS_LOG_LOGIC (
"measObjectId " << (uint32_t) measObjectId <<
" is new, adding entry");
1665 uint8_t reportConfigId = *it;
1666 NS_LOG_LOGIC (
this <<
" deleting reportConfigId " << (uint32_t) reportConfigId);
1671 if (measIdIt->second.reportConfigId == reportConfigId)
1673 uint8_t measId = measIdIt->second.measId;
1675 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId <<
" because referring to reportConfigId " << (uint32_t) reportConfigId);
1695 "only trigger type EVENT is supported");
1697 uint8_t reportConfigId = it->reportConfigId;
1701 NS_LOG_LOGIC (
"reportConfigId " << (uint32_t) reportConfigId <<
" exists, updating entry");
1703 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1708 if (measIdIt->second.reportConfigId == reportConfigId)
1710 uint8_t measId = measIdIt->second.measId;
1711 NS_LOG_LOGIC (
this <<
" found measId " << (uint32_t) measId <<
" referring to reportConfigId " << (uint32_t) reportConfigId);
1718 NS_LOG_LOGIC (
"reportConfigId " << (uint32_t) reportConfigId <<
" is new, adding entry");
1739 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1753 uint8_t measId = *it;
1754 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId);
1764 for (std::list<LteRrcSap::MeasIdToAddMod>::iterator it = mc.
measIdToAddModList.begin ();
1768 NS_LOG_LOGIC (
this <<
" measId " << (uint32_t) it->measId
1769 <<
" (measObjectId=" << (uint32_t) it->measObjectId
1770 <<
", reportConfigId=" << (uint32_t) it->reportConfigId
1777 std::map<uint8_t, VarMeasReport>::iterator measReportIt =
m_varMeasReportList.find (it->measId);
1780 measReportIt->second.periodicReportTimer.Cancel ();
1787 std::list<PendingTrigger_t> s;
1810 bool useLayer3Filtering)
1812 NS_LOG_FUNCTION (
this << cellId << rsrp << rsrq << useLayer3Filtering);
1814 std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.find (cellId);
1818 if (useLayer3Filtering)
1824 if (std::isnan (storedMeasIt->second.rsrq))
1827 storedMeasIt->second.rsrq = rsrq;
1837 storedMeasIt->second.rsrp = rsrp;
1838 storedMeasIt->second.rsrq = rsrq;
1847 std::pair<uint16_t, MeasValues> val (cellId, v);
1848 std::pair<std::map<uint16_t, MeasValues>::iterator,
bool>
1850 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
1851 storedMeasIt = ret.first;
1856 <<
", new RSRP " << rsrp <<
" stored " << storedMeasIt->second.rsrp
1857 <<
", new RSRQ " << rsrq <<
" stored " << storedMeasIt->second.rsrq);
1867 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt =
1870 NS_ASSERT (measIdIt->first == measIdIt->second.measId);
1872 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>::iterator
1877 std::map<uint8_t, LteRrcSap::MeasObjectToAddMod>::iterator
1882 std::map<uint8_t, VarMeasReport>::iterator
1890 "only triggerType == event is supported");
1893 NS_LOG_LOGIC (
this <<
" considering measId " << (uint32_t) measId);
1894 bool eventEntryCondApplicable =
false;
1895 bool eventLeavingCondApplicable =
false;
1899 switch (reportConfigEutra.
eventId)
1933 bool entryCond = ms - hys > thresh;
1937 if (!isMeasIdInReportList)
1939 concernedCellsEntry.push_back (
m_cellId);
1940 eventEntryCondApplicable =
true;
1949 != measReportIt->second.cellsTriggeredList.end ());
1958 bool leavingCond = ms + hys < thresh;
1962 if (isMeasIdInReportList)
1969 != measReportIt->second.cellsTriggeredList.end ());
1970 concernedCellsLeaving.push_back (
m_cellId);
1971 eventLeavingCondApplicable =
true;
1980 <<
" ms=" << ms <<
" thresh=" << thresh
1981 <<
" entryCond=" << entryCond
1982 <<
" leavingCond=" << leavingCond);
2020 bool entryCond = ms + hys < thresh;
2024 if (!isMeasIdInReportList)
2026 concernedCellsEntry.push_back (
m_cellId);
2027 eventEntryCondApplicable =
true;
2036 != measReportIt->second.cellsTriggeredList.end ());
2045 bool leavingCond = ms - hys > thresh;
2049 if (isMeasIdInReportList)
2056 != measReportIt->second.cellsTriggeredList.end ());
2057 concernedCellsLeaving.push_back (
m_cellId);
2058 eventLeavingCondApplicable =
true;
2067 <<
" ms=" << ms <<
" thresh=" << thresh
2068 <<
" entryCond=" << entryCond
2069 <<
" leavingCond=" << leavingCond);
2110 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2114 uint16_t cellId = storedMeasIt->first;
2123 mn = storedMeasIt->second.rsrp;
2126 mn = storedMeasIt->second.rsrq;
2133 bool hasTriggered = isMeasIdInReportList
2134 && (measReportIt->second.cellsTriggeredList.find (cellId)
2135 != measReportIt->second.cellsTriggeredList.end ());
2138 bool entryCond = mn + ofn + ocn - hys > mp + ofp + ocp + off;
2144 concernedCellsEntry.push_back (cellId);
2145 eventEntryCondApplicable =
true;
2154 bool leavingCond = mn + ofn + ocn + hys < mp + ofp + ocp + off;
2160 concernedCellsLeaving.push_back (cellId);
2161 eventLeavingCondApplicable =
true;
2169 NS_LOG_LOGIC (
this <<
" event A3: neighbor cell " << cellId
2170 <<
" mn=" << mn <<
" mp=" << mp <<
" offset=" << off
2171 <<
" entryCond=" << entryCond
2172 <<
" leavingCond=" << leavingCond);
2211 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2215 uint16_t cellId = storedMeasIt->first;
2224 mn = storedMeasIt->second.rsrp;
2227 mn = storedMeasIt->second.rsrq;
2234 bool hasTriggered = isMeasIdInReportList
2235 && (measReportIt->second.cellsTriggeredList.find (cellId)
2236 != measReportIt->second.cellsTriggeredList.end ());
2239 bool entryCond = mn + ofn + ocn - hys > thresh;
2245 concernedCellsEntry.push_back (cellId);
2246 eventEntryCondApplicable =
true;
2255 bool leavingCond = mn + ofn + ocn + hys < thresh;
2261 concernedCellsLeaving.push_back (cellId);
2262 eventLeavingCondApplicable =
true;
2270 NS_LOG_LOGIC (
this <<
" event A4: neighbor cell " << cellId
2271 <<
" mn=" << mn <<
" thresh=" << thresh
2272 <<
" entryCond=" << entryCond
2273 <<
" leavingCond=" << leavingCond);
2324 bool entryCond = mp + hys < thresh1;
2328 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2332 uint16_t cellId = storedMeasIt->first;
2341 mn = storedMeasIt->second.rsrp;
2344 mn = storedMeasIt->second.rsrq;
2351 bool hasTriggered = isMeasIdInReportList
2352 && (measReportIt->second.cellsTriggeredList.find (cellId)
2353 != measReportIt->second.cellsTriggeredList.end ());
2357 entryCond = mn + ofn + ocn - hys > thresh2;
2363 concernedCellsEntry.push_back (cellId);
2364 eventEntryCondApplicable =
true;
2372 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2373 <<
" mn=" << mn <<
" mp=" << mp
2374 <<
" thresh2=" << thresh2
2375 <<
" thresh1=" << thresh1
2376 <<
" entryCond=" << entryCond);
2384 <<
" mp=" << mp <<
" thresh1=" << thresh1
2385 <<
" entryCond=" << entryCond);
2393 if (isMeasIdInReportList)
2396 bool leavingCond = mp - hys > thresh1;
2404 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2408 uint16_t cellId = storedMeasIt->first;
2414 if (measReportIt->second.cellsTriggeredList.find (cellId)
2415 != measReportIt->second.cellsTriggeredList.end ())
2417 concernedCellsLeaving.push_back (cellId);
2418 eventLeavingCondApplicable =
true;
2426 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2430 uint16_t cellId = storedMeasIt->first;
2436 if (measReportIt->second.cellsTriggeredList.find (cellId)
2437 != measReportIt->second.cellsTriggeredList.end ())
2442 mn = storedMeasIt->second.rsrp;
2445 mn = storedMeasIt->second.rsrq;
2454 leavingCond = mn + ofn + ocn + hys < thresh2;
2466 concernedCellsLeaving.push_back (cellId);
2467 eventLeavingCondApplicable =
true;
2469 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2470 <<
" mn=" << mn <<
" mp=" << mp
2471 <<
" thresh2=" << thresh2
2472 <<
" thresh1=" << thresh1
2473 <<
" leavingCond=" << leavingCond);
2483 <<
" mp=" << mp <<
" thresh1=" << thresh1
2484 <<
" leavingCond=" << leavingCond);
2496 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2500 uint16_t cellId = storedMeasIt->first;
2506 if (measReportIt->second.cellsTriggeredList.find (cellId)
2507 != measReportIt->second.cellsTriggeredList.end ())
2512 mn = storedMeasIt->second.rsrp;
2515 mn = storedMeasIt->second.rsrq;
2523 leavingCond = mn + ofn + ocn + hys < thresh2;
2527 concernedCellsLeaving.push_back (cellId);
2528 eventLeavingCondApplicable =
true;
2531 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2532 <<
" mn=" << mn <<
" mp=" << mp
2533 <<
" thresh2=" << thresh2
2534 <<
" thresh1=" << thresh1
2535 <<
" leavingCond=" << leavingCond);
2556 NS_LOG_LOGIC (
this <<
" eventEntryCondApplicable=" << eventEntryCondApplicable
2557 <<
" eventLeavingCondApplicable=" << eventLeavingCondApplicable);
2559 if (eventEntryCondApplicable)
2572 measId, concernedCellsEntry);
2573 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2576 enteringTriggerIt->second.push_back (t);
2580 if (eventLeavingCondApplicable)
2597 measId, concernedCellsLeaving, reportOnLeave);
2598 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2601 leavingTriggerIt->second.push_back (t);
2612 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2616 if (!it1->second.empty ())
2618 std::list<PendingTrigger_t>::iterator it2;
2619 for (it2 = it1->second.begin (); it2 != it1->second.end (); ++it2)
2622 NS_LOG_LOGIC (
this <<
" canceling entering time-to-trigger event at "
2627 it1->second.clear ();
2636 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2640 std::list<PendingTrigger_t>::iterator it2 = it1->second.begin ();
2641 while (it2 != it1->second.end ())
2645 ConcernedCells_t::iterator it3;
2646 for (it3 = it2->concernedCells.begin ();
2647 it3 != it2->concernedCells.end (); ++it3)
2651 it3 = it2->concernedCells.erase (it3);
2655 if (it2->concernedCells.empty ())
2657 NS_LOG_LOGIC (
this <<
" canceling entering time-to-trigger event at "
2660 it2 = it1->second.erase (it2);
2674 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2678 if (!it1->second.empty ())
2680 std::list<PendingTrigger_t>::iterator it2;
2681 for (it2 = it1->second.begin (); it2 != it1->second.end (); ++it2)
2684 NS_LOG_LOGIC (
this <<
" canceling leaving time-to-trigger event at "
2689 it1->second.clear ();
2698 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2702 std::list<PendingTrigger_t>::iterator it2 = it1->second.begin ();
2703 while (it2 != it1->second.end ())
2707 ConcernedCells_t::iterator it3;
2708 for (it3 = it2->concernedCells.begin ();
2709 it3 != it2->concernedCells.end (); ++it3)
2713 it3 = it2->concernedCells.erase (it3);
2717 if (it2->concernedCells.empty ())
2719 NS_LOG_LOGIC (
this <<
" canceling leaving time-to-trigger event at "
2722 it2 = it1->second.erase (it2);
2737 std::map<uint8_t, VarMeasReport>::iterator
2744 std::pair<uint8_t, VarMeasReport> val (measId, r);
2745 std::pair<std::map<uint8_t, VarMeasReport>::iterator,
bool>
2747 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
2748 measReportIt = ret.first;
2753 for (ConcernedCells_t::const_iterator it = enteringCells.begin ();
2754 it != enteringCells.end ();
2757 measReportIt->second.cellsTriggeredList.insert (*it);
2760 NS_ASSERT (!measReportIt->second.cellsTriggeredList.empty ());
2763 if (!measReportIt->second.periodicReportTimer.IsRunning ())
2765 measReportIt->second.numberOfReportsSent = 0;
2766 measReportIt->second.periodicReportTimer
2772 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2775 if (!enteringTriggerIt->second.empty ())
2783 enteringTriggerIt->second.pop_front ();
2785 if (!enteringTriggerIt->second.empty ())
2792 for (ConcernedCells_t::const_iterator it = enteringCells.begin ();
2793 it != enteringCells.end (); ++it)
2810 std::map<uint8_t, VarMeasReport>::iterator
2814 for (ConcernedCells_t::const_iterator it = leavingCells.begin ();
2815 it != leavingCells.end ();
2818 measReportIt->second.cellsTriggeredList.erase (*it);
2827 if (measReportIt->second.cellsTriggeredList.empty ())
2829 measReportIt->second.periodicReportTimer.Cancel ();
2833 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2836 if (!leavingTriggerIt->second.empty ())
2844 leavingTriggerIt->second.pop_front ();
2846 if (!leavingTriggerIt->second.empty ())
2853 for (ConcernedCells_t::const_iterator it = leavingCells.begin ();
2854 it != leavingCells.end (); ++it)
2870 std::map<uint8_t, VarMeasReport>::iterator
2874 NS_LOG_LOGIC (
this <<
" deleting existing report for measId " << (uint16_t) measId);
2875 measReportIt->second.periodicReportTimer.Cancel ();
2889 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator
2893 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>::iterator
2900 measResults.
measId = measId;
2907 "RSRP " << (uint32_t) measResults.
rsrpResult <<
" (" << servingMeasIt->second.rsrp <<
" dBm) "
2908 "RSRQ " << (uint32_t) measResults.
rsrqResult <<
" (" << servingMeasIt->second.rsrq <<
" dB)");
2910 std::map<uint8_t, VarMeasReport>::iterator measReportIt =
m_varMeasReportList.find (measId);
2913 NS_LOG_ERROR (
"no entry found in m_varMeasReportList for measId " << (uint32_t) measId);
2917 if (!(measReportIt->second.cellsTriggeredList.empty ()))
2919 std::multimap<double, uint16_t> sortedNeighCells;
2920 for (std::set<uint16_t>::iterator cellsTriggeredIt = measReportIt->second.cellsTriggeredList.begin ();
2921 cellsTriggeredIt != measReportIt->second.cellsTriggeredList.end ();
2924 uint16_t cellId = *cellsTriggeredIt;
2927 std::map<uint16_t, MeasValues>::iterator neighborMeasIt =
m_storedMeasValues.find (cellId);
2928 double triggerValue;
2932 triggerValue = neighborMeasIt->second.rsrp;
2935 triggerValue = neighborMeasIt->second.rsrq;
2941 sortedNeighCells.insert (std::pair<double, uint16_t> (triggerValue, cellId));
2945 std::multimap<double, uint16_t>::reverse_iterator sortedNeighCellsIt;
2947 for (sortedNeighCellsIt = sortedNeighCells.rbegin (), count = 0;
2948 sortedNeighCellsIt != sortedNeighCells.rend () && count < reportConfigEutra.
maxReportCells;
2949 ++sortedNeighCellsIt, ++count)
2951 uint16_t cellId = sortedNeighCellsIt->second;
2952 std::map<uint16_t, MeasValues>::iterator neighborMeasIt =
m_storedMeasValues.find (cellId);
2962 <<
" RSRP " << (uint32_t) measResultEutra.
rsrpResult
2963 <<
" (" << neighborMeasIt->second.rsrp <<
" dBm)"
2964 <<
" RSRQ " << (uint32_t) measResultEutra.
rsrqResult
2965 <<
" (" << neighborMeasIt->second.rsrq <<
" dB)");
2972 NS_LOG_WARN (
this <<
" cellsTriggeredList is empty");
2988 measResultScell.
servFreqId = sCellsMeasIt->first;
3002 measReportIt->second.numberOfReportsSent++;
3003 measReportIt->second.periodicReportTimer.Cancel ();
3005 Time reportInterval;
3033 reportInterval =
Seconds (60);
3036 reportInterval =
Seconds (360);
3039 reportInterval =
Seconds (720);
3042 reportInterval =
Seconds (1800);
3045 reportInterval =
Seconds (3600);
3053 measReportIt->second.periodicReportTimer
3082 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
3158 std::map<uint8_t, uint8_t>::iterator it =
m_bid2DrbidMap.find (bid);
3185 NS_LOG_INFO (
"Starting initial cell selection after RLF");
3230 bool useLayer3Filtering, uint16_t componentCarrierId)
3232 NS_LOG_FUNCTION (
this << sCellId << componentCarrierId << rsrp << rsrq << useLayer3Filtering);
3240 if (useLayer3Filtering)
3246 if (std::isnan (storedMeasIt->second.rsrq))
3249 storedMeasIt->second.rsrq = rsrq;
3259 storedMeasIt->second.rsrp = rsrp;
3260 storedMeasIt->second.rsrq = rsrq;
3269 std::pair<uint16_t, MeasValues> val (componentCarrierId, v);
3270 std::pair<std::map<uint16_t, MeasValues>::iterator,
bool>
3272 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
3273 storedMeasIt = ret.first;
3277 <<
", measured cell " << sCellId
3278 <<
", carrier component Id " << componentCarrierId
3279 <<
", new RSRP " << rsrp <<
" stored " << storedMeasIt->second.rsrp
3280 <<
", new RSRQ " << rsrq <<
" stored " << storedMeasIt->second.rsrq);
3285 NS_LOG_DEBUG (
this <<
" IMSI " <<
m_imsi <<
"measurement on SCC from not serving cell ");
3318 NS_LOG_INFO (
this <<
" Total Number of Sync indications from PHY "
static uint8_t Dbm2RsrpRange(double dbm)
convert an RSRP value in dBm to the corresponding range as per 3GPP TS 36.133 section 9....
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
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
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
static uint8_t Db2RsrqRange(double db)
convert an RSRQ value in dB to the corresponding range as per 3GPP TS 36.133 section 9....
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
virtual void NotifyConnectionFailed()=0
Notify the NAS that RRC Connection Establishment failed.
virtual void NotifyConnectionSuccessful()=0
Notify the NAS that RRC Connection Establishment was successful.
virtual void NotifyConnectionReleased()=0
Notify the NAS that RRC Connection was released.
virtual void RecvData(Ptr< Packet > packet)=0
receive a data packet
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
static TypeId GetTypeId(void)
Get the type ID.
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
void SetLteRlcSapUser(LteRlcSapUser *s)
void SetRnti(uint16_t rnti)
void SetLteMacSapProvider(LteMacSapProvider *s)
LteMacSapUser * GetLteMacSapUser()
void SetLcId(uint8_t lcId)
LteRlcSapProvider * GetLteRlcSapProvider()
static TypeId GetTypeId(void)
Get the type ID.
static TypeId GetTypeId(void)
Get the type ID.
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Convert PDSCH config dedicated function.
Service Access Point (SAP) offered by the UE component carrier manager to the UE RRC.
virtual std::vector< LteUeCcmRrcSapProvider::LcsConfig > AddLc(uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser *msu)=0
add a new Logical Channel (LC)
virtual void Reset()=0
Reset LC maps.
virtual LteMacSapUser * ConfigureSignalBearer(uint8_t lcid, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser *msu)=0
Add the Signal Bearer for a specific Ue in LteUeComponenCarrierManager.
Service Access Point (SAP) offered by the UE RRC to the UE CCM.
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
friend class MemberLteUeCcmRrcSapUser< LteUeRrc >
allow MemberLteUeCcmRrcSapUser<LteUeRrc> class friend access
void DoRecvRrcConnectionReconfiguration(LteRrcSap::RrcConnectionReconfiguration msg)
Part of the RRC protocol.
uint8_t m_lastRrcTransactionIdentifier
last RRC transaction identifier
bool m_connectionPending
True if a connection request by upper layers is pending.
bool m_hasReceivedSib1
True if SIB1 was received for the current cell.
void SendMeasurementReport(uint8_t measId)
Produce a proper measurement report from the given measurement identity's reporting entry in m_varMea...
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...
void DoCompleteSetup(LteUeRrcSapProvider::CompleteSetupParameters params)
Part of the RRC protocol.
void DoNotifyOutOfSync()
Do notify out of sync function.
LteUeCcmRrcSapUser * GetLteCcmRrcSapUser()
Get the Component Carrier Management SAP offered by this RRC.
void DoRecvRrcConnectionReject(LteRrcSap::RrcConnectionReject msg)
Part of the RRC protocol.
uint16_t m_previousCellId
the cell id of the previous cell UE was attached to
Ptr< LteSignalingRadioBearerInfo > m_srb1Old
SRB1 configuration before RRC connection reconfiguration.
void SwitchToState(State s)
Switch the UE RRC to the given state.
void DoDisconnect()
Disconnect function.
LteMacSapProvider * m_macSapProvider
MAC SAP provider.
void DoNotifyRandomAccessFailed()
Notify random access failed function.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_mibReceivedTrace
The MibReceived trace source.
LteUeCmacSapUser * GetLteUeCmacSapUser()
This function is overloaded to maintain backward compatibility.
std::map< uint16_t, MeasValues > m_storedScellMeasValues
Internal storage of the latest measurement results from all detected detected Secondary carrier compo...
void SetLteUeCmacSapProvider(LteUeCmacSapProvider *s)
set the CMAC SAP this RRC should interact with
uint64_t m_imsi
The unique UE identifier.
uint8_t m_n311
The 'N311' attribute.
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
uint8_t m_connEstFailCountLimit
the counter value for T300 timer expiration received from the eNB
LteUeCphySapUser * GetLteUeCphySapUser()
void DoConnect()
Connect function.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndErrorTrace
The HandoverEndError trace source.
State
The states of the UE RRC entity.
@ CONNECTED_REESTABLISHING
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
VarMeasConfig m_varMeasConfig
Includes the accumulated configuration of the measurements to be performed by the UE.
friend class MemberLteUeRrcSapProvider< LteUeRrc >
allow MemberLteUeRrcSapProvider<LteUeRrc> class friend access
void ApplyMeasConfig(LteRrcSap::MeasConfig mc)
Update the current measurement configuration m_varMeasConfig.
LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated
the PDSCH condig dedicated
uint8_t m_n310
The 'N310' attribute.
void SetUseRlcSm(bool val)
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndErrorTrace
The InitialCellSelectionEndError trace source.
EventId m_radioLinkFailureDetected
Time limit (given by m_t310) before the radio link is considered to have failed.
virtual void DoInitialize(void)
Initialize() implementation.
void DoRecvRrcConnectionReestablishmentReject(LteRrcSap::RrcConnectionReestablishmentReject msg)
Part of the RRC protocol.
void DoNotifyRandomAccessSuccessful()
Notify random access successful function.
LteUeRrcSapProvider * m_rrcSapProvider
RRC SAP provider.
void VarMeasReportListErase(uint8_t measId, ConcernedCells_t leavingCells, bool reportOnLeave)
Remove some cells from an existing reporting entry in m_varMeasReportList.
void DoRecvRrcConnectionSetup(LteRrcSap::RrcConnectionSetup msg)
Part of the RRC protocol.
void CancelLeavingTrigger(uint8_t measId)
Clear all the waiting triggers in m_leavingTriggerQueue which are associated with the given measureme...
void InitializeSap(void)
Initiaize SAP.
bool m_leaveConnectedMode
true if UE NAS ask UE RRC to leave connected mode, e.g., after RLF, i.e. T310 has expired
void DoRecvRrcConnectionReestablishment(LteRrcSap::RrcConnectionReestablishment msg)
Part of the RRC protocol.
bool m_hasReceivedSib2
True if SIB2 was received for the current cell.
void SynchronizeToStrongestCell()
Go through the list of measurement results, choose the one with the strongest RSRP,...
std::map< uint8_t, uint8_t > m_bid2DrbidMap
bid to DR bid map
void SetLteUeCphySapProvider(LteUeCphySapProvider *s)
set the CPHY SAP this RRC should use to interact with the PHY
std::vector< LteUeCmacSapProvider * > m_cmacSapProvider
UE CMac SAP provider.
uint32_t m_dlEarfcn
Downlink carrier frequency.
LteUeCcmRrcSapProvider * m_ccmRrcSapProvider
Interface to the LteUeComponentCarrierManage instance.
void DoSetCsgWhiteList(uint32_t csgId)
Set CSG white list function.
void ApplyRadioResourceConfigDedicatedSecondaryCarrier(LteRrcSap::NonCriticalExtensionConfiguration nonCec)
Apply radio resource config dedicated secondary carrier.
LteAsSapProvider * GetAsSapProvider()
void DoSetTemporaryCellRnti(uint16_t rnti)
Set temporary cell rnti function.
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
TracedCallback< uint64_t, uint16_t, uint16_t > m_radioLinkFailureTrace
The 'RadioLinkFailure' trace source.
uint32_t m_ulEarfcn
Uplink carrier frequency.
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
uint8_t GetDlBandwidth() const
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_sib1ReceivedTrace
The Sib1Received trace source.
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessErrorTrace
The RandomAccessError trace source.
uint32_t GetDlEarfcn() const
std::list< LteRrcSap::SCellToAddMod > m_sCellToAddModList
Secondary carriers.
LtePdcpSapUser * m_drbPdcpSapUser
DRB PDCP SAP user.
TracedCallback< Ptr< LteUeRrc >, std::list< LteRrcSap::SCellToAddMod > > m_sCarrierConfiguredTrace
The SCarrierConfigured trace source.
void DoStartCellSelection(uint32_t dlEarfcn)
Start cell selection function.
friend class MemberLteAsSapProvider< LteUeRrc >
allow MemberLteAsSapProvider<LteUeRrc> class friend access
bool m_useRlcSm
True if RLC SM is to be used, false if RLC UM/AM are to be used.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
TracedCallback< uint64_t, uint16_t, uint16_t, std::string, uint8_t > m_phySyncDetectionTrace
The 'PhySyncDetection' trace source.
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...
Time m_t310
The 'T310' attribute.
void RadioLinkFailureDetected()
Radio link failure detected function.
State m_state
The current UE RRC state.
std::vector< LteUeCphySapProvider * > m_cphySapProvider
UE CPhy SAP provider.
LteUeCcmRrcSapUser * m_ccmRrcSapUser
CCM RRC SAP user.
TracedCallback< uint64_t, uint16_t, uint16_t, uint8_t > m_drbCreatedTrace
The DrbCreated trace source.
uint16_t m_numberOfComponentCarriers
The number of component carriers.
std::map< uint8_t, VarMeasReport > m_varMeasReportList
The list of active reporting entries, indexed by the measurement identity which triggered the reporti...
std::vector< LteUeCmacSapUser * > m_cmacSapUser
UE CMac SAP user.
TracedCallback< uint64_t, uint16_t, uint16_t > m_srb1CreatedTrace
The Srb1Created trace source.
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndOkTrace
The InitialCellSelectionEndOk trace source.
uint8_t GetUlBandwidth() const
void DoSendData(Ptr< Packet > packet, uint8_t bid)
Send data function.
LteAsSapProvider * m_asSapProvider
AS SAP provider.
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 m_rnti
The C-RNTI attribute.
uint8_t m_noOfSyncIndications
number of in-sync or out-of-sync indications coming from PHY layer
uint16_t GetCellId() const
void DoSetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)
RRC CCM SAP USER Method.
void CancelEnteringTrigger(uint8_t measId)
Clear all the waiting triggers in m_enteringTriggerQueue which are associated with the given measurem...
virtual ~LteUeRrc()
Destructor.
std::map< uint16_t, MeasValues > m_storedMeasValues
Internal storage of the latest measurement results from all detected detected cells,...
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...
void DoReportUeMeasurements(LteUeCphySapUser::UeMeasurementsParameters params)
Report UE measurements function.
LteUeRrcSapUser * m_rrcSapUser
RRC SAP user.
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
The ConnectionReconfiguration trace source.
void MeasurementReportTriggering(uint8_t measId)
Evaluate the reporting criteria of a measurement identity and invoke some reporting actions based on ...
void SetLteCcmRrcSapProvider(LteUeCcmRrcSapProvider *s)
set the Component Carrier Management SAP this RRC should interact with
TracedCallback< uint64_t, uint16_t, uint16_t > m_sib2ReceivedTrace
The Sib2Received trace source.
void LeaveConnectedMode()
Leave connected mode method Resets the UE back to an appropiate state depending on the nature of caus...
uint32_t GetUlEarfcn() const
void VarMeasReportListClear(uint8_t measId)
Remove the reporting entry of the given measurement identity from m_varMeasReportList.
LteUeRrcSapProvider * GetLteUeRrcSapProvider()
std::map< uint8_t, Ptr< LteDataRadioBearerInfo > > m_drbMap
The DataRadioBearerMap attribute.
uint16_t m_cellId
The CellId attribute.
uint8_t m_connEstFailCount
the counter to count T300 timer expiration
void DoRecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock msg)
Receive master information block function.
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
TracedCallback< uint64_t, uint16_t, uint16_t, uint8_t > m_connectionTimeoutTrace
The ConnectionTimeout trace source.
std::set< uint16_t > m_acceptableCell
List of cell ID of acceptable cells for cell selection that have been detected.
Time m_t300
The T300 attribute.
EventId m_connectionTimeout
Invokes ConnectionEstablishmentTimeout() if RRC connection establishment procedure for this UE takes ...
void VarMeasReportListAdd(uint8_t measId, ConcernedCells_t enteringCells)
Compose a new reporting entry of the given measurement identity, insert it into m_varMeasReportList,...
std::vector< LteUeCphySapUser * > m_cphySapUser
UE CPhy SAP user.
uint64_t GetImsi(void) const
void ConnectionTimeout()
Invoked after timer T300 expires, notifying upper layers that RRC connection establishment procedure ...
bool m_hasReceivedMib
True if MIB was received for the current cell.
void DoRecvRrcConnectionRelease(LteRrcSap::RrcConnectionRelease msg)
Part of the RRC protocol.
std::list< uint16_t > ConcernedCells_t
List of cell IDs which are responsible for a certain trigger.
void EvaluateCellForSelection()
Performs cell selection evaluation to the current serving cell.
void DoRecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 msg)
Receive system information block type 1 function.
void StartConnection()
Start connection function.
void DoRecvSystemInformation(LteRrcSap::SystemInformation msg)
Part of the RRC protocol.
void DoNotifyInSync()
Do notify in sync function.
uint16_t m_ulBandwidth
Uplink bandwidth in RBs.
LteUeRrc()
create an RRC instance for use within an ue
uint32_t m_csgWhiteList
List of CSG ID which this UE entity has access to.
uint16_t GetPreviousCellId() const
Get the previous cell id.
static TypeId GetTypeId(void)
Get the type ID.
void DisposeOldSrb1()
Dispose old SRB1.
friend class LtePdcpSpecificLtePdcpSapUser< LteUeRrc >
allow LtePdcpSpecificLtePdcpSapUser<LteUeRrc> class friend access
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessSuccessfulTrace
The RandomAccessSuccessful trace source.
LteRrcSap::SystemInformationBlockType1 m_lastSib1
Stored content of the last SIB1 received.
void SetAsSapUser(LteAsSapUser *s)
Set the AS SAP user to interact with the NAS entity.
void SetLteUeRrcSapUser(LteUeRrcSapUser *s)
set the RRC SAP this RRC should interact with
uint16_t m_dlBandwidth
Downlink bandwidth in RBs.
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
LteAsSapUser * m_asSapUser
AS SAP user.
void SetImsi(uint64_t imsi)
virtual void DoDispose(void)
Destructor implementation.
void DoForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)
Force camped on ENB function.
void StorePreviousCellId(uint16_t cellId)
Store the previous cell id.
void ResetRlfParams()
Reset radio link failure parameters.
void DoResetSyncIndicationCounter()
Do reset sync indication counter function.
void ApplyRadioResourceConfigDedicated(LteRrcSap::RadioResourceConfigDedicated rrcd)
Apply radio resource config dedicated.
uint8_t Bid2Drbid(uint8_t bid)
Bid 2 DR bid.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
The HandoverStart trace source.
Part of the RRC protocol.
Part of the RRC protocol.
virtual void Setup(SetupParameters params)=0
Setup function.
virtual void SendRrcConnectionReconfigurationCompleted(RrcConnectionReconfigurationCompleted msg)=0
Send an RRCConnectionReconfigurationComplete message to the serving eNodeB during an RRC connection r...
virtual void SendMeasurementReport(MeasurementReport msg)=0
Send a MeasurementReport message to the serving eNodeB during a measurement reporting procedure (Sect...
virtual void SendIdealUeContextRemoveRequest(uint16_t rnti)=0
Send UE context remove request function.
virtual void SendRrcConnectionRequest(RrcConnectionRequest msg)=0
Send an _RRCConnectionRequest message to the serving eNodeB during an RRC connection establishment pr...
virtual void SendRrcConnectionSetupCompleted(RrcConnectionSetupCompleted msg)=0
Send an RRCConnectionSetupComplete message to the serving eNodeB during an RRC connection establishme...
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
Instantiate subclasses of ns3::Object.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
A base class which provides memory management and object aggregation.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Container for a set of ns3::Object pointers.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Hold objects of type Ptr<T>.
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...
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
static Time Now(void)
Return the current simulation virtual time.
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
Simulation virtual time values and global simulation resolution.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
UeMemberLteUeCmacSapUser class.
virtual void NotifyRandomAccessSuccessful()
Notify the RRC that the MAC Random Access procedure completed successfully.
UeMemberLteUeCmacSapUser(LteUeRrc *rrc)
Constructor.
LteUeRrc * m_rrc
the RRC class
virtual void NotifyRandomAccessFailed()
Notify the RRC that the MAC Random Access procedure failed.
virtual void SetTemporaryCellRnti(uint16_t rnti)
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
static const std::string & ToString(EpcUeNas::State s)
static const std::string g_ueRrcStateName[LteUeRrc::NUM_STATES]
Map each of UE RRC states to its string representation.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Ptr< Packet > pdcpSdu
the RRC PDU
uint16_t rnti
the C-RNTI identifying the UE
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
Ptr< Packet > pdcpSdu
the RRC PDU
uint8_t transmissionMode
transmission mode
uint16_t dlBandwidth
DL bandwidth.
uint16_t ulBandwidth
UL bandwidth.
uint32_t dlCarrierFreq
DL carrier frequency.
uint32_t ulCarrierFreq
UL carrier frequency.
uint32_t dlCarrierFreq
ARFCN - valueEUTRA.
uint32_t physCellId
physical cell ID
int8_t qRxLevMin
INTEGER (-70..-22), actual value = IE value * 2 [dBm].
uint32_t ulCarrierFreq
UL carrier frequency.
uint16_t ulBandwidth
UL bandwidth.
std::list< uint8_t > measIdToRemoveList
measure ID to remove list
std::list< MeasObjectToAddMod > measObjectToAddModList
measure object to add mod list
std::list< uint8_t > reportConfigToRemoveList
report config to remove list
std::list< uint8_t > measObjectToRemoveList
measure object to remove list
bool haveMeasGapConfig
have measure gap config?
QuantityConfig quantityConfig
quantity config
bool haveSmeasure
have S measure?
bool haveSpeedStatePars
have speed state parameters?
std::list< ReportConfigToAddMod > reportConfigToAddModList
report config to add mod list
std::list< MeasIdToAddMod > measIdToAddModList
measure ID to add mod list
bool haveQuantityConfig
have quantity config?
MeasObjectEutra structure.
int8_t offsetFreq
offset frequency
MeasResultEutra structure.
uint8_t rsrqResult
RSRQ result.
uint8_t rsrpResult
RSRP result.
bool haveRsrpResult
have RSRP result
bool haveRsrqResult
have RSRQ result?
uint16_t physCellId
Phy cell ID.
bool haveCgiInfo
have CGI info?
MeasResultScell structure.
uint8_t rsrpResult
the RSRP result
bool haveRsrqResult
have RSRQ result?
bool haveRsrpResult
have RSRP result?
uint8_t rsrqResult
the RSRQ result
uint16_t servFreqId
service frequency ID
bool haveMeasurementResultsServingSCells
have measure results serving Scells
std::list< MeasResultScell > measResultScell
measure results Scells
bool haveMeasurementResultsNeighCell
always false since not implemented
bool haveMeasResultNeighCells
have measure result neighbor cells
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
bool haveScellsMeas
has SCells measure
uint8_t rsrpResult
RSRP result.
uint8_t rsrqResult
RSRQ result.
MeasResultServFreqList measScellResultList
measure SCell result list
MeasurementReport structure.
MeasResults measResults
measure results
MobilityControlInfo structure.
RachConfigDedicated rachConfigDedicated
RACH config dedicated.
bool haveRachConfigDedicated
Have RACH config dedicated?
uint16_t newUeIdentity
new UE identity
bool haveCarrierBandwidth
have carrier bandwidth?
bool haveCarrierFreq
have carrier frequency?
CarrierBandwidthEutra carrierBandwidth
carrier bandwidth
CarrierFreqEutra carrierFreq
carrier frequency
uint16_t targetPhysCellId
target Phy cell ID
NonCriticalExtensionConfiguration structure.
std::list< SCellToAddMod > sCellsToAddModList
SCell to add mod list.
PdschConfigCommon pdschConfigCommon
4: Physical configuration, physical channels pdsch-ConfigCommon-r10
uint16_t dlBandwidth
1: Cell characteristics
int8_t referenceSignalPower
INTEGER (-60..50),.
PdschConfigDedicated structure.
PhysicalConfigDedicated structure.
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
bool haveAntennaInfoDedicated
have antenna info dedicated?
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
bool havePdschConfigDedicated
have PDSCH config dedicated?
AntennaInfoDedicated antennaInfo
antenna info
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
AntennaInfoDedicated antennaInfo
antenna info dedicated
uint8_t numberOfRaPreambles
number of RA preambles
uint8_t filterCoefficientRSRQ
filter coefficient RSRQ
uint8_t filterCoefficientRSRP
filter coefficient RSRP
uint8_t raResponseWindowSize
RA response window size.
uint8_t preambleTransMax
preamble transmit maximum
TxFailParam txFailParam
txFailParams
PreambleInfo preambleInfo
preamble info
RaSupervisionInfo raSupervisionInfo
RA supervision info.
uint8_t raPreambleIndex
RA preamble index.
uint8_t raPrachMaskIndex
RA PRACH mask index.
NonUlConfiguration nonUlConfiguration
non UL configuration
UlConfiguration ulConfiguration
UL configuration.
RachConfigCommon rachConfigCommon
RACH config common.
PdschConfigCommon pdschConfigCommon
PDSCH config common.
RadioResourceConfigDedicated structure.
PhysicalConfigDedicated physicalConfigDedicated
physical config dedicated
std::list< uint8_t > drbToReleaseList
DRB to release list.
std::list< DrbToAddMod > drbToAddModList
DRB to add mod list.
std::list< SrbToAddMod > srbToAddModList
SRB to add mod list.
PhysicalConfigDedicatedSCell physicalConfigDedicatedSCell
physical config dedicated SCell
Specifies criteria for triggering of an E-UTRA measurement reporting event.
bool reportOnLeave
Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving c...
uint8_t maxReportCells
Maximum number of cells, excluding the serving cell, to be included in the measurement report.
@ RSRP
Reference Signal Received Power.
@ RSRQ
Reference Signal Received Quality.
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition....
enum ns3::LteRrcSap::ReportConfigEutra::@68 reportInterval
Report interval enumeration.
ThresholdEutra threshold2
Threshold for event A5.
enum ns3::LteRrcSap::ReportConfigEutra::@64 triggerType
Trigger enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@65 eventId
Event enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@66 triggerQuantity
Trigger type enumeration.
@ PERIODICAL
periodical report
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
@ EVENT_A2
Event A2: Serving becomes worse than absolute threshold.
@ EVENT_A3
Event A3: Neighbour becomes amount of offset better than PCell.
@ EVENT_A4
Event A4: Neighbour becomes better than absolute threshold.
@ EVENT_A1
Event A1: Serving becomes better than absolute threshold.
@ EVENT_A5
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
int8_t a3Offset
Offset value for Event A3. An integer between -30 and 30. The actual value is (value * 0....
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...
RrcConnectionReconfigurationCompleted structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RrcConnectionReconfiguration structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
bool haveMobilityControlInfo
have mobility control info
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....
bool haveRadioResourceConfigDedicated
have radio resource config dedicated
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
bool haveNonCriticalExtension
have critical extension?
MeasConfig measConfig
measure config
bool haveMeasConfig
have measure config
MobilityControlInfo mobilityControlInfo
mobility control info
RrcConnectionReestablishment structure.
RrcConnectionReestablishmentReject structure.
RrcConnectionReject structure.
RrcConnectionRelease structure.
RrcConnectionRequest structure.
uint64_t ueIdentity
UE identity.
RrcConnectionSetupCompleted structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RrcConnectionSetup structure.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
uint32_t sCellIndex
SCell index.
CellIdentification cellIdentification
cell identification
RadioResourceConfigDedicatedSCell radioResourceConfigDedicateSCell
radio resource config dedicated SCell
RadioResourceConfigCommonSCell radioResourceConfigCommonSCell
radio resource config common SCell
uint16_t srsConfigIndex
SRS config index.
@ THRESHOLD_RSRP
RSRP is used for the threshold.
@ THRESHOLD_RSRQ
RSRQ is used for the threshold.
uint8_t range
Value range used in RSRP/RSRQ threshold.
enum ns3::LteRrcSap::ThresholdEutra::@63 choice
Threshold enumeration.
uint8_t connEstFailCount
Number of times that the UE detects T300 expiry on the same cell.
FreqInfo ulFreqInfo
UL frequency info.
LogicalChannelConfig structure.
uint16_t prioritizedBitRateKbps
prioritize bit rate Kbps
uint16_t bucketSizeDurationMs
bucket size duration ms
uint8_t logicalChannelGroup
logical channel group
uint8_t raResponseWindowSize
RA response window size.
uint8_t connEstFailCount
the counter value for T300 timer expiration
uint8_t preambleTransMax
preamble transmit maximum
uint8_t numberOfRaPreambles
number of RA preambles
UeMeasurementsParameters structure.
uint8_t m_componentCarrierId
component carrier ID
std::vector< struct UeMeasurementsElement > m_ueMeasurementsList
UE measurement list.
Represents a measurement result from a certain cell.
double rsrp
Measured RSRP in dBm.
double rsrq
Measured RSRQ in dB.
Represents a single triggered event from a measurement identity which reporting criteria have been fu...
ConcernedCells_t concernedCells
The list of cells responsible for this trigger.
EventId timer
The pending reporting event, scheduled at the end of the time-to-trigger.
uint8_t measId
The measurement identity which raised the trigger.
std::map< uint8_t, LteRrcSap::ReportConfigToAddMod > reportConfigList
report config list
LteRrcSap::QuantityConfig quantityConfig
quantity config
std::map< uint8_t, LteRrcSap::MeasObjectToAddMod > measObjectList
measure object list
std::map< uint8_t, LteRrcSap::MeasIdToAddMod > measIdList
measure ID list
Represents a single measurement reporting entry., which includes information about a measurement for ...
CompleteSetupParameters structure.
LtePdcpSapUser * srb1SapUser
SRB1 SAP user.
LteRlcSapUser * srb0SapUser
SRB0 SAP user.
SetupParameters structure.
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.
LtePdcpSapProvider * srb1SapProvider
SRB1 SAP provider.