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