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
32namespace ns3
33{
34
37{
38 uint16_t m_rnti;
39 uint8_t m_lcId;
40
41 public:
49 LteFlowId_t(const uint16_t a, const uint8_t b);
50
51 friend bool operator==(const LteFlowId_t& a, const LteFlowId_t& b);
52 friend bool operator<(const LteFlowId_t& a, const LteFlowId_t& b);
53};
54
57{
58 uint64_t m_imsi;
59 uint8_t m_lcId;
60
61 public:
69 ImsiLcidPair_t(const uint64_t a, const uint8_t b);
70
71 friend bool operator==(const ImsiLcidPair_t& a, const ImsiLcidPair_t& b);
72 friend bool operator<(const ImsiLcidPair_t& a, const ImsiLcidPair_t& b);
73};
74
79{
83 uint16_t m_rnti;
96
97 public:
99
107 friend bool operator==(const LteUeConfig_t& a, const LteUeConfig_t& b);
115 friend bool operator<(const LteUeConfig_t& a, const LteUeConfig_t& b);
116};
117
120{
121 public:
128 static uint16_t double2fpS11dot3(double val);
135 static double fpS11dot3toDouble(uint16_t val);
141 static double getMinFpS11dot3Value();
142
143 // static const double MIN_FP_S11DOT3_VALUE = -4096;
144};
145
148{
149 public:
156 static uint32_t BsrId2BufferSize(uint8_t val);
163 static uint8_t BufferSize2BsrId(uint32_t val);
164
165 static int m_bufferSizeLevelBsr[64];
166};
167
170{
171 public:
177 static uint8_t TxMode2LayerNum(uint8_t txMode);
178};
179
182{
183 int64_t m_timestamp;
184 uint16_t m_cellId;
185 uint64_t m_imsi;
186 uint16_t m_rnti;
187 uint8_t m_txMode;
188 uint8_t m_layer;
189 uint8_t m_mcs;
190 uint16_t m_size;
191 uint8_t m_rv;
192 uint8_t m_ndi;
193 uint8_t m_ccId;
194
201 typedef void (*TracedCallback)(const PhyTransmissionStatParameters params);
202};
203
206{
207 int64_t m_timestamp;
208 uint16_t m_cellId;
209 uint64_t m_imsi;
210 uint16_t m_rnti;
211 uint8_t m_txMode;
212 uint8_t m_layer;
213 uint8_t m_mcs;
214 uint16_t m_size;
215 uint8_t m_rv;
216 uint8_t m_ndi;
218 uint8_t m_ccId;
219
226 typedef void (*TracedCallback)(const PhyReceptionStatParameters params);
227};
228
231{
234 uint16_t rnti;
235 uint8_t mcsTb1;
236 uint16_t sizeTb1;
237 uint8_t mcsTb2;
238 uint16_t sizeTb2;
240};
241
248{
249 public:
258 static double RsrpRange2Dbm(uint8_t range);
259
268 static uint8_t Dbm2RsrpRange(double dbm);
269
278 static double RsrqRange2Db(uint8_t range);
279
288 static uint8_t Db2RsrqRange(double db);
289
297 static double QuantizeRsrp(double v);
298
306 static double QuantizeRsrq(double v);
307
319 static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue);
320
331 static uint8_t ActualHysteresis2IeValue(double hysteresisDb);
332
344 static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue);
345
356 static int8_t ActualA3Offset2IeValue(double a3OffsetDb);
357
367 static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue);
368
378 static double IeValue2ActualQQualMin(int8_t qQualMinIeValue);
379
380}; // end of class EutranMeasurementMapping
381
382}; // namespace ns3
383
384#endif /* LTE_COMMON_H_ */
BufferSizeLevelBsr class.
Definition: lte-common.h:148
static int m_bufferSizeLevelBsr[64]
buffer size level BSR
Definition: lte-common.h:165
static uint8_t BufferSize2BsrId(uint32_t val)
Convert Buffer size to BSR ID.
Definition: lte-common.cc:185
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
Definition: lte-common.cc:178
Implements the E-UTRA measurement mappings defined in 3GPP TS 36.133 section 9.1 E-UTRAN measurements...
Definition: lte-common.h:248
static double QuantizeRsrp(double v)
Quantize an RSRP value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:268
static int8_t ActualA3Offset2IeValue(double a3OffsetDb)
Returns the IE value of a3-Offset.
Definition: lte-common.cc:326
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:244
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
Definition: lte-common.cc:296
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:236
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:252
static double QuantizeRsrq(double v)
Quantize an RSRQ value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:274
static double IeValue2ActualQQualMin(int8_t qQualMinIeValue)
Returns the actual value of an Q-QualMin parameter.
Definition: lte-common.cc:357
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
Definition: lte-common.cc:341
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
Definition: lte-common.cc:280
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:260
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
Definition: lte-common.cc:310
LteFfConverter class.
Definition: lte-common.h:120
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:170
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
Definition: lte-common.cc:205
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DlSchedulingCallbackInfo structure.
Definition: lte-common.h:231
uint32_t subframeNo
subframe number
Definition: lte-common.h:233
uint16_t sizeTb2
size TB2
Definition: lte-common.h:238
uint16_t sizeTb1
size TB1
Definition: lte-common.h:236
uint8_t componentCarrierId
component carrier ID
Definition: lte-common.h:239
uint32_t frameNo
frame number
Definition: lte-common.h:232
ImsiLcidPair structure.
Definition: lte-common.h:57
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:59
friend bool operator==(const ImsiLcidPair_t &a, const ImsiLcidPair_t &b)
Equaity operator.
Definition: lte-common.cc:85
uint64_t m_imsi
IMSI.
Definition: lte-common.h:58
LteFlowId structure.
Definition: lte-common.h:37
uint8_t m_lcId
LCID.
Definition: lte-common.h:39
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:38
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:79
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:87
uint16_t m_srsConfigurationIndex
Srs Configuration index for UE specific SRS, see section 8.2 of TS 36.213.
Definition: lte-common.h:95
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:83
uint8_t m_transmissionMode
Transmission mode [1..7] (i.e., SISO, MIMO, etc.)
Definition: lte-common.h:91
PhyReceptionStatParameters structure.
Definition: lte-common.h:206
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:211
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:215
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:212
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:209
uint8_t m_correctness
correctness of the TB received
Definition: lte-common.h:217
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:210
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:208
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:216
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:213
int64_t m_timestamp
in millisecond
Definition: lte-common.h:207
uint16_t m_size
Size of transport block.
Definition: lte-common.h:214
uint8_t m_ccId
component carrier id
Definition: lte-common.h:218
PhyTransmissionStatParameters structure.
Definition: lte-common.h:182
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:192
int64_t m_timestamp
in millisecond
Definition: lte-common.h:183
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:188
uint16_t m_size
Size of transport block.
Definition: lte-common.h:190
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:185
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:186
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:187
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:191
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:184
uint8_t m_ccId
component carrier id
Definition: lte-common.h:193
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:189