author | Marco Miozzo <marco.miozzo@cttc.es> |
Tue, 26 Jun 2012 16:35:04 +0200 | |
changeset 9038 | e1d67c8aa95b |
parent 9036 | 5e09b29d4af5 |
child 9039 | 5bdf0c1be85f |
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 |
* Author: Marco Miozzo <marco.miozzo@cttc.es> |
6705 | 20 |
*/ |
21 |
||
22 |
#ifndef ENB_LTE_PHY_H |
|
23 |
#define ENB_LTE_PHY_H |
|
24 |
||
25 |
||
26 |
#include "lte-phy.h" |
|
7886 | 27 |
#include <ns3/lte-enb-phy-sap.h> |
28 |
#include <map> |
|
7887 | 29 |
#include <ns3/lte-ue-phy.h> |
6705 | 30 |
|
31 |
namespace ns3 { |
|
32 |
||
33 |
class PacketBurst; |
|
34 |
class LteNetDevice; |
|
35 |
||
36 |
/** |
|
7238
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6852
diff
changeset
|
37 |
* \ingroup lte |
7887 | 38 |
* LteEnbPhy models the physical layer for the eNodeB |
6705 | 39 |
*/ |
7887 | 40 |
class LteEnbPhy : public LtePhy |
6705 | 41 |
{ |
42 |
||
7886 | 43 |
friend class EnbMemberLteEnbPhySapProvider; |
44 |
||
6705 | 45 |
public: |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
46 |
/** |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
47 |
* @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
|
48 |
*/ |
7887 | 49 |
LteEnbPhy (); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
50 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
51 |
/** |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
52 |
* |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
53 |
* \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
|
54 |
* \param ulPhy the uplink LteSpectrumPhy instance |
6705 | 55 |
*/ |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
56 |
LteEnbPhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
57 |
|
7887 | 58 |
virtual ~LteEnbPhy (); |
6705 | 59 |
|
8015 | 60 |
// inherited from Object |
6705 | 61 |
static TypeId GetTypeId (void); |
8015 | 62 |
virtual void DoStart (void); |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
63 |
virtual void DoDispose (void); |
6705 | 64 |
|
7886 | 65 |
|
6705 | 66 |
/** |
7886 | 67 |
* \brief Get the PHY SAP provider |
68 |
* \return a pointer to the SAP Provider of the PHY |
|
69 |
*/ |
|
70 |
LteEnbPhySapProvider* GetLteEnbPhySapProvider (); |
|
71 |
||
72 |
/** |
|
73 |
* \brief Set the PHY SAP User |
|
74 |
* \param s a pointer to the PHY SAP user |
|
75 |
*/ |
|
76 |
void SetLteEnbPhySapUser (LteEnbPhySapUser* s); |
|
77 |
||
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
78 |
/** |
7949 | 79 |
* \param pw the transmission power in dBm |
80 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
81 |
void SetTxPower (double pow); |
7949 | 82 |
|
83 |
/** |
|
84 |
* \return the transmission power in dBm |
|
85 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
86 |
double GetTxPower () const; |
7886 | 87 |
|
8670
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
88 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
89 |
/** |
7981 | 90 |
* \param pw the noise figure in dB |
91 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
92 |
void SetNoiseFigure (double pow); |
7981 | 93 |
|
94 |
/** |
|
95 |
* \return the noise figure in dB |
|
96 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
97 |
double GetNoiseFigure () const; |
7981 | 98 |
|
7886 | 99 |
/** |
8670
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
100 |
* \param delay the TTI delay between MAC and channel |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
101 |
*/ |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
102 |
void SetMacChDelay (uint8_t delay); |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
103 |
|
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
104 |
/** |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
105 |
* \returns the TTI delay between MAC and channel |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
106 |
*/ |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
107 |
uint8_t GetMacChDelay (void) const; |
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
108 |
|
8f63d16fb2e8
fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents:
8664
diff
changeset
|
109 |
/** |
7886 | 110 |
* \brief Queue the MAC PDU to be sent |
111 |
* \param p the MAC PDU to sent |
|
112 |
*/ |
|
113 |
virtual void DoSendMacPdu (Ptr<Packet> p); |
|
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
114 |
|
9036 | 115 |
virtual void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode); |
116 |
||
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
117 |
virtual void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi); |
9036 | 118 |
|
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
119 |
virtual uint8_t DoGetMacChTtiDelay (); |
7886 | 120 |
|
121 |
||
6705 | 122 |
void DoSetDownlinkSubChannels (); |
123 |
||
124 |
/** |
|
125 |
* \brief Create the PSD for TX |
|
126 |
*/ |
|
127 |
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity (); |
|
128 |
||
129 |
/** |
|
130 |
* \brief Calculate the channel quality for a given UE |
|
131 |
* \param sinr a list of computed SINR |
|
132 |
* \param ue the UE |
|
133 |
*/ |
|
134 |
void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue); |
|
135 |
||
136 |
/** |
|
137 |
* \brief Receive the control message |
|
138 |
* \param msg the received message |
|
139 |
*/ |
|
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:
8729
diff
changeset
|
140 |
virtual void ReceiveLteControlMessage (Ptr<LteControlMessage> msg); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
141 |
|
7910 | 142 |
/** |
143 |
* \brief Create the UL CQI feedback from SINR values perceived at |
|
9036 | 144 |
* the physical layer with the PUSCH signal received from eNB |
7910 | 145 |
* \param sinr SINR values vector |
146 |
*/ |
|
9036 | 147 |
UlCqi_s CreatePuschCqiReport (const SpectrumValue& sinr); |
148 |
||
149 |
/** |
|
150 |
* \brief Create the UL CQI feedback from SINR values perceived at |
|
151 |
* the physical layer with the SRS signal received from eNB |
|
152 |
* \param sinr SINR values vector |
|
153 |
*/ |
|
154 |
UlCqi_s CreateSrsCqiReport (const SpectrumValue& sinr); |
|
6705 | 155 |
|
156 |
||
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:
8729
diff
changeset
|
157 |
void DoSendLteControlMessage (Ptr<LteControlMessage> msg); |
7886 | 158 |
|
8180
5429db8b8c37
Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
159 |
bool AddUePhy (uint16_t rnti, Ptr<LteUePhy> phy); |
7886 | 160 |
|
8180
5429db8b8c37
Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
161 |
bool DeleteUePhy (uint16_t rnti); |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
162 |
|
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
163 |
/** |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
164 |
* \brief Send the PDCCH and PCFICH in the first 3 symbols |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
165 |
* \param ctrlMsgList the list of control messages of PDCCH |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
166 |
*/ |
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:
8729
diff
changeset
|
167 |
void SendControlChannels (std::list<Ptr<LteControlMessage> > ctrlMsgList); |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
168 |
|
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
169 |
/** |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
170 |
* \brief Send the PDSCH |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
171 |
* \param pb the PacketBurst to be sent |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
172 |
*/ |
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:
8729
diff
changeset
|
173 |
void SendDataChannels (Ptr<PacketBurst> pb); |
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:
8729
diff
changeset
|
174 |
|
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
175 |
/** |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
176 |
* \param m the UL-CQI to be queued |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
177 |
*/ |
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:
8729
diff
changeset
|
178 |
void QueueUlDci (UlDciLteControlMessage m); |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
179 |
|
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
180 |
/** |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
181 |
* \returns the list of UL-CQI to be processed |
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
182 |
*/ |
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:
8729
diff
changeset
|
183 |
std::list<UlDciLteControlMessage> DequeueUlDci (void); |
7886 | 184 |
|
185 |
||
6705 | 186 |
/** |
187 |
* \brief Start a LTE frame |
|
188 |
*/ |
|
189 |
void StartFrame (void); |
|
190 |
/** |
|
191 |
* \brief Start a LTE sub frame |
|
192 |
*/ |
|
193 |
void StartSubFrame (void); |
|
194 |
/** |
|
195 |
* \brief End a LTE sub frame |
|
196 |
*/ |
|
197 |
void EndSubFrame (void); |
|
198 |
/** |
|
199 |
* \brief End a LTE frame |
|
200 |
*/ |
|
201 |
void EndFrame (void); |
|
202 |
||
7886 | 203 |
/** |
204 |
* \brief PhySpectrum received a new PHY-PDU |
|
205 |
*/ |
|
206 |
void PhyPduReceived (Ptr<Packet> p); |
|
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:
8729
diff
changeset
|
207 |
|
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:
8729
diff
changeset
|
208 |
/** |
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:
8729
diff
changeset
|
209 |
* \brief PhySpectrum received a new list of 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:
8729
diff
changeset
|
210 |
*/ |
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:
8729
diff
changeset
|
211 |
virtual void ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> >); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
212 |
|
7886 | 213 |
// inherited from LtePhy |
9036 | 214 |
virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr); |
215 |
virtual void GenerateDataCqiReport (const SpectrumValue& sinr); |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
216 |
|
6705 | 217 |
|
218 |
private: |
|
8180
5429db8b8c37
Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
219 |
std::map <uint16_t, Ptr<LteUePhy> > m_ueAttached; |
8728
5a99218bfd1b
Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents:
8726
diff
changeset
|
220 |
|
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:
8729
diff
changeset
|
221 |
std::vector <int> m_dlDataRbMap; |
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:
8729
diff
changeset
|
222 |
|
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:
8729
diff
changeset
|
223 |
std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue; // for storing info on future receptions |
7886 | 224 |
|
225 |
LteEnbPhySapProvider* m_enbPhySapProvider; |
|
226 |
LteEnbPhySapUser* m_enbPhySapUser; |
|
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:
8729
diff
changeset
|
227 |
|
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:
8729
diff
changeset
|
228 |
std::vector <uint16_t> m_ulRntiRxed; |
7886 | 229 |
|
230 |
uint32_t m_nrFrames; |
|
231 |
uint32_t m_nrSubFrames; |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8253
diff
changeset
|
232 |
|
9036 | 233 |
uint16_t m_srsPeriodicity; |
234 |
std::map <uint16_t,uint16_t> m_srsCounter; |
|
235 |
||
6705 | 236 |
}; |
237 |
||
238 |
||
239 |
} |
|
240 |
||
7887 | 241 |
#endif /* LTE_ENB_PHY_H */ |