author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Fri, 26 Sep 2014 15:51:00 -0700 | |
changeset 10968 | 2d29fee2b7b8 |
parent 10425 | 1867d8c25aa7 |
child 10983 | 087597a150da |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Mileti? <rivanvx@gmail.com>
parents:
7238
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6705 | 2 |
/* |
3 |
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari |
|
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: Giuseppe Piro <g.piro@poliba.it> |
|
7886 | 19 |
* Marco Miozzo <mmiozzo@cttc.es> |
8339 | 20 |
* Nicola Baldo <nbaldo@cttc.es> |
6705 | 21 |
*/ |
22 |
||
23 |
#ifndef LTE_PHY_H |
|
24 |
#define LTE_PHY_H |
|
25 |
||
26 |
||
27 |
#include <ns3/spectrum-value.h> |
|
28 |
#include <ns3/mobility-model.h> |
|
29 |
#include <ns3/packet.h> |
|
30 |
#include <ns3/nstime.h> |
|
31 |
#include <ns3/spectrum-phy.h> |
|
32 |
#include <ns3/spectrum-channel.h> |
|
7581 | 33 |
#include <ns3/spectrum-signal-parameters.h> |
6705 | 34 |
#include <ns3/spectrum-interference.h> |
6969 | 35 |
#include <ns3/generic-phy.h> |
7581 | 36 |
#include <ns3/lte-spectrum-phy.h> |
6705 | 37 |
|
38 |
namespace ns3 { |
|
39 |
||
40 |
class PacketBurst; |
|
41 |
class LteNetDevice; |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
42 |
class LteControlMessage; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
43 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
44 |
|
6705 | 45 |
|
46 |
/** |
|
7238
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6969
diff
changeset
|
47 |
* \ingroup lte |
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6969
diff
changeset
|
48 |
* |
6705 | 49 |
* The LtePhy models the physical layer of LTE. It is composed by two |
50 |
* LteSpectrumPhy, one for the downlink and one for the uplink. |
|
51 |
*/ |
|
52 |
class LtePhy : public Object |
|
53 |
{ |
|
54 |
||
55 |
public: |
|
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
56 |
/** |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
57 |
* @warning the default constructor should not be used |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
58 |
*/ |
6705 | 59 |
LtePhy (); |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
60 |
|
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
61 |
/** |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
62 |
* |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
63 |
* \param dlPhy the downlink LteSpectrumPhy instance |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
64 |
* \param ulPhy the uplink LteSpectrumPhy instance |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
65 |
*/ |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
66 |
LtePhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy); |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
67 |
|
6705 | 68 |
virtual ~LtePhy (); |
69 |
||
70 |
static TypeId GetTypeId (void); |
|
71 |
||
7581 | 72 |
/** |
6705 | 73 |
* \brief Set the device where the phy layer is attached |
74 |
* \param d the device |
|
75 |
*/ |
|
76 |
void SetDevice (Ptr<LteNetDevice> d); |
|
7581 | 77 |
/** |
6705 | 78 |
* \brief Get the device where the phy layer is attached |
79 |
* \return the pointer to the device |
|
80 |
*/ |
|
81 |
Ptr<LteNetDevice> GetDevice (); |
|
82 |
||
8064
026861f85f53
added SNR test to lte-test-link-adaptation & updated it with new tx psd & noise values
Nicola Baldo <nbaldo@cttc.es>
parents:
8036
diff
changeset
|
83 |
/** |
026861f85f53
added SNR test to lte-test-link-adaptation & updated it with new tx psd & noise values
Nicola Baldo <nbaldo@cttc.es>
parents:
8036
diff
changeset
|
84 |
* |
026861f85f53
added SNR test to lte-test-link-adaptation & updated it with new tx psd & noise values
Nicola Baldo <nbaldo@cttc.es>
parents:
8036
diff
changeset
|
85 |
* \return a pointer to the LteSpectrumPhy instance that manages the downlink |
6705 | 86 |
*/ |
87 |
Ptr<LteSpectrumPhy> GetDownlinkSpectrumPhy (); |
|
88 |
||
8064
026861f85f53
added SNR test to lte-test-link-adaptation & updated it with new tx psd & noise values
Nicola Baldo <nbaldo@cttc.es>
parents:
8036
diff
changeset
|
89 |
|
026861f85f53
added SNR test to lte-test-link-adaptation & updated it with new tx psd & noise values
Nicola Baldo <nbaldo@cttc.es>
parents:
8036
diff
changeset
|
90 |
/** |
026861f85f53
added SNR test to lte-test-link-adaptation & updated it with new tx psd & noise values
Nicola Baldo <nbaldo@cttc.es>
parents:
8036
diff
changeset
|
91 |
* |
026861f85f53
added SNR test to lte-test-link-adaptation & updated it with new tx psd & noise values
Nicola Baldo <nbaldo@cttc.es>
parents:
8036
diff
changeset
|
92 |
* \return a pointer to the LteSpectrumPhy instance that manages the uplink |
6705 | 93 |
*/ |
94 |
Ptr<LteSpectrumPhy> GetUplinkSpectrumPhy (); |
|
95 |
||
96 |
/** |
|
7886 | 97 |
* \brief Queue the MAC PDU to be sent (according to m_macChTtiDelay) |
98 |
* \param p the MAC PDU to sent |
|
99 |
*/ |
|
100 |
virtual void DoSendMacPdu (Ptr<Packet> p) = 0; |
|
6705 | 101 |
|
102 |
/** |
|
103 |
* Set the downlink channel |
|
104 |
* \param c the downlink channel |
|
105 |
*/ |
|
106 |
void SetDownlinkChannel (Ptr<SpectrumChannel> c); |
|
107 |
||
108 |
/** |
|
109 |
* Set the uplink channel |
|
110 |
* \param c the uplink channel |
|
111 |
*/ |
|
112 |
void SetUplinkChannel (Ptr<SpectrumChannel> c); |
|
113 |
||
114 |
||
115 |
/** |
|
7581 | 116 |
* \brief Compute the TX Power Spectral Density |
8036
52262ea6db24
documented units for TX and noise PSD
Nicola Baldo <nbaldo@cttc.es>
parents:
8015
diff
changeset
|
117 |
* \return a pointer to a newly allocated SpectrumValue representing the TX Power Spectral Density in W/Hz for each Resource Block |
6705 | 118 |
*/ |
119 |
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity () = 0; |
|
120 |
||
121 |
void DoDispose (); |
|
122 |
||
123 |
/** |
|
124 |
* \param tti transmission time interval |
|
125 |
*/ |
|
126 |
void SetTti (double tti); |
|
127 |
/** |
|
128 |
* \returns transmission time interval |
|
129 |
*/ |
|
130 |
double GetTti (void) const; |
|
131 |
||
7886 | 132 |
/** |
133 |
* |
|
134 |
* \param cellId the Cell Identifier |
|
6705 | 135 |
*/ |
7886 | 136 |
void DoSetCellId (uint16_t cellId); |
6705 | 137 |
|
138 |
||
139 |
/** |
|
7886 | 140 |
* \returns the RB gruop size according to the bandwidth |
141 |
*/ |
|
142 |
uint8_t GetRbgSize (void) const; |
|
9036 | 143 |
|
144 |
||
145 |
/** |
|
146 |
* \returns the SRS periodicity (see Table 8.2-1 of 36.213) |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
147 |
* \param srcCi the SRS Configuration Index |
9036 | 148 |
*/ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
149 |
uint16_t GetSrsPeriodicity (uint16_t srcCi) const; |
9036 | 150 |
|
151 |
/** |
|
152 |
* \returns the SRS Subframe offset (see Table 8.2-1 of 36.213) |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
153 |
* \param srcCi the SRS Configuration Index |
9036 | 154 |
*/ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
155 |
uint16_t GetSrsSubframeOffset (uint16_t srcCi) const; |
7886 | 156 |
|
157 |
||
158 |
/** |
|
159 |
* \param p queue MAC PDU to be sent |
|
160 |
*/ |
|
161 |
void SetMacPdu (Ptr<Packet> p); |
|
162 |
||
6705 | 163 |
/** |
7886 | 164 |
* \returns the packet burst to be sent |
165 |
*/ |
|
166 |
Ptr<PacketBurst> GetPacketBurst (void); |
|
167 |
||
168 |
/** |
|
8664
ab4c821fc251
revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents:
8339
diff
changeset
|
169 |
* \param m the control message to be sent |
7886 | 170 |
*/ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
171 |
void SetControlMessages (Ptr<LteControlMessage> m); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
172 |
|
7886 | 173 |
/** |
174 |
* \returns the list of control messages to be sent |
|
175 |
*/ |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
176 |
std::list<Ptr<LteControlMessage> > GetControlMessages (void); |
6705 | 177 |
|
178 |
||
7886 | 179 |
/** |
9036 | 180 |
* generate a CQI report based on the given SINR of Ctrl frame |
7886 | 181 |
* |
182 |
* \param sinr the SINR vs frequency measured by the device |
|
183 |
*/ |
|
10425
1867d8c25aa7
doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9389
diff
changeset
|
184 |
virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr) = 0; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
185 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
186 |
/** |
9036 | 187 |
* generate a CQI report based on the given SINR of Data frame |
188 |
* (used for PUSCH CQIs) |
|
189 |
* |
|
190 |
* \param sinr the SINR vs frequency measured by the device |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
191 |
*/ |
10425
1867d8c25aa7
doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9389
diff
changeset
|
192 |
virtual void GenerateDataCqiReport (const SpectrumValue& sinr) = 0; |
7886 | 193 |
|
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9346
diff
changeset
|
194 |
/** |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9346
diff
changeset
|
195 |
* generate a report based on the linear interference and noise power |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9346
diff
changeset
|
196 |
* perceived during DATA frame |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9346
diff
changeset
|
197 |
* NOTE: used only by eNB |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9346
diff
changeset
|
198 |
* |
10425
1867d8c25aa7
doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9389
diff
changeset
|
199 |
* \param interf the interference + noise power measured by the device |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9346
diff
changeset
|
200 |
*/ |
10425
1867d8c25aa7
doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9389
diff
changeset
|
201 |
virtual void ReportInterference (const SpectrumValue& interf) = 0; |
9389
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
202 |
|
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
203 |
/** |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
204 |
* generate a report based on the linear RS power perceived during CTRL |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
205 |
* frame |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
206 |
* NOTE: used only by UE for evaluating RSRP |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
207 |
* |
10425
1867d8c25aa7
doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9389
diff
changeset
|
208 |
* \param power the RS power measured by the device |
9389
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
209 |
*/ |
10425
1867d8c25aa7
doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9389
diff
changeset
|
210 |
virtual void ReportRsReceivedPower (const SpectrumValue& power) = 0; |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9346
diff
changeset
|
211 |
|
7886 | 212 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
213 |
|
7893 | 214 |
protected: |
6705 | 215 |
Ptr<LteNetDevice> m_netDevice; |
216 |
||
217 |
Ptr<LteSpectrumPhy> m_downlinkSpectrumPhy; |
|
218 |
Ptr<LteSpectrumPhy> m_uplinkSpectrumPhy; |
|
219 |
||
220 |
double m_txPower; |
|
7981 | 221 |
double m_noiseFigure; |
6705 | 222 |
|
223 |
double m_tti; |
|
7886 | 224 |
uint8_t m_ulBandwidth; |
225 |
uint8_t m_dlBandwidth; |
|
226 |
uint8_t m_rbgSize; |
|
6705 | 227 |
|
8015 | 228 |
uint16_t m_dlEarfcn; |
229 |
uint16_t m_ulEarfcn; |
|
6705 | 230 |
|
7886 | 231 |
std::vector< Ptr<PacketBurst> > m_packetBurstQueue; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8670
diff
changeset
|
232 |
std::vector< std::list<Ptr<LteControlMessage> > > m_controlMessagesQueue; |
7886 | 233 |
uint8_t m_macChTtiDelay; // delay between MAC and channel layer in terms of TTIs |
234 |
||
235 |
uint16_t m_cellId; |
|
236 |
||
6705 | 237 |
}; |
238 |
||
239 |
||
240 |
} |
|
241 |
||
242 |
#endif /* LTE_PHY_H */ |