A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ue-cphy-sap.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>,
7 * Marco Miozzo <mmiozzo@cttc.es>
8 */
9
10#ifndef LTE_UE_CPHY_SAP_H
11#define LTE_UE_CPHY_SAP_H
12
13#include "lte-rrc-sap.h"
14
15#include <ns3/ptr.h>
16
17#include <stdint.h>
18
19namespace ns3
20{
21
22class LteEnbNetDevice;
23
24/**
25 * Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes
26 *
27 * This is the PHY SAP Provider, i.e., the part of the SAP that contains
28 * the PHY methods called by the MAC
29 */
31{
32 public:
33 /**
34 * Destructor
35 */
36 virtual ~LteUeCphySapProvider();
37
38 /**
39 * Reset the PHY
40 */
41 virtual void Reset() = 0;
42
43 /**
44 * \brief Tell the PHY entity to listen to PSS from surrounding cells and
45 * measure the RSRP.
46 * \param dlEarfcn the downlink carrier frequency (EARFCN) to listen to
47 *
48 * This function will instruct this PHY instance to listen to the DL channel
49 * over the bandwidth of 6 RB at the frequency associated with the given
50 * EARFCN.
51 *
52 * After this, it will start receiving Primary Synchronization Signal (PSS)
53 * and periodically returning measurement reports to RRC via
54 * LteUeCphySapUser::ReportUeMeasurements function.
55 */
56 virtual void StartCellSearch(uint32_t dlEarfcn) = 0;
57
58 /**
59 * \brief Tell the PHY entity to synchronize with a given eNodeB over the
60 * currently active EARFCN for communication purposes.
61 * \param cellId the ID of the eNodeB to synchronize with
62 *
63 * By synchronizing, the PHY will start receiving various information
64 * transmitted by the eNodeB. For instance, when receiving system information,
65 * the message will be relayed to RRC via
66 * LteUeCphySapUser::RecvMasterInformationBlock and
67 * LteUeCphySapUser::RecvSystemInformationBlockType1 functions.
68 *
69 * Initially, the PHY will be configured to listen to 6 RBs of BCH.
70 * LteUeCphySapProvider::SetDlBandwidth can be called afterwards to increase
71 * the bandwidth.
72 */
73 virtual void SynchronizeWithEnb(uint16_t cellId) = 0;
74
75 /**
76 * \brief Tell the PHY entity to align to the given EARFCN and synchronize
77 * with a given eNodeB for communication purposes.
78 * \param cellId the ID of the eNodeB to synchronize with
79 * \param dlEarfcn the downlink carrier frequency (EARFCN)
80 *
81 * By synchronizing, the PHY will start receiving various information
82 * transmitted by the eNodeB. For instance, when receiving system information,
83 * the message will be relayed to RRC via
84 * LteUeCphySapUser::RecvMasterInformationBlock and
85 * LteUeCphySapUser::RecvSystemInformationBlockType1 functions.
86 *
87 * Initially, the PHY will be configured to listen to 6 RBs of BCH.
88 * LteUeCphySapProvider::SetDlBandwidth can be called afterwards to increase
89 * the bandwidth.
90 */
91 virtual void SynchronizeWithEnb(uint16_t cellId, uint32_t dlEarfcn) = 0;
92
93 /**
94 * \brief Get PHY cell ID
95 * \return cell ID this PHY is synchronized to
96 */
97 virtual uint16_t GetCellId() = 0;
98
99 /**
100 * \brief Get PHY DL EARFCN
101 * \return DL EARFCN this PHY is synchronized to
102 */
103 virtual uint32_t GetDlEarfcn() = 0;
104
105 /**
106 * \param dlBandwidth the DL bandwidth in number of PRBs
107 */
108 virtual void SetDlBandwidth(uint16_t dlBandwidth) = 0;
109
110 /**
111 * \brief Configure uplink (normally done after reception of SIB2)
112 *
113 * \param ulEarfcn the uplink carrier frequency (EARFCN)
114 * \param ulBandwidth the UL bandwidth in number of PRBs
115 */
116 virtual void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth) = 0;
117
118 /**
119 * \brief Configure referenceSignalPower
120 *
121 * \param referenceSignalPower received from eNB in SIB2
122 */
123 virtual void ConfigureReferenceSignalPower(int8_t referenceSignalPower) = 0;
124
125 /**
126 * \brief Set Rnti function
127 *
128 * \param rnti the cell-specific UE identifier
129 */
130 virtual void SetRnti(uint16_t rnti) = 0;
131
132 /**
133 * \brief Set transmission mode
134 *
135 * \param txMode the transmissionMode of the user
136 */
137 virtual void SetTransmissionMode(uint8_t txMode) = 0;
138
139 /**
140 * \brief Set SRS configuration index
141 *
142 * \param srcCi the SRS configuration index
143 */
144 virtual void SetSrsConfigurationIndex(uint16_t srcCi) = 0;
145
146 /**
147 * \brief Set P_A value for UE power control
148 *
149 * \param pa the P_A value
150 */
151 virtual void SetPa(double pa) = 0;
152
153 /**
154 * \brief Set RSRP filter coefficient.
155 *
156 * Determines the strength of smoothing effect induced by layer 3
157 * filtering of RSRP used for uplink power control in all attached UE.
158 * If equals to 0, no layer 3 filtering is applicable.
159 *
160 * \param rsrpFilterCoefficient value.
161 */
162 virtual void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient) = 0;
163
164 /**
165 * \brief Reset the PHY after radio link failure function
166 * It resets the physical layer parameters of the
167 * UE after RLF.
168 */
169 virtual void ResetPhyAfterRlf() = 0;
170
171 /**
172 * \brief Reset radio link failure parameters
173 *
174 * Upon receiving N311 in-sync indications from the UE
175 * PHY the UE RRC instructs the UE PHY to reset the
176 * RLF parameters so, it can start RLF detection again.
177 */
178 virtual void ResetRlfParams() = 0;
179
180 /**
181 * \brief Start in-sync detection function
182 * When T310 timer is started, it indicates that physical layer
183 * problems are detected at the UE and the recovery process is
184 * started by checking if the radio frames are in-sync for N311
185 * consecutive times.
186 */
187 virtual void StartInSyncDetection() = 0;
188
189 /**
190 * \brief A method call by UE RRC to communicate the IMSI to the UE PHY
191 * \param imsi the IMSI of the UE
192 */
193 virtual void SetImsi(uint64_t imsi) = 0;
194};
195
196/**
197 * Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes
198 *
199 * This is the CPHY SAP User, i.e., the part of the SAP that contains the RRC
200 * methods called by the PHY
201 */
203{
204 public:
205 /**
206 * destructor
207 */
208 virtual ~LteUeCphySapUser();
209
210 /**
211 * Parameters of the ReportUeMeasurements primitive: RSRP [dBm] and RSRQ [dB]
212 * See section 5.1.1 and 5.1.3 of TS 36.214
213 */
215 {
216 uint16_t m_cellId; ///< cell ID
217 double m_rsrp; ///< [dBm]
218 double m_rsrq; ///< [dB]
219 };
220
221 /// UeMeasurementsParameters structure
223 {
224 std::vector<UeMeasurementsElement> m_ueMeasurementsList; ///< UE measurement list
225 uint8_t m_componentCarrierId; ///< component carrier ID
226 };
227
228 /**
229 * \brief Relay an MIB message from the PHY entity to the RRC layer.
230 *
231 * This function is typically called after PHY receives an MIB message over
232 * the BCH.
233 *
234 * \param cellId the ID of the eNodeB where the message originates from
235 * \param mib the Master Information Block message.
236 */
237 virtual void RecvMasterInformationBlock(uint16_t cellId,
239
240 /**
241 * \brief Relay an SIB1 message from the PHY entity to the RRC layer.
242 *
243 * This function is typically called after PHY receives an SIB1 message over
244 * the BCH.
245 *
246 * \param cellId the ID of the eNodeB where the message originates from
247 * \param sib1 the System Information Block Type 1 message
248 */
249 virtual void RecvSystemInformationBlockType1(uint16_t cellId,
251
252 /**
253 * \brief Send a report of RSRP and RSRQ values perceived from PSS by the PHY
254 * entity (after applying layer-1 filtering) to the RRC layer.
255 *
256 * \param params the structure containing a vector of cellId, RSRP and RSRQ
257 */
259
260 /**
261 * \brief Send an out of sync indication to UE RRC.
262 *
263 * When the number of out-of-sync indications
264 * are equal to N310, RRC starts the T310 timer.
265 */
266 virtual void NotifyOutOfSync() = 0;
267
268 /**
269 * \brief Send an in sync indication to UE RRC.
270 *
271 * When the number of in-sync indications
272 * are equal to N311, RRC stops the T310 timer.
273 */
274 virtual void NotifyInSync() = 0;
275
276 /**
277 * \brief Reset the sync indication counter.
278 *
279 * Resets the sync indication counter of RRC if the Qin or Qout condition
280 * is not fulfilled for the number of consecutive frames.
281 */
282 virtual void ResetSyncIndicationCounter() = 0;
283};
284
285/**
286 * Template for the implementation of the LteUeCphySapProvider as a member
287 * of an owner class of type C to which all methods are forwarded
288 */
289template <class C>
291{
292 public:
293 /**
294 * Constructor
295 *
296 * \param owner the owner class
297 */
299
300 // Delete default constructor to avoid misuse
302
303 // inherited from LteUeCphySapProvider
304 void Reset() override;
305 void StartCellSearch(uint32_t dlEarfcn) override;
306 void SynchronizeWithEnb(uint16_t cellId) override;
307 void SynchronizeWithEnb(uint16_t cellId, uint32_t dlEarfcn) override;
308 uint16_t GetCellId() override;
309 uint32_t GetDlEarfcn() override;
310 void SetDlBandwidth(uint16_t dlBandwidth) override;
311 void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth) override;
312 void ConfigureReferenceSignalPower(int8_t referenceSignalPower) override;
313 void SetRnti(uint16_t rnti) override;
314 void SetTransmissionMode(uint8_t txMode) override;
315 void SetSrsConfigurationIndex(uint16_t srcCi) override;
316 void SetPa(double pa) override;
317 void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient) override;
318 void ResetPhyAfterRlf() override;
319 void ResetRlfParams() override;
320 void StartInSyncDetection() override;
321 void SetImsi(uint64_t imsi) override;
322
323 private:
324 C* m_owner; ///< the owner class
325};
326
327template <class C>
329 : m_owner(owner)
330{
331}
332
333template <class C>
334void
336{
337 m_owner->DoReset();
338}
339
340template <class C>
341void
343{
344 m_owner->DoStartCellSearch(dlEarfcn);
345}
346
347template <class C>
348void
350{
351 m_owner->DoSynchronizeWithEnb(cellId);
352}
353
354template <class C>
355void
357{
358 m_owner->DoSynchronizeWithEnb(cellId, dlEarfcn);
359}
360
361template <class C>
362uint16_t
364{
365 return m_owner->DoGetCellId();
366}
367
368template <class C>
371{
372 return m_owner->DoGetDlEarfcn();
373}
374
375template <class C>
376void
378{
379 m_owner->DoSetDlBandwidth(dlBandwidth);
380}
381
382template <class C>
383void
385{
386 m_owner->DoConfigureUplink(ulEarfcn, ulBandwidth);
387}
388
389template <class C>
390void
392{
393 m_owner->DoConfigureReferenceSignalPower(referenceSignalPower);
394}
395
396template <class C>
397void
399{
400 m_owner->DoSetRnti(rnti);
401}
402
403template <class C>
404void
406{
407 m_owner->DoSetTransmissionMode(txMode);
408}
409
410template <class C>
411void
413{
414 m_owner->DoSetSrsConfigurationIndex(srcCi);
415}
416
417template <class C>
418void
420{
421 m_owner->DoSetPa(pa);
422}
423
424template <class C>
425void
427{
428 m_owner->DoSetRsrpFilterCoefficient(rsrpFilterCoefficient);
429}
430
431template <class C>
432void
434{
435 m_owner->DoResetPhyAfterRlf();
436}
437
438template <class C>
439void
441{
442 m_owner->DoResetRlfParams();
443}
444
445template <class C>
446void
448{
449 m_owner->DoStartInSyncDetection();
450}
451
452template <class C>
453void
455{
456 m_owner->DoSetImsi(imsi);
457}
458
459/**
460 * Template for the implementation of the LteUeCphySapUser as a member
461 * of an owner class of type C to which all methods are forwarded
462 */
463template <class C>
465{
466 public:
467 /**
468 * Constructor
469 *
470 * \param owner the owner class
471 */
472 MemberLteUeCphySapUser(C* owner);
473
474 // Delete default constructor to avoid misuse
476
477 // methods inherited from LteUeCphySapUser go here
478 void RecvMasterInformationBlock(uint16_t cellId,
480 void RecvSystemInformationBlockType1(uint16_t cellId,
483 void NotifyOutOfSync() override;
484 void NotifyInSync() override;
485 void ResetSyncIndicationCounter() override;
486
487 private:
488 C* m_owner; ///< the owner class
489};
490
491template <class C>
493 : m_owner(owner)
494{
495}
496
497template <class C>
498void
501{
502 m_owner->DoRecvMasterInformationBlock(cellId, mib);
503}
504
505template <class C>
506void
508 uint16_t cellId,
510{
511 m_owner->DoRecvSystemInformationBlockType1(cellId, sib1);
512}
513
514template <class C>
515void
517{
518 m_owner->DoReportUeMeasurements(params);
519}
520
521template <class C>
522void
524{
525 m_owner->DoNotifyOutOfSync();
526}
527
528template <class C>
529void
531{
532 m_owner->DoNotifyInSync();
533}
534
535template <class C>
536void
538{
539 m_owner->DoResetSyncIndicationCounter();
540}
541
542} // namespace ns3
543
544#endif // LTE_UE_CPHY_SAP_H
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual void SynchronizeWithEnb(uint16_t cellId, uint32_t dlEarfcn)=0
Tell the PHY entity to align to the given EARFCN and synchronize with a given eNodeB for communicatio...
virtual uint16_t GetCellId()=0
Get PHY cell ID.
virtual void ResetPhyAfterRlf()=0
Reset the PHY after radio link failure function It resets the physical layer parameters of the UE aft...
virtual void SetRnti(uint16_t rnti)=0
Set Rnti function.
virtual void ConfigureReferenceSignalPower(int8_t referenceSignalPower)=0
Configure referenceSignalPower.
virtual void StartCellSearch(uint32_t dlEarfcn)=0
Tell the PHY entity to listen to PSS from surrounding cells and measure the RSRP.
virtual void SetTransmissionMode(uint8_t txMode)=0
Set transmission mode.
virtual ~LteUeCphySapProvider()
Destructor.
virtual void SetSrsConfigurationIndex(uint16_t srcCi)=0
Set SRS configuration index.
virtual void SetPa(double pa)=0
Set P_A value for UE power control.
virtual void ResetRlfParams()=0
Reset radio link failure parameters.
virtual void Reset()=0
Reset the PHY.
virtual void SetImsi(uint64_t imsi)=0
A method call by UE RRC to communicate the IMSI to the UE PHY.
virtual void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)=0
Set RSRP filter coefficient.
virtual void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)=0
Configure uplink (normally done after reception of SIB2)
virtual uint32_t GetDlEarfcn()=0
Get PHY DL EARFCN.
virtual void SynchronizeWithEnb(uint16_t cellId)=0
Tell the PHY entity to synchronize with a given eNodeB over the currently active EARFCN for communica...
virtual void SetDlBandwidth(uint16_t dlBandwidth)=0
virtual void StartInSyncDetection()=0
Start in-sync detection function When T310 timer is started, it indicates that physical layer problem...
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual void NotifyInSync()=0
Send an in sync indication to UE RRC.
virtual void ReportUeMeasurements(UeMeasurementsParameters params)=0
Send a report of RSRP and RSRQ values perceived from PSS by the PHY entity (after applying layer-1 fi...
virtual void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib)=0
Relay an MIB message from the PHY entity to the RRC layer.
virtual void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1)=0
Relay an SIB1 message from the PHY entity to the RRC layer.
virtual void NotifyOutOfSync()=0
Send an out of sync indication to UE RRC.
virtual void ResetSyncIndicationCounter()=0
Reset the sync indication counter.
virtual ~LteUeCphySapUser()
destructor
Template for the implementation of the LteUeCphySapProvider as a member of an owner class of type C t...
void SetDlBandwidth(uint16_t dlBandwidth) override
void ConfigureReferenceSignalPower(int8_t referenceSignalPower) override
Configure referenceSignalPower.
void Reset() override
Reset the PHY.
uint16_t GetCellId() override
Get PHY cell ID.
void SetSrsConfigurationIndex(uint16_t srcCi) override
Set SRS configuration index.
void SetRnti(uint16_t rnti) override
Set Rnti function.
void ResetPhyAfterRlf() override
Reset the PHY after radio link failure function It resets the physical layer parameters of the UE aft...
void SetImsi(uint64_t imsi) override
A method call by UE RRC to communicate the IMSI to the UE PHY.
void ResetRlfParams() override
Reset radio link failure parameters.
void SetPa(double pa) override
Set P_A value for UE power control.
uint32_t GetDlEarfcn() override
Get PHY DL EARFCN.
void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth) override
Configure uplink (normally done after reception of SIB2)
void SetTransmissionMode(uint8_t txMode) override
Set transmission mode.
void StartCellSearch(uint32_t dlEarfcn) override
Tell the PHY entity to listen to PSS from surrounding cells and measure the RSRP.
void StartInSyncDetection() override
Start in-sync detection function When T310 timer is started, it indicates that physical layer problem...
void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient) override
Set RSRP filter coefficient.
void SynchronizeWithEnb(uint16_t cellId) override
Tell the PHY entity to synchronize with a given eNodeB over the currently active EARFCN for communica...
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
void NotifyOutOfSync() override
Send an out of sync indication to UE RRC.
void ResetSyncIndicationCounter() override
Reset the sync indication counter.
void ReportUeMeasurements(LteUeCphySapUser::UeMeasurementsParameters params) override
Send a report of RSRP and RSRQ values perceived from PSS by the PHY entity (after applying layer-1 fi...
void NotifyInSync() override
Send an in sync indication to UE RRC.
void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1) override
Relay an SIB1 message from the PHY entity to the RRC layer.
void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib) override
Relay an MIB message from the PHY entity to the RRC layer.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MasterInformationBlock structure.
SystemInformationBlockType1 structure.
Parameters of the ReportUeMeasurements primitive: RSRP [dBm] and RSRQ [dB] See section 5....
UeMeasurementsParameters structure.
std::vector< UeMeasurementsElement > m_ueMeasurementsList
UE measurement list.