A Discrete-Event Network Simulator
API
lte-common.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 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: Manuel Requena <manuel.requena@cttc.es>
18  * Author: Marco Miozzo <marco.miozzo@cttc.es>
19  */
20 #ifndef LTE_COMMON_H
21 #define LTE_COMMON_H
22 
23 #include "ns3/uinteger.h"
24 
25 #include <cmath>
26 
27 // see 36.213 section 8
28 #define UL_PUSCH_TTIS_DELAY 4
29 
30 #define HARQ_PERIOD 7
31 
32 namespace ns3
33 {
34 
36 constexpr uint32_t MIN_NO_CC = 1;
37 
39 constexpr uint32_t MAX_NO_CC = 5;
40 
43 {
44  uint16_t m_rnti;
45  uint8_t m_lcId;
46 
47  public:
48  LteFlowId_t();
55  LteFlowId_t(const uint16_t a, const uint8_t b);
56 
57  friend bool operator==(const LteFlowId_t& a, const LteFlowId_t& b);
58  friend bool operator<(const LteFlowId_t& a, const LteFlowId_t& b);
59 };
60 
63 {
64  uint64_t m_imsi;
65  uint8_t m_lcId;
66 
67  public:
75  ImsiLcidPair_t(const uint64_t a, const uint8_t b);
76 
77  friend bool operator==(const ImsiLcidPair_t& a, const ImsiLcidPair_t& b);
78  friend bool operator<(const ImsiLcidPair_t& a, const ImsiLcidPair_t& b);
79 };
80 
85 {
89  uint16_t m_rnti;
102 
103  public:
104  LteUeConfig_t();
105 
113  friend bool operator==(const LteUeConfig_t& a, const LteUeConfig_t& b);
121  friend bool operator<(const LteUeConfig_t& a, const LteUeConfig_t& b);
122 };
123 
126 {
127  public:
134  static uint16_t double2fpS11dot3(double val);
141  static double fpS11dot3toDouble(uint16_t val);
147  static double getMinFpS11dot3Value();
148 
149  // static const double MIN_FP_S11DOT3_VALUE = -4096;
150 };
151 
154 {
155  public:
162  static uint32_t BsrId2BufferSize(uint8_t val);
169  static uint8_t BufferSize2BsrId(uint32_t val);
170 
171  static int m_bufferSizeLevelBsr[64];
172 };
173 
176 {
177  public:
183  static uint8_t TxMode2LayerNum(uint8_t txMode);
184 };
185 
188 {
189  int64_t m_timestamp;
190  uint16_t m_cellId;
191  uint64_t m_imsi;
192  uint16_t m_rnti;
193  uint8_t m_txMode;
194  uint8_t m_layer;
195  uint8_t m_mcs;
196  uint16_t m_size;
197  uint8_t m_rv;
198  uint8_t m_ndi;
199  uint8_t m_ccId;
200 
208 };
209 
212 {
213  int64_t m_timestamp;
214  uint16_t m_cellId;
215  uint64_t m_imsi;
216  uint16_t m_rnti;
217  uint8_t m_txMode;
218  uint8_t m_layer;
219  uint8_t m_mcs;
220  uint16_t m_size;
221  uint8_t m_rv;
222  uint8_t m_ndi;
223  uint8_t m_correctness;
224  uint8_t m_ccId;
225 
233 };
234 
237 {
238  uint32_t frameNo;
239  uint32_t subframeNo;
240  uint16_t rnti;
241  uint8_t mcsTb1;
242  uint16_t sizeTb1;
243  uint8_t mcsTb2;
244  uint16_t sizeTb2;
246 };
247 
254 {
255  public:
264  static double RsrpRange2Dbm(uint8_t range);
265 
274  static uint8_t Dbm2RsrpRange(double dbm);
275 
284  static double RsrqRange2Db(uint8_t range);
285 
294  static uint8_t Db2RsrqRange(double db);
295 
303  static double QuantizeRsrp(double v);
304 
312  static double QuantizeRsrq(double v);
313 
325  static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue);
326 
337  static uint8_t ActualHysteresis2IeValue(double hysteresisDb);
338 
350  static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue);
351 
362  static int8_t ActualA3Offset2IeValue(double a3OffsetDb);
363 
373  static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue);
374 
384  static double IeValue2ActualQQualMin(int8_t qQualMinIeValue);
385 
386 }; // end of class EutranMeasurementMapping
387 
388 }; // namespace ns3
389 
390 #endif /* LTE_COMMON_H_ */
BufferSizeLevelBsr class.
Definition: lte-common.h:154
static int m_bufferSizeLevelBsr[64]
buffer size level BSR
Definition: lte-common.h:171
static uint8_t BufferSize2BsrId(uint32_t val)
Convert Buffer size to BSR ID.
Definition: lte-common.cc:183
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
Definition: lte-common.cc:176
Implements the E-UTRA measurement mappings defined in 3GPP TS 36.133 section 9.1 E-UTRAN measurements...
Definition: lte-common.h:254
static double QuantizeRsrp(double v)
Quantize an RSRP value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:266
static int8_t ActualA3Offset2IeValue(double a3OffsetDb)
Returns the IE value of a3-Offset.
Definition: lte-common.cc:324
static uint8_t Dbm2RsrpRange(double dbm)
convert an RSRP value in dBm to the corresponding range as per 3GPP TS 36.133 section 9....
Definition: lte-common.cc:242
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
Definition: lte-common.cc:294
static double RsrpRange2Dbm(uint8_t range)
converts an RSRP range to dBm as per 3GPP TS 36.133 section 9.1.4 RSRP Measurement Report Mapping
Definition: lte-common.cc:234
static double RsrqRange2Db(uint8_t range)
converts an RSRQ range to dB as per 3GPP TS 36.133 section 9.1.7 RSRQ Measurement Report Mapping
Definition: lte-common.cc:250
static double QuantizeRsrq(double v)
Quantize an RSRQ value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:272
static double IeValue2ActualQQualMin(int8_t qQualMinIeValue)
Returns the actual value of an Q-QualMin parameter.
Definition: lte-common.cc:355
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
Definition: lte-common.cc:339
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
Definition: lte-common.cc:278
static uint8_t Db2RsrqRange(double db)
convert an RSRQ value in dB to the corresponding range as per 3GPP TS 36.133 section 9....
Definition: lte-common.cc:258
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
Definition: lte-common.cc:308
LteFfConverter class.
Definition: lte-common.h:126
static double getMinFpS11dot3Value()
Get minimum fixed point S11.3 value.
Definition: lte-common.cc:159
static uint16_t double2fpS11dot3(double val)
Convert from double to fixed point S11.3 notation.
Definition: lte-common.cc:134
static double fpS11dot3toDouble(uint16_t val)
Convert from fixed point S11.3 notation to double.
Definition: lte-common.cc:151
Forward calls to a chain of Callback.
TransmissionModesLayers class.
Definition: lte-common.h:176
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
Definition: lte-common.cc:203
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr uint32_t MIN_NO_CC
Minimum number of carrier components allowed by 3GPP up to R13.
Definition: lte-common.h:36
constexpr uint32_t MAX_NO_CC
Maximum number of carrier components allowed by 3GPP up to R13.
Definition: lte-common.h:39
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
DlSchedulingCallbackInfo structure.
Definition: lte-common.h:237
uint32_t subframeNo
subframe number
Definition: lte-common.h:239
uint16_t sizeTb2
size TB2
Definition: lte-common.h:244
uint16_t sizeTb1
size TB1
Definition: lte-common.h:242
uint8_t componentCarrierId
component carrier ID
Definition: lte-common.h:245
uint32_t frameNo
frame number
Definition: lte-common.h:238
ImsiLcidPair structure.
Definition: lte-common.h:63
friend bool operator<(const ImsiLcidPair_t &a, const ImsiLcidPair_t &b)
Less than operator.
Definition: lte-common.cc:98
uint8_t m_lcId
LCID.
Definition: lte-common.h:65
friend bool operator==(const ImsiLcidPair_t &a, const ImsiLcidPair_t &b)
Equality operator.
Definition: lte-common.cc:85
uint64_t m_imsi
IMSI.
Definition: lte-common.h:64
LteFlowId structure.
Definition: lte-common.h:43
uint8_t m_lcId
LCID.
Definition: lte-common.h:45
friend bool operator<(const LteFlowId_t &a, const LteFlowId_t &b)
Less than operator.
Definition: lte-common.cc:62
uint16_t m_rnti
RNTI.
Definition: lte-common.h:44
friend bool operator==(const LteFlowId_t &a, const LteFlowId_t &b)
Equality operator.
Definition: lte-common.cc:49
Parameters for configuring the UE.
Definition: lte-common.h:85
friend bool operator==(const LteUeConfig_t &a, const LteUeConfig_t &b)
Equality operator.
Definition: lte-common.cc:115
bool m_reconfigureFlag
When false means that the message is intended for configuring a new UE.
Definition: lte-common.h:93
uint16_t m_srsConfigurationIndex
Srs Configuration index for UE specific SRS, see section 8.2 of TS 36.213.
Definition: lte-common.h:101
friend bool operator<(const LteUeConfig_t &a, const LteUeConfig_t &b)
Less than operator.
Definition: lte-common.cc:128
uint16_t m_rnti
RNTI.
Definition: lte-common.h:89
uint8_t m_transmissionMode
Transmission mode 1..7
Definition: lte-common.h:97
PhyReceptionStatParameters structure.
Definition: lte-common.h:212
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:217
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:221
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:218
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:215
uint8_t m_correctness
correctness of the TB received
Definition: lte-common.h:223
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:216
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:214
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:222
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:219
int64_t m_timestamp
in millisecond
Definition: lte-common.h:213
uint16_t m_size
Size of transport block.
Definition: lte-common.h:220
uint8_t m_ccId
component carrier id
Definition: lte-common.h:224
PhyTransmissionStatParameters structure.
Definition: lte-common.h:188
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:198
int64_t m_timestamp
in millisecond
Definition: lte-common.h:189
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:194
uint16_t m_size
Size of transport block.
Definition: lte-common.h:196
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:191
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:192
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:193
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:197
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:190
uint8_t m_ccId
component carrier id
Definition: lte-common.h:199
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:195