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