A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ue-rrc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 * Copyright (c) 2018 Fraunhofer ESK : RLF extensions
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Author: Nicola Baldo <nbaldo@cttc.es>
8 * Budiarto Herman <budiarto.herman@magister.fi>
9 * Modified by:
10 * Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
11 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
12 * Vignesh Babu <ns3-dev@esk.fraunhofer.de> (RLF extensions)
13 */
14
15#ifndef LTE_UE_RRC_H
16#define LTE_UE_RRC_H
17
18#include "lte-as-sap.h"
19#include "lte-pdcp-sap.h"
20#include "lte-rrc-sap.h"
21#include "lte-ue-ccm-rrc-sap.h"
22#include "lte-ue-cmac-sap.h"
23#include "lte-ue-cphy-sap.h"
24
25#include <ns3/object.h>
26#include <ns3/packet.h>
27#include <ns3/traced-callback.h>
28
29#include <map>
30#include <set>
31#include <vector>
32
33namespace ns3
34{
35
36/**
37 * \brief Artificial delay of UE measurements procedure.
38 *
39 * i.e. the period between the time layer-1-filtered measurements from PHY
40 * layer is received and the earliest time the actual measurement report
41 * submission to the serving cell is invoked.
42 *
43 * This delay exists because of racing condition between several UE measurements
44 * functions which happen to be scheduled at the same time. The delay ensures
45 * that:
46 * - measurements (e.g., layer-3 filtering) are always performed before
47 * reporting, thus the latter always use the latest measured RSRP and RSRQ;
48 * and
49 * - time-to-trigger check is always performed before the reporting, so there
50 * would still be chance for it to cancel the reporting if necessary.
51 */
53
54class LteRlc;
55class LteMacSapProvider;
56class LteUeCmacSapUser;
57class LteUeCmacSapProvider;
58class LteDataRadioBearerInfo;
59class LteSignalingRadioBearerInfo;
60
61/**
62 *
63 *
64 */
65class LteUeRrc : public Object
66{
67 /// allow UeMemberLteUeCmacSapUser class friend access
69 /// allow UeRrcMemberLteEnbCmacSapUser class friend access
71 /// allow LtePdcpSpecificLtePdcpSapUser<LteUeRrc> class friend access
73 /// allow MemberLteAsSapProvider<LteUeRrc> class friend access
74 friend class MemberLteAsSapProvider<LteUeRrc>;
75 /// allow MemberLteUeCphySapUser<LteUeRrc> class friend access
76 friend class MemberLteUeCphySapUser<LteUeRrc>;
77 /// allow MemberLteUeRrcSapProvider<LteUeRrc> class friend access
79 /// allow MemberLteUeCcmRrcSapUser<LteUeRrc> class friend access
81
82 public:
83 /**
84 * The states of the UE RRC entity
85 *
86 */
104
105 /**
106 * create an RRC instance for use within an ue
107 *
108 */
109 LteUeRrc();
110
111 /**
112 * Destructor
113 */
114 ~LteUeRrc() override;
115
116 // inherited from Object
117 private:
118 void DoInitialize() override;
119 void DoDispose() override;
120
121 public:
122 /**
123 * \brief Get the type ID.
124 * \return the object TypeId
125 */
126 static TypeId GetTypeId();
127
128 /// Initialize SAP
129 void InitializeSap();
130
131 /**
132 * set the CPHY SAP this RRC should use to interact with the PHY
133 *
134 * \param s the CPHY SAP Provider
135 */
137 /**
138 * set the CPHY SAP this RRC should use to interact with the PHY
139 *
140 * \param s the CPHY SAP Provider
141 * \param index the index
142 */
143 void SetLteUeCphySapProvider(LteUeCphySapProvider* s, uint8_t index);
144
145 /**
146 *
147 *
148 * \return s the CPHY SAP User interface offered to the PHY by this RRC
149 */
151 /**
152 *
153 * \param index the index
154 * \return s the CPHY SAP User interface offered to the PHY by this RRC
155 */
157
158 /**
159 * set the CMAC SAP this RRC should interact with
160 * \brief This function is overloaded to maintain backward compatibility
161 * \param s the CMAC SAP Provider to be used by this RRC
162 */
164 /**
165 * set the CMAC SAP this RRC should interact with
166 * \brief This function is overloaded to maintain backward compatibility
167 * \param s the CMAC SAP Provider to be used by this RRC
168 * \param index the index
169 */
170 void SetLteUeCmacSapProvider(LteUeCmacSapProvider* s, uint8_t index);
171
172 /**
173 * \brief This function is overloaded to maintain backward compatibility
174 * \return s the CMAC SAP User interface offered to the MAC by this RRC
175 */
177 /**
178 * \brief This function is overloaded to maintain backward compatibility
179 * \param index the index
180 * \return s the CMAC SAP User interface offered to the MAC by this RRC
181 */
183
184 /**
185 * set the RRC SAP this RRC should interact with
186 *
187 * \param s the RRC SAP User to be used by this RRC
188 */
190
191 /**
192 *
193 *
194 * \return s the RRC SAP Provider interface offered to the MAC by this RRC
195 */
197
198 /**
199 * set the MAC SAP provider. The ue RRC does not use this
200 * directly, but it needs to provide it to newly created RLC instances.
201 *
202 * \param s the MAC SAP provider that will be used by all
203 * newly created RLC instances
204 */
206
207 /**
208 * Set the AS SAP user to interact with the NAS entity
209 *
210 * \param s the AS SAP user
211 */
212 void SetAsSapUser(LteAsSapUser* s);
213
214 /**
215 *
216 *
217 * \return the AS SAP provider exported by this RRC
218 */
220
221 /**
222 * set the Component Carrier Management SAP this RRC should interact with
223 *
224 * \param s the Component Carrier Management SAP Provider to be used by this RRC
225 */
227
228 /**
229 * Get the Component Carrier Management SAP offered by this RRC
230 * \return s the Component Carrier Management SAP User interface offered to the
231 * carrier component selection algorithm by this RRC
232 */
234
235 /**
236 *
237 * \param imsi the unique UE identifier
238 */
239 void SetImsi(uint64_t imsi);
240
241 /**
242 * \brief Store the previous cell id
243 *
244 * \param cellId The cell id of the previous cell the UE was attached to
245 */
246 void StorePreviousCellId(uint16_t cellId);
247
248 /**
249 *
250 * \return imsi the unique UE identifier
251 */
252 uint64_t GetImsi() const;
253
254 /**
255 *
256 * \return the C-RNTI of the user
257 */
258 uint16_t GetRnti() const;
259
260 /**
261 *
262 * \return the CellId of the attached Enb
263 */
264 uint16_t GetCellId() const;
265
266 /**
267 * \param cellId cell identifier
268 * \return true if cellId is the serving cell for this UE
269 */
270 bool IsServingCell(uint16_t cellId) const;
271
272 /**
273 * \return the uplink bandwidth in RBs
274 */
275 uint8_t GetUlBandwidth() const;
276
277 /**
278 * \return the downlink bandwidth in RBs
279 */
280 uint8_t GetDlBandwidth() const;
281
282 /**
283 * \return the downlink carrier frequency (EARFCN)
284 */
285 uint32_t GetDlEarfcn() const;
286
287 /**
288 * \return the uplink carrier frequency (EARFCN)
289 */
290 uint32_t GetUlEarfcn() const;
291
292 /**
293 *
294 * \return the current state
295 */
296 State GetState() const;
297
298 /**
299 * \brief Get the previous cell id
300 *
301 * \return The cell Id of the previous cell the UE was attached to.
302 */
303 uint16_t GetPreviousCellId() const;
304
305 /**
306 *
307 *
308 * \param val true if RLC SM is to be used, false if RLC UM/AM are to be used
309 */
310 void SetUseRlcSm(bool val);
311
312 /**
313 * \param s The UE RRC state.
314 * \return The string representation of the given state.
315 */
316 static const std::string ToString(LteUeRrc::State s);
317
318 /**
319 * TracedCallback signature for imsi, cellId and rnti events.
320 *
321 * \param [in] imsi
322 * \param [in] cellId
323 */
324 typedef void (*CellSelectionTracedCallback)(uint64_t imsi, uint16_t cellId);
325
326 /**
327 * TracedCallback signature for imsi, cellId and rnti events.
328 *
329 * \param [in] imsi
330 * \param [in] cellId
331 * \param [in] rnti
332 */
333 typedef void (*ImsiCidRntiTracedCallback)(uint64_t imsi, uint16_t cellId, uint16_t rnti);
334
335 /**
336 * TracedCallback signature for MIBReceived, Sib1Received and
337 * HandoverStart events.
338 *
339 * \param [in] imsi
340 * \param [in] cellId
341 * \param [in] rnti
342 * \param [in] otherCid
343 */
344 typedef void (*MibSibHandoverTracedCallback)(uint64_t imsi,
345 uint16_t cellId,
346 uint16_t rnti,
347 uint16_t otherCid);
348
349 /**
350 * TracedCallback signature for state transition events.
351 *
352 * \param [in] imsi
353 * \param [in] cellId
354 * \param [in] rnti
355 * \param [in] oldState
356 * \param [in] newState
357 */
358 typedef void (*StateTracedCallback)(uint64_t imsi,
359 uint16_t cellId,
360 uint16_t rnti,
361 State oldState,
362 State newState);
363
364 /**
365 * TracedCallback signature for secondary carrier configuration events.
366 *
367 * \param [in] Pointer to UE RRC
368 * \param [in] List of LteRrcSap::SCellToAddMod
369 */
371 std::list<LteRrcSap::SCellToAddMod>);
372
373 /**
374 * TracedCallback signature for in-sync and out-of-sync detection events.
375 *
376 *
377 * \param [in] imsi
378 * \param [in] rnti
379 * \param [in] cellId
380 * \param [in] type
381 * \param [in] count
382 */
383 typedef void (*PhySyncDetectionTracedCallback)(uint64_t imsi,
384 uint16_t rnti,
385 uint16_t cellId,
386 std::string type,
387 uint16_t count);
388
389 /**
390 * TracedCallback signature for imsi, cellId, rnti and counter for
391 * random access events.
392 *
393 * \param [in] imsi
394 * \param [in] cellId
395 * \param [in] rnti
396 * \param [in] count
397 */
398 typedef void (*ImsiCidRntiCountTracedCallback)(uint64_t imsi,
399 uint16_t cellId,
400 uint16_t rnti,
401 uint8_t count);
402
403 private:
404 // PDCP SAP methods
405 /**
406 * Receive PDCP SDU function
407 *
408 * \param params LtePdcpSapUser::ReceivePdcpSduParameters
409 */
411
412 // CMAC SAP methods
413 /**
414 * Set temporary cell rnti function
415 *
416 * \param rnti RNTI
417 */
418 void DoSetTemporaryCellRnti(uint16_t rnti);
419 /// Notify random access successful function
421 /// Notify random access failed function
423
424 // LTE AS SAP methods
425 /**
426 * Set CSG white list function
427 *
428 * \param csgId CSG ID
429 */
430 void DoSetCsgWhiteList(uint32_t csgId);
431 /**
432 * Force camped on ENB function
433 *
434 * \param cellId the cell ID
435 * \param dlEarfcn the DL EARFCN
436 */
437 void DoForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn);
438 /**
439 * Start cell selection function
440 *
441 * \param dlEarfcn the DL EARFCN
442 */
443 void DoStartCellSelection(uint32_t dlEarfcn);
444 /// Connect function
445 void DoConnect();
446 /**
447 * Send data function
448 *
449 * \param packet the packet
450 * \param bid the BID
451 */
452 void DoSendData(Ptr<Packet> packet, uint8_t bid);
453 /// Disconnect function
454 void DoDisconnect();
455
456 // CPHY SAP methods
457 /**
458 * Receive master information block function
459 *
460 * \param cellId the cell ID
461 * \param msg LteRrcSap::MasterInformationBlock
462 */
464 /**
465 * Receive system information block type 1 function
466 *
467 * \param cellId the cell ID
468 * \param msg LteRrcSap::SystemInformationBlockType1
469 */
470 void DoRecvSystemInformationBlockType1(uint16_t cellId,
472 /**
473 * Report UE measurements function
474 *
475 * \param params LteUeCphySapUser::UeMeasurementsParameters
476 */
478
479 // RRC SAP methods
480
481 /**
482 * Part of the RRC protocol. Implement the LteUeRrcSapProvider::CompleteSetup interface.
483 * \param params the LteUeRrcSapProvider::CompleteSetupParameters
484 */
486 /**
487 * Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvSystemInformation interface.
488 * \param msg the LteRrcSap::SystemInformation
489 */
491 /**
492 * Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionSetup
493 * interface.
494 * \param msg the LteRrcSap::RrcConnectionSetup
495 */
497 /**
498 * Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionReconfiguration
499 * interface.
500 * \param msg the LteRrcSap::RrcConnectionReconfiguration
501 */
503 /**
504 * Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionReestablishment
505 * interface.
506 * \param msg LteRrcSap::RrcConnectionReestablishment
507 */
509 /**
510 * Part of the RRC protocol. Implement the
511 * LteUeRrcSapProvider::RecvRrcConnectionReestablishmentReject interface.
512 * \param msg LteRrcSap::RrcConnectionReestablishmentReject
513 */
516 /**
517 * Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionRelease
518 * interface.
519 * \param msg LteRrcSap::RrcConnectionRelease
520 */
522 /**
523 * Part of the RRC protocol. Implement the LteUeRrcSapProvider::RecvRrcConnectionReject
524 * interface.
525 * \param msg the LteRrcSap::RrcConnectionReject
526 */
528
529 /**
530 * RRC CCM SAP USER Method
531 * \param noOfComponentCarriers the number of component carriers
532 */
533 void DoSetNumberOfComponentCarriers(uint16_t noOfComponentCarriers);
534
535 // INTERNAL METHODS
536
537 /**
538 * \brief Go through the list of measurement results, choose the one with the
539 * strongest RSRP, and tell PHY to synchronize to it.
540 *
541 * \warning This function is a part of the *initial cell selection* procedure,
542 * hence must be only executed during IDLE mode.
543 */
545
546 /**
547 * \brief Performs cell selection evaluation to the current serving cell.
548 *
549 * \warning This function is a part of the *initial cell selection* procedure,
550 * hence must be only executed during IDLE mode and specifically
551 * during the state when the UE just received the first SIB1 message
552 * from the serving cell.
553 *
554 * This function assumes that the required information for the evaluation
555 * procedure have been readily gathered, such as *measurement results*, MIB,
556 * and SIB1. Please refer to the LTE module's Design Documentation for more
557 * details on the evaluation process.
558 *
559 * If the cell passes the evaluation, the UE will immediately camp to it.
560 * Otherwise, the UE will pick another cell and restart the cell selection
561 * procedure.
562 */
564
565 /**
566 * \brief Update the current measurement configuration #m_varMeasConfig.
567 * \param mc measurements to be performed by the UE
568 *
569 * Implements Section 5.5.2 "Measurement configuration" of 3GPP TS 36.331.
570 * The supported subfunctions are:
571 * - Measurement object removal
572 * - Measurement object addition/ modification
573 * - Reporting configuration removal
574 * - Reporting configuration addition/ modification
575 * - Quantity configuration
576 * - Measurement identity removal
577 * - Measurement identity addition/ modification
578 *
579 * The subfunctions that will be invoked are determined by the content of
580 * the given measurement configuration.
581 *
582 * Note the existence of some chain reaction behaviours:
583 * - Removal of measurement object or reporting configuration also removes any
584 * impacted measurement identities.
585 * - Removal of measurement identity also removes any associated *reporting
586 * entry* from #m_varMeasReportList.
587 * - Modification to measurement object or reporting configuration also
588 * removes any reporting entries of the impacted measurement identities
589 * from #m_varMeasReportList.
590 * - Modification to quantity configuration also removes all existing
591 * reporting entries from #m_varMeasReportList, regardless of measurement
592 * identity.
593 *
594 * Some unsupported features:
595 * - List of neighbouring cells
596 * - List of black cells
597 * - CGI reporting
598 * - Periodical reporting configuration
599 * - Measurement gaps
600 * - s-Measure
601 * - Speed-dependent scaling
602 *
603 * \warning There is a possibility that the input argument (of type
604 * LteRrcSap::MeasConfig) may contain information in fields related
605 * to the unsupported features. In such case, the function will raise
606 * an error.
607 *
608 * The measurement configuration given as an argument is typically provided by
609 * the serving eNodeB. It is transmitted through the RRC protocol when the UE
610 * joins the cell, e.g., by connection establishment or by incoming handover.
611 * The information inside the argument can be configured from the eNodeB side,
612 * which would then equally apply to all other UEs attached to the same
613 * eNodeB. See the LTE module's User Documentation for more information on
614 * configuring this.
615 *
616 * \sa LteRrcSap::MeasConfig, LteUeRrc::m_varMeasReportList
617 */
619
620 /**
621 * \brief Keep the given measurement result as the latest measurement figures,
622 * to be utilised by UE RRC functions.
623 * \param cellId the cell ID of the measured cell
624 * \param rsrp measured RSRP value to be saved (in dBm)
625 * \param rsrq measured RSRQ value to be saved (in dB)
626 * \param useLayer3Filtering
627 * \param componentCarrierId
628 * \todo Remove the useLayer3Filtering argument
629 *
630 * Implements Section 5.5.3.2 "Layer 3 filtering" of 3GPP TS 36.331. *Layer-3
631 * filtering* is applied to the given measurement results before saved to
632 * #m_storedMeasValues. The filtering is however disabled when the UE is in
633 * IDLE mode, i.e., saving unfiltered values.
634 *
635 * Layer-3 filtering is influenced by a filter coefficient, which determines
636 * the strength of the filtering. This coefficient is provided by the active
637 * *quantity configuration* in #m_varMeasConfig, which is configured by the
638 * LteUeRrc::ApplyMeasConfig. Details on how the coefficient works and how to
639 * modify it can be found in LTE module's Design Documentation.
640 *
641 * \sa LteUeRrc::m_storedMeasValues
642 */
643 void SaveUeMeasurements(uint16_t cellId,
644 double rsrp,
645 double rsrq,
646 bool useLayer3Filtering,
647 uint8_t componentCarrierId);
648
649 /**
650 * \brief Evaluate the reporting criteria of a measurement identity and
651 * invoke some reporting actions based on the result.
652 * \param measId the measurement identity to be evaluated
653 *
654 * Implements Section 5.5.4.1 "Measurement report triggering - General" of
655 * 3GPP TS 36.331. This function take into use the latest measurement results
656 * and evaluate them against the *entering condition* and the *leaving
657 * condition* of the measurement identity's reporting criteria. The evaluation
658 * also take into account other defined criteria, such as *hysteresis* and
659 * *time-to-trigger*.
660 *
661 * The entering and leaving condition to be evaluated are determined by the
662 * *event type* of the measurement identity's reporting criteria. As defined
663 * in LteRrcSap::ReportConfigEutra, there 5 supported events. The gore details
664 * of these events can be found in Section 5.5.4 of 3GPP TS 36.331.
665 *
666 * An applicable entering condition (i.e., the condition evaluates to true)
667 * will insert a new *reporting entry* to #m_varMeasReportList, so
668 * *measurement reports* would be produced and submitted to eNodeB. On the
669 * other hand, an applicable leaving condition will remove the related
670 * reporting entry from #m_varMeasReportList, so submission of related
671 * measurement reports to eNodeB will be suspended.
672 */
673 void MeasurementReportTriggering(uint8_t measId);
674
675 /**
676 * \brief Produce a proper measurement report from the given measurement
677 * identity's reporting entry in #m_varMeasReportList and then submit
678 * it to the serving eNodeB.
679 * \param measId the measurement identity which report is to be submitted.
680 *
681 * Implements Section 5.5.5 "Measurement reporting" of 3GPP TS 36.331.
682 * Producing a *measurement report* involves several tasks such as:
683 * - including the measurement results of the serving cell into the report;
684 * - selecting some neighbour cells which triggered the reporting (i.e., those
685 * in *cellsTriggeredList*) to be included in the report;
686 * - sorting the order of neighbour cells in the report by their RSRP or RSRQ
687 * measurement results (the highest comes first); and
688 * - ensuring the number of neighbour cells in the report is under the
689 * *maxReportCells* limit defined by the measurement identity's reporting
690 * configuration.
691 *
692 * The RSRP and RSRQ measurement results included in the report are expressed
693 * in 3GPP-specified range format. They are converted from dBm and dB units
694 * using EutranMeasurementMapping::Dbm2RsrpRange and
695 * EutranMeasurementMapping::Db2RsrqRange functions.
696 *
697 * Measurement report is submitted to the serving eNodeB through the *RRC
698 * protocol*. The LteUeRrcSapUser::SendMeasurementReport method of the *UE RRC
699 * SAP* facilitates this submission.
700 *
701 * After the submission, the function will repeat itself after a certain
702 * interval. The interval length may vary from 120 ms to 60 minutes and is
703 * determined by the *report interval* parameter specified by the measurement
704 * identity's reporting configuration.
705 */
706 void SendMeasurementReport(uint8_t measId);
707
708 /**
709 * Apply radio resource config dedicated.
710 * \param rrcd LteRrcSap::RadioResourceConfigDedicated
711 */
713 /**
714 * Apply radio resource config dedicated secondary carrier.
715 * \param nonCec LteRrcSap::NonCriticalExtensionConfiguration
716 */
719 /// Start connection function
720 void StartConnection();
721 /**
722 * \brief Leave connected mode method
723 * Resets the UE back to an appropriate state depending
724 * on the nature of cause. For example, the UE is move
725 * to the IDLE_START state upon radio link failure. At
726 * RRC, all radio bearers except SRB 0 are removed,
727 * measurement reports are cleared and the appropriate
728 * flags are reset to their default values. This method
729 * in turn triggers the reset methods of UE PHY and MAC layers.
730 */
731 void LeaveConnectedMode();
732 /// Dispose old SRB1
733 void DisposeOldSrb1();
734 /**
735 * Bid 2 DR bid.
736 * \param bid the BID
737 * \returns the DR bid
738 */
739 uint8_t Bid2Drbid(uint8_t bid);
740 /**
741 * Switch the UE RRC to the given state.
742 * \param s the destination state
743 */
744 void SwitchToState(State s);
745
746 std::map<uint8_t, uint8_t> m_bid2DrbidMap; ///< bid to DR bid map
747
748 std::vector<LteUeCphySapUser*> m_cphySapUser; ///< UE CPhy SAP user
749 std::vector<LteUeCphySapProvider*> m_cphySapProvider; ///< UE CPhy SAP provider
750
751 std::vector<LteUeCmacSapUser*> m_cmacSapUser; ///< UE CMac SAP user
752 std::vector<LteUeCmacSapProvider*> m_cmacSapProvider; ///< UE CMac SAP provider
753
754 LteUeRrcSapUser* m_rrcSapUser; ///< RRC SAP user
755 LteUeRrcSapProvider* m_rrcSapProvider; ///< RRC SAP provider
756
757 LteMacSapProvider* m_macSapProvider; ///< MAC SAP provider
758 LtePdcpSapUser* m_drbPdcpSapUser; ///< DRB PDCP SAP user
759
760 LteAsSapProvider* m_asSapProvider; ///< AS SAP provider
761 LteAsSapUser* m_asSapUser; ///< AS SAP user
762
763 // Receive API calls from the LteUeComponentCarrierManager instance.
764 // LteCcmRrcSapUser* m_ccmRrcSapUser;
765 /// Interface to the LteUeComponentCarrierManage instance.
766 LteUeCcmRrcSapProvider* m_ccmRrcSapProvider; ///< CCM RRC SAP provider
767 LteUeCcmRrcSapUser* m_ccmRrcSapUser; ///< CCM RRC SAP user
768
769 /// The current UE RRC state.
771
772 /// The unique UE identifier.
773 uint64_t m_imsi;
774 /**
775 * The `C-RNTI` attribute. Cell Radio Network Temporary Identifier.
776 */
777 uint16_t m_rnti;
778 /**
779 * The `CellId` attribute. Serving cell identifier.
780 */
781 uint16_t m_cellId;
782
783 /**
784 * The `Srb0` attribute. SignalingRadioBearerInfo for SRB0.
785 */
787 /**
788 * The `Srb1` attribute. SignalingRadioBearerInfo for SRB1.
789 */
791 /**
792 * SRB1 configuration before RRC connection reconfiguration. To be deleted
793 * soon by DisposeOldSrb1().
794 */
796 /**
797 * The `DataRadioBearerMap` attribute. List of UE RadioBearerInfo for Data
798 * Radio Bearers by LCID.
799 */
800 std::map<uint8_t, Ptr<LteDataRadioBearerInfo>> m_drbMap;
801
802 /**
803 * True if RLC SM is to be used, false if RLC UM/AM are to be used.
804 * Can be modified using SetUseRlcSm().
805 */
807
808 uint8_t m_lastRrcTransactionIdentifier; ///< last RRC transaction identifier
809
811
812 uint16_t m_dlBandwidth; /**< Downlink bandwidth in RBs. */
813 uint16_t m_ulBandwidth; /**< Uplink bandwidth in RBs. */
814
815 uint32_t m_dlEarfcn; /**< Downlink carrier frequency. */
816 uint32_t m_ulEarfcn; /**< Uplink carrier frequency. */
817 std::list<LteRrcSap::SCellToAddMod> m_sCellToAddModList; /**< Secondary carriers. */
818
819 /**
820 * The `MibReceived` trace source. Fired upon reception of Master Information
821 * Block. Exporting IMSI, the serving cell ID, RNTI, and the source cell ID.
822 */
824 /**
825 * The `Sib1Received` trace source. Fired upon reception of System
826 * Information Block Type 1. Exporting IMSI, the serving cell ID, RNTI, and
827 * the source cell ID.
828 */
830 /**
831 * The `Sib2Received` trace source. Fired upon reception of System
832 * Information Block Type 2. Exporting IMSI, the serving cell ID, RNTI.
833 */
835 /**
836 * The `StateTransition` trace source. Fired upon every UE RRC state
837 * transition. Exporting IMSI, the serving cell ID, RNTI, old state, and new
838 * state.
839 */
841 /**
842 * The `InitialCellSelectionEndOk` trace source. Fired upon successful
843 * initial cell selection procedure. Exporting IMSI and the selected cell ID.
844 */
846 /**
847 * The `InitialCellSelectionEndError` trace source. Fired upon failed initial
848 * cell selection procedure. Exporting IMSI and the cell ID under evaluation.
849 */
851 /**
852 * The `RandomAccessSuccessful` trace source. Fired upon successful
853 * completion of the random access procedure. Exporting IMSI, cell ID, and
854 * RNTI.
855 */
857 /**
858 * The `RandomAccessError` trace source. Fired upon failure of the random
859 * access procedure. Exporting IMSI, cell ID, and RNTI.
860 */
862 /**
863 * The `ConnectionEstablished` trace source. Fired upon successful RRC
864 * connection establishment. Exporting IMSI, cell ID, and RNTI.
865 */
867 /**
868 * The `ConnectionTimeout` trace source. Fired upon timeout RRC connection
869 * establishment because of T300. Exporting IMSI, cell ID, and RNTI.
870 */
872 /**
873 * The `ConnectionReconfiguration` trace source. Fired upon RRC connection
874 * reconfiguration. Exporting IMSI, cell ID, and RNTI.
875 */
877 /**
878 * The `HandoverStart` trace source. Fired upon start of a handover
879 * procedure. Exporting IMSI, source cell ID, RNTI, and target cell ID.
880 */
882 /**
883 * The `HandoverEndOk` trace source. Fired upon successful termination of a
884 * handover procedure. Exporting IMSI, cell ID, and RNTI.
885 */
887 /**
888 * The `HandoverEndError` trace source. Fired upon failure of a handover
889 * procedure. Exporting IMSI, cell ID, and RNTI.
890 */
892 /**
893 * The `SCarrierConfigured` trace source. Fired after the configuration
894 * of secondary carriers received through RRC Connection Reconfiguration
895 * message.
896 */
897 TracedCallback<Ptr<LteUeRrc>, std::list<LteRrcSap::SCellToAddMod>> m_sCarrierConfiguredTrace;
898 /**
899 * The `Srb1Created` trace source. Fired when SRB1 is created, i.e.
900 * the RLC and PDCP entities are created for logical channel = 1.
901 * Exporting IMSI, cell ID, and RNTI
902 */
904 /**
905 * The `DrbCreated` trace source. Fired when DRB is created, i.e.
906 * the RLC and PDCP entities are created for one logical channel.
907 * Exporting IMSI, cell ID, RNTI, LCID.
908 */
910 /**
911 * The 'PhySyncDetection' trace source. Fired when UE RRC
912 * receives in-sync or out-of-sync indications from UE PHY
913 *
914 */
916 /**
917 * The 'RadioLinkFailure' trace source. Fired when T310 timer expires.
918 *
919 */
921
922 /// True if a connection request by upper layers is pending.
924 /// True if MIB was received for the current cell.
926 /// True if SIB1 was received for the current cell.
928 /// True if SIB2 was received for the current cell.
930
931 /// Stored content of the last SIB1 received.
933
934 /// List of cell ID of acceptable cells for cell selection that have been detected.
935 std::set<uint16_t> m_acceptableCell;
936
937 /// List of CSG ID which this UE entity has access to.
939
940 // INTERNAL DATA STRUCTURE RELATED TO UE MEASUREMENTS
941
942 /**
943 * \brief Includes the accumulated configuration of the measurements to be
944 * performed by the UE.
945 *
946 * Based on 3GPP TS 36.331 section 7.1. Also note that some optional variables
947 * in the specification are omitted.
948 */
950 {
951 std::map<uint8_t, LteRrcSap::MeasIdToAddMod> measIdList; ///< measure ID list
952 std::map<uint8_t, LteRrcSap::MeasObjectToAddMod> measObjectList; ///< measure object list
953 std::map<uint8_t, LteRrcSap::ReportConfigToAddMod> reportConfigList; ///< report config list
955 double aRsrp; ///< RSRP
956 double aRsrq; ///< RSRQ
957 };
958
959 /**
960 * \brief Includes the accumulated configuration of the measurements to be
961 * performed by the UE.
962 *
963 * Based on 3GPP TS 36.331 section 7.1.
964 */
966
967 /**
968 * \brief Represents a single measurement reporting entry., which includes
969 * information about a measurement for which the triggering conditions
970 * have been met.
971 *
972 * Based on 3GPP TS 36.331 section 7.1.
973 */
975 {
976 uint8_t measId; ///< measure ID
977 std::set<uint16_t> cellsTriggeredList; ///< note: only E-UTRA is supported.
978 uint32_t numberOfReportsSent; ///< number of reports sent
979 EventId periodicReportTimer; ///< periodic report timer
980 };
981
982 /**
983 * \brief The list of active reporting entries, indexed by the measurement
984 * identity which triggered the reporting. Includes information about
985 * measurements for which the triggering conditions have been met.
986 */
987 std::map<uint8_t, VarMeasReport> m_varMeasReportList;
988
989 /**
990 * \brief List of cell IDs which are responsible for a certain trigger.
991 */
992 typedef std::list<uint16_t> ConcernedCells_t;
993
994 /**
995 * \brief Compose a new reporting entry of the given measurement identity,
996 * insert it into #m_varMeasReportList, and set it up for submission
997 * to eNodeB.
998 * \param measId the measurement identity which the new reporting entry will
999 * be based upon
1000 * \param enteringCells the cells which are responsible for triggering the
1001 * reporting (i.e., successfully fulfilling the entering
1002 * condition of the measurement identity) and will be
1003 * included in the measurement report.
1004 *
1005 * \note If an existing reporting entry with the same measurement identity has
1006 * already existed in #m_varMeasReportList, the function will update it
1007 * by adding the entering cells into the existing reporting entry.
1008 * \note When time-to-trigger is enabled for this measurement identity, the
1009 * function will also remove the related trigger from the
1010 * #m_enteringTriggerQueue.
1011 */
1012 void VarMeasReportListAdd(uint8_t measId, ConcernedCells_t enteringCells);
1013
1014 /**
1015 * \brief Remove some cells from an existing reporting entry in
1016 * #m_varMeasReportList.
1017 * \param measId the measurement identity to be removed from
1018 * #m_varMeasReportList, must already exists there, otherwise
1019 * an error would be raised
1020 * \param leavingCells the cells which are about to be removed
1021 * \param reportOnLeave when true, will make the function send one last
1022 * measurement report to eNodeB before removing it
1023 *
1024 * \note If a given cell is not found in the reporting entry, the function
1025 * will quietly continue.
1026 * \note If the removal has removed all the cells in the reporting entry, the
1027 * function will remove the reporting entry as well.
1028 * \note When time-to-trigger is enabled for this measurement identity, the
1029 * function will also remove the related trigger from the
1030 * #m_leavingTriggerQueue.
1031 */
1032 void VarMeasReportListErase(uint8_t measId, ConcernedCells_t leavingCells, bool reportOnLeave);
1033
1034 /**
1035 * \brief Remove the reporting entry of the given measurement identity from
1036 * #m_varMeasReportList.
1037 * \param measId the measurement identity to be removed from
1038 * #m_varMeasReportList, must already exists there, otherwise
1039 * an error would be raised
1040 *
1041 * Any events or triggers related with this measurement identity will be
1042 * canceled as well.
1043 */
1044 void VarMeasReportListClear(uint8_t measId);
1045
1046 /**
1047 * \brief Represents a measurement result from a certain cell.
1048 */
1050 {
1051 double rsrp; ///< Measured RSRP in dBm.
1052 double rsrq; ///< Measured RSRQ in dB.
1053 uint32_t carrierFreq; ///< Measurement object frequency
1054 };
1055
1056 /**
1057 * \brief Internal storage of the latest measurement results from all detected
1058 * detected cells, indexed by the cell ID where the measurement was
1059 * taken from.
1060 *
1061 * Each *measurement result* comprises of RSRP (in dBm) and RSRQ (in dB).
1062 *
1063 * In IDLE mode, the measurement results are used by the *initial cell
1064 * selection* procedure. While in CONNECTED mode, *layer-3 filtering* is
1065 * applied to the measurement results and they are used by *UE measurements*
1066 * function (LteUeRrc::MeasurementReportTriggering and
1067 * LteUeRrc::SendMeasurementReport).
1068 */
1069 std::map<uint16_t, MeasValues> m_storedMeasValues;
1070
1071 /**
1072 * \brief Stored measure values per carrier.
1073 */
1074 std::map<uint16_t, std::map<uint8_t, MeasValues>> m_storedMeasValuesPerCarrier;
1075
1076 /**
1077 * \brief Internal storage of the latest measurement results from all detected
1078 * detected Secondary carrier component, indexed by the carrier component ID
1079 * where the measurement was taken from.
1080 *
1081 * Each *measurement result* comprises of RSRP (in dBm) and RSRQ (in dB).
1082 *
1083 * In IDLE mode, the measurement results are used by the *initial cell
1084 * selection* procedure. While in CONNECTED mode, *layer-3 filtering* is
1085 * applied to the measurement results and they are used by *UE measurements*
1086 * function:
1087 * - LteUeRrc::MeasurementReportTriggering: in this case it is not set any
1088 * measurement related to secondary carrier components since the
1089 * A6 event is not implemented
1090 * - LteUeRrc::SendMeasurementReport: in this case the report are sent.
1091 */
1092 std::map<uint16_t, MeasValues> m_storedScellMeasValues;
1093
1094 /**
1095 * \brief Represents a single triggered event from a measurement identity
1096 * which reporting criteria have been fulfilled, but delayed by
1097 * time-to-trigger.
1098 */
1100 {
1101 uint8_t measId; ///< The measurement identity which raised the trigger.
1102 ConcernedCells_t concernedCells; ///< The list of cells responsible for this trigger.
1103 EventId
1104 timer; ///< The pending reporting event, scheduled at the end of the time-to-trigger.
1105 };
1106
1107 /**
1108 * \brief List of triggers that were raised because entering condition have
1109 * been true, but are still delayed from reporting it by
1110 * time-to-trigger.
1111 *
1112 * The list is indexed by the measurement identity where the trigger
1113 * originates from. The enclosed event will run at the end of the
1114 * time-to-trigger and insert a *reporting entry* to #m_varMeasReportList.
1115 */
1116 std::map<uint8_t, std::list<PendingTrigger_t>> m_enteringTriggerQueue;
1117
1118 /**
1119 * \brief List of triggers that were raised because leaving condition have
1120 * been true, but are still delayed from stopping the reporting by
1121 * time-to-trigger.
1122 *
1123 * The list is indexed by the measurement identity where the trigger
1124 * originates from. The enclosed event will run at the end of the
1125 * time-to-trigger and remove the associated *reporting entry* from
1126 * #m_varMeasReportList.
1127 */
1128 std::map<uint8_t, std::list<PendingTrigger_t>> m_leavingTriggerQueue;
1129
1130 /**
1131 * \brief Clear all the waiting triggers in #m_enteringTriggerQueue which are
1132 * associated with the given measurement identity.
1133 * \param measId the measurement identity to be processed, must already exists
1134 * in #m_enteringTriggerQueue, otherwise an error would be
1135 * raised
1136 *
1137 * \note The function may conclude that there is nothing to be removed. In
1138 * this case, the function will simply ignore quietly.
1139 *
1140 * This function is used when the entering condition of the measurement
1141 * identity becomes no longer true. Therefore all the waiting triggers for
1142 * this measurement identity in #m_enteringTriggerQueue have become invalid
1143 * and must be canceled.
1144 *
1145 * \sa LteUeRrc::m_enteringTriggerQueue
1146 */
1147 void CancelEnteringTrigger(uint8_t measId);
1148
1149 /**
1150 * \brief Remove a specific cell from the waiting triggers in
1151 * #m_enteringTriggerQueue which belong to the given measurement
1152 * identity.
1153 * \param measId the measurement identity to be processed, must already exists
1154 * in #m_enteringTriggerQueue, otherwise an error would be
1155 * raised
1156 * \param cellId the cell ID to be removed from the waiting triggers
1157 *
1158 * \note The function may conclude that there is nothing to be removed. In
1159 * this case, the function will simply ignore quietly.
1160 *
1161 * This function is used when a specific neighbour cell no longer fulfills
1162 * the entering condition of the measurement identity. Thus the cell must be
1163 * removed from all the waiting triggers for this measurement identity in
1164 * #m_enteringTriggerQueue.
1165 *
1166 * \sa LteUeRrc::m_enteringTriggerQueue
1167 */
1168 void CancelEnteringTrigger(uint8_t measId, uint16_t cellId);
1169
1170 /**
1171 * \brief Clear all the waiting triggers in #m_leavingTriggerQueue which are
1172 * associated with the given measurement identity.
1173 * \param measId the measurement identity to be processed, must already exists
1174 * in #m_leavingTriggerQueue, otherwise an error would be
1175 * raised
1176 *
1177 * \note The function may conclude that there is nothing to be removed. In
1178 * this case, the function will simply ignore quietly.
1179 *
1180 * This function is used when the leaving condition of the measurement
1181 * identity becomes no longer true. Therefore all the waiting triggers for
1182 * this measurement identity in #m_leavingTriggerQueue have become invalid
1183 * and must be canceled.
1184 *
1185 * \sa LteUeRrc::m_leavingTriggerQueue
1186 */
1187 void CancelLeavingTrigger(uint8_t measId);
1188
1189 /**
1190 * \brief Remove a specific cell from the waiting triggers in
1191 * #m_leavingTriggerQueue which belong to the given measurement
1192 * identity.
1193 * \param measId the measurement identity to be processed, must already exists
1194 * in #m_leavingTriggerQueue, otherwise an error would be
1195 * raised
1196 * \param cellId the cell ID to be removed from the waiting triggers
1197 *
1198 * \note The function may conclude that there is nothing to be removed. In
1199 * this case, the function will simply ignore quietly.
1200 *
1201 * This function is used when a specific neighbour cell no longer fulfills
1202 * the leaving condition of the measurement identity. Thus the cell must be
1203 * removed from all the waiting triggers for this measurement identity in
1204 * #m_leavingTriggerQueue.
1205 *
1206 * \sa LteUeRrc::m_leavingTriggerQueue
1207 */
1208 void CancelLeavingTrigger(uint8_t measId, uint16_t cellId);
1209
1210 /**
1211 * The `T300` attribute. Timer for RRC connection establishment procedure
1212 * (i.e., the procedure is deemed as failed if it takes longer than this).
1213 * See Section 7.3 of 3GPP TS 36.331.
1214 */
1216
1217 /**
1218 * \brief Invokes ConnectionEstablishmentTimeout() if RRC connection
1219 * establishment procedure for this UE takes longer than T300.
1220 */
1222
1223 /**
1224 * \brief Invoked after timer T300 expires, notifying upper layers that RRC
1225 * connection establishment procedure has failed.
1226 */
1227 void ConnectionTimeout();
1228
1229 /**
1230 * The 'T310' attribute. After detecting N310 out-of-sync indications,
1231 * if number of in-sync indications detected is less than N311 before this
1232 * time, then the radio link is considered to have failed and the UE
1233 * transitions to state CONNECTED_PHY_PROMLEM and eventually IDLE_START
1234 * and UE context at eNodeB is destroyed. RRC connection re-establishment
1235 * is not initiated after this time. See 3GPP TS 36.331 7.3.
1236 */
1238
1239 /**
1240 * The 'N310' attribute. This specifies the maximum
1241 * consecutive out-of-sync indications from lower layers.
1242 */
1243 uint8_t m_n310;
1244
1245 /**
1246 * The 'N311' attribute. This specifies the minimum
1247 * consecutive in-sync indications from lower layers.
1248 */
1249 uint8_t m_n311;
1250
1251 /**
1252 * Time limit (given by m_t310) before the radio link is considered to have failed.
1253 * It is set upon detecting physical layer problems i.e. upon receiving
1254 * N310 consecutive out-of-sync indications from lower layers. Calling
1255 * LteUeRrc::RadioLinkFailureDetected() when it expires.
1256 * It is cancelled upon receiving N311 consecutive in-sync indications. Upon
1257 * expiry, the UE transitions to RRC_IDLE and no RRC connection
1258 * re-establishment is initiated.
1259 */
1261
1262 uint8_t m_noOfSyncIndications; ///< number of in-sync or out-of-sync indications coming from PHY
1263 ///< layer
1264
1265 bool m_leaveConnectedMode; ///< true if UE NAS ask UE RRC to leave connected mode, e.g., after
1266 ///< RLF, i.e. T310 has expired
1267
1268 uint16_t m_previousCellId; ///< the cell id of the previous cell UE was attached to
1269
1270 uint8_t m_connEstFailCountLimit; ///< the counter value for T300 timer expiration received from
1271 ///< the eNB
1272
1273 uint8_t m_connEstFailCount; ///< the counter to count T300 timer expiration
1274 /**
1275 * \brief Radio link failure detected function
1276 *
1277 * Upon detection of radio link failure, the UE is reverted
1278 * back to idle state and the UE context at eNodeB and EPC
1279 * is deleted, thus releasing the RRC connection. The eNodeB is notified
1280 * in an ideal way since there is no radio link failure detection
1281 * implemented at the eNodeB. If the deletion process is not synchronous,
1282 * then errors occur due to triggering of assert messages.
1283 */
1285
1286 /**
1287 * \brief Do notify in sync function
1288 *
1289 * Triggered upon receiving an in sync indication from UE PHY.
1290 * When the count equals N311, then T310 is cancelled.
1291 */
1292 void DoNotifyInSync();
1293
1294 /**
1295 * \brief Do notify out of sync function
1296 *
1297 * Triggered upon receiving an out of sync indication from UE PHY.
1298 * When the count equals N310, then T310 is started.
1299 */
1300 void DoNotifyOutOfSync();
1301
1302 /**
1303 * \brief Do reset sync indication counter function
1304 *
1305 * Reset the sync indication counter
1306 * if the Qin or Qout condition at PHY
1307 * is not fulfilled for the number of
1308 * consecutive frames.
1309 */
1311
1312 /**
1313 * \brief Reset radio link failure parameters
1314 *
1315 * RLF timers and counters should be rest upon:
1316 *
1317 * - If the UE received N311 in Sync indications from the UE
1318 * PHY.
1319 * - If the UE receives RRCConnectionReconfiguration including
1320 * the mobilityControlInfo (TS 36.331 sec 5.3.5.4)
1321 *
1322 * Inside this method the UE RRC also instructs the UE PHY to reset the
1323 * RLF parameters so, it can start RLF detection again.
1324 *
1325 */
1326 void ResetRlfParams();
1327
1328 public:
1329 /**
1330 * The number of component carriers.
1331 */
1333
1334}; // end of class LteUeRrc
1335
1336} // namespace ns3
1337
1338#endif // LTE_UE_RRC_H
An identifier for simulation events.
Definition event-id.h:45
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition lte-as-sap.h:28
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition lte-as-sap.h:87
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition lte-mac-sap.h:25
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36....
LtePdcpSpecificLtePdcpSapUser class.
Service Access Point (SAP) offered by the UE component carrier manager to the UE RRC.
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.
void DoRecvRrcConnectionReconfiguration(LteRrcSap::RrcConnectionReconfiguration msg)
Part of the RRC protocol.
uint8_t m_lastRrcTransactionIdentifier
last RRC transaction identifier
Definition lte-ue-rrc.h:808
bool m_connectionPending
True if a connection request by upper layers is pending.
Definition lte-ue-rrc.h:923
bool m_hasReceivedSib1
True if SIB1 was received for the current cell.
Definition lte-ue-rrc.h:927
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.
Definition lte-ue-rrc.h:795
static TypeId GetTypeId()
Get the type ID.
void SwitchToState(State s)
Switch the UE RRC to the given state.
uint16_t GetRnti() const
void DoDisconnect()
Disconnect function.
LteMacSapProvider * m_macSapProvider
MAC SAP provider.
Definition lte-ue-rrc.h:757
void(* ImsiCidRntiCountTracedCallback)(uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t count)
TracedCallback signature for imsi, cellId, rnti and counter for random access events.
Definition lte-ue-rrc.h:398
void DoNotifyRandomAccessFailed()
Notify random access failed function.
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_mibReceivedTrace
The MibReceived trace source.
Definition lte-ue-rrc.h:823
LteUeCmacSapUser * GetLteUeCmacSapUser()
This function is overloaded to maintain backward compatibility.
std::map< uint16_t, MeasValues > m_storedScellMeasValues
Internal storage of the latest measurement results from all detected detected Secondary carrier compo...
void SetLteUeCmacSapProvider(LteUeCmacSapProvider *s)
set the CMAC SAP this RRC should interact with
uint64_t m_imsi
The unique UE identifier.
Definition lte-ue-rrc.h:773
uint8_t m_n311
The 'N311' attribute.
Ptr< LteSignalingRadioBearerInfo > m_srb0
The Srb0 attribute.
Definition lte-ue-rrc.h:786
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.
Definition lte-ue-rrc.h:891
State
The states of the UE RRC entity.
Definition lte-ue-rrc.h:88
@ CONNECTED_REESTABLISHING
Definition lte-ue-rrc.h:101
TracedCallback< uint64_t, uint16_t, uint16_t, State, State > m_stateTransitionTrace
The StateTransition trace source.
Definition lte-ue-rrc.h:840
VarMeasConfig m_varMeasConfig
Includes the accumulated configuration of the measurements to be performed by the UE.
Definition lte-ue-rrc.h:965
void ApplyMeasConfig(LteRrcSap::MeasConfig mc)
Update the current measurement configuration m_varMeasConfig.
LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated
the PDSCH config dedicated
Definition lte-ue-rrc.h:810
uint8_t m_n310
The 'N310' attribute.
void SetUseRlcSm(bool val)
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndErrorTrace
The InitialCellSelectionEndError trace source.
Definition lte-ue-rrc.h:850
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.
Definition lte-ue-rrc.h:755
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.
Definition lte-ue-rrc.h:929
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
Definition lte-ue-rrc.h:746
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.
Definition lte-ue-rrc.h:752
State GetState() const
uint32_t m_dlEarfcn
Downlink carrier frequency.
Definition lte-ue-rrc.h:815
LteUeCcmRrcSapProvider * m_ccmRrcSapProvider
Interface to the LteUeComponentCarrierManage instance.
Definition lte-ue-rrc.h:766
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.
Definition lte-ue-rrc.h:920
uint64_t GetImsi() const
uint32_t m_ulEarfcn
Uplink carrier frequency.
Definition lte-ue-rrc.h:816
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
Definition lte-ue-rrc.h:866
friend class UeRrcMemberLteEnbCmacSapUser
allow UeRrcMemberLteEnbCmacSapUser class friend access
Definition lte-ue-rrc.h:70
uint8_t GetDlBandwidth() const
TracedCallback< uint64_t, uint16_t, uint16_t, uint16_t > m_sib1ReceivedTrace
The Sib1Received trace source.
Definition lte-ue-rrc.h:829
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessErrorTrace
The RandomAccessError trace source.
Definition lte-ue-rrc.h:861
uint32_t GetDlEarfcn() const
std::list< LteRrcSap::SCellToAddMod > m_sCellToAddModList
Secondary carriers.
Definition lte-ue-rrc.h:817
LtePdcpSapUser * m_drbPdcpSapUser
DRB PDCP SAP user.
Definition lte-ue-rrc.h:758
TracedCallback< Ptr< LteUeRrc >, std::list< LteRrcSap::SCellToAddMod > > m_sCarrierConfiguredTrace
The SCarrierConfigured trace source.
Definition lte-ue-rrc.h:897
void DoStartCellSelection(uint32_t dlEarfcn)
Start cell selection function.
bool m_useRlcSm
True if RLC SM is to be used, false if RLC UM/AM are to be used.
Definition lte-ue-rrc.h:806
TracedCallback< uint64_t, uint16_t, uint16_t > m_handoverEndOkTrace
The HandoverEndOk trace source.
Definition lte-ue-rrc.h:886
TracedCallback< uint64_t, uint16_t, uint16_t, std::string, uint8_t > m_phySyncDetectionTrace
The 'PhySyncDetection' trace source.
Definition lte-ue-rrc.h:915
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...
void(* PhySyncDetectionTracedCallback)(uint64_t imsi, uint16_t rnti, uint16_t cellId, std::string type, uint16_t count)
TracedCallback signature for in-sync and out-of-sync detection events.
Definition lte-ue-rrc.h:383
Time m_t310
The 'T310' attribute.
void RadioLinkFailureDetected()
Radio link failure detected function.
State m_state
The current UE RRC state.
Definition lte-ue-rrc.h:770
std::vector< LteUeCphySapProvider * > m_cphySapProvider
UE CPhy SAP provider.
Definition lte-ue-rrc.h:749
LteUeCcmRrcSapUser * m_ccmRrcSapUser
CCM RRC SAP user.
Definition lte-ue-rrc.h:767
TracedCallback< uint64_t, uint16_t, uint16_t, uint8_t > m_drbCreatedTrace
The DrbCreated trace source.
Definition lte-ue-rrc.h:909
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...
Definition lte-ue-rrc.h:987
std::vector< LteUeCmacSapUser * > m_cmacSapUser
UE CMac SAP user.
Definition lte-ue-rrc.h:751
TracedCallback< uint64_t, uint16_t, uint16_t > m_srb1CreatedTrace
The Srb1Created trace source.
Definition lte-ue-rrc.h:903
TracedCallback< uint64_t, uint16_t > m_initialCellSelectionEndOkTrace
The InitialCellSelectionEndOk trace source.
Definition lte-ue-rrc.h:845
uint8_t GetUlBandwidth() const
void DoSendData(Ptr< Packet > packet, uint8_t bid)
Send data function.
void(* MibSibHandoverTracedCallback)(uint64_t imsi, uint16_t cellId, uint16_t rnti, uint16_t otherCid)
TracedCallback signature for MIBReceived, Sib1Received and HandoverStart events.
Definition lte-ue-rrc.h:344
LteAsSapProvider * m_asSapProvider
AS SAP provider.
Definition lte-ue-rrc.h:760
uint16_t m_rnti
The C-RNTI attribute.
Definition lte-ue-rrc.h:777
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.
Definition lte-ue-rrc.h:754
TracedCallback< uint64_t, uint16_t, uint16_t > m_connectionReconfigurationTrace
The ConnectionReconfiguration trace source.
Definition lte-ue-rrc.h:876
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.
Definition lte-ue-rrc.h:834
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.
Definition lte-ue-rrc.h:800
uint16_t m_cellId
The CellId attribute.
Definition lte-ue-rrc.h:781
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.
Definition lte-ue-rrc.h:871
std::set< uint16_t > m_acceptableCell
List of cell ID of acceptable cells for cell selection that have been detected.
Definition lte-ue-rrc.h:935
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.
Definition lte-ue-rrc.h:748
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.
Definition lte-ue-rrc.h:925
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.
Definition lte-ue-rrc.h:992
void EvaluateCellForSelection()
Performs cell selection evaluation to the current serving cell.
void(* CellSelectionTracedCallback)(uint64_t imsi, uint16_t cellId)
TracedCallback signature for imsi, cellId and rnti events.
Definition lte-ue-rrc.h:324
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.
Definition lte-ue-rrc.h:813
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.
Definition lte-ue-rrc.h:938
uint16_t GetPreviousCellId() const
Get the previous cell id.
void(* ImsiCidRntiTracedCallback)(uint64_t imsi, uint16_t cellId, uint16_t rnti)
TracedCallback signature for imsi, cellId and rnti events.
Definition lte-ue-rrc.h:333
void InitializeSap()
Initialize SAP.
void DisposeOldSrb1()
Dispose old SRB1.
void DoInitialize() override
Initialize() implementation.
TracedCallback< uint64_t, uint16_t, uint16_t > m_randomAccessSuccessfulTrace
The RandomAccessSuccessful trace source.
Definition lte-ue-rrc.h:856
bool IsServingCell(uint16_t cellId) const
LteRrcSap::SystemInformationBlockType1 m_lastSib1
Stored content of the last SIB1 received.
Definition lte-ue-rrc.h:932
void(* StateTracedCallback)(uint64_t imsi, uint16_t cellId, uint16_t rnti, State oldState, State newState)
TracedCallback signature for state transition events.
Definition lte-ue-rrc.h:358
static const std::string ToString(LteUeRrc::State s)
void(* SCarrierConfiguredTracedCallback)(Ptr< LteUeRrc >, std::list< LteRrcSap::SCellToAddMod >)
TracedCallback signature for secondary carrier configuration events.
Definition lte-ue-rrc.h:370
std::map< uint16_t, std::map< uint8_t, MeasValues > > m_storedMeasValuesPerCarrier
Stored measure values per carrier.
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.
Definition lte-ue-rrc.h:812
Ptr< LteSignalingRadioBearerInfo > m_srb1
The Srb1 attribute.
Definition lte-ue-rrc.h:790
LteAsSapUser * m_asSapUser
AS SAP user.
Definition lte-ue-rrc.h:761
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.
Definition lte-ue-rrc.h:881
Part of the RRC protocol.
Part of the RRC protocol.
Template for the implementation of the LteAsSapProvider as a member of an owner class of type C to wh...
Definition lte-as-sap.h:120
MemberLteUeCcmRrcSapUser class.
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
Template for the implementation of the LteUeRrcSapProvider as a member of an owner class of type C to...
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
UeMemberLteUeCmacSapUser class.
Definition lte-ue-rrc.cc:45
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition nstime.h:828
Every class exported by the ns3 library is enclosed in the ns3 namespace.
const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
Definition lte-ue-rrc.cc:35
Parameters for LtePdcpSapUser::ReceivePdcpSdu.
MasterInformationBlock structure.
MeasConfig structure.
NonCriticalExtensionConfiguration structure.
PdschConfigDedicated structure.
QuantityConfig structure.
RadioResourceConfigDedicated structure.
RrcConnectionReconfiguration structure.
RrcConnectionReestablishment structure.
RrcConnectionReestablishmentReject structure.
RrcConnectionReject structure.
RrcConnectionRelease structure.
RrcConnectionSetup structure.
SystemInformationBlockType1 structure.
SystemInformation structure.
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...
ConcernedCells_t concernedCells
The list of cells responsible for this trigger.
EventId timer
The pending reporting event, scheduled at the end of the time-to-trigger.
uint8_t measId
The measurement identity which raised the trigger.
Includes the accumulated configuration of the measurements to be performed by the UE.
Definition lte-ue-rrc.h:950
std::map< uint8_t, LteRrcSap::ReportConfigToAddMod > reportConfigList
report config list
Definition lte-ue-rrc.h:953
LteRrcSap::QuantityConfig quantityConfig
quantity config
Definition lte-ue-rrc.h:954
std::map< uint8_t, LteRrcSap::MeasObjectToAddMod > measObjectList
measure object list
Definition lte-ue-rrc.h:952
std::map< uint8_t, LteRrcSap::MeasIdToAddMod > measIdList
measure ID list
Definition lte-ue-rrc.h:951
Represents a single measurement reporting entry., which includes information about a measurement for ...
Definition lte-ue-rrc.h:975
uint32_t numberOfReportsSent
number of reports sent
Definition lte-ue-rrc.h:978
std::set< uint16_t > cellsTriggeredList
note: only E-UTRA is supported.
Definition lte-ue-rrc.h:977
EventId periodicReportTimer
periodic report timer
Definition lte-ue-rrc.h:979
uint8_t measId
measure ID
Definition lte-ue-rrc.h:976
CompleteSetupParameters structure.