author | Nicola Baldo <nbaldo@cttc.es> |
Tue, 20 Nov 2012 18:18:01 +0100 | |
changeset 9413 | 20f1c6678ee2 |
parent 9406 | 7f0f9d8f8e20 |
child 9414 | 7b0db3dbf19b |
permissions | -rw-r--r-- |
7886 | 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: Marco Miozzo <marco.miozzo@cttc.es> |
|
19 |
* Nicola Baldo <nbaldo@cttc.es> |
|
20 |
*/ |
|
21 |
||
22 |
#ifndef LTE_ENB_MAC_H |
|
23 |
#define LTE_ENB_MAC_H |
|
24 |
||
25 |
||
26 |
#include <map> |
|
27 |
#include <vector> |
|
7940 | 28 |
#include <ns3/lte-common.h> |
7886 | 29 |
#include <ns3/lte-mac-sap.h> |
30 |
#include <ns3/lte-enb-cmac-sap.h> |
|
31 |
#include <ns3/ff-mac-csched-sap.h> |
|
32 |
#include <ns3/ff-mac-sched-sap.h> |
|
33 |
#include <ns3/lte-enb-phy-sap.h> |
|
7987 | 34 |
#include "ns3/traced-value.h" |
35 |
#include "ns3/trace-source-accessor.h" |
|
7886 | 36 |
|
37 |
namespace ns3 { |
|
38 |
||
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
|
39 |
class DlCqiLteControlMessage; |
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
|
40 |
class UlCqiLteControlMessage; |
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
|
41 |
class PdcchMapLteControlMessage; |
7886 | 42 |
|
43 |
||
44 |
||
45 |
/** |
|
46 |
* This class implements the MAC layer of the eNodeB device |
|
47 |
*/ |
|
48 |
class LteEnbMac : public Object |
|
49 |
{ |
|
7888 | 50 |
friend class EnbMacMemberLteEnbCmacSapProvider; |
8173
c471bd9a5f96
New design of the MAC SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8135
diff
changeset
|
51 |
friend class EnbMacMemberLteMacSapProvider<LteEnbMac>; |
7888 | 52 |
friend class EnbMacMemberFfMacSchedSapUser; |
53 |
friend class EnbMacMemberFfMacCschedSapUser; |
|
54 |
friend class EnbMacMemberLteEnbPhySapUser; |
|
7886 | 55 |
|
56 |
public: |
|
57 |
static TypeId GetTypeId (void); |
|
58 |
||
59 |
LteEnbMac (void); |
|
60 |
virtual ~LteEnbMac (void); |
|
61 |
virtual void DoDispose (void); |
|
62 |
||
63 |
||
64 |
/** |
|
65 |
* \brief Set the scheduler SAP provider |
|
66 |
* \param s a pointer SAP provider of the FF packet scheduler |
|
67 |
*/ |
|
68 |
void SetFfMacSchedSapProvider (FfMacSchedSapProvider* s); |
|
69 |
/** |
|
70 |
* \brief Get the scheduler SAP user |
|
71 |
* \return a pointer to the SAP user of the scheduler |
|
72 |
*/ |
|
73 |
FfMacSchedSapUser* GetFfMacSchedSapUser (void); |
|
74 |
/** |
|
75 |
* \brief Set the control scheduler SAP provider |
|
76 |
* \param s a pointer to the control scheduler SAP provider |
|
77 |
*/ |
|
78 |
void SetFfMacCschedSapProvider (FfMacCschedSapProvider* s); |
|
79 |
/** |
|
80 |
* \brief Get the control scheduler SAP user |
|
81 |
* \return a pointer to the control scheduler SAP user |
|
82 |
*/ |
|
83 |
FfMacCschedSapUser* GetFfMacCschedSapUser (void); |
|
84 |
||
85 |
||
86 |
||
87 |
/** |
|
88 |
* \brief Set the MAC SAP user |
|
89 |
* \param s a pointer to the MAC SAP user |
|
90 |
*/ |
|
91 |
void SetLteMacSapUser (LteMacSapUser* s); |
|
92 |
/** |
|
93 |
* \brief Get the MAC SAP provider |
|
94 |
* \return a pointer to the SAP provider of the MAC |
|
95 |
*/ |
|
96 |
LteMacSapProvider* GetLteMacSapProvider (void); |
|
97 |
/** |
|
98 |
* \brief Set the control MAC SAP user |
|
99 |
* \param s a pointer to the control MAC SAP user |
|
100 |
*/ |
|
101 |
void SetLteEnbCmacSapUser (LteEnbCmacSapUser* s); |
|
102 |
/** |
|
103 |
* \brief Get the control MAC SAP provider |
|
104 |
* \return a pointer to the control MAC SAP provider |
|
105 |
*/ |
|
106 |
LteEnbCmacSapProvider* GetLteEnbCmacSapProvider (void); |
|
107 |
||
108 |
||
109 |
/** |
|
110 |
* \brief Get the eNB-PHY SAP User |
|
111 |
* \return a pointer to the SAP User of the PHY |
|
112 |
*/ |
|
113 |
LteEnbPhySapUser* GetLteEnbPhySapUser (); |
|
114 |
||
115 |
/** |
|
116 |
* \brief Set the PHY SAP Provider |
|
117 |
* \param s a pointer to the PHY SAP provider |
|
118 |
*/ |
|
119 |
void SetLteEnbPhySapProvider (LteEnbPhySapProvider* s); |
|
120 |
||
121 |
||
9406 | 122 |
private: |
123 |
||
7886 | 124 |
/** |
125 |
* \brief Receive a DL CQI ideal control message |
|
126 |
* \param msg the DL CQI message |
|
127 |
*/ |
|
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
|
128 |
void ReceiveDlCqiLteControlMessage (Ptr<DlCqiLteControlMessage> msg); |
7943
db21a8048ab9
PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents:
7940
diff
changeset
|
129 |
|
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
|
130 |
void DoReceiveLteControlMessage (Ptr<LteControlMessage> msg); |
7886 | 131 |
|
132 |
/** |
|
133 |
* \brief Receive a CE element containing the buffer status report |
|
134 |
* \param msg the BSR message |
|
135 |
*/ |
|
136 |
void ReceiveBsrMessage (MacCeListElement_s bsr); |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8135
diff
changeset
|
137 |
|
9406 | 138 |
|
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
139 |
void DoUlCqiReport (FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi); |
7886 | 140 |
|
141 |
||
142 |
||
143 |
// forwarded from LteEnbCmacSapProvider |
|
144 |
void DoConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth); |
|
145 |
void DoAddUe (uint16_t rnti); |
|
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
8729
diff
changeset
|
146 |
void DoRemoveUe (uint16_t rnti); |
7886 | 147 |
void DoAddLc (LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser* msu); |
148 |
void DoReconfigureLc (LteEnbCmacSapProvider::LcInfo lcinfo); |
|
149 |
void DoReleaseLc (uint16_t rnti, uint8_t lcid); |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
150 |
void DoUeUpdateConfigurationReq (LteEnbCmacSapProvider::UeConfig params); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
151 |
LteEnbCmacSapProvider::RachConfig DoGetRachConfig (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
152 |
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue DoAllocateNcRaPreamble (); |
7886 | 153 |
|
154 |
// forwarded from LteMacSapProvider |
|
155 |
void DoTransmitPdu (LteMacSapProvider::TransmitPduParameters); |
|
156 |
void DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters); |
|
157 |
||
158 |
||
159 |
// forwarded from FfMacCchedSapUser |
|
160 |
void DoCschedCellConfigCnf (FfMacCschedSapUser::CschedCellConfigCnfParameters params); |
|
161 |
void DoCschedUeConfigCnf (FfMacCschedSapUser::CschedUeConfigCnfParameters params); |
|
162 |
void DoCschedLcConfigCnf (FfMacCschedSapUser::CschedLcConfigCnfParameters params); |
|
163 |
void DoCschedLcReleaseCnf (FfMacCschedSapUser::CschedLcReleaseCnfParameters params); |
|
164 |
void DoCschedUeReleaseCnf (FfMacCschedSapUser::CschedUeReleaseCnfParameters params); |
|
165 |
void DoCschedUeConfigUpdateInd (FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params); |
|
166 |
void DoCschedCellConfigUpdateInd (FfMacCschedSapUser::CschedCellConfigUpdateIndParameters params); |
|
167 |
||
168 |
// forwarded from FfMacSchedSapUser |
|
169 |
void DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind); |
|
170 |
void DoSchedUlConfigInd (FfMacSchedSapUser::SchedUlConfigIndParameters params); |
|
171 |
||
9406 | 172 |
// forwarded from LteEnbPhySapUser |
7886 | 173 |
void DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo); |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
174 |
void DoReceiveRachPreamble (uint8_t prachId); |
7886 | 175 |
|
176 |
public: |
|
177 |
// legacy public for use the Phy callback |
|
178 |
void DoReceivePhyPdu (Ptr<Packet> p); |
|
179 |
||
180 |
private: |
|
7971 | 181 |
std::map <LteFlowId_t, LteMacSapUser*> m_rlcAttached; |
7886 | 182 |
|
7943
db21a8048ab9
PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents:
7940
diff
changeset
|
183 |
std::vector <CqiListElement_s> m_dlCqiReceived; // DL-CQI received |
9039
5bdf0c1be85f
Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
184 |
std::vector <FfMacSchedSapProvider::SchedUlCqiInfoReqParameters> m_ulCqiReceived; // UL-CQI received |
7886 | 185 |
std::vector <MacCeListElement_s> m_ulCeReceived; // CE received (BSR up to now) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8135
diff
changeset
|
186 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8135
diff
changeset
|
187 |
|
7886 | 188 |
/* |
189 |
* Map of UE's info element (see 4.3.12 of FF MAC Scheduler API) |
|
190 |
*/ |
|
191 |
std::map <uint16_t,UlInfoListElement_s> m_ulInfoListElements; |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8135
diff
changeset
|
192 |
|
7886 | 193 |
|
194 |
||
195 |
LteMacSapProvider* m_macSapProvider; |
|
196 |
LteEnbCmacSapProvider* m_cmacSapProvider; |
|
197 |
LteMacSapUser* m_macSapUser; |
|
198 |
LteEnbCmacSapUser* m_cmacSapUser; |
|
199 |
||
200 |
||
201 |
FfMacSchedSapProvider* m_schedSapProvider; |
|
202 |
FfMacCschedSapProvider* m_cschedSapProvider; |
|
203 |
FfMacSchedSapUser* m_schedSapUser; |
|
204 |
FfMacCschedSapUser* m_cschedSapUser; |
|
205 |
||
206 |
// PHY-SAP |
|
207 |
LteEnbPhySapProvider* m_enbPhySapProvider; |
|
208 |
LteEnbPhySapUser* m_enbPhySapUser; |
|
209 |
||
7987 | 210 |
uint32_t m_frameNo; |
211 |
uint32_t m_subframeNo; |
|
212 |
/** |
|
213 |
* Trace information regarding DL scheduling |
|
8135 | 214 |
* Frame number, Subframe number, RNTI, MCS of TB1, size of TB1, |
7987 | 215 |
* MCS of TB2 (0 if not present), size of TB2 (0 if not present) |
216 |
*/ |
|
217 |
TracedCallback<uint32_t, uint32_t, uint16_t, uint8_t, uint16_t, uint8_t, uint16_t> m_dlScheduling; |
|
218 |
/** |
|
219 |
* Trace information regarding UL scheduling |
|
8135 | 220 |
* Frame number, Subframe number, RNTI, MCS of TB, size of TB |
7987 | 221 |
*/ |
222 |
TracedCallback<uint32_t, uint32_t, uint16_t, uint8_t, uint16_t> m_ulScheduling; |
|
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:
8714
diff
changeset
|
223 |
|
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:
8714
diff
changeset
|
224 |
uint8_t m_macChTtiDelay; // delay of MAC, PHY and channel in terms of TTIs |
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:
8714
diff
changeset
|
225 |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
226 |
uint8_t m_numberOfRaPreambles; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
227 |
uint8_t m_preambleTransMax; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
228 |
uint8_t m_raResponseWindowSize; |
7987 | 229 |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
230 |
/** |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
231 |
* map storing as key the random acccess preamble IDs allocated for |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
232 |
* non-contention based access, and as value the expiration time of |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
233 |
* this allocation (so that stale preambles can be reused). |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
234 |
* |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
235 |
*/ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
236 |
std::map<uint8_t, Time> m_allocatedNcRaPreambleMap; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
237 |
|
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
238 |
std::map<uint8_t, uint32_t> m_receivedRachPreambleCount; |
7886 | 239 |
}; |
240 |
||
241 |
} // end namespace ns3 |
|
242 |
||
243 |
#endif /* LTE_ENB_MAC_ENTITY_H */ |