/usr/include/ns3.27/ns3/lte-enb-mac.h is in libns3-dev 3.27+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Marco Miozzo <marco.miozzo@cttc.es>
* Nicola Baldo <nbaldo@cttc.es>
* Modified by:
* Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
* Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
*/
#ifndef LTE_ENB_MAC_H
#define LTE_ENB_MAC_H
#include <map>
#include <vector>
#include <ns3/lte-common.h>
#include <ns3/lte-mac-sap.h>
#include <ns3/lte-enb-cmac-sap.h>
#include <ns3/ff-mac-csched-sap.h>
#include <ns3/ff-mac-sched-sap.h>
#include <ns3/lte-enb-phy-sap.h>
#include "ns3/traced-value.h"
#include "ns3/trace-source-accessor.h"
#include <ns3/packet.h>
#include <ns3/packet-burst.h>
#include <ns3/lte-ccm-mac-sap.h>
namespace ns3 {
class DlCqiLteControlMessage;
class UlCqiLteControlMessage;
class PdcchMapLteControlMessage;
/// DlHarqProcessesBuffer_t typedef
typedef std::vector <std::vector < Ptr<PacketBurst> > > DlHarqProcessesBuffer_t;
/**
* This class implements the MAC layer of the eNodeB device
*/
class LteEnbMac : public Object
{
/// allow EnbMacMemberLteEnbCmacSapProvider class friend access
friend class EnbMacMemberLteEnbCmacSapProvider;
/// allow EnbMacMemberLteMacSapProvider<LteEnbMac> class friend access
friend class EnbMacMemberLteMacSapProvider<LteEnbMac>;
/// allow EnbMacMemberFfMacSchedSapUser class friend access
friend class EnbMacMemberFfMacSchedSapUser;
/// allow EnbMacMemberFfMacCschedSapUser class friend access
friend class EnbMacMemberFfMacCschedSapUser;
/// allow EnbMacMemberLteEnbPhySapUser class friend access
friend class EnbMacMemberLteEnbPhySapUser;
/// allow MemberLteCcmMacSapProvider<LteEnbMac> class friend access
friend class MemberLteCcmMacSapProvider<LteEnbMac>;
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
LteEnbMac (void);
virtual ~LteEnbMac (void);
virtual void DoDispose (void);
/**
* \brief Set the component carrier ID
* \param index the component carrier ID
*/
void SetComponentCarrierId (uint8_t index);
/**
* \brief Set the scheduler SAP provider
* \param s a pointer SAP provider of the FF packet scheduler
*/
void SetFfMacSchedSapProvider (FfMacSchedSapProvider* s);
/**
* \brief Get the scheduler SAP user
* \return a pointer to the SAP user of the scheduler
*/
FfMacSchedSapUser* GetFfMacSchedSapUser (void);
/**
* \brief Set the control scheduler SAP provider
* \param s a pointer to the control scheduler SAP provider
*/
void SetFfMacCschedSapProvider (FfMacCschedSapProvider* s);
/**
* \brief Get the control scheduler SAP user
* \return a pointer to the control scheduler SAP user
*/
FfMacCschedSapUser* GetFfMacCschedSapUser (void);
/**
* \brief Set the MAC SAP user
* \param s a pointer to the MAC SAP user
*/
void SetLteMacSapUser (LteMacSapUser* s);
/**
* \brief Get the MAC SAP provider
* \return a pointer to the SAP provider of the MAC
*/
LteMacSapProvider* GetLteMacSapProvider (void);
/**
* \brief Set the control MAC SAP user
* \param s a pointer to the control MAC SAP user
*/
void SetLteEnbCmacSapUser (LteEnbCmacSapUser* s);
/**
* \brief Get the control MAC SAP provider
* \return a pointer to the control MAC SAP provider
*/
LteEnbCmacSapProvider* GetLteEnbCmacSapProvider (void);
/**
* \brief Get the eNB-PHY SAP User
* \return a pointer to the SAP User of the PHY
*/
LteEnbPhySapUser* GetLteEnbPhySapUser ();
/**
* \brief Set the PHY SAP Provider
* \param s a pointer to the PHY SAP provider
*/
void SetLteEnbPhySapProvider (LteEnbPhySapProvider* s);
/**
* \brief Get the eNB-ComponentCarrierManager SAP User
* \return a pointer to the SAP User of the ComponentCarrierManager
*/
LteCcmMacSapProvider* GetLteCcmMacSapProvider ();
/**
* \brief Set the ComponentCarrierManager SAP user
* \param s a pointer to the ComponentCarrierManager provider
*/
void SetLteCcmMacSapUser (LteCcmMacSapUser* s);
/**
* TracedCallback signature for DL scheduling events.
*
* \param [in] frame Frame number.
* \param [in] subframe Subframe number.
* \param [in] rnti The C-RNTI identifying the UE.
* \param [in] mcs0 The MCS for transport block..
* \param [in] tbs0Size
* \param [in] mcs1 The MCS for transport block.
* \param [in] tbs1Size
* \param [in] component carrier id
*/
typedef void (* DlSchedulingTracedCallback)
(const uint32_t frame, const uint32_t subframe, const uint16_t rnti,
const uint8_t mcs0, const uint16_t tbs0Size,
const uint8_t mcs1, const uint16_t tbs1Size, const uint8_t ccId);
/**
* TracedCallback signature for UL scheduling events.
*
* \param [in] frame Frame number.
* \param [in] subframe Subframe number.
* \param [in] rnti The C-RNTI identifying the UE.
* \param [in] mcs The MCS for transport block
* \param [in] tbsSize
*/
typedef void (* UlSchedulingTracedCallback)
(const uint32_t frame, const uint32_t subframe, const uint16_t rnti,
const uint8_t mcs, const uint16_t tbsSize);
private:
/**
* \brief Receive a DL CQI ideal control message
* \param msg the DL CQI message
*/
void ReceiveDlCqiLteControlMessage (Ptr<DlCqiLteControlMessage> msg);
/**
* \brief Receive a DL CQI ideal control message
* \param msg the DL CQI message
*/
void DoReceiveLteControlMessage (Ptr<LteControlMessage> msg);
/**
* \brief Receive a CE element containing the buffer status report
* \param bsr the BSR message
*/
void ReceiveBsrMessage (MacCeListElement_s bsr);
/**
* \brief UL CQI report
* \param ulcqi FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
*/
void DoUlCqiReport (FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi);
// forwarded from LteEnbCmacSapProvider
/**
* \brief Configure MAC function
* \param ulBandwidth the UL bandwidth
* \param dlBandwidth the DL bandwidth
*/
void DoConfigureMac (uint8_t ulBandwidth, uint8_t dlBandwidth);
/**
* \brief Add UE function
* \param rnti the RNTI
*/
void DoAddUe (uint16_t rnti);
/**
* \brief Remove UE function
* \param rnti the RNTI
*/
void DoRemoveUe (uint16_t rnti);
/**
* \brief Add LC function
* \param lcinfo the LC info
* \param msu the LTE MAC SAP user
*/
void DoAddLc (LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser* msu);
/**
* \brief Reconfigure LC function
* \param lcinfo the LC info
*/
void DoReconfigureLc (LteEnbCmacSapProvider::LcInfo lcinfo);
/**
* \brief Release LC function
* \param rnti the RNTI
* \param lcid the LCID
*/
void DoReleaseLc (uint16_t rnti, uint8_t lcid);
/**
* \brief UE Update configuration request function
* \param params LteEnbCmacSapProvider::UeConfig
*/
void DoUeUpdateConfigurationReq (LteEnbCmacSapProvider::UeConfig params);
/**
* \brief Get RACH configuration function
* \returns LteEnbCmacSapProvider::RachConfig
*/
LteEnbCmacSapProvider::RachConfig DoGetRachConfig ();
/**
* \brief Allocate NC RA preamble function
* \param rnti the RNTI
* \returns LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue
*/
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue DoAllocateNcRaPreamble (uint16_t rnti);
// forwarded from LteMacSapProvider
/**
* \brief Transmit PDU function
* \param params LteMacSapProvider::TransmitPduParameters
*/
void DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params);
/**
* \brief Report Buffer Status function
* \param params LteMacSapProvider::ReportBufferStatusParameters
*/
void DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters params);
// forwarded from FfMacCchedSapUser
/**
* \brief CSched Cell Config configure function
* \param params FfMacCschedSapUser::CschedCellConfigCnfParameters
*/
void DoCschedCellConfigCnf (FfMacCschedSapUser::CschedCellConfigCnfParameters params);
/**
* \brief CSched UE Config configure function
* \param params FfMacCschedSapUser::CschedUeConfigCnfParameters
*/
void DoCschedUeConfigCnf (FfMacCschedSapUser::CschedUeConfigCnfParameters params);
/**
* \brief CSched LC Config configure function
* \param params FfMacCschedSapUser::CschedLcConfigCnfParameters
*/
void DoCschedLcConfigCnf (FfMacCschedSapUser::CschedLcConfigCnfParameters params);
/**
* \brief CSched LC Release configure function
* \param params FfMacCschedSapUser::CschedLcReleaseCnfParameters
*/
void DoCschedLcReleaseCnf (FfMacCschedSapUser::CschedLcReleaseCnfParameters params);
/**
* \brief CSched UE Release configure function
* \param params FfMacCschedSapUser::CschedUeReleaseCnfParameters
*/
void DoCschedUeReleaseCnf (FfMacCschedSapUser::CschedUeReleaseCnfParameters params);
/**
* \brief CSched UE Config Update Indication function
* \param params FfMacCschedSapUser::CschedUeConfigUpdateIndParameters
*/
void DoCschedUeConfigUpdateInd (FfMacCschedSapUser::CschedUeConfigUpdateIndParameters params);
/**
* \brief CSched Cell Config Update Indication function
* \param params FfMacCschedSapUser::CschedCellConfigUpdateIndParameters
*/
void DoCschedCellConfigUpdateInd (FfMacCschedSapUser::CschedCellConfigUpdateIndParameters params);
// forwarded from FfMacSchedSapUser
/**
* \brief Sched DL Config Indication function
* \param ind FfMacSchedSapUser::SchedDlConfigIndParameters
*/
void DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind);
/**
* \brief Sched UL Config Indication function
* \param params FfMacSchedSapUser::SchedUlConfigIndParameters
*/
void DoSchedUlConfigInd (FfMacSchedSapUser::SchedUlConfigIndParameters params);
// forwarded from LteEnbPhySapUser
/**
* \brief Subrame Indication function
* \param frameNo frame number
* \param subframeNo subframe number
*/
void DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo);
/**
* \brief Receive RACH Preamble function
* \param prachId PRACH ID number
*/
void DoReceiveRachPreamble (uint8_t prachId);
// forwarded by LteCcmMacSapProvider
/**
* Report MAC CE to scheduler
* \param bsr the BSR
*/
void DoReportMacCeToScheduler (MacCeListElement_s bsr);
public:
/**
* legacy public for use the Phy callback
* \param p packet
*/
void DoReceivePhyPdu (Ptr<Packet> p);
private:
/**
* \brief UL Info List ELements HARQ Feedback function
* \param params UlInfoListElement_s
*/
void DoUlInfoListElementHarqFeeback (UlInfoListElement_s params);
/**
* \brief DL Info List ELements HARQ Feedback function
* \param params DlInfoListElement_s
*/
void DoDlInfoListElementHarqFeeback (DlInfoListElement_s params);
/// rnti, lcid, SAP of the RLC instance
std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> > m_rlcAttached;
std::vector <CqiListElement_s> m_dlCqiReceived; ///< DL-CQI received
std::vector <FfMacSchedSapProvider::SchedUlCqiInfoReqParameters> m_ulCqiReceived; ///< UL-CQI received
std::vector <MacCeListElement_s> m_ulCeReceived; ///< CE received (BSR up to now)
std::vector <DlInfoListElement_s> m_dlInfoListReceived; ///< DL HARQ feedback received
std::vector <UlInfoListElement_s> m_ulInfoListReceived; ///< UL HARQ feedback received
/*
* Map of UE's info element (see 4.3.12 of FF MAC Scheduler API)
*/
//std::map <uint16_t,UlInfoListElement_s> m_ulInfoListElements;
LteMacSapProvider* m_macSapProvider; ///< the MAC SAP provider
LteEnbCmacSapProvider* m_cmacSapProvider; ///< the CMAC SAP provider
LteMacSapUser* m_macSapUser; ///< the MAC SAP user
LteEnbCmacSapUser* m_cmacSapUser; ///< the CMAC SAP user
FfMacSchedSapProvider* m_schedSapProvider; ///< the Sched SAP provider
FfMacCschedSapProvider* m_cschedSapProvider; ///< the Csched SAP provider
FfMacSchedSapUser* m_schedSapUser; ///< the Sched SAP user
FfMacCschedSapUser* m_cschedSapUser; ///< the CSched SAP user
// PHY-SAP
LteEnbPhySapProvider* m_enbPhySapProvider; ///< the ENB Phy SAP provider
LteEnbPhySapUser* m_enbPhySapUser; ///< the ENB Phy SAP user
// Sap For ComponentCarrierManager 'Uplink case'
LteCcmMacSapProvider* m_ccmMacSapProvider; ///< CCM MAC SAP provider
LteCcmMacSapUser* m_ccmMacSapUser; ///< CCM MAC SAP user
/**
* frame number of current subframe indication
*/
uint32_t m_frameNo;
/**
* subframe number of current subframe indication
*/
uint32_t m_subframeNo;
/**
* Trace information regarding DL scheduling
* Frame number, Subframe number, RNTI, MCS of TB1, size of TB1,
* MCS of TB2 (0 if not present), size of TB2 (0 if not present)
*/
TracedCallback<DlSchedulingCallbackInfo> m_dlScheduling;
/**
* Trace information regarding UL scheduling
* Frame number, Subframe number, RNTI, MCS of TB, size of TB, component carrier id
*/
TracedCallback<uint32_t, uint32_t, uint16_t,
uint8_t, uint16_t, uint8_t> m_ulScheduling;
uint8_t m_macChTtiDelay; ///< delay of MAC, PHY and channel in terms of TTIs
std::map <uint16_t, DlHarqProcessesBuffer_t> m_miDlHarqProcessesPackets; ///< Packet under transmission of the DL HARQ process
uint8_t m_numberOfRaPreambles; ///< number of RA preambles
uint8_t m_preambleTransMax; ///< preamble transmit maximum
uint8_t m_raResponseWindowSize; ///< RA response window size
/**
* info associated with a preamble allocated for non-contention based RA
*
*/
struct NcRaPreambleInfo
{
uint16_t rnti; ///< rnti previously allocated for this non-contention based RA procedure
Time expiryTime; ///< value the expiration time of this allocation (so that stale preambles can be reused)
};
/**
* map storing as key the random access preamble IDs allocated for
* non-contention based access, and as value the associated info
*
*/
std::map<uint8_t, NcRaPreambleInfo> m_allocatedNcRaPreambleMap;
std::map<uint8_t, uint32_t> m_receivedRachPreambleCount; ///< received RACH preamble count
std::map<uint8_t, uint32_t> m_rapIdRntiMap; ///< RAPID RNTI map
/// component carrier Id used to address sap
uint8_t m_componentCarrierId;
};
} // end namespace ns3
#endif /* LTE_ENB_MAC_ENTITY_H */
|