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> 105 "IDLE_WAIT_MIB_SIB1",
108 "IDLE_CAMPED_NORMALLY",
110 "IDLE_RANDOM_ACCESS",
112 "CONNECTED_NORMALLY",
113 "CONNECTED_HANDOVER",
114 "CONNECTED_PHY_PROBLEM",
115 "CONNECTED_REESTABLISHING" 136 : m_cmacSapProvider (0),
138 m_macSapProvider (0),
140 m_ccmRrcSapProvider (0),
141 m_state (IDLE_START),
146 m_connectionPending (false),
147 m_hasReceivedMib (false),
148 m_hasReceivedSib1 (false),
149 m_hasReceivedSib2 (false),
151 m_noOfSyncIndications (0),
152 m_leaveConnectedMode (false),
153 m_previousCellId (0),
154 m_connEstFailCountLimit (0),
155 m_connEstFailCount (0),
201 .SetGroupName (
"Lte")
203 .AddAttribute (
"DataRadioBearerMap",
"List of UE RadioBearerInfo for Data Radio Bearers by LCID.",
206 MakeObjectMapChecker<LteDataRadioBearerInfo> ())
207 .AddAttribute (
"Srb0",
"SignalingRadioBearerInfo for SRB0",
210 MakePointerChecker<LteSignalingRadioBearerInfo> ())
211 .AddAttribute (
"Srb1",
"SignalingRadioBearerInfo for SRB1",
214 MakePointerChecker<LteSignalingRadioBearerInfo> ())
215 .AddAttribute (
"CellId",
216 "Serving cell identifier",
219 MakeUintegerChecker<uint16_t> ())
220 .AddAttribute (
"C-RNTI",
221 "Cell Radio Network Temporary Identifier",
224 MakeUintegerChecker<uint16_t> ())
225 .AddAttribute (
"T300",
226 "Timer for the RRC Connection Establishment procedure " 227 "(i.e., the procedure is deemed as failed if it takes longer than this). " 228 "Standard values: 100ms, 200ms, 300ms, 400ms, 600ms, 1000ms, 1500ms, 2000ms",
232 .AddAttribute (
"T310",
233 "Timer for detecting the Radio link failure " 234 "(i.e., the radio link is deemed as failed if this timer expires). " 235 "Standard values: 0ms 50ms, 100ms, 200ms, 500ms, 1000ms, 2000ms",
239 .AddAttribute (
"N310",
240 "This specifies the maximum number of out-of-sync indications. " 241 "Standard values: 1, 2, 3, 4, 6, 8, 10, 20",
244 MakeUintegerChecker<uint8_t> (1, 20))
245 .AddAttribute (
"N311",
246 "This specifies the maximum number of in-sync indications. " 247 "Standard values: 1, 2, 3, 4, 5, 6, 8, 10",
250 MakeUintegerChecker<uint8_t> (1, 10))
251 .AddTraceSource (
"MibReceived",
252 "trace fired upon reception of Master Information Block",
254 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
255 .AddTraceSource (
"Sib1Received",
256 "trace fired upon reception of System Information Block Type 1",
258 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
259 .AddTraceSource (
"Sib2Received",
260 "trace fired upon reception of System Information Block Type 2",
262 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
263 .AddTraceSource (
"StateTransition",
264 "trace fired upon every UE RRC state transition",
266 "ns3::LteUeRrc::StateTracedCallback")
267 .AddTraceSource (
"InitialCellSelectionEndOk",
268 "trace fired upon successful initial cell selection procedure",
270 "ns3::LteUeRrc::CellSelectionTracedCallback")
271 .AddTraceSource (
"InitialCellSelectionEndError",
272 "trace fired upon failed initial cell selection procedure",
274 "ns3::LteUeRrc::CellSelectionTracedCallback")
275 .AddTraceSource (
"RandomAccessSuccessful",
276 "trace fired upon successful completion of the random access procedure",
278 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
279 .AddTraceSource (
"RandomAccessError",
280 "trace fired upon failure of the random access procedure",
282 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
283 .AddTraceSource (
"ConnectionEstablished",
284 "trace fired upon successful RRC connection establishment",
286 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
287 .AddTraceSource (
"ConnectionTimeout",
288 "trace fired upon timeout RRC connection establishment because of T300",
290 "ns3::LteUeRrc::ImsiCidRntiCountTracedCallback")
291 .AddTraceSource (
"ConnectionReconfiguration",
292 "trace fired upon RRC connection reconfiguration",
294 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
295 .AddTraceSource (
"HandoverStart",
296 "trace fired upon start of a handover procedure",
298 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
299 .AddTraceSource (
"HandoverEndOk",
300 "trace fired upon successful termination of a handover procedure",
302 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
303 .AddTraceSource (
"HandoverEndError",
304 "trace fired upon failure of a handover procedure",
306 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
307 .AddTraceSource (
"SCarrierConfigured",
308 "trace fired after configuring secondary carriers",
310 "ns3::LteUeRrc::SCarrierConfiguredTracedCallback")
311 .AddTraceSource (
"Srb1Created",
312 "trace fired after SRB1 is created",
314 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
315 .AddTraceSource (
"DrbCreated",
316 "trace fired after DRB is created",
318 "ns3::LteUeRrc::ImsiCidRntiLcIdTracedCallback")
319 .AddTraceSource (
"RadioLinkFailure",
320 "trace fired upon failure of radio link",
322 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
323 .AddTraceSource (
"PhySyncDetection",
324 "trace fired upon receiving in Sync or out of Sync indications from UE PHY",
326 "ns3::LteUeRrc::PhySyncDetectionTracedCallback")
534 Ptr<LteRlc> rlc = CreateObject<LteRlcTm> ()->GetObject<LteRlc> ();
539 m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
541 m_srb0->m_srbIdentity = 0;
560 if (m_numberOfComponentCarriers < MIN_NO_CC || m_numberOfComponentCarriers >
MAX_NO_CC)
590 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it =
m_drbMap.find (drbid);
596 params.lcid = it->second->m_logicalChannelIdentity;
599 <<
" on DRBID " << (uint32_t) drbid
600 <<
" (LCID " << (uint32_t) params.lcid <<
")" 601 <<
" (" << packet->
GetSize () <<
" bytes)");
602 it->second->m_pdcp->GetLtePdcpSapProvider ()->TransmitPdcpSdu (params);
687 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
881 "Cell identity in SIB1 does not match with the originating cell");
896 "Cell identity in SIB1 does not match with the originating cell");
919 bool triggering =
true;
920 std::vector <LteUeCphySapUser::UeMeasurementsElement>::iterator newMeasIt;
930 newMeasIt->m_rsrq, useLayer3Filtering,
936 newMeasIt->m_rsrq, useLayer3Filtering);
949 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
1004 "SIB2 msg contains wrong value " 1103 NS_LOG_DEBUG (
this <<
"RNTI " <<
m_rnti <<
" Handover. Configuring secondary carriers");
1225 uint16_t maxRsrpCellId = 0;
1226 double maxRsrp = -std::numeric_limits<double>::infinity ();
1227 double minRsrp = -140.0;
1229 std::map<uint16_t, MeasValues>::iterator it;
1236 if (maxRsrp < it->
second.rsrp && it->second.rsrp > minRsrp)
1238 std::set<uint16_t>::const_iterator itCell;
1242 maxRsrpCellId = it->first;
1243 maxRsrp = it->second.rsrp;
1248 if (maxRsrpCellId == 0)
1250 NS_LOG_WARN (
this <<
" Cell search is unable to detect surrounding cell to attach to");
1255 <<
" is the strongest untried surrounding cell");
1274 bool isSuitableCell =
false;
1275 bool isAcceptableCell =
false;
1276 std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.find (cellId);
1277 double qRxLevMeas = storedMeasIt->second.rsrp;
1279 NS_LOG_LOGIC (
this <<
" cell selection to cellId=" << cellId
1280 <<
" qrxlevmeas=" << qRxLevMeas <<
" dBm" 1281 <<
" qrxlevmin=" << qRxLevMin <<
" dBm");
1283 if (qRxLevMeas - qRxLevMin > 0)
1285 isAcceptableCell =
true;
1290 isSuitableCell = (cellCsgIndication ==
false) || (cellCsgId ==
m_csgWhiteList);
1293 << cellCsgId <<
"/" << cellCsgIndication);
1328 if (isAcceptableCell)
1405 std::list<LteRrcSap::SrbToAddMod>::const_iterator stamIt = rrcd.
srbToAddModList.begin ();
1413 NS_ASSERT_MSG (stamIt->srbIdentity == 1,
"only SRB1 supported");
1415 const uint8_t lcid = 1;
1424 pdcp->SetLcId (lcid);
1429 m_srb1 = CreateObject<LteSignalingRadioBearerInfo> ();
1432 m_srb1->m_srbIdentity = 1;
1435 m_srb1->m_logicalChannelConfig.priority = stamIt->logicalChannelConfig.priority;
1436 m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = stamIt->logicalChannelConfig.prioritizedBitRateKbps;
1437 m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = stamIt->logicalChannelConfig.bucketSizeDurationMs;
1438 m_srb1->m_logicalChannelConfig.logicalChannelGroup = stamIt->logicalChannelConfig.logicalChannelGroup;
1441 lcConfig.
priority = stamIt->logicalChannelConfig.priority;
1452 ueParams.srb1SapProvider =
m_srb1->m_pdcp->GetLtePdcpSapProvider ();
1457 NS_LOG_INFO (
"request to modify SRB1 (skipping as currently not implemented)");
1463 std::list<LteRrcSap::DrbToAddMod>::const_iterator dtamIt;
1468 NS_LOG_INFO (
this <<
" IMSI " <<
m_imsi <<
" adding/modifying DRBID " << (uint32_t) dtamIt->drbIdentity <<
" LC " << (uint32_t) dtamIt->logicalChannelIdentity);
1469 NS_ASSERT_MSG (dtamIt->logicalChannelIdentity > 2,
"LCID value " << dtamIt->logicalChannelIdentity <<
" is reserved for SRBs");
1471 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbMapIt =
m_drbMap.find (dtamIt->drbIdentity);
1483 switch (dtamIt->rlcConfig.choice)
1504 rlc->
SetLcId (dtamIt->logicalChannelIdentity);
1507 drbInfo->m_rlc = rlc;
1508 drbInfo->m_epsBearerIdentity = dtamIt->epsBearerIdentity;
1509 drbInfo->m_logicalChannelIdentity = dtamIt->logicalChannelIdentity;
1510 drbInfo->m_drbIdentity = dtamIt->drbIdentity;
1518 pdcp->SetLcId (dtamIt->logicalChannelIdentity);
1522 drbInfo->m_pdcp = pdcp;
1533 lcConfig.
priority = dtamIt->logicalChannelConfig.priority;
1542 NS_LOG_DEBUG (
"Size of lcOnCcMapping vector "<<lcOnCcMapping.size());
1543 std::vector<LteUeCcmRrcSapProvider::LcsConfig>::iterator itLcOnCcMapping = lcOnCcMapping.begin ();
1544 NS_ASSERT_MSG (itLcOnCcMapping != lcOnCcMapping.end (),
"Component carrier manager failed to add LC for data radio bearer");
1546 for (itLcOnCcMapping = lcOnCcMapping.begin (); itLcOnCcMapping != lcOnCcMapping.end (); ++itLcOnCcMapping)
1549 <<
" LCG id " << (uint16_t) itLcOnCcMapping->lcConfig.logicalChannelGroup
1550 <<
" ComponentCarrierId " << (uint16_t) itLcOnCcMapping->componentCarrierId);
1551 uint8_t index = itLcOnCcMapping->componentCarrierId;
1554 m_cmacSapProvider.at (index)->AddLc (dtamIt->logicalChannelIdentity, lcConfigFromCcm, msu);
1567 std::list<uint8_t>::iterator dtdmIt;
1572 uint8_t drbid = *dtdmIt;
1573 NS_LOG_INFO (
this <<
" IMSI " <<
m_imsi <<
" releasing DRB " << (uint32_t) drbid);
1574 std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it =
m_drbMap.find (drbid);
1599 uint8_t measObjectId = *it;
1600 NS_LOG_LOGIC (
this <<
" deleting measObjectId " << (uint32_t) measObjectId);
1605 if (measIdIt->second.measObjectId == measObjectId)
1607 uint8_t measId = measIdIt->second.measId;
1609 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId <<
" because referring to measObjectId " << (uint32_t) measObjectId);
1628 NS_ASSERT_MSG (it->measObjectEutra.cellsToRemoveList.empty (),
"cellsToRemoveList not supported");
1629 NS_ASSERT_MSG (it->measObjectEutra.cellsToAddModList.empty (),
"cellsToAddModList not supported");
1630 NS_ASSERT_MSG (it->measObjectEutra.cellsToRemoveList.empty (),
"blackCellsToRemoveList not supported");
1631 NS_ASSERT_MSG (it->measObjectEutra.blackCellsToAddModList.empty (),
"blackCellsToAddModList not supported");
1632 NS_ASSERT_MSG (it->measObjectEutra.haveCellForWhichToReportCGI ==
false,
"cellForWhichToReportCGI is not supported");
1634 uint8_t measObjectId = it->measObjectId;
1638 NS_LOG_LOGIC (
"measObjectId " << (uint32_t) measObjectId <<
" exists, updating entry");
1639 measObjectIt->second = *it;
1640 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1645 if (measIdIt->second.measObjectId == measObjectId)
1647 uint8_t measId = measIdIt->second.measId;
1648 NS_LOG_LOGIC (
this <<
" found measId " << (uint32_t) measId <<
" referring to measObjectId " << (uint32_t) measObjectId);
1655 NS_LOG_LOGIC (
"measObjectId " << (uint32_t) measObjectId <<
" is new, adding entry");
1666 uint8_t reportConfigId = *it;
1667 NS_LOG_LOGIC (
this <<
" deleting reportConfigId " << (uint32_t) reportConfigId);
1672 if (measIdIt->second.reportConfigId == reportConfigId)
1674 uint8_t measId = measIdIt->second.measId;
1676 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId <<
" because referring to reportConfigId " << (uint32_t) reportConfigId);
1696 "only trigger type EVENT is supported");
1698 uint8_t reportConfigId = it->reportConfigId;
1702 NS_LOG_LOGIC (
"reportConfigId " << (uint32_t) reportConfigId <<
" exists, updating entry");
1704 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1709 if (measIdIt->second.reportConfigId == reportConfigId)
1711 uint8_t measId = measIdIt->second.measId;
1712 NS_LOG_LOGIC (
this <<
" found measId " << (uint32_t) measId <<
" referring to reportConfigId " << (uint32_t) reportConfigId);
1719 NS_LOG_LOGIC (
"reportConfigId " << (uint32_t) reportConfigId <<
" is new, adding entry");
1740 for (std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt
1754 uint8_t measId = *it;
1755 NS_LOG_LOGIC (
this <<
" deleting measId " << (uint32_t) measId);
1765 for (std::list<LteRrcSap::MeasIdToAddMod>::iterator it = mc.
measIdToAddModList.begin ();
1769 NS_LOG_LOGIC (
this <<
" measId " << (uint32_t) it->measId
1770 <<
" (measObjectId=" << (uint32_t) it->measObjectId
1771 <<
", reportConfigId=" << (uint32_t) it->reportConfigId
1778 std::map<uint8_t, VarMeasReport>::iterator measReportIt =
m_varMeasReportList.find (it->measId);
1781 measReportIt->second.periodicReportTimer.Cancel ();
1788 std::list<PendingTrigger_t> s;
1811 bool useLayer3Filtering)
1813 NS_LOG_FUNCTION (
this << cellId << rsrp << rsrq << useLayer3Filtering);
1815 std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.find (cellId);
1819 if (useLayer3Filtering)
1825 if (std::isnan (storedMeasIt->second.rsrq))
1828 storedMeasIt->second.rsrq = rsrq;
1838 storedMeasIt->second.rsrp = rsrp;
1839 storedMeasIt->second.rsrq = rsrq;
1848 std::pair<uint16_t, MeasValues> val (cellId, v);
1849 std::pair<std::map<uint16_t, MeasValues>::iterator,
bool>
1851 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
1852 storedMeasIt = ret.first;
1857 <<
", new RSRP " << rsrp <<
" stored " << storedMeasIt->second.rsrp
1858 <<
", new RSRQ " << rsrq <<
" stored " << storedMeasIt->second.rsrq);
1868 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt =
1871 NS_ASSERT (measIdIt->first == measIdIt->second.measId);
1873 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>::iterator
1878 std::map<uint8_t, LteRrcSap::MeasObjectToAddMod>::iterator
1883 std::map<uint8_t, VarMeasReport>::iterator
1891 "only triggerType == event is supported");
1894 NS_LOG_LOGIC (
this <<
" considering measId " << (uint32_t) measId);
1895 bool eventEntryCondApplicable =
false;
1896 bool eventLeavingCondApplicable =
false;
1900 switch (reportConfigEutra.eventId)
1914 switch (reportConfigEutra.triggerQuantity)
1918 NS_ASSERT (reportConfigEutra.threshold1.choice
1924 NS_ASSERT (reportConfigEutra.threshold1.choice
1934 bool entryCond = ms - hys > thresh;
1938 if (!isMeasIdInReportList)
1940 concernedCellsEntry.push_back (
m_cellId);
1941 eventEntryCondApplicable =
true;
1950 != measReportIt->second.cellsTriggeredList.end ());
1953 else if (reportConfigEutra.timeToTrigger > 0)
1959 bool leavingCond = ms + hys < thresh;
1963 if (isMeasIdInReportList)
1970 != measReportIt->second.cellsTriggeredList.end ());
1971 concernedCellsLeaving.push_back (
m_cellId);
1972 eventLeavingCondApplicable =
true;
1975 else if (reportConfigEutra.timeToTrigger > 0)
1981 <<
" ms=" << ms <<
" thresh=" << thresh
1982 <<
" entryCond=" << entryCond
1983 <<
" leavingCond=" << leavingCond);
2001 switch (reportConfigEutra.triggerQuantity)
2005 NS_ASSERT (reportConfigEutra.threshold1.choice
2011 NS_ASSERT (reportConfigEutra.threshold1.choice
2021 bool entryCond = ms + hys < thresh;
2025 if (!isMeasIdInReportList)
2027 concernedCellsEntry.push_back (
m_cellId);
2028 eventEntryCondApplicable =
true;
2037 != measReportIt->second.cellsTriggeredList.end ());
2040 else if (reportConfigEutra.timeToTrigger > 0)
2046 bool leavingCond = ms - hys > thresh;
2050 if (isMeasIdInReportList)
2057 != measReportIt->second.cellsTriggeredList.end ());
2058 concernedCellsLeaving.push_back (
m_cellId);
2059 eventLeavingCondApplicable =
true;
2062 else if (reportConfigEutra.timeToTrigger > 0)
2068 <<
" ms=" << ms <<
" thresh=" << thresh
2069 <<
" entryCond=" << entryCond
2070 <<
" leavingCond=" << leavingCond);
2084 double ofn = measObjectEutra.offsetFreq;
2087 double ofp = measObjectEutra.offsetFreq;
2094 switch (reportConfigEutra.triggerQuantity)
2098 NS_ASSERT (reportConfigEutra.threshold1.choice
2103 NS_ASSERT (reportConfigEutra.threshold1.choice
2111 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2115 uint16_t cellId = storedMeasIt->first;
2121 switch (reportConfigEutra.triggerQuantity)
2124 mn = storedMeasIt->second.rsrp;
2127 mn = storedMeasIt->second.rsrq;
2134 bool hasTriggered = isMeasIdInReportList
2135 && (measReportIt->second.cellsTriggeredList.find (cellId)
2136 != measReportIt->second.cellsTriggeredList.end ());
2139 bool entryCond = mn + ofn + ocn - hys > mp + ofp + ocp + off;
2145 concernedCellsEntry.push_back (cellId);
2146 eventEntryCondApplicable =
true;
2149 else if (reportConfigEutra.timeToTrigger > 0)
2155 bool leavingCond = mn + ofn + ocn + hys < mp + ofp + ocp + off;
2161 concernedCellsLeaving.push_back (cellId);
2162 eventLeavingCondApplicable =
true;
2165 else if (reportConfigEutra.timeToTrigger > 0)
2170 NS_LOG_LOGIC (
this <<
" event A3: neighbor cell " << cellId
2171 <<
" mn=" << mn <<
" mp=" << mp <<
" offset=" << off
2172 <<
" entryCond=" << entryCond
2173 <<
" leavingCond=" << leavingCond);
2189 double ofn = measObjectEutra.offsetFreq;
2195 switch (reportConfigEutra.triggerQuantity)
2198 NS_ASSERT (reportConfigEutra.threshold1.choice
2203 NS_ASSERT (reportConfigEutra.threshold1.choice
2212 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2216 uint16_t cellId = storedMeasIt->first;
2222 switch (reportConfigEutra.triggerQuantity)
2225 mn = storedMeasIt->second.rsrp;
2228 mn = storedMeasIt->second.rsrq;
2235 bool hasTriggered = isMeasIdInReportList
2236 && (measReportIt->second.cellsTriggeredList.find (cellId)
2237 != measReportIt->second.cellsTriggeredList.end ());
2240 bool entryCond = mn + ofn + ocn - hys > thresh;
2246 concernedCellsEntry.push_back (cellId);
2247 eventEntryCondApplicable =
true;
2250 else if (reportConfigEutra.timeToTrigger > 0)
2256 bool leavingCond = mn + ofn + ocn + hys < thresh;
2262 concernedCellsLeaving.push_back (cellId);
2263 eventLeavingCondApplicable =
true;
2266 else if (reportConfigEutra.timeToTrigger > 0)
2271 NS_LOG_LOGIC (
this <<
" event A4: neighbor cell " << cellId
2272 <<
" mn=" << mn <<
" thresh=" << thresh
2273 <<
" entryCond=" << entryCond
2274 <<
" leavingCond=" << leavingCond);
2292 double ofn = measObjectEutra.offsetFreq;
2299 switch (reportConfigEutra.triggerQuantity)
2303 NS_ASSERT (reportConfigEutra.threshold1.choice
2305 NS_ASSERT (reportConfigEutra.threshold2.choice
2312 NS_ASSERT (reportConfigEutra.threshold1.choice
2314 NS_ASSERT (reportConfigEutra.threshold2.choice
2325 bool entryCond = mp + hys < thresh1;
2329 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2333 uint16_t cellId = storedMeasIt->first;
2339 switch (reportConfigEutra.triggerQuantity)
2342 mn = storedMeasIt->second.rsrp;
2345 mn = storedMeasIt->second.rsrq;
2352 bool hasTriggered = isMeasIdInReportList
2353 && (measReportIt->second.cellsTriggeredList.find (cellId)
2354 != measReportIt->second.cellsTriggeredList.end ());
2358 entryCond = mn + ofn + ocn - hys > thresh2;
2364 concernedCellsEntry.push_back (cellId);
2365 eventEntryCondApplicable =
true;
2368 else if (reportConfigEutra.timeToTrigger > 0)
2373 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2374 <<
" mn=" << mn <<
" mp=" << mp
2375 <<
" thresh2=" << thresh2
2376 <<
" thresh1=" << thresh1
2377 <<
" entryCond=" << entryCond);
2385 <<
" mp=" << mp <<
" thresh1=" << thresh1
2386 <<
" entryCond=" << entryCond);
2388 if (reportConfigEutra.timeToTrigger > 0)
2394 if (isMeasIdInReportList)
2397 bool leavingCond = mp - hys > thresh1;
2401 if (reportConfigEutra.timeToTrigger == 0)
2405 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2409 uint16_t cellId = storedMeasIt->first;
2415 if (measReportIt->second.cellsTriggeredList.find (cellId)
2416 != measReportIt->second.cellsTriggeredList.end ())
2418 concernedCellsLeaving.push_back (cellId);
2419 eventLeavingCondApplicable =
true;
2427 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2431 uint16_t cellId = storedMeasIt->first;
2437 if (measReportIt->second.cellsTriggeredList.find (cellId)
2438 != measReportIt->second.cellsTriggeredList.end ())
2440 switch (reportConfigEutra.triggerQuantity)
2443 mn = storedMeasIt->second.rsrp;
2446 mn = storedMeasIt->second.rsrq;
2455 leavingCond = mn + ofn + ocn + hys < thresh2;
2467 concernedCellsLeaving.push_back (cellId);
2468 eventLeavingCondApplicable =
true;
2470 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2471 <<
" mn=" << mn <<
" mp=" << mp
2472 <<
" thresh2=" << thresh2
2473 <<
" thresh1=" << thresh1
2474 <<
" leavingCond=" << leavingCond);
2484 <<
" mp=" << mp <<
" thresh1=" << thresh1
2485 <<
" leavingCond=" << leavingCond);
2490 if (reportConfigEutra.timeToTrigger > 0)
2497 for (std::map<uint16_t, MeasValues>::iterator storedMeasIt =
m_storedMeasValues.begin ();
2501 uint16_t cellId = storedMeasIt->first;
2507 if (measReportIt->second.cellsTriggeredList.find (cellId)
2508 != measReportIt->second.cellsTriggeredList.end ())
2510 switch (reportConfigEutra.triggerQuantity)
2513 mn = storedMeasIt->second.rsrp;
2516 mn = storedMeasIt->second.rsrq;
2524 leavingCond = mn + ofn + ocn + hys < thresh2;
2528 concernedCellsLeaving.push_back (cellId);
2529 eventLeavingCondApplicable =
true;
2532 NS_LOG_LOGIC (
this <<
" event A5: neighbor cell " << cellId
2533 <<
" mn=" << mn <<
" mp=" << mp
2534 <<
" thresh2=" << thresh2
2535 <<
" thresh1=" << thresh1
2536 <<
" leavingCond=" << leavingCond);
2552 NS_FATAL_ERROR (
"unsupported eventId " << reportConfigEutra.eventId);
2557 NS_LOG_LOGIC (
this <<
" eventEntryCondApplicable=" << eventEntryCondApplicable
2558 <<
" eventLeavingCondApplicable=" << eventLeavingCondApplicable);
2560 if (eventEntryCondApplicable)
2562 if (reportConfigEutra.timeToTrigger == 0)
2573 measId, concernedCellsEntry);
2574 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2577 enteringTriggerIt->second.push_back (t);
2581 if (eventLeavingCondApplicable)
2585 && reportConfigEutra.reportOnLeave;
2587 if (reportConfigEutra.timeToTrigger == 0)
2598 measId, concernedCellsLeaving, reportOnLeave);
2599 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2602 leavingTriggerIt->second.push_back (t);
2613 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2617 if (!it1->second.empty ())
2619 std::list<PendingTrigger_t>::iterator it2;
2620 for (it2 = it1->second.begin (); it2 != it1->second.end (); ++it2)
2623 NS_LOG_LOGIC (
this <<
" canceling entering time-to-trigger event at " 2628 it1->second.clear ();
2637 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2641 std::list<PendingTrigger_t>::iterator it2 = it1->second.begin ();
2642 while (it2 != it1->second.end ())
2646 ConcernedCells_t::iterator it3;
2647 for (it3 = it2->concernedCells.begin ();
2648 it3 != it2->concernedCells.end (); ++it3)
2652 it3 = it2->concernedCells.erase (it3);
2656 if (it2->concernedCells.empty ())
2658 NS_LOG_LOGIC (
this <<
" canceling entering time-to-trigger event at " 2661 it2 = it1->second.erase (it2);
2675 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2679 if (!it1->second.empty ())
2681 std::list<PendingTrigger_t>::iterator it2;
2682 for (it2 = it1->second.begin (); it2 != it1->second.end (); ++it2)
2685 NS_LOG_LOGIC (
this <<
" canceling leaving time-to-trigger event at " 2690 it1->second.clear ();
2699 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2703 std::list<PendingTrigger_t>::iterator it2 = it1->second.begin ();
2704 while (it2 != it1->second.end ())
2708 ConcernedCells_t::iterator it3;
2709 for (it3 = it2->concernedCells.begin ();
2710 it3 != it2->concernedCells.end (); ++it3)
2714 it3 = it2->concernedCells.erase (it3);
2718 if (it2->concernedCells.empty ())
2720 NS_LOG_LOGIC (
this <<
" canceling leaving time-to-trigger event at " 2723 it2 = it1->second.erase (it2);
2738 std::map<uint8_t, VarMeasReport>::iterator
2745 std::pair<uint8_t, VarMeasReport> val (measId, r);
2746 std::pair<std::map<uint8_t, VarMeasReport>::iterator,
bool>
2748 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
2749 measReportIt = ret.first;
2754 for (ConcernedCells_t::const_iterator it = enteringCells.begin ();
2755 it != enteringCells.end ();
2758 measReportIt->second.cellsTriggeredList.insert (*it);
2761 NS_ASSERT (!measReportIt->second.cellsTriggeredList.empty ());
2762 measReportIt->second.numberOfReportsSent = 0;
2763 measReportIt->second.periodicReportTimer
2768 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2771 if (!enteringTriggerIt->second.empty ())
2779 enteringTriggerIt->second.pop_front ();
2781 if (!enteringTriggerIt->second.empty ())
2788 for (ConcernedCells_t::const_iterator it = enteringCells.begin ();
2789 it != enteringCells.end (); ++it)
2806 std::map<uint8_t, VarMeasReport>::iterator
2810 for (ConcernedCells_t::const_iterator it = leavingCells.begin ();
2811 it != leavingCells.end ();
2814 measReportIt->second.cellsTriggeredList.erase (*it);
2823 if (measReportIt->second.cellsTriggeredList.empty ())
2825 measReportIt->second.periodicReportTimer.Cancel ();
2829 std::map<uint8_t, std::list<PendingTrigger_t> >::iterator
2832 if (!leavingTriggerIt->second.empty ())
2840 leavingTriggerIt->second.pop_front ();
2842 if (!leavingTriggerIt->second.empty ())
2849 for (ConcernedCells_t::const_iterator it = leavingCells.begin ();
2850 it != leavingCells.end (); ++it)
2866 std::map<uint8_t, VarMeasReport>::iterator
2870 NS_LOG_LOGIC (
this <<
" deleting existing report for measId " << (uint16_t) measId);
2871 measReportIt->second.periodicReportTimer.Cancel ();
2885 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator
2889 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod>::iterator
2896 measResults.
measId = measId;
2903 "RSRP " << (uint32_t) measResults.
rsrpResult <<
" (" << servingMeasIt->second.rsrp <<
" dBm) " 2904 "RSRQ " << (uint32_t) measResults.
rsrqResult <<
" (" << servingMeasIt->second.rsrq <<
" dB)");
2906 std::map<uint8_t, VarMeasReport>::iterator measReportIt =
m_varMeasReportList.find (measId);
2909 NS_LOG_ERROR (
"no entry found in m_varMeasReportList for measId " << (uint32_t) measId);
2913 if (!(measReportIt->second.cellsTriggeredList.empty ()))
2915 std::multimap<double, uint16_t> sortedNeighCells;
2916 for (std::set<uint16_t>::iterator cellsTriggeredIt = measReportIt->second.cellsTriggeredList.begin ();
2917 cellsTriggeredIt != measReportIt->second.cellsTriggeredList.end ();
2920 uint16_t cellId = *cellsTriggeredIt;
2923 std::map<uint16_t, MeasValues>::iterator neighborMeasIt =
m_storedMeasValues.find (cellId);
2924 double triggerValue;
2925 switch (reportConfigEutra.triggerQuantity)
2928 triggerValue = neighborMeasIt->second.rsrp;
2931 triggerValue = neighborMeasIt->second.rsrq;
2937 sortedNeighCells.insert (std::pair<double, uint16_t> (triggerValue, cellId));
2941 std::multimap<double, uint16_t>::reverse_iterator sortedNeighCellsIt;
2943 for (sortedNeighCellsIt = sortedNeighCells.rbegin (), count = 0;
2944 sortedNeighCellsIt != sortedNeighCells.rend () && count < reportConfigEutra.maxReportCells;
2945 ++sortedNeighCellsIt, ++count)
2947 uint16_t cellId = sortedNeighCellsIt->second;
2948 std::map<uint16_t, MeasValues>::iterator neighborMeasIt =
m_storedMeasValues.find (cellId);
2952 measResultEutra.haveCgiInfo =
false;
2953 measResultEutra.haveRsrpResult =
true;
2955 measResultEutra.haveRsrqResult =
true;
2957 NS_LOG_INFO (
this <<
" reporting neighbor cell " << (uint32_t) measResultEutra.physCellId
2958 <<
" RSRP " << (uint32_t) measResultEutra.rsrpResult
2959 <<
" (" << neighborMeasIt->second.rsrp <<
" dBm)" 2960 <<
" RSRQ " << (uint32_t) measResultEutra.rsrqResult
2961 <<
" (" << neighborMeasIt->second.rsrq <<
" dB)");
2968 NS_LOG_WARN (
this <<
" cellsTriggeredList is empty");
2984 measResultScell.
servFreqId = sCellsMeasIt->first;
2998 measReportIt->second.numberOfReportsSent++;
2999 measReportIt->second.periodicReportTimer.Cancel ();
3001 Time reportInterval;
3002 switch (reportConfigEutra.reportInterval)
3029 reportInterval =
Seconds (60);
3032 reportInterval =
Seconds (360);
3035 reportInterval =
Seconds (720);
3038 reportInterval =
Seconds (1800);
3041 reportInterval =
Seconds (3600);
3044 NS_FATAL_ERROR (
"Unsupported reportInterval " << (uint16_t) reportConfigEutra.reportInterval);
3049 measReportIt->second.periodicReportTimer
3079 std::map<uint8_t, LteRrcSap::MeasIdToAddMod>::iterator measIdIt;
3155 std::map<uint8_t, uint8_t>::iterator it =
m_bid2DrbidMap.find (bid);
3182 NS_LOG_INFO (
"Starting initial cell selection after RLF");
3227 bool useLayer3Filtering, uint16_t componentCarrierId)
3229 NS_LOG_FUNCTION (
this << sCellId << componentCarrierId << rsrp << rsrq << useLayer3Filtering);
3237 if (useLayer3Filtering)
3243 if (std::isnan (storedMeasIt->second.rsrq))
3246 storedMeasIt->second.rsrq = rsrq;
3256 storedMeasIt->second.rsrp = rsrp;
3257 storedMeasIt->second.rsrq = rsrq;
3266 std::pair<uint16_t, MeasValues> val (componentCarrierId, v);
3267 std::pair<std::map<uint16_t, MeasValues>::iterator,
bool>
3269 NS_ASSERT_MSG (ret.second ==
true,
"element already existed");
3270 storedMeasIt = ret.first;
3274 <<
", measured cell " << sCellId
3275 <<
", carrier component Id " << componentCarrierId
3276 <<
", new RSRP " << rsrp <<
" stored " << storedMeasIt->second.rsrp
3277 <<
", new RSRQ " << rsrq <<
" stored " << storedMeasIt->second.rsrq);
3282 NS_LOG_DEBUG (
this <<
" IMSI " <<
m_imsi <<
"measurement on SCC from not serving cell ");
3317 NS_LOG_INFO (
this <<
" Total Number of Sync indications from PHY "
uint32_t sCellIndex
SCell index.
std::map< uint16_t, MeasValues > m_storedScellMeasValues
Internal storage of the latest measurement results from all detected detected Secondary carrier compo...
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
MemberLteUeCcmRrcSapUser class.
RrcConnectionRequest structure.
uint64_t GetImsi(void) const
uint8_t numberOfRaPreambles
number of RA preambles
PhysicalConfigDedicated structure.
bool haveNonCriticalExtension
have critical extension?
void DoSetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)
RRC CCM SAP USER Method.
LtePdcpSapProvider * srb1SapProvider
SRB1 SAP provider.
Simulation virtual time values and global simulation resolution.
TracedCallback< uint64_t, uint16_t, uint16_t > m_radioLinkFailureTrace
The 'RadioLinkFailure' trace source.
uint8_t raResponseWindowSize
RA response window size.
RadioResourceConfigCommonSCell radioResourceConfigCommonSCell
radio resource config common SCell
CarrierFreqEutra carrierFreq
carrier frequency
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
Part of the RRC protocol.
void DoRecvRrcConnectionSetup(LteRrcSap::RrcConnectionSetup msg)
Part of the RRC protocol.
uint8_t m_componentCarrierId
component carrier ID
void DoRecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock msg)
Receive master information block function.
MeasurementReport structure.
std::map< uint8_t, LteRrcSap::MeasObjectToAddMod > measObjectList
measure object list
std::vector< struct UeMeasurementsElement > m_ueMeasurementsList
UE measurement list.
UeMemberLteUeCmacSapUser class.
void CancelEnteringTrigger(uint8_t measId)
Clear all the waiting triggers in m_enteringTriggerQueue which are associated with the given measurem...
void DoRecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 msg)
Receive system information block type 1 function.
PdschConfigDedicated pdschConfigDedicated
PDSCH config dedicated.
static TypeId GetTypeId(void)
Get the type ID.
MobilityControlInfo structure.
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
std::list< MeasObjectToAddMod > measObjectToAddModList
measure object to add mod list
uint8_t GetDlBandwidth() const
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
LtePdcpSapUser * m_drbPdcpSapUser
DRB PDCP SAP user.
void DoRecvSystemInformation(LteRrcSap::SystemInformation msg)
Part of the RRC protocol.
uint16_t bucketSizeDurationMs
bucket size duration ms
uint8_t numberOfRaPreambles
number of RA preambles
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void DoNotifyOutOfSync()
Do notify out of sync function.
Event A3: Neighbour becomes amount of offset better than PCell.
static double ConvertPdschConfigDedicated2Double(PdschConfigDedicated pdschConfigDedicated)
Convert PDSCH config dedicated function.
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
static TypeId GetTypeId(void)
Get the type ID.
RSRP is used for the threshold.
uint8_t m_connEstFailCount
the counter to count T300 timer expiration
void SetAsSapUser(LteAsSapUser *s)
Set the AS SAP user to interact with the NAS entity.
void MeasurementReportTriggering(uint8_t measId)
Evaluate the reporting criteria of a measurement identity and invoke some reporting actions based on ...
QuantityConfig quantityConfig
quantity config
void DoRecvRrcConnectionReject(LteRrcSap::RrcConnectionReject msg)
Part of the RRC protocol.
std::list< uint8_t > reportConfigToRemoveList
report config to remove list
bool m_hasReceivedSib2
True if SIB2 was received for the current cell.
MeasObjectEutra structure.
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
int8_t qRxLevMin
INTEGER (-70..-22), actual value = IE value * 2 [dBm].
std::map< uint8_t, Ptr< LteDataRadioBearerInfo > > m_drbMap
The DataRadioBearerMap attribute.
void ApplyMeasConfig(LteRrcSap::MeasConfig mc)
Update the current measurement configuration m_varMeasConfig.
Specifies criteria for triggering of an E-UTRA measurement reporting event.
virtual void DoDispose(void)
Destructor implementation.
void SetUseRlcSm(bool val)
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
virtual void SendRrcConnectionReconfigurationCompleted(RrcConnectionReconfigurationCompleted msg)=0
Send an RRCConnectionReconfigurationComplete message to the serving eNodeB during an RRC connection r...
uint16_t m_numberOfComponentCarriers
The number of component carriers.
uint8_t measId
The measurement identity which raised the trigger.
RadioResourceConfigDedicatedSCell radioResourceConfigDedicateSCell
radio resource config dedicated SCell
LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated
the PDSCH condig dedicated
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
std::list< SrbToAddMod > srbToAddModList
SRB to add mod list.
void DoSetTemporaryCellRnti(uint16_t rnti)
Set temporary cell rnti function.
Represents a single triggered event from a measurement identity which reporting criteria have been fu...
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
EventId m_connectionTimeout
Invokes ConnectionEstablishmentTimeout() if RRC connection establishment procedure for this UE takes ...
LteUeRrc()
create an RRC instance for use within an ue
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
std::list< uint8_t > measObjectToRemoveList
measure object to remove list
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
uint8_t m_n311
The 'N311' attribute.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
std::vector< LteUeCmacSapProvider * > m_cmacSapProvider
UE CMac SAP provider.
virtual std::vector< LteUeCcmRrcSapProvider::LcsConfig > AddLc(uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser *msu)=0
add a new Logical Channel (LC)
PdschConfigCommon pdschConfigCommon
4: Physical configuration, physical channels pdsch-ConfigCommon-r10
virtual ~LteUeRrc()
Destructor.
uint16_t srsConfigIndex
SRS config index.
uint16_t m_cellId
The CellId attribute.
EventId timer
The pending reporting event, scheduled at the end of the time-to-trigger.
void CancelLeavingTrigger(uint8_t measId)
Clear all the waiting triggers in m_leavingTriggerQueue which are associated with the given measureme...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
virtual void NotifyRandomAccessSuccessful()
Notify the RRC that the MAC Random Access procedure completed successfully.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual void NotifyConnectionSuccessful()=0
Notify the NAS that RRC Connection Establishment was successful.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
TxFailParam txFailParam
txFailParams
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
bool haveCarrierFreq
have carrier frequency?
bool m_hasReceivedMib
True if MIB was received for the current cell.
RachConfigDedicated rachConfigDedicated
RACH config dedicated.
uint16_t GetPreviousCellId() const
Get the previous cell id.
SetupParameters structure.
bool haveSmeasure
have S measure?
void DoRecvRrcConnectionReestablishmentReject(LteRrcSap::RrcConnectionReestablishmentReject msg)
Part of the RRC protocol.
uint8_t GetUlBandwidth() const
uint32_t m_dlEarfcn
Downlink carrier frequency.
Reference Signal Received Quality.
MeasConfig measConfig
measure config
void SetRnti(uint16_t rnti)
bool m_connectionPending
True if a connection request by upper layers is pending.
LtePdcpSapUser * srb1SapUser
SRB1 SAP user.
uint8_t rsrpResult
the RSRP result
void DoStartCellSelection(uint32_t dlEarfcn)
Start cell selection function.
uint32_t ulCarrierFreq
UL carrier frequency.
bool m_hasReceivedSib1
True if SIB1 was received for the current cell.
LteMacSapProvider * m_macSapProvider
MAC SAP provider.
bool haveRadioResourceConfigDedicated
have radio resource config dedicated
TracedCallback< uint64_t, uint16_t, uint16_t > m_srb1CreatedTrace
The Srb1Created trace source.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
static double RsrqRange2Db(uint8_t range)
converts an RSRQ range to dB as per 3GPP TS 36.133 section 9.1.7 RSRQ Measurement Report Mapping ...
virtual void SendRrcConnectionSetupCompleted(RrcConnectionSetupCompleted msg)=0
Send an RRCConnectionSetupComplete message to the serving eNodeB during an RRC connection establishme...
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
Ptr< Packet > pdcpSdu
the RRC PDU
uint8_t Bid2Drbid(uint8_t bid)
Bid 2 DR bid.
PreambleInfo preambleInfo
preamble info
uint8_t rsrpResult
RSRP result.
void DoResetSyncIndicationCounter()
Do reset sync indication counter function.
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
CellIdentification cellIdentification
cell identification
LteUeCmacSapUser * GetLteUeCmacSapUser()
This function is overloaded to maintain backward compatibility.
uint8_t preambleTransMax
preamble transmit maximum
static const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
LteRrcSap::QuantityConfig quantityConfig
quantity config
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
std::vector< LteUeCphySapProvider * > m_cphySapProvider
UE CPhy SAP provider.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
void SetLteUeRrcSapUser(LteUeRrcSapUser *s)
set the RRC SAP this RRC should interact with
LteUeRrcSapUser * m_rrcSapUser
RRC SAP user.
uint8_t preambleTransMax
preamble transmit maximum
MeasResults measResults
measure results
FreqInfo ulFreqInfo
UL frequency info.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
MeasResultScell structure.
State m_state
The current UE RRC state.
AttributeValue implementation for Time.
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
ConcernedCells_t concernedCells
The list of cells responsible for this trigger.
TracedCallback< Ptr< LteUeRrc >, std::list< LteRrcSap::SCellToAddMod > > m_sCarrierConfiguredTrace
The SCarrierConfigured trace source.
uint64_t ueIdentity
UE identity.
static TypeId GetTypeId(void)
Get the type ID.
int8_t referenceSignalPower
INTEGER (-60..50),.
RrcConnectionReestablishment structure.
Represents a measurement result from a certain cell.
void DisposeOldSrb1()
Dispose old SRB1.
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_handoverStartTrace
The HandoverStart trace source.
uint8_t rsrqResult
the RSRQ result
void DoRecvRrcConnectionReconfiguration(LteRrcSap::RrcConnectionReconfiguration msg)
Part of the RRC protocol.
void DoRecvRrcConnectionReestablishment(LteRrcSap::RrcConnectionReestablishment msg)
Part of the RRC protocol.
uint8_t m_dlBandwidth
Downlink bandwidth in RBs.
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
Hold an unsigned integer type.
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessErrorTrace
The RandomAccessError trace source.
bool haveMeasurementResultsNeighCell
always false since not implemented
Service Access Point (SAP) offered by the UE RRC to the UE CCM.
NonUlConfiguration nonUlConfiguration
non UL configuration
virtual void SendIdealUeContextRemoveRequest(uint16_t rnti)=0
Send UE context remove request function.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
TracedCallback< uint64_t, uint16_t, uint16_t > m_sib2ReceivedTrace
The Sib2Received trace source.
Event A5: PCell becomes worse than absolute threshold1 AND Neighbour becomes better than another abso...
LteUeRrc * m_rrc
the RRC class
void ConnectionTimeout()
Invoked after timer T300 expires, notifying upper layers that RRC connection establishment procedure ...
uint32_t dlCarrierFreq
ARFCN - valueEUTRA.
bool haveMeasGapConfig
have measure gap config?
void EvaluateCellForSelection()
Performs cell selection evaluation to the current serving cell.
MeasResultEutra structure.
std::list< MeasResultScell > measResultScell
measure results Scells
RrcConnectionReconfiguration structure.
std::list< MeasIdToAddMod > measIdToAddModList
measure ID to add mod list
bool haveRachConfigDedicated
Have RACH config dedicated?
uint8_t raPrachMaskIndex
RA PRACH mask index.
virtual void DoInitialize(void)
Initialize() implementation.
std::map< uint16_t, MeasValues > m_storedMeasValues
Internal storage of the latest measurement results from all detected detected cells, indexed by the cell ID where the measurement was taken from.
void StorePreviousCellId(uint16_t cellId)
Store the previous cell id.
void SetLteCcmRrcSapProvider(LteUeCcmRrcSapProvider *s)
set the Component Carrier Management SAP this RRC should interact with
PhysicalConfigDedicated physicalConfigDedicated
physical config dedicated
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
uint8_t filterCoefficientRSRP
filter coefficient RSRP
EventId m_radioLinkFailureDetected
Time limit (given by m_t310) before the radio link is considered to have failed.
bool haveRsrpResult
have RSRP result?
void SetLteUeCmacSapProvider(LteUeCmacSapProvider *s)
set the CMAC SAP this RRC should interact with
RrcConnectionReconfigurationCompleted structure.
bool m_useRlcSm
True if RLC SM is to be used, false if RLC UM/AM are to be used.
MeasResultServFreqList measScellResultList
measure SCell result list
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
std::list< SCellToAddMod > sCellsToAddModList
SCell to add mod list.
Template for the implementation of the LteAsSapProvider as a member of an owner class of type C to wh...
LteMacSapUser * GetLteMacSapUser()
uint32_t m_csgWhiteList
List of CSG ID which this UE entity has access to.
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
std::map< uint8_t, LteRrcSap::MeasIdToAddMod > measIdList
measure ID list
LogicalChannelConfig structure.
std::map< uint8_t, uint8_t > m_bid2DrbidMap
bid to DR bid map
void SetLteMacSapProvider(LteMacSapProvider *s)
set the MAC SAP provider.
RrcConnectionSetupCompleted structure.
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndOkTrace
The InitialCellSelectionEndOk trace source.
RadioResourceConfigDedicated radioResourceConfigDedicated
radio resource config dedicated
RrcConnectionSetup structure.
std::list< LteRrcSap::SCellToAddMod > m_sCellToAddModList
Secondary carriers.
uint8_t rrcTransactionIdentifier
RRC transaction identifier.
void SetLteUeCphySapProvider(LteUeCphySapProvider *s)
set the CPHY SAP this RRC should use to interact with the PHY
void SwitchToState(State s)
Switch the UE RRC to the given state.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
virtual LteMacSapUser * ConfigureSignalBearer(uint8_t lcid, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser *msu)=0
Add the Signal Bearer for a specific Ue in LteUeComponenCarrierManager.
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
uint8_t raPreambleIndex
RA preamble index.
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndErrorTrace
The InitialCellSelectionEndError trace source.
VarMeasConfig m_varMeasConfig
Includes the accumulated configuration of the measurements to be performed by the UE...
std::map< uint8_t, std::list< PendingTrigger_t > > m_leavingTriggerQueue
List of triggers that were raised because leaving condition have been true, but are still delayed fro...
std::vector< LteUeCphySapUser * > m_cphySapUser
UE CPhy SAP user.
uint8_t m_connEstFailCountLimit
the counter value for T300 timer expiration received from the eNB
std::map< uint8_t, LteRrcSap::ReportConfigToAddMod > reportConfigList
report config list
uint16_t servFreqId
service frequency ID
virtual void Setup(SetupParameters params)=0
Setup function.
uint16_t physCellId
Phy cell ID.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool haveQuantityConfig
have quantity config?
TracedCallback< uint64_t, uint16_t, uint16_t, uint8_t > m_connectionTimeoutTrace
The ConnectionTimeout trace source.
Hold objects of type Ptr<T>.
Time m_t310
The 'T310' attribute.
Ptr< Packet > pdcpSdu
the RRC PDU
void SetLteRlcSapUser(LteRlcSapUser *s)
uint16_t targetPhysCellId
target Phy cell ID
RrcConnectionReject structure.
LteAsSapUser * m_asSapUser
AS SAP user.
PhysicalConfigDedicatedSCell physicalConfigDedicatedSCell
physical config dedicated SCell
Template for the implementation of the LteUeRrcSapProvider as a member of an owner class of type C to...
bool haveMobilityControlInfo
have mobility control info
TracedCallback< uint64_t, uint16_t, uint16_t, uint8_t > m_drbCreatedTrace
The DrbCreated trace source.
uint8_t connEstFailCount
Number of times that the UE detects T300 expiry on the same cell.
void DoNotifyRandomAccessSuccessful()
Notify random access successful function.
void SaveScellUeMeasurements(uint16_t cellId, double rsrp, double rsrq, bool useLayer3Filtering, uint16_t componentCarrierId)
keep the given measurement result as the latest measurement figures, to be utilised by UE RRC functio...
Reference Signal Received Power.
void RadioLinkFailureDetected()
Radio link failure detected function.
LteUeCcmRrcSapUser * m_ccmRrcSapUser
CCM RRC SAP user.
bool haveMeasResultNeighCells
have measure result neighbor cells
uint16_t dlBandwidth
1: Cell characteristics
uint32_t physCellId
physical cell ID
uint8_t filterCoefficientRSRQ
filter coefficient RSRQ
bool havePdschConfigDedicated
have PDSCH config dedicated?
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_sib1ReceivedTrace
The Sib1Received trace source.
uint16_t newUeIdentity
new UE identity
double rsrq
Measured RSRQ in dB.
uint8_t ulBandwidth
UL bandwidth.
void DoSendData(Ptr< Packet > packet, uint8_t bid)
Send data function.
uint16_t m_previousCellId
the cell id of the previous cell UE was attached to
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
void DoForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)
Force camped on ENB function.
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
LtePdcpSpecificLtePdcpSapUser class.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
bool haveSoundingRsUlConfigDedicated
have sounding RS UL config dedicated?
RrcConnectionReestablishmentReject structure.
static Time Now(void)
Return the current simulation virtual time.
LteRlcSapUser * srb0SapUser
SRB0 SAP user.
void SetLcId(uint8_t lcId)
void DoRecvRrcConnectionRelease(LteRrcSap::RrcConnectionRelease msg)
Part of the RRC protocol.
double rsrp
Measured RSRP in dBm.
void VarMeasReportListErase(uint8_t measId, ConcernedCells_t leavingCells, bool reportOnLeave)
Remove some cells from an existing reporting entry in m_varMeasReportList.
LteUeCcmRrcSapUser * GetLteCcmRrcSapUser()
Get the Component Carrier Management SAP offered by this RRC.
uint8_t m_n310
The 'N310' attribute.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
uint32_t dlCarrierFreq
DL carrier frequency.
CarrierBandwidthEutra carrierBandwidth
carrier bandwidth
LteUeCcmRrcSapProvider * m_ccmRrcSapProvider
Interface to the LteUeComponentCarrierManage instance.
uint8_t m_ulBandwidth
Uplink bandwidth in RBs.
LteUeCphySapUser * GetLteUeCphySapUser()
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
The ConnectionReconfiguration trace source.
Ptr< LteSignalingRadioBearerInfo > m_srb1Old
SRB1 configuration before RRC connection reconfiguration.
virtual void SendMeasurementReport(MeasurementReport msg)=0
Send a MeasurementReport message to the serving eNodeB during a measurement reporting procedure (Sect...
State
The states of the UE RRC entity.
RachConfigCommon rachConfigCommon
RACH config common.
void StartConnection()
Start connection function.
Instantiate subclasses of ns3::Object.
static uint8_t Dbm2RsrpRange(double dbm)
convert an RSRP value in dBm to the corresponding range as per 3GPP TS 36.133 section 9...
uint8_t raResponseWindowSize
RA response window size.
void SaveUeMeasurements(uint16_t cellId, double rsrp, double rsrq, bool useLayer3Filtering)
Keep the given measurement result as the latest measurement figures, to be utilised by UE RRC functio...
uint16_t prioritizedBitRateKbps
prioritize bit rate Kbps
Service Access Point (SAP) offered by the UE component carrier manager to the UE RRC...
bool haveCarrierBandwidth
have carrier bandwidth?
bool haveAntennaInfoDedicated
have antenna info dedicated?
uint8_t ulBandwidth
UL bandwidth.
static const std::string & ToString(EpcUeNas::State s)
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
void DoSetCsgWhiteList(uint32_t csgId)
Set CSG white list function.
std::vector< LteUeCmacSapUser * > m_cmacSapUser
UE CMac SAP user.
void DoNotifyRandomAccessFailed()
Notify random access failed function.
NonCriticalExtensionConfiguration nonCriticalExtension
3GPP TS 36.331 v.11.10 R11 Sec. 6.2.2 pag. 147 (also known as ETSI TS 136 331 v.11.10 Feb-2015)
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
void DoCompleteSetup(LteUeRrcSapProvider::CompleteSetupParameters params)
Part of the RRC protocol.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
LteUeRrcSapProvider * m_rrcSapProvider
RRC SAP provider.
void DoConnect()
Connect function.
bool haveSpeedStatePars
have speed state parameters?
void ApplyRadioResourceConfigDedicated(LteRrcSap::RadioResourceConfigDedicated rrcd)
Apply radio resource config dedicated.
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
std::list< DrbToAddMod > drbToAddModList
DRB to add mod list.
virtual void NotifyConnectionReleased()=0
Notify the NAS that RRC Connection was released.
std::map< uint8_t, VarMeasReport > m_varMeasReportList
The list of active reporting entries, indexed by the measurement identity which triggered the reporti...
virtual void NotifyConnectionFailed()=0
Notify the NAS that RRC Connection Establishment failed.
LteAsSapProvider * m_asSapProvider
AS SAP provider.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_mibReceivedTrace
The MibReceived trace source.
uint16_t m_rnti
The C-RNTI attribute.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
uint64_t m_imsi
The unique UE identifier.
uint8_t transmissionMode
transmission mode
void ApplyRadioResourceConfigDedicatedSecondaryCarrier(LteRrcSap::NonCriticalExtensionConfiguration nonCec)
Apply radio resource config dedicated secondary carrier.
UeMeasurementsParameters structure.
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.
Event A1: Serving becomes better than absolute threshold.
LteAsSapProvider * GetAsSapProvider()
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
void DoReportUeMeasurements(LteUeCphySapUser::UeMeasurementsParameters params)
Report UE measurements function.
RSRQ is used for the threshold.
MobilityControlInfo mobilityControlInfo
mobility control info
bool haveMeasConfig
have measure config
Event A4: Neighbour becomes better than absolute threshold.
bool m_leaveConnectedMode
true if UE NAS ask UE RRC to leave connected mode, e.g., after RLF, i.e. T310 has expired ...
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Represents a single measurement reporting entry., which includes information about a measurement for ...
bool haveRsrqResult
have RSRQ result?
CompleteSetupParameters structure.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
AntennaInfoDedicated antennaInfo
antenna info
void DoNotifyInSync()
Do notify in sync function.
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...
uint32_t GetDlEarfcn() const
uint8_t rsrqResult
RSRQ result.
A base class which provides memory management and object aggregation.
virtual void Reset()=0
Reset LC maps.
PdschConfigCommon pdschConfigCommon
PDSCH config common.
void SynchronizeToStrongestCell()
Go through the list of measurement results, choose the one with the strongest RSRP, and tell PHY to synchronize to it.
Container for a set of ns3::Object pointers.
void InitializeSap(void)
Initiaize SAP.
void DoReceivePdcpSdu(LtePdcpSapUser::ReceivePdcpSduParameters params)
Receive PDCP SDU function.
virtual void SendRrcConnectionRequest(RrcConnectionRequest msg)=0
Send an _RRCConnectionRequest message to the serving eNodeB during an RRC connection establishment pr...
Part of the RRC protocol.
uint8_t dlBandwidth
DL bandwidth.
NonCriticalExtensionConfiguration structure.
uint32_t GetUlEarfcn() const
RrcConnectionRelease structure.
static uint8_t Db2RsrqRange(double db)
convert an RSRQ value in dB to the corresponding range as per 3GPP TS 36.133 section 9...
PdschConfigDedicated structure.
virtual void RecvData(Ptr< Packet > packet)=0
receive a data packet
SoundingRsUlConfigDedicated soundingRsUlConfigDedicated
sounding RS UL config dedicated
UeMemberLteUeCmacSapUser(LteUeRrc *rrc)
Constructor.
LteUeRrcSapProvider * GetLteUeRrcSapProvider()
static const std::string g_ueRrcStateName[LteUeRrc::NUM_STATES]
Map each of UE RRC states to its string representation.
std::list< uint16_t > ConcernedCells_t
List of cell IDs which are responsible for a certain trigger.
Time m_t300
The T300 attribute.
UlConfiguration ulConfiguration
UL configuration.
Event A2: Serving becomes worse than absolute threshold.
void VarMeasReportListAdd(uint8_t measId, ConcernedCells_t enteringCells)
Compose a new reporting entry of the given measurement identity, insert it into m_varMeasReportList, and set it up for submission to eNodeB.
void DoDisconnect()
Disconnect function.
virtual void SetTemporaryCellRnti(uint16_t rnti)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessSuccessfulTrace
The RandomAccessSuccessful trace source.
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_enteringTriggerQueue
List of triggers that were raised because entering condition have been true, but are still delayed fr...
std::list< uint8_t > measIdToRemoveList
measure ID to remove list
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE...
a unique identifier for an interface.
std::list< ReportConfigToAddMod > reportConfigToAddModList
report config to add mod list
TypeId SetParent(TypeId tid)
Set the parent TypeId.
std::list< uint8_t > drbToReleaseList
DRB to release list.
static TypeId GetTypeId(void)
Get the type ID.
void SetImsi(uint64_t imsi)
uint8_t m_lastRrcTransactionIdentifier
last RRC transaction identifier
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
void VarMeasReportListClear(uint8_t measId)
Remove the reporting entry of the given measurement identity from m_varMeasReportList.
void LeaveConnectedMode()
Leave connected mode method Resets the UE back to an appropiate state depending on the nature of caus...
uint32_t m_ulEarfcn
Uplink carrier frequency.
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndErrorTrace
The HandoverEndError trace source.
RaSupervisionInfo raSupervisionInfo
RA supervision info.
uint8_t m_noOfSyncIndications
number of in-sync or out-of-sync indications coming from PHY layer
LteRrcSap::SystemInformationBlockType1 m_lastSib1
Stored content of the last SIB1 received.
void SetLteMacSapProvider(LteMacSapProvider *s)
bool haveScellsMeas
has SCells measure
bool haveMeasurementResultsServingSCells
have measure results serving Scells
AntennaInfoDedicated antennaInfo
antenna info dedicated
virtual void NotifyRandomAccessFailed()
Notify the RRC that the MAC Random Access procedure failed.
uint8_t connEstFailCount
the counter value for T300 timer expiration
RadioResourceConfigDedicated structure.
uint32_t ulCarrierFreq
UL carrier frequency.
static double RsrpRange2Dbm(uint8_t range)
converts an RSRP range to dBm as per 3GPP TS 36.133 section 9.1.4 RSRP Measurement Report Mapping ...
uint8_t logicalChannelGroup
logical channel group
uint16_t GetCellId() const