A Discrete-Event Network Simulator
API
lte-helper.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: Nicola Baldo <nbaldo@cttc.es>
19  * Modified by: Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
20  * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
21  */
22 
23 #ifndef LTE_HELPER_H
24 #define LTE_HELPER_H
25 
26 #include <ns3/config.h>
27 #include <ns3/simulator.h>
28 #include <ns3/names.h>
29 #include <ns3/net-device.h>
30 #include <ns3/net-device-container.h>
31 #include <ns3/node.h>
32 #include <ns3/node-container.h>
33 #include <ns3/eps-bearer.h>
34 #include <ns3/phy-stats-calculator.h>
35 #include <ns3/phy-tx-stats-calculator.h>
36 #include <ns3/phy-rx-stats-calculator.h>
37 #include <ns3/mac-stats-calculator.h>
38 #include <ns3/radio-bearer-stats-calculator.h>
39 #include <ns3/radio-bearer-stats-connector.h>
40 #include <ns3/epc-tft.h>
41 #include <ns3/mobility-model.h>
42 #include <ns3/component-carrier-enb.h>
43 #include <ns3/cc-helper.h>
44 #include <map>
45 
46 namespace ns3 {
47 
48 
49 class LteUePhy;
50 class LteEnbPhy;
51 class SpectrumChannel;
52 class EpcHelper;
53 class PropagationLossModel;
54 class SpectrumPropagationLossModel;
55 
102 class LteHelper : public Object
103 {
104 public:
105  LteHelper (void);
106  virtual ~LteHelper (void);
107 
112  static TypeId GetTypeId (void);
113  virtual void DoDispose (void);
114 
128  void SetEpcHelper (Ptr<EpcHelper> h);
129 
137  void SetPathlossModelType (TypeId type);
138 
145  void SetPathlossModelAttribute (std::string n, const AttributeValue &v);
146 
156  void SetSchedulerType (std::string type);
157 
162  std::string GetSchedulerType () const;
163 
170  void SetSchedulerAttribute (std::string n, const AttributeValue &v);
171 
181  void SetFfrAlgorithmType (std::string type);
182 
187  std::string GetFfrAlgorithmType () const;
188 
195  void SetFfrAlgorithmAttribute (std::string n, const AttributeValue &v);
196 
206  void SetHandoverAlgorithmType (std::string type);
207 
212  std::string GetHandoverAlgorithmType () const;
213 
220  void SetHandoverAlgorithmAttribute (std::string n, const AttributeValue &v);
221 
228  void SetEnbDeviceAttribute (std::string n, const AttributeValue &v);
229 
237  void SetEnbAntennaModelType (std::string type);
238 
245  void SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v);
246 
253  void SetUeDeviceAttribute (std::string n, const AttributeValue &v);
254 
262  void SetUeAntennaModelType (std::string type);
263 
270  void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v);
271 
278  void SetCcPhyParams (std::map< uint8_t, ComponentCarrier> ccmap);
279 
287  void SetSpectrumChannelType (std::string type);
288 
295  void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v);
296 
303  void SetEnbComponentCarrierManagerType (std::string type);
304 
309  std::string GetEnbComponentCarrierManagerType () const;
310 
317  void SetEnbComponentCarrierManagerAttribute (std::string n, const AttributeValue &v);
318 
325  void SetUeComponentCarrierManagerType (std::string type);
326 
327 
332  std::string GetUeComponentCarrierManagerType () const;
333 
340  void SetUeComponentCarrierManagerAttribute (std::string n, const AttributeValue &v);
341 
349 
357 
375  void Attach (NetDeviceContainer ueDevices);
376 
394  void Attach (Ptr<NetDevice> ueDevice);
395 
409  void Attach (NetDeviceContainer ueDevices, Ptr<NetDevice> enbDevice);
410 
423  void Attach (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
424 
439  void AttachToClosestEnb (NetDeviceContainer ueDevices, NetDeviceContainer enbDevices);
440 
455  void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
456 
465  uint8_t ActivateDedicatedEpsBearer (NetDeviceContainer ueDevices, EpsBearer bearer, Ptr<EpcTft> tft);
466 
475  uint8_t ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer, Ptr<EpcTft> tft);
476 
486  void DeActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice, uint8_t bearerId);
492  void AddX2Interface (NodeContainer enbNodes);
493 
500  void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
501 
515  void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev,
516  Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev);
517 
518 
531  void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev,
532  Ptr<NetDevice> sourceEnbDev, uint16_t targetCellId);
533 
540  void ActivateDataRadioBearer (NetDeviceContainer ueDevices, EpsBearer bearer);
541 
550  void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer);
551 
559  void SetFadingModel (std::string type);
560 
567  void SetFadingModelAttribute (std::string n, const AttributeValue &v);
568 
572  void EnableLogComponents (void);
573 
579  void EnableTraces (void);
580 
584  void EnablePhyTraces (void);
585 
589  void EnableDlPhyTraces (void);
590 
594  void EnableUlPhyTraces (void);
595 
599  void EnableDlTxPhyTraces (void);
600 
604  void EnableUlTxPhyTraces (void);
605 
609  void EnableDlRxPhyTraces (void);
610 
614  void EnableUlRxPhyTraces (void);
615 
619  void EnableMacTraces (void);
620 
624  void EnableDlMacTraces (void);
625 
629  void EnableUlMacTraces (void);
630 
634  void EnableRlcTraces (void);
635 
641 
645  void EnablePdcpTraces (void);
646 
652 
667  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
668 
673 
674 
679 
680 
681 protected:
682  // inherited from Object
683  virtual void DoInitialize (void);
684 
685 private:
686 
695  void DoComponentCarrierConfigure (uint32_t ulEarfcn, uint32_t dlEarfcn, uint8_t ulbw, uint8_t dlbw);
702 
709 
721  void DoHandoverRequest (Ptr<NetDevice> ueDev,
722  Ptr<NetDevice> sourceEnbDev,
723  uint16_t targetCellId);
724 
725 
735  void DoDeActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice, uint8_t bearerId);
736 
738  void ChannelModelInitialization (void);
739 
752 
775 
777  std::string m_fadingModelType;
787 
802 
809 
815  uint64_t m_imsiCounter;
821  uint16_t m_cellIdCounter;
822 
839 
846  bool m_useCa;
847 
851  std::map< uint8_t, ComponentCarrier > m_componentCarrierPhyParams;
852 
856  uint16_t m_noOfCcs;
857 
858 }; // end of `class LteHelper`
859 
860 
861 } // namespace ns3
862 
863 
864 
865 #endif // LTE_HELPER_H
void SetFadingModel(std::string type)
Set the type of fading model to be used in both DL and UL.
Definition: lte-helper.cc:446
Ptr< Object > m_uplinkPathlossModel
The path loss model used in the uplink channel.
Definition: lte-helper.h:751
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the path loss models to be created.
Definition: lte-helper.cc:396
void EnableDlRxPhyTraces(void)
Enable trace sinks for DL reception PHY layer.
Definition: lte-helper.cc:1429
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
RadioBearerStatsConnector m_radioBearerStatsConnector
Connects RLC and PDCP statistics containers to appropriate trace sources.
Definition: lte-helper.h:801
Ptr< NetDevice > InstallSingleEnbDevice(Ptr< Node > n)
Create an eNodeB device (LteEnbNetDevice) on the given node.
Definition: lte-helper.cc:514
static TypeId GetTypeId(void)
Register this type.
Definition: lte-helper.cc:109
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:484
void SetCcPhyParams(std::map< uint8_t, ComponentCarrier > ccmap)
This method is used to send the ComponentCarrier map created with CcHelper to the helper...
Definition: lte-helper.cc:477
void EnableLogComponents(void)
Enables full-blown logging for major components of the LENA architecture.
Definition: lte-helper.cc:1304
void HandoverRequest(Time hoTime, Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
Manually trigger an X2-based handover.
Definition: lte-helper.cc:1228
bool m_fadingStreamsAssigned
True if a random variable stream number has been assigned for the fading model.
Definition: lte-helper.h:786
ObjectFactory m_fadingModelFactory
Factory of fading model object for both the downlink and uplink channels.
Definition: lte-helper.h:779
Hold a value for an Attribute.
Definition: attribute.h:68
void EnableDlPhyTraces(void)
Enable trace sinks for DL PHY layer.
Definition: lte-helper.cc:1468
Ptr< SpectrumChannel > GetUplinkSpectrumChannel(void) const
Definition: lte-helper.cc:215
void DoComponentCarrierConfigure(uint32_t ulEarfcn, uint32_t dlEarfcn, uint8_t ulbw, uint8_t dlbw)
A private function used for component carrier configuration.
Definition: lte-helper.cc:1280
void SetUeAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the UE antenna model to be created.
Definition: lte-helper.cc:439
std::map< uint8_t, ComponentCarrier > m_componentCarrierPhyParams
This contains all the information about each component carrier.
Definition: lte-helper.h:851
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
Definition: lte-helper.cc:943
void SetEnbComponentCarrierManagerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the enb component carrier manager to be created.
Definition: lte-helper.cc:360
void EnableRlcTraces(void)
Enable trace sinks for RLC layer.
Definition: lte-helper.cc:1350
bool m_usePdschForCqiGeneration
The UsePdschForCqiGeneration attribute.
Definition: lte-helper.h:838
Ptr< PhyStatsCalculator > m_phyStats
Container of PHY layer statistics.
Definition: lte-helper.h:789
Ptr< PhyRxStatsCalculator > m_phyRxStats
Container of PHY layer statistics related to reception.
Definition: lte-helper.h:793
std::string m_fadingModelType
Name of fading model type, e.g., "ns3::TraceFadingLossModel".
Definition: lte-helper.h:777
void SetUeDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the UE devices (LteUeNetDevice) to be created.
Definition: lte-helper.cc:425
void SetUeAntennaModelType(std::string type)
Set the type of antenna model to be used by UE devices.
Definition: lte-helper.cc:432
ObjectFactory m_enbComponentCarrierManagerFactory
Factory of enb component carrier manager object.
Definition: lte-helper.h:760
Ptr< MacStatsCalculator > m_macStats
Container of MAC layer statistics.
Definition: lte-helper.h:795
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used.
Definition: lte-helper.cc:1358
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
Definition: lte-helper.cc:1294
void SetEnbComponentCarrierManagerType(std::string type)
Set the type of carrier component algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:352
ObjectFactory m_channelFactory
Factory of both the downlink and uplink LTE channels.
Definition: lte-helper.h:774
uint8_t ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
Definition: lte-helper.cc:1051
void ChannelModelInitialization(void)
Function that performs a channel model initialization of all component carriers.
Definition: lte-helper.cc:227
std::string GetUeComponentCarrierManagerType() const
Definition: lte-helper.cc:367
void SetHandoverAlgorithmType(std::string type)
Set the type of handover algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:330
void EnableUlRxPhyTraces(void)
Enable trace sinks for UL reception PHY layer.
Definition: lte-helper.cc:1436
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:309
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:282
Ptr< RadioBearerStatsCalculator > m_rlcStats
Container of RLC layer statistics.
Definition: lte-helper.h:797
std::string GetHandoverAlgorithmType() const
Definition: lte-helper.cc:324
void EnablePdcpTraces(void)
Enable trace sinks for PDCP layer.
Definition: lte-helper.cc:1493
void AttachToClosestEnb(NetDeviceContainer ueDevices, NetDeviceContainer enbDevices)
Manual attachment of a set of UE devices to the network via the closest eNodeB (with respect to dista...
Definition: lte-helper.cc:1019
Ptr< Object > m_downlinkPathlossModel
The path loss model used in the downlink channel.
Definition: lte-helper.h:749
Creation and configuration of LTE entities.
Definition: lte-helper.h:102
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
ObjectFactory m_pathlossModelFactory
Factory of path loss model object.
Definition: lte-helper.h:772
void DeActivateDedicatedEpsBearer(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice, uint8_t bearerId)
Manually trigger dedicated bearer de-activation at specific simulation time.
Definition: lte-helper.cc:1255
void SetHandoverAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the handover algorithm to be created.
Definition: lte-helper.cc:338
void SetUeComponentCarrierManagerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the ue component carrier manager to be created.
Definition: lte-helper.cc:381
ObjectFactory m_ueComponentCarrierManagerFactory
Factory of ue component carrier manager object.
Definition: lte-helper.h:762
void EnableTraces(void)
Enables trace sinks for PHY, MAC, RLC and PDCP.
Definition: lte-helper.cc:1341
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Definition: lte-helper.cc:296
Ptr< NetDevice > InstallSingleUeDevice(Ptr< Node > n)
Create a UE device (LteUeNetDevice) on the given node.
Definition: lte-helper.cc:763
uint64_t m_imsiCounter
Keep track of the number of IMSI allocated.
Definition: lte-helper.h:815
ObjectFactory m_enbAntennaModelFactory
Factory of antenna object for eNodeB.
Definition: lte-helper.h:766
holds a vector of ns3::NetDevice pointers
void SetPathlossModelType(TypeId type)
Set the type of path loss model to be used for both DL and UL channels.
Definition: lte-helper.cc:388
uint16_t m_cellIdCounter
Keep track of the number of cell ID allocated.
Definition: lte-helper.h:821
void EnablePhyTraces(void)
Enable trace sinks for PHY layer.
Definition: lte-helper.cc:1404
bool m_isAnrEnabled
The AnrEnabled attribute.
Definition: lte-helper.h:832
void SetUeComponentCarrierManagerType(std::string type)
Set the type of Component Carrier Manager to be used by Ue devices.
Definition: lte-helper.cc:373
ObjectFactory m_handoverAlgorithmFactory
Factory of handover algorithm object.
Definition: lte-helper.h:758
void SetEnbAntennaModelType(std::string type)
Set the type of antenna model to be used by eNodeB devices.
Definition: lte-helper.cc:411
void SetSpectrumChannelType(std::string type)
Set the type of spectrum channel to be used in both DL and UL.
Definition: lte-helper.cc:464
void SetFadingModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the fading model to be created (both DL and UL).
Definition: lte-helper.cc:458
void EnableDlMacTraces(void)
Enable trace sinks for DL MAC layer.
Definition: lte-helper.cc:1452
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void EnableUlTxPhyTraces(void)
Enable trace sinks for UL transmission PHY layer.
Definition: lte-helper.cc:1422
uint16_t m_noOfCcs
Number of component carriers that will be installed by default at eNodeB and UE devices.
Definition: lte-helper.h:856
Ptr< SpectrumChannel > m_uplinkChannel
The uplink LTE channel used in the simulation.
Definition: lte-helper.h:747
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
Definition: lte-helper.cc:1203
ObjectFactory m_schedulerFactory
Factory of MAC scheduler object.
Definition: lte-helper.h:754
void EnableUlPhyTraces(void)
Enable trace sinks for UL PHY layer.
Definition: lte-helper.cc:1476
void EnableDlTxPhyTraces(void)
Enable trace sinks for DL transmission PHY layer.
Definition: lte-helper.cc:1415
Ptr< SpectrumPropagationLossModel > m_fadingModule
The fading model used in both the downlink and uplink channels.
Definition: lte-helper.h:781
void EnableUlMacTraces(void)
Enable trace sinks for UL MAC layer.
Definition: lte-helper.cc:1460
Ptr< EpcHelper > m_epcHelper
Helper which provides implementation of core network.
Definition: lte-helper.h:808
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
Definition: lte-helper.cc:1487
virtual ~LteHelper(void)
Definition: lte-helper.cc:104
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:499
Ptr< PhyTxStatsCalculator > m_phyTxStats
Container of PHY layer statistics related to transmission.
Definition: lte-helper.h:791
Ptr< RadioBearerStatsCalculator > GetPdcpStats(void)
Definition: lte-helper.cc:1501
Ptr< SpectrumChannel > GetDownlinkSpectrumChannel(void) const
Definition: lte-helper.cc:221
virtual void DoDispose(void)
Destructor implementation.
Definition: lte-helper.cc:205
Instantiate subclasses of ns3::Object.
ObjectFactory m_ffrAlgorithmFactory
Factory of FFR (frequency reuse) algorithm object.
Definition: lte-helper.h:756
void DoHandoverRequest(Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, uint16_t targetCellId)
The actual function to trigger a manual handover.
Definition: lte-helper.cc:1245
void SetEpcHelper(Ptr< EpcHelper > h)
Set the EpcHelper to be used to setup the EPC network in conjunction with the setup of the LTE radio ...
Definition: lte-helper.cc:275
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB antenna model to be created.
Definition: lte-helper.cc:418
ObjectFactory m_ueNetDeviceFactory
Factory for LteUeNetDevice objects.
Definition: lte-helper.h:768
void SetSpectrumChannelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the spectrum channel to be created (both DL and UL).
Definition: lte-helper.cc:471
virtual void DoInitialize(void)
Initialize() implementation.
Definition: lte-helper.cc:92
bool m_useCa
The UseCa attribute.
Definition: lte-helper.h:846
void EnableMacTraces(void)
Enable trace sinks for MAC layer.
Definition: lte-helper.cc:1444
A base class which provides memory management and object aggregation.
Definition: object.h:87
void DoDeActivateDedicatedEpsBearer(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice, uint8_t bearerId)
The actual function to trigger a manual bearer de-activation.
Definition: lte-helper.cc:1265
Ptr< RadioBearerStatsCalculator > m_pdcpStats
Container of PDCP layer statistics.
Definition: lte-helper.h:799
ObjectFactory m_ueAntennaModelFactory
Factory of antenna object for UE.
Definition: lte-helper.h:770
std::string GetFfrAlgorithmType() const
Definition: lte-helper.cc:303
This class is very useful when user needs to collect statistics from PDCP and RLC.
a unique identifier for an interface.
Definition: type-id.h:58
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
Definition: lte-helper.cc:317
ObjectFactory m_enbNetDeviceFactory
Factory of LteEnbNetDevice objects.
Definition: lte-helper.h:764
Ptr< SpectrumChannel > m_downlinkChannel
This function create the component carrier based on provided configuration parameters.
Definition: lte-helper.h:745
std::string GetSchedulerType() const
Definition: lte-helper.cc:290
std::string GetEnbComponentCarrierManagerType() const
Definition: lte-helper.cc:346
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
Definition: lte-helper.cc:403
bool m_useIdealRrc
The UseIdealRrc attribute.
Definition: lte-helper.h:827