25#include "ns3/fatal-error.h"
27#include "ns3/object-factory.h"
28#include "ns3/object-map.h"
29#include "ns3/simulator.h"
92 : m_cmacSapProvider(0),
93 m_rrcSapUser(nullptr),
94 m_macSapProvider(nullptr),
96 m_ccmRrcSapProvider(nullptr),
102 m_connectionPending(
false),
103 m_hasReceivedMib(
false),
104 m_hasReceivedSib1(
false),
105 m_hasReceivedSib2(
false),
107 m_noOfSyncIndications(0),
108 m_leaveConnectedMode(
false),
110 m_connEstFailCountLimit(0),
111 m_connEstFailCount(0),
160 .AddAttribute(
"DataRadioBearerMap",
161 "List of UE RadioBearerInfo for Data Radio Bearers by LCID.",
165 .AddAttribute(
"Srb0",
166 "SignalingRadioBearerInfo for SRB0",
170 .AddAttribute(
"Srb1",
171 "SignalingRadioBearerInfo for SRB1",
175 .AddAttribute(
"CellId",
176 "Serving cell identifier",
180 .AddAttribute(
"C-RNTI",
181 "Cell Radio Network Temporary Identifier",
187 "Timer for the RRC Connection Establishment procedure "
188 "(i.e., the procedure is deemed as failed if it takes longer than this). "
189 "Standard values: 100ms, 200ms, 300ms, 400ms, 600ms, 1000ms, 1500ms, 2000ms",
196 "Timer for detecting the Radio link failure "
197 "(i.e., the radio link is deemed as failed if this timer expires). "
198 "Standard values: 0ms 50ms, 100ms, 200ms, 500ms, 1000ms, 2000ms",
205 "This specifies the maximum number of out-of-sync indications. "
206 "Standard values: 1, 2, 3, 4, 6, 8, 10, 20",
212 "This specifies the maximum number of in-sync indications. "
213 "Standard values: 1, 2, 3, 4, 5, 6, 8, 10",
217 .AddTraceSource(
"MibReceived",
218 "trace fired upon reception of Master Information Block",
220 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
221 .AddTraceSource(
"Sib1Received",
222 "trace fired upon reception of System Information Block Type 1",
224 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
225 .AddTraceSource(
"Sib2Received",
226 "trace fired upon reception of System Information Block Type 2",
228 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
229 .AddTraceSource(
"StateTransition",
230 "trace fired upon every UE RRC state transition",
232 "ns3::LteUeRrc::StateTracedCallback")
233 .AddTraceSource(
"InitialCellSelectionEndOk",
234 "trace fired upon successful initial cell selection procedure",
236 "ns3::LteUeRrc::CellSelectionTracedCallback")
237 .AddTraceSource(
"InitialCellSelectionEndError",
238 "trace fired upon failed initial cell selection procedure",
240 "ns3::LteUeRrc::CellSelectionTracedCallback")
241 .AddTraceSource(
"RandomAccessSuccessful",
242 "trace fired upon successful completion of the random access procedure",
244 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
245 .AddTraceSource(
"RandomAccessError",
246 "trace fired upon failure of the random access procedure",
248 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
249 .AddTraceSource(
"ConnectionEstablished",
250 "trace fired upon successful RRC connection establishment",
252 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
253 .AddTraceSource(
"ConnectionTimeout",
254 "trace fired upon timeout RRC connection establishment because of T300",
256 "ns3::LteUeRrc::ImsiCidRntiCountTracedCallback")
257 .AddTraceSource(
"ConnectionReconfiguration",
258 "trace fired upon RRC connection reconfiguration",
260 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
261 .AddTraceSource(
"HandoverStart",
262 "trace fired upon start of a handover procedure",
264 "ns3::LteUeRrc::MibSibHandoverTracedCallback")
265 .AddTraceSource(
"HandoverEndOk",
266 "trace fired upon successful termination of a handover procedure",
268 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
269 .AddTraceSource(
"HandoverEndError",
270 "trace fired upon failure of a handover procedure",
272 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
273 .AddTraceSource(
"SCarrierConfigured",
274 "trace fired after configuring secondary carriers",
276 "ns3::LteUeRrc::SCarrierConfiguredTracedCallback")
277 .AddTraceSource(
"Srb1Created",
278 "trace fired after SRB1 is created",
280 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
281 .AddTraceSource(
"DrbCreated",
282 "trace fired after DRB is created",
284 "ns3::LteUeRrc::ImsiCidRntiLcIdTracedCallback")
285 .AddTraceSource(
"RadioLinkFailure",
286 "trace fired upon failure of radio link",
288 "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
291 "trace fired upon receiving in Sync or out of Sync indications from UE PHY",
293 "ns3::LteUeRrc::PhySyncDetectionTracedCallback");
447 if (cellId ==
cphySap->GetCellId())
518 m_srb0->m_srbIdentity = 0;
571 params.pdcpSdu = packet;
573 params.lcid =
it->second->m_logicalChannelIdentity;
575 NS_LOG_LOGIC(
this <<
" RNTI=" <<
m_rnti <<
" sending packet " << packet <<
" on DRBID "
577 <<
" (" << packet->GetSize() <<
" bytes)");
578 it->second->m_pdcp->GetLtePdcpSapProvider()->TransmitPdcpSdu(params);
852 "Cell identity in SIB1 does not match with the originating cell");
867 "Cell identity in SIB1 does not match with the originating cell");
890 for (
auto newMeasIt = params.m_ueMeasurementsList.begin();
891 newMeasIt != params.m_ueMeasurementsList.end();
894 if (params.m_componentCarrierId != 0)
903 params.m_componentCarrierId);
932 m_srb0->m_rlc->SetLteRlcSapUser(params.srb0SapUser);
935 m_srb1->m_pdcp->SetLtePdcpSapUser(params.srb1SapUser);
961 rc.numberOfRaPreambles =
msg.sib2.radioResourceConfigCommon.rachConfigCommon
962 .preambleInfo.numberOfRaPreambles;
963 rc.preambleTransMax =
msg.sib2.radioResourceConfigCommon.rachConfigCommon
964 .raSupervisionInfo.preambleTransMax;
965 rc.raResponseWindowSize =
msg.sib2.radioResourceConfigCommon.rachConfigCommon
966 .raSupervisionInfo.raResponseWindowSize;
967 rc.connEstFailCount =
968 msg.sib2.radioResourceConfigCommon.rachConfigCommon.txFailParam.connEstFailCount;
972 <<
"of connEstFailCount");
976 msg.sib2.radioResourceConfigCommon.pdschConfigCommon.referenceSignalPower);
1010 "Sync indications should be zero "
1011 "when a new RRC connection is established. Current value = "
1026 NS_LOG_INFO(
"DoRecvRrcConnectionReconfiguration haveNonCriticalExtension:"
1027 <<
msg.haveNonCriticalExtension);
1031 if (
msg.haveMobilityControlInfo)
1058 mci.carrierBandwidth.ulBandwidth);
1059 m_rnti =
msg.mobilityControlInfo.newUeIdentity;
1062 mci.haveRachConfigDedicated,
1063 "handover is only supported with non-contention-based random access procedure");
1066 mci.rachConfigDedicated.raPreambleIndex,
1067 mci.rachConfigDedicated.raPrachMaskIndex);
1083 if (
msg.haveNonCriticalExtension)
1086 <<
" Handover. Configuring secondary carriers");
1090 if (
msg.haveMeasConfig)
1100 if (
msg.haveNonCriticalExtension)
1105 if (
msg.haveRadioResourceConfigDedicated)
1109 if (
msg.haveMeasConfig)
1216 double maxRsrp = -std::numeric_limits<double>::infinity();
1238 NS_LOG_WARN(
this <<
" Cell search is unable to detect surrounding cell to attach to");
1243 <<
" is the strongest untried surrounding cell");
1269 <<
" qrxlevmin=" << qRxLevMin <<
" dBm");
1349 uint16_t physCellId =
scell.cellIdentification.physCellId;
1351 scell.radioResourceConfigCommonSCell.ulConfiguration.ulFreqInfo.ulBandwidth;
1353 scell.radioResourceConfigCommonSCell.ulConfiguration.ulFreqInfo.ulCarrierFreq;
1354 uint16_t
dlBand =
scell.radioResourceConfigCommonSCell.nonUlConfiguration.dlBandwidth;
1356 uint8_t txMode =
scell.radioResourceConfigDedicatedSCell.physicalConfigDedicatedSCell
1357 .antennaInfo.transmissionMode;
1358 uint16_t
srsIndex =
scell.radioResourceConfigDedicatedSCell.physicalConfigDedicatedSCell
1359 .soundingRsUlConfigDedicated.srsConfigIndex;
1365 scell.radioResourceConfigCommonSCell.nonUlConfiguration.pdschConfigCommon
1366 .referenceSignalPower);
1372 scell.radioResourceConfigDedicatedSCell.physicalConfigDedicatedSCell
1373 .pdschConfigDedicated;
1388 if (
pcd.haveAntennaInfoDedicated)
1392 if (
pcd.haveSoundingRsUlConfigDedicated)
1395 pcd.soundingRsUlConfigDedicated.srsConfigIndex);
1398 if (
pcd.havePdschConfigDedicated)
1413 "unexpected state " <<
m_state);
1416 const uint8_t lcid = 1;
1425 pdcp->SetLcId(lcid);
1427 pdcp->SetLteRlcSapProvider(
rlc->GetLteRlcSapProvider());
1428 rlc->SetLteRlcSapUser(
pdcp->GetLteRlcSapUser());
1433 m_srb1->m_srbIdentity = 1;
1436 m_srb1->m_logicalChannelConfig.priority =
stamIt->logicalChannelConfig.priority;
1437 m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps =
1438 stamIt->logicalChannelConfig.prioritizedBitRateKbps;
1439 m_srb1->m_logicalChannelConfig.bucketSizeDurationMs =
1440 stamIt->logicalChannelConfig.bucketSizeDurationMs;
1441 m_srb1->m_logicalChannelConfig.logicalChannelGroup =
1442 stamIt->logicalChannelConfig.logicalChannelGroup;
1457 ueParams.srb1SapProvider =
m_srb1->m_pdcp->GetLtePdcpSapProvider();
1462 NS_LOG_INFO(
"request to modify SRB1 (skipping as currently not implemented)");
1473 "LCID value " <<
dtamIt->logicalChannelIdentity <<
" is reserved for SRBs");
1487 switch (
dtamIt->rlcConfig.choice)
1508 rlc->SetLcId(
dtamIt->logicalChannelIdentity);
1513 drbInfo->m_logicalChannelIdentity =
dtamIt->logicalChannelIdentity;
1522 pdcp->SetLcId(
dtamIt->logicalChannelIdentity);
1524 pdcp->SetLteRlcSapProvider(
rlc->GetLteRlcSapProvider());
1525 rlc->SetLteRlcSapUser(
pdcp->GetLteRlcSapUser());
1544 << (uint16_t)
dtamIt->logicalChannelIdentity);
1546 std::vector<LteUeCcmRrcSapProvider::LcsConfig>
lcOnCcMapping =
1549 rlc->GetLteMacSapUser());
1554 "Component carrier manager failed to add LC for data radio bearer");
1561 <<
" ComponentCarrierId "
1608 for (
auto it =
mc.measObjectToRemoveList.begin();
it !=
mc.measObjectToRemoveList.end(); ++
it)
1610 uint8_t measObjectId = *
it;
1616 if (
measIdIt->second.measObjectId == measObjectId)
1618 uint8_t measId =
measIdIt->second.measId;
1621 <<
" because referring to measObjectId "
1635 for (
auto it =
mc.measObjectToAddModList.begin();
it !=
mc.measObjectToAddModList.end(); ++
it)
1639 "cellsToRemoveList not supported");
1641 "cellsToAddModList not supported");
1643 "blackCellsToRemoveList not supported");
1645 "blackCellsToAddModList not supported");
1646 NS_ASSERT_MSG(
it->measObjectEutra.haveCellForWhichToReportCGI ==
false,
1647 "cellForWhichToReportCGI is not supported");
1649 uint8_t measObjectId =
it->measObjectId;
1659 if (
measIdIt->second.measObjectId == measObjectId)
1661 uint8_t measId =
measIdIt->second.measId;
1663 <<
" referring to measObjectId " << (
uint32_t)measObjectId);
1676 for (
auto it =
mc.reportConfigToRemoveList.begin();
it !=
mc.reportConfigToRemoveList.end();
1679 uint8_t reportConfigId = *
it;
1685 if (
measIdIt->second.reportConfigId == reportConfigId)
1687 uint8_t measId =
measIdIt->second.measId;
1690 <<
" because referring to reportConfigId "
1704 for (
auto it =
mc.reportConfigToAddModList.begin();
it !=
mc.reportConfigToAddModList.end();
1709 "only trigger type EVENT is supported");
1711 uint8_t reportConfigId =
it->reportConfigId;
1716 <<
" exists, updating entry");
1722 if (
measIdIt->second.reportConfigId == reportConfigId)
1724 uint8_t measId =
measIdIt->second.measId;
1726 <<
" referring to reportConfigId "
1740 if (
mc.haveQuantityConfig)
1749 mc.quantityConfig.filterCoefficientRSRP);
1767 for (
auto it =
mc.measIdToRemoveList.begin();
it !=
mc.measIdToRemoveList.end(); ++
it)
1769 uint8_t measId = *
it;
1780 for (
auto it =
mc.measIdToAddModList.begin();
it !=
mc.measIdToAddModList.end(); ++
it)
1783 <<
" (measObjectId=" << (
uint32_t)
it->measObjectId
1784 <<
", reportConfigId=" << (
uint32_t)
it->reportConfigId <<
")");
1797 ->second.reportConfigEutra.triggerType !=
1801 std::list<PendingTrigger_t> s;
1806 if (
mc.haveMeasGapConfig)
1811 if (
mc.haveSmeasure)
1816 if (
mc.haveSpeedStatePars)
1827 uint8_t componentCarrierId)
1867 std::pair<uint16_t, MeasValues>
val(cellId, v);
1874 <<
", carrier component Id " << componentCarrierId <<
", new RSRP " << rsrp
1875 <<
" stored " <<
storedMeasIt->second.rsrp <<
", new RSRQ " << rsrq
1903 "only triggerType == event is supported");
1933 switch (reportConfigEutra.
eventId)
2115 double ofn = measObjectEutra
2119 double ofp = measObjectEutra
2211 NS_LOG_LOGIC(
this <<
" event A3: neighbor cell " << cellId <<
" mn=" <<
mn
2212 <<
" mp=" <<
mp <<
" offset=" <<
off <<
" entryCond=" <<
entryCond
2228 double ofn = measObjectEutra
2312 NS_LOG_LOGIC(
this <<
" event A4: neighbor cell " << cellId <<
" mn=" <<
mn
2331 double ofn = measObjectEutra
2414 NS_LOG_LOGIC(
this <<
" event A5: neighbor cell " << cellId <<
" mn=" <<
mn
2415 <<
" mp=" <<
mp <<
" thresh2=" <<
thresh2
2453 if (
measReportIt->second.cellsTriggeredList.find(cellId) !=
2475 if (
measReportIt->second.cellsTriggeredList.find(cellId) !=
2508 NS_LOG_LOGIC(
this <<
" event A5: neighbor cell " << cellId
2509 <<
" mn=" <<
mn <<
" mp=" <<
mp
2543 if (
measReportIt->second.cellsTriggeredList.find(cellId) !=
2568 NS_LOG_LOGIC(
this <<
" event A5: neighbor cell " << cellId <<
" mn=" <<
mn
2569 <<
" mp=" <<
mp <<
" thresh2=" <<
thresh2 <<
" thresh1="
2619 bool reportOnLeave =
2654 if (!
it1->second.empty())
2659 NS_LOG_LOGIC(
this <<
" canceling entering time-to-trigger event at "
2664 it1->second.clear();
2676 auto it2 =
it1->second.begin();
2677 while (
it2 !=
it1->second.end())
2681 it2->concernedCells.remove_if([cellId](
auto cell) {
return cellId ==
cell; });
2683 if (
it2->concernedCells.empty())
2685 NS_LOG_LOGIC(
this <<
" canceling entering time-to-trigger event at "
2705 if (!
it1->second.empty())
2710 NS_LOG_LOGIC(
this <<
" canceling leaving time-to-trigger event at "
2715 it1->second.clear();
2727 auto it2 =
it1->second.begin();
2728 while (
it2 !=
it1->second.end())
2732 it2->concernedCells.remove_if([cellId](
auto cell) {
return cellId ==
cell; });
2734 if (
it2->concernedCells.empty())
2736 NS_LOG_LOGIC(
this <<
" canceling leaving time-to-trigger event at "
2760 std::pair<uint8_t, VarMeasReport>
val(measId, r);
2776 if (!
measReportIt->second.periodicReportTimer.IsPending())
2879 NS_LOG_LOGIC(
this <<
" deleting existing report for measId " << (uint16_t)measId);
2903 measResults.
measId = measId;
2929 componentCarrierId++)
2950 if (!(
measReportIt->second.cellsTriggeredList.empty()))
3009 NS_LOG_WARN(
this <<
" cellsTriggeredList is empty");
3020 Time reportInterval;
3051 reportInterval =
Seconds(360);
3054 reportInterval =
Seconds(720);
3057 reportInterval =
Seconds(1800);
3060 reportInterval =
Seconds(3600);
3199 NS_LOG_INFO(
"Starting initial cell selection after RLF");
3267 NS_LOG_INFO(
this <<
" Total Number of Sync indications from PHY "
3288 NS_LOG_DEBUG(
"The number of sync indication received by RRC from PHY: "
3305 std::ostringstream
ss;
3316 return os <<
"IDLE_START";
3318 return os <<
"IDLE_CELL_SEARCH";
3320 return os <<
"IDLE_WAIT_MIB_SIB1";
3322 return os <<
"IDLE_WAIT_MIB";
3324 return os <<
"IDLE_WAIT_SIB1";
3326 return os <<
"IDLE_CAMPED_NORMALLY";
3328 return os <<
"IDLE_WAIT_SIB2";
3330 return os <<
"IDLE_RANDOM_ACCESS";
3332 return os <<
"IDLE_CONNECTING";
3334 return os <<
"CONNECTED_NORMALLY";
3336 return os <<
"CONNECTED_HANDOVER";
3338 return os <<
"CONNECTED_PHY_PROBLEM";
3340 return os <<
"CONNECTED_REESTABLISHING";
3342 return os <<
"NUM_STATES";
3344 return os <<
"UNKNOWN(" <<
static_cast<uint32_t>(state) <<
")";
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.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsPending() const
This method is syntactic sugar for !IsExpired().
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()
Get the type ID.
This abstract base class defines the API to interact with the Radio Link Control (LTE_RLC) in LTE,...
void SetLteMacSapProvider(LteMacSapProvider *s)
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
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 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.
virtual std::vector< LteUeCcmRrcSapProvider::LcsConfig > AddLc(uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser *msu)=0
add a new Logical Channel (LC)
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.
static TypeId GetTypeId()
Get the type ID.
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.
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 config 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.
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...
bool m_leaveConnectedMode
true if UE NAS ask UE RRC to leave connected mode, e.g., after RLF, i.e.
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.
friend class UeMemberLteUeCmacSapUser
allow UeMemberLteUeCmacSapUser class friend access
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.
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.
~LteUeRrc() override
Destructor.
void CancelEnteringTrigger(uint8_t measId)
Clear all the waiting triggers in m_enteringTriggerQueue which are associated with the given measurem...
std::map< uint16_t, MeasValues > m_storedMeasValues
Internal storage of the latest measurement results from all detected detected cells,...
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 SaveUeMeasurements(uint16_t cellId, double rsrp, double rsrq, bool useLayer3Filtering, uint8_t componentCarrierId)
Keep the given measurement result as the latest measurement figures, to be utilised by UE RRC functio...
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 appropriate state depending on the nature of cau...
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.
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.
void InitializeSap()
Initialize SAP.
void DisposeOldSrb1()
Dispose old SRB1.
void DoInitialize() override
Initialize() implementation.
friend class LtePdcpSpecificLtePdcpSapUser< LteUeRrc >
allow LtePdcpSpecificLtePdcpSapUser<LteUeRrc> class friend access
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessSuccessfulTrace
The RandomAccessSuccessful trace source.
bool IsServingCell(uint16_t cellId) const
LteRrcSap::SystemInformationBlockType1 m_lastSib1
Stored content of the last SIB1 received.
static const std::string ToString(LteUeRrc::State s)
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)
void DoForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)
Force camped on ENB function.
void DoDispose() override
Destructor implementation.
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.
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.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
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 ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
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() 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.
UeMemberLteUeCmacSapUser(LteUeRrc *rrc)
Constructor.
LteUeRrc * m_rrc
the RRC class
void SetTemporaryCellRnti(uint16_t rnti) override
void NotifyRandomAccessSuccessful() override
Notify the RRC that the MAC Random Access procedure completed successfully.
void NotifyRandomAccessFailed() override
Notify the RRC that the MAC Random Access procedure failed.
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...
ObjectPtrContainerValue ObjectMapValue
ObjectMapValue is an alias for ObjectPtrContainerValue.
Ptr< const AttributeAccessor > MakeObjectMapAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
#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.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
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.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
std::ostream & operator<<(std::ostream &os, const Angles &a)
const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
constexpr uint32_t MIN_NO_CC
Minimum number of carrier components allowed by 3GPP up to R13.
constexpr uint32_t MAX_NO_CC
Maximum number of carrier components allowed by 3GPP up to R13.
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
int8_t qRxLevMin
INTEGER (-70..-22), actual value = IE value * 2 [dBm].
MeasObjectEutra structure.
int8_t offsetFreq
offset frequency
uint32_t carrierFreq
carrier frequency
MeasResultEutra structure.
uint16_t physCellId
Phy cell ID.
uint8_t rsrqResult
the RSRQ result
uint8_t rsrpResult
the RSRP result
MeasResultServFreq structure.
uint16_t servFreqId
serving cell index
bool haveMeasResultNeighCells
have measure result neighbor cells
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
bool haveMeasResultServFreqList
has measResultServFreqList-r10
std::list< MeasResultServFreq > measResultServFreqList
MeasResultServFreqList-r10.
MeasResultPCell measResultPCell
measurement result primary cell
MeasurementReport structure.
MobilityControlInfo structure.
NonCriticalExtensionConfiguration structure.
PdschConfigDedicated structure.
PhysicalConfigDedicated structure.
RadioResourceConfigDedicated structure.
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.
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition.
@ PERIODICAL
periodical report
ThresholdEutra threshold2
Threshold for event A5.
enum ns3::LteRrcSap::ReportConfigEutra::@63 triggerType
Trigger enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@64 eventId
Event enumeration.
@ 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...
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
enum ns3::LteRrcSap::ReportConfigEutra::@67 reportInterval
Report interval enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@65 triggerQuantity
Trigger type enumeration.
@ RSRP
Reference Signal Received Power.
@ RSRQ
Reference Signal Received Quality.
int8_t a3Offset
Offset value for Event A3.
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.
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.
enum ns3::LteRrcSap::ThresholdEutra::@62 choice
Threshold enumeration.
@ 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.
LogicalChannelConfig structure.
uint16_t prioritizedBitRateKbps
prioritize bit rate Kbps
uint16_t bucketSizeDurationMs
bucket size duration ms
uint8_t logicalChannelGroup
logical channel group
UeMeasurementsParameters structure.
Represents a measurement result from a certain cell.
uint32_t carrierFreq
Measurement object frequency.
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...
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.
SetupParameters structure.
LteRlcSapProvider * srb0SapProvider
SRB0 SAP provider.