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