A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 };
131 
132 
134 {
135  int64_t m_timestamp; // in millisecond
136  uint16_t m_cellId;
137  uint64_t m_imsi;
138  uint16_t m_rnti;
139  uint8_t m_txMode;
140  uint8_t m_layer;
141  uint8_t m_mcs;
142  uint16_t m_size;
143  uint8_t m_rv;
144  uint8_t m_ndi;
145  uint8_t m_correctness;
146 };
147 
148 
155 {
156 public:
165  static double RsrpRange2Dbm (uint8_t range);
166 
175  static uint8_t Dbm2RsrpRange (double dbm);
176 
185  static double RsrqRange2Db (uint8_t range);
186 
195  static uint8_t Db2RsrqRange (double db);
196 
204  static double QuantizeRsrp (double v);
205 
213  static double QuantizeRsrq (double v);
214 
226  static double IeValue2ActualHysteresis (uint8_t hysteresisIeValue);
227 
238  static uint8_t ActualHysteresis2IeValue (double hysteresisDb);
239 
251  static double IeValue2ActualA3Offset (int8_t a3OffsetIeValue);
252 
263  static int8_t ActualA3Offset2IeValue (double a3OffsetDb);
264 
274  static double IeValue2ActualQRxLevMin (int8_t qRxLevMinIeValue);
275 
285  static double IeValue2ActualQQualMin (int8_t qQualMinIeValue);
286 
287 }; // end of class EutranMeasurementMapping
288 
289 }; // namespace ns3
290 
291 
292 #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:97
uint8_t m_mcs
MCS for transport block.
Definition: lte-common.h:141
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
Definition: lte-common.cc:246
static double QuantizeRsrp(double v)
Quantize an RSRP value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:234
friend bool operator==(const LteUeConfig_t &a, const LteUeConfig_t &b)
Definition: lte-common.cc:84
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:42
uint8_t m_rv
the redundancy version (HARQ)
Definition: lte-common.h:143
static int8_t ActualA3Offset2IeValue(double a3OffsetDb)
Returns the IE value of a3-Offset.
Definition: lte-common.cc:293
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:48
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:218
friend bool operator<(const ImsiLcidPair_t &a, const ImsiLcidPair_t &b)
Definition: lte-common.cc:70
static uint8_t BufferSize2BsrId(uint32_t val)
Definition: lte-common.cc:149
static double getMinFpS11dot3Value()
Definition: lte-common.cc:122
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
Definition: lte-common.cc:277
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:170
Implements the E-UTRA measurement mappings defined in 3GPP TS 36.133 section 9.1 E-UTRAN measurements...
Definition: lte-common.h:154
static double QuantizeRsrq(double v)
Quantize an RSRQ value according to the measurement mapping of TS 36.133.
Definition: lte-common.cc:240
uint8_t m_layer
the layer (cw) of the transmission
Definition: lte-common.h:140
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:64
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
Definition: lte-common.cc:309
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:144
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:139
uint16_t m_size
Size of transport block.
Definition: lte-common.h:142
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:145
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
Definition: lte-common.cc:262
uint16_t m_rnti
C-RNTI scheduled.
Definition: lte-common.h:138
static double fpS11dot3toDouble(uint16_t val)
Definition: lte-common.cc:114
uint16_t m_cellId
Cell ID of the attached Enb.
Definition: lte-common.h:136
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:210
static double IeValue2ActualQQualMin(int8_t qQualMinIeValue)
Returns the actual value of an Q-QualMin parameter.
Definition: lte-common.cc:325
static uint32_t BsrId2BufferSize(uint8_t val)
Definition: lte-common.cc:142
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:90
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:226
uint64_t m_imsi
IMSI of the scheduled UE.
Definition: lte-common.h:137
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:202