A Discrete-Event Network Simulator
API
lte-common.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Manuel Requena <manuel.requena@cttc.es>
19  * Author: Marco Miozzo <marco.miozzo@cttc.es>
20  */
21 #ifndef LTE_COMMON_H
22 #define LTE_COMMON_H
23 
24 #include "ns3/uinteger.h"
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 
37 {
38  uint16_t m_rnti;
39  uint8_t m_lcId;
40 
41 public:
42  LteFlowId_t ();
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:
62  ImsiLcidPair_t ();
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:
98  LteUeConfig_t ();
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 
122 public:
129  static uint16_t double2fpS11dot3 (double val);
136  static double fpS11dot3toDouble (uint16_t val);
142  static double getMinFpS11dot3Value ();
143 
144  //static const double MIN_FP_S11DOT3_VALUE = -4096;
145 
146 };
147 
150 {
151 
152 public:
159  static uint32_t BsrId2BufferSize (uint8_t val);
166  static uint8_t BufferSize2BsrId (uint32_t val);
167 
168  static int m_bufferSizeLevelBsr[64];
169 
170 };
171 
174 {
175 public:
181  static uint8_t TxMode2LayerNum (uint8_t txMode);
182 };
183 
184 
187 {
188  int64_t m_timestamp;
189  uint16_t m_cellId;
190  uint64_t m_imsi;
191  uint16_t m_rnti;
192  uint8_t m_txMode;
193  uint8_t m_layer;
194  uint8_t m_mcs;
195  uint16_t m_size;
196  uint8_t m_rv;
197  uint8_t m_ndi;
198  uint8_t m_ccId;
199 
206  typedef void (* TracedCallback)(const PhyTransmissionStatParameters params);
207 
208 };
209 
210 
213 {
214  int64_t m_timestamp;
215  uint16_t m_cellId;
216  uint64_t m_imsi;
217  uint16_t m_rnti;
218  uint8_t m_txMode;
219  uint8_t m_layer;
220  uint8_t m_mcs;
221  uint16_t m_size;
222  uint8_t m_rv;
223  uint8_t m_ndi;
224  uint8_t m_correctness;
225  uint8_t m_ccId;
226 
233  typedef void (* TracedCallback)(const PhyReceptionStatParameters params);
234 
235 };
236 
237 
240 {
241  uint32_t frameNo;
242  uint32_t subframeNo;
243  uint16_t rnti;
244  uint8_t mcsTb1;
245  uint16_t sizeTb1;
246  uint8_t mcsTb2;
247  uint16_t sizeTb2;
249 };
250 
257 {
258 public:
267  static double RsrpRange2Dbm (uint8_t range);
268 
277  static uint8_t Dbm2RsrpRange (double dbm);
278 
287  static double RsrqRange2Db (uint8_t range);
288 
297  static uint8_t Db2RsrqRange (double db);
298 
306  static double QuantizeRsrp (double v);
307 
315  static double QuantizeRsrq (double v);
316 
328  static double IeValue2ActualHysteresis (uint8_t hysteresisIeValue);
329 
340  static uint8_t ActualHysteresis2IeValue (double hysteresisDb);
341 
353  static double IeValue2ActualA3Offset (int8_t a3OffsetIeValue);
354 
365  static int8_t ActualA3Offset2IeValue (double a3OffsetDb);
366 
376  static double IeValue2ActualQRxLevMin (int8_t qRxLevMinIeValue);
377 
387  static double IeValue2ActualQQualMin (int8_t qQualMinIeValue);
388 
389 }; // end of class EutranMeasurementMapping
390 
391 }; // namespace ns3
392 
393 
394 #endif /* LTE_COMMON_H_ */
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:192
static uint16_t double2fpS11dot3(double val)
Convert from double to fixed point S11.3 notation.
Definition: lte-common.cc:138
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:220
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
Definition: lte-common.cc:288
TransmissionModesLayers class.
Definition: lte-common.h:173
static double QuantizeRsrp(double v)
Quantize an RSRP value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:276
LteFfConverter class.
Definition: lte-common.h:119
uint16_t sizeTb2
size TB2
Definition: lte-common.h:247
uint32_t frameNo
frame number
Definition: lte-common.h:241
friend bool operator==(const LteUeConfig_t &a, const LteUeConfig_t &b)
Equality operator.
Definition: lte-common.cc:118
Forward calls to a chain of Callback.
static int m_bufferSizeLevelBsr[64]
buffer size level BSR
Definition: lte-common.h:168
friend bool operator==(const LteFlowId_t &a, const LteFlowId_t &b)
Equality operator.
Definition: lte-common.cc:48
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:222
static int8_t ActualA3Offset2IeValue(double a3OffsetDb)
Returns the IE value of a3-Offset.
Definition: lte-common.cc:335
int64_t m_timestamp
in millisecond
Definition: lte-common.h:214
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:196
uint16_t sizeTb1
size TB1
Definition: lte-common.h:245
uint8_t componentCarrierId
component carrier ID
Definition: lte-common.h:248
friend bool operator<(const LteFlowId_t &a, const LteFlowId_t &b)
Less than operator.
Definition: lte-common.cc:61
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:260
friend bool operator<(const ImsiLcidPair_t &a, const ImsiLcidPair_t &b)
Less than operator.
Definition: lte-common.cc:97
static uint8_t BufferSize2BsrId(uint32_t val)
Convert Buffer size to BSR ID.
Definition: lte-common.cc:191
static double getMinFpS11dot3Value()
Get minimum fixed point S11.3 value.
Definition: lte-common.cc:163
uint16_t m_rnti
RNTI.
Definition: lte-common.h:83
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
Definition: lte-common.cc:319
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:190
ImsiLcidPair structure.
Definition: lte-common.h:56
static uint8_t TxMode2LayerNum(uint8_t txMode)
Transmit mode 2 layer number.
Definition: lte-common.cc:212
Implements the E-UTRA measurement mappings defined in 3GPP TS 36.133 section 9.1 E-UTRAN measurements...
Definition: lte-common.h:256
static double QuantizeRsrq(double v)
Quantize an RSRQ value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:282
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:219
bool m_reconfigureFlag
When false means that the message is intended for configuring a new UE.
Definition: lte-common.h:87
uint32_t subframeNo
subframe number
Definition: lte-common.h:242
friend bool operator==(const ImsiLcidPair_t &a, const ImsiLcidPair_t &b)
Equaity operator.
Definition: lte-common.cc:84
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
Definition: lte-common.cc:351
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:194
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:223
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PhyReceptionStatParameters structure.
Definition: lte-common.h:212
uint16_t m_srsConfigurationIndex
Srs Configuration index for UE specific SRS, see section 8.2 of TS 36.213.
Definition: lte-common.h:95
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:218
uint16_t m_size
Size of transport block.
Definition: lte-common.h:221
uint16_t m_size
Size of transport block.
Definition: lte-common.h:195
uint8_t m_transmissionMode
Transmission mode 1..7
Definition: lte-common.h:91
uint8_t m_ccId
component carrier id
Definition: lte-common.h:225
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:197
uint8_t m_correctness
correctness of the TB received
Definition: lte-common.h:224
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
Definition: lte-common.cc:304
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:217
static double fpS11dot3toDouble(uint16_t val)
Convert from fixed point S11.3 notation to double.
Definition: lte-common.cc:155
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:215
Parameters for configuring the UE.
Definition: lte-common.h:78
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:252
static double IeValue2ActualQQualMin(int8_t qQualMinIeValue)
Returns the actual value of an Q-QualMin parameter.
Definition: lte-common.cc:367
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
Definition: lte-common.cc:184
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:189
LteFlowId structure.
Definition: lte-common.h:36
uint64_t m_imsi
IMSI.
Definition: lte-common.h:58
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:193
uint8_t m_lcId
LCID.
Definition: lte-common.h:39
friend bool operator<(const LteUeConfig_t &a, const LteUeConfig_t &b)
Less than operator.
Definition: lte-common.cc:131
uint8_t m_ccId
component carrier id
Definition: lte-common.h:198
DlSchedulingCallbackInfo structure.
Definition: lte-common.h:239
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:268
PhyTransmissionStatParameters structure.
Definition: lte-common.h:186
uint8_t m_lcId
LCID.
Definition: lte-common.h:59
BufferSizeLevelBsr class.
Definition: lte-common.h:149
int64_t m_timestamp
in millisecond
Definition: lte-common.h:188
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:216
uint16_t m_rnti
RNTI.
Definition: lte-common.h:38
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:191
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:244