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