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 
36 {
37  uint16_t m_rnti;
38  uint8_t m_lcId;
39 
40 public:
41  LteFlowId_t ();
42  LteFlowId_t (const uint16_t a, const uint8_t b);
43 
44  friend bool operator == (const LteFlowId_t &a, const LteFlowId_t &b);
45  friend bool operator < (const LteFlowId_t &a, const LteFlowId_t &b);
46 };
47 
49 {
50  uint64_t m_imsi;
51  uint8_t m_lcId;
52 
53 public:
54  ImsiLcidPair_t ();
55  ImsiLcidPair_t (const uint64_t a, const uint8_t b);
56 
57  friend bool operator == (const ImsiLcidPair_t &a, const ImsiLcidPair_t &b);
58  friend bool operator < (const ImsiLcidPair_t &a, const ImsiLcidPair_t &b);
59 };
60 
65 {
66  uint16_t m_rnti;
79 
80 public:
81  LteUeConfig_t ();
82 
83  friend bool operator == (const LteUeConfig_t &a, const LteUeConfig_t &b);
84  friend bool operator < (const LteUeConfig_t &a, const LteUeConfig_t &b);
85 };
86 
87 
89 {
90 
91 public:
92  static uint16_t double2fpS11dot3 (double val);
93  static double fpS11dot3toDouble (uint16_t val);
94  static double getMinFpS11dot3Value ();
95 
96  //static const double MIN_FP_S11DOT3_VALUE = -4096;
97 
98 };
99 
101 {
102 
103 public:
104  static uint32_t BsrId2BufferSize (uint8_t val);
105  static uint8_t BufferSize2BsrId (uint32_t val);
106 
107  static int m_bufferSizeLevelBsr[64];
108 
109 };
110 
112 {
113 public:
114  static uint8_t TxMode2LayerNum (uint8_t txMode);
115 };
116 
117 
119 {
120  int64_t m_timestamp; // in millisecond
121  uint16_t m_cellId;
122  uint64_t m_imsi;
123  uint16_t m_rnti;
124  uint8_t m_txMode;
125  uint8_t m_layer;
126  uint8_t m_mcs;
127  uint16_t m_size;
128  uint8_t m_rv;
129  uint8_t m_ndi;
130 
137  typedef void (* TracedCallback)(const PhyTransmissionStatParameters params);
138 
139 };
140 
141 
143 {
144  int64_t m_timestamp; // in millisecond
145  uint16_t m_cellId;
146  uint64_t m_imsi;
147  uint16_t m_rnti;
148  uint8_t m_txMode;
149  uint8_t m_layer;
150  uint8_t m_mcs;
151  uint16_t m_size;
152  uint8_t m_rv;
153  uint8_t m_ndi;
154  uint8_t m_correctness;
155 
162  typedef void (* TracedCallback)(const PhyReceptionStatParameters params);
163 
164 };
165 
166 
173 {
174 public:
183  static double RsrpRange2Dbm (uint8_t range);
184 
193  static uint8_t Dbm2RsrpRange (double dbm);
194 
203  static double RsrqRange2Db (uint8_t range);
204 
213  static uint8_t Db2RsrqRange (double db);
214 
222  static double QuantizeRsrp (double v);
223 
231  static double QuantizeRsrq (double v);
232 
244  static double IeValue2ActualHysteresis (uint8_t hysteresisIeValue);
245 
256  static uint8_t ActualHysteresis2IeValue (double hysteresisDb);
257 
269  static double IeValue2ActualA3Offset (int8_t a3OffsetIeValue);
270 
281  static int8_t ActualA3Offset2IeValue (double a3OffsetDb);
282 
292  static double IeValue2ActualQRxLevMin (int8_t qRxLevMinIeValue);
293 
303  static double IeValue2ActualQQualMin (int8_t qQualMinIeValue);
304 
305 }; // end of class EutranMeasurementMapping
306 
307 }; // namespace ns3
308 
309 
310 #endif /* LTE_COMMON_H_ */
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:124
static uint16_t double2fpS11dot3(double val)
Definition: lte-common.cc:96
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:150
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
Definition: lte-common.cc:245
static double QuantizeRsrp(double v)
Quantize an RSRP value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:233
friend bool operator==(const LteUeConfig_t &a, const LteUeConfig_t &b)
Definition: lte-common.cc:83
Forward calls to a chain of Callback.
static int m_bufferSizeLevelBsr[64]
Definition: lte-common.h:107
friend bool operator==(const LteFlowId_t &a, const LteFlowId_t &b)
Definition: lte-common.cc:41
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:152
static int8_t ActualA3Offset2IeValue(double a3OffsetDb)
Returns the IE value of a3-Offset.
Definition: lte-common.cc:292
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:128
friend bool operator<(const LteFlowId_t &a, const LteFlowId_t &b)
Definition: lte-common.cc:47
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:217
friend bool operator<(const ImsiLcidPair_t &a, const ImsiLcidPair_t &b)
Definition: lte-common.cc:69
static uint8_t BufferSize2BsrId(uint32_t val)
Definition: lte-common.cc:148
static double getMinFpS11dot3Value()
Definition: lte-common.cc:121
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
Definition: lte-common.cc:276
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:122
static uint8_t TxMode2LayerNum(uint8_t txMode)
Definition: lte-common.cc:169
Implements the E-UTRA measurement mappings defined in 3GPP TS 36.133 section 9.1 E-UTRAN measurements...
Definition: lte-common.h:172
static double QuantizeRsrq(double v)
Quantize an RSRQ value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:239
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:149
bool m_reconfigureFlag
When false means that the message is inteded foro configuring a new UE.
Definition: lte-common.h:70
friend bool operator==(const ImsiLcidPair_t &a, const ImsiLcidPair_t &b)
Definition: lte-common.cc:63
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
Definition: lte-common.cc:308
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:126
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:153
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t m_srsConfigurationIndex
Srs Configuration index for UE specific SRS, see section 8.2 of TS 36.213.
Definition: lte-common.h:78
uint8_t m_txMode
the transmission Mode
Definition: lte-common.h:148
uint16_t m_size
Size of transport block.
Definition: lte-common.h:151
uint16_t m_size
Size of transport block.
Definition: lte-common.h:127
uint8_t m_transmissionMode
Transmission mode 1..7
Definition: lte-common.h:74
uint8_t m_ndi
new data indicator flag
Definition: lte-common.h:129
uint8_t m_correctness
correctness of the TB received
Definition: lte-common.h:154
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
Definition: lte-common.cc:261
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:147
static double fpS11dot3toDouble(uint16_t val)
Definition: lte-common.cc:113
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:145
Parameters for configuring the UE.
Definition: lte-common.h:64
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:209
static double IeValue2ActualQQualMin(int8_t qQualMinIeValue)
Returns the actual value of an Q-QualMin parameter.
Definition: lte-common.cc:324
static uint32_t BsrId2BufferSize(uint8_t val)
Definition: lte-common.cc:141
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:121
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:125
uint8_t m_lcId
Definition: lte-common.h:38
friend bool operator<(const LteUeConfig_t &a, const LteUeConfig_t &b)
Definition: lte-common.cc:89
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:225
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:146
uint16_t m_rnti
Definition: lte-common.h:37
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:123
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:201