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  */
20 
21 #ifndef LTE_HELPER_H
22 #define LTE_HELPER_H
23 
24 #include <ns3/config.h>
25 #include <ns3/simulator.h>
26 #include <ns3/names.h>
27 #include <ns3/net-device.h>
28 #include <ns3/net-device-container.h>
29 #include <ns3/node.h>
30 #include <ns3/node-container.h>
31 #include <ns3/eps-bearer.h>
32 #include <ns3/phy-stats-calculator.h>
33 #include <ns3/phy-tx-stats-calculator.h>
34 #include <ns3/phy-rx-stats-calculator.h>
35 #include <ns3/mac-stats-calculator.h>
36 #include <ns3/radio-bearer-stats-calculator.h>
37 #include <ns3/radio-bearer-stats-connector.h>
38 #include <ns3/epc-tft.h>
39 #include <ns3/mobility-model.h>
40 
41 namespace ns3 {
42 
43 
44 class LteUePhy;
45 class LteEnbPhy;
46 class SpectrumChannel;
47 class EpcHelper;
48 class PropagationLossModel;
49 class SpectrumPropagationLossModel;
50 
96 class LteHelper : public Object
97 {
98 public:
99  LteHelper (void);
100  virtual ~LteHelper (void);
101 
106  static TypeId GetTypeId (void);
107  virtual void DoDispose (void);
108 
122  void SetEpcHelper (Ptr<EpcHelper> h);
123 
131  void SetPathlossModelType (std::string type);
132 
139  void SetPathlossModelAttribute (std::string n, const AttributeValue &v);
140 
150  void SetSchedulerType (std::string type);
151 
156  std::string GetSchedulerType () const;
157 
164  void SetSchedulerAttribute (std::string n, const AttributeValue &v);
165 
175  void SetFfrAlgorithmType (std::string type);
176 
181  std::string GetFfrAlgorithmType () const;
182 
189  void SetFfrAlgorithmAttribute (std::string n, const AttributeValue &v);
190 
200  void SetHandoverAlgorithmType (std::string type);
201 
206  std::string GetHandoverAlgorithmType () const;
207 
214  void SetHandoverAlgorithmAttribute (std::string n, const AttributeValue &v);
215 
222  void SetEnbDeviceAttribute (std::string n, const AttributeValue &v);
223 
231  void SetEnbAntennaModelType (std::string type);
232 
239  void SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v);
240 
247  void SetUeDeviceAttribute (std::string n, const AttributeValue &v);
248 
256  void SetUeAntennaModelType (std::string type);
257 
264  void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v);
265 
273  void SetSpectrumChannelType (std::string type);
274 
281  void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v);
282 
290 
298 
316  void Attach (NetDeviceContainer ueDevices);
317 
335  void Attach (Ptr<NetDevice> ueDevice);
336 
350  void Attach (NetDeviceContainer ueDevices, Ptr<NetDevice> enbDevice);
351 
364  void Attach (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
365 
380  void AttachToClosestEnb (NetDeviceContainer ueDevices, NetDeviceContainer enbDevices);
381 
396  void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
397 
405  uint8_t ActivateDedicatedEpsBearer (NetDeviceContainer ueDevices, EpsBearer bearer, Ptr<EpcTft> tft);
406 
414  uint8_t ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer, Ptr<EpcTft> tft);
415 
425  void DeActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice, uint8_t bearerId);
431  void AddX2Interface (NodeContainer enbNodes);
432 
439  void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
440 
454  void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev,
455  Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev);
456 
457 
464  void ActivateDataRadioBearer (NetDeviceContainer ueDevices, EpsBearer bearer);
465 
474  void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer);
475 
483  void SetFadingModel (std::string type);
484 
491  void SetFadingModelAttribute (std::string n, const AttributeValue &v);
492 
496  void EnableLogComponents (void);
497 
503  void EnableTraces (void);
504 
508  void EnablePhyTraces (void);
509 
513  void EnableDlPhyTraces (void);
514 
518  void EnableUlPhyTraces (void);
519 
523  void EnableDlTxPhyTraces (void);
524 
528  void EnableUlTxPhyTraces (void);
529 
533  void EnableDlRxPhyTraces (void);
534 
538  void EnableUlRxPhyTraces (void);
539 
543  void EnableMacTraces (void);
544 
548  void EnableDlMacTraces (void);
549 
553  void EnableUlMacTraces (void);
554 
558  void EnableRlcTraces (void);
559 
565 
569  void EnablePdcpTraces (void);
570 
576 
591  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
592 
593 protected:
594  // inherited from Object
595  virtual void DoInitialize (void);
596 
597 private:
604 
611 
624  void DoHandoverRequest (Ptr<NetDevice> ueDev,
625  Ptr<NetDevice> sourceEnbDev,
626  Ptr<NetDevice> targetEnbDev);
627 
628 
638  void DoDeActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice, uint8_t bearerId);
639 
640 
649 
670 
672  std::string m_fadingModelType;
682 
697 
704 
710  uint64_t m_imsiCounter;
716  uint16_t m_cellIdCounter;
717 
734 
735 }; // end of `class LteHelper`
736 
737 
738 } // namespace ns3
739 
740 
741 
742 #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:350
Ptr< Object > m_uplinkPathlossModel
The path loss model used in the uplink channel.
Definition: lte-helper.h:648
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:299
void EnableDlRxPhyTraces(void)
Enable trace sinks for DL reception PHY layer.
Definition: lte-helper.cc:1175
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:696
Ptr< NetDevice > InstallSingleEnbDevice(Ptr< Node > n)
Create an eNodeB device (LteEnbNetDevice) on the given node.
Definition: lte-helper.cc:412
static TypeId GetTypeId(void)
Register this type.
Definition: lte-helper.cc:140
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:382
void EnableLogComponents(void)
Enables full-blown logging for major components of the LENA architecture.
Definition: lte-helper.cc:1056
void HandoverRequest(Time hoTime, Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
Manually trigger an X2-based handover.
Definition: lte-helper.cc:1001
bool m_fadingStreamsAssigned
True if a random variable stream number has been assigned for the fading model.
Definition: lte-helper.h:681
ObjectFactory m_fadingModelFactory
Factory of fading model object for both the downlink and uplink channels.
Definition: lte-helper.h:674
Hold a value for an Attribute.
Definition: attribute.h:68
void EnableDlPhyTraces(void)
Enable trace sinks for DL PHY layer.
Definition: lte-helper.cc:1214
void SetUeAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the UE antenna model to be created.
Definition: lte-helper.cc:343
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:716
void EnableRlcTraces(void)
Enable trace sinks for RLC layer.
Definition: lte-helper.cc:1102
bool m_usePdschForCqiGeneration
The UsePdschForCqiGeneration attribute.
Definition: lte-helper.h:733
Ptr< PhyStatsCalculator > m_phyStats
Container of PHY layer statistics.
Definition: lte-helper.h:684
Ptr< PhyRxStatsCalculator > m_phyRxStats
Container of PHY layer statistics related to reception.
Definition: lte-helper.h:688
std::string m_fadingModelType
Name of fading model type, e.g., "ns3::TraceFadingLossModel".
Definition: lte-helper.h:672
void SetUeDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the UE devices (LteUeNetDevice) to be created.
Definition: lte-helper.cc:329
void SetUeAntennaModelType(std::string type)
Set the type of antenna model to be used by UE devices.
Definition: lte-helper.cc:336
Ptr< MacStatsCalculator > m_macStats
Container of MAC layer statistics.
Definition: lte-helper.h:690
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used.
Definition: lte-helper.cc:1110
ObjectFactory m_ulPathlossModelFactory
Factory of path loss model object for the uplink channel.
Definition: lte-helper.h:667
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
Definition: lte-helper.cc:1046
ObjectFactory m_channelFactory
Factory of both the downlink and uplink LTE channels.
Definition: lte-helper.h:669
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:824
void SetHandoverAlgorithmType(std::string type)
Set the type of handover algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:273
void EnableUlRxPhyTraces(void)
Enable trace sinks for UL reception PHY layer.
Definition: lte-helper.cc:1182
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:252
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:225
Ptr< RadioBearerStatsCalculator > m_rlcStats
Container of RLC layer statistics.
Definition: lte-helper.h:692
std::string GetHandoverAlgorithmType() const
Definition: lte-helper.cc:267
void EnablePdcpTraces(void)
Enable trace sinks for PDCP layer.
Definition: lte-helper.cc:1239
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:792
Ptr< Object > m_downlinkPathlossModel
The path loss model used in the downlink channel.
Definition: lte-helper.h:646
Creation and configuration of LTE entities.
Definition: lte-helper.h:96
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
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:1020
void SetHandoverAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the handover algorithm to be created.
Definition: lte-helper.cc:281
void DoHandoverRequest(Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
The actual function to trigger a manual handover.
Definition: lte-helper.cc:1009
void EnableTraces(void)
Enables trace sinks for PHY, MAC, RLC and PDCP.
Definition: lte-helper.cc:1093
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Definition: lte-helper.cc:239
Ptr< NetDevice > InstallSingleUeDevice(Ptr< Node > n)
Create a UE device (LteUeNetDevice) on the given node.
Definition: lte-helper.cc:584
uint64_t m_imsiCounter
Keep track of the number of IMSI allocated.
Definition: lte-helper.h:710
ObjectFactory m_enbAntennaModelFactory
Factory of antenna object for eNodeB.
Definition: lte-helper.h:659
holds a vector of ns3::NetDevice pointers
uint16_t m_cellIdCounter
Keep track of the number of cell ID allocated.
Definition: lte-helper.h:716
void EnablePhyTraces(void)
Enable trace sinks for PHY layer.
Definition: lte-helper.cc:1150
bool m_isAnrEnabled
The AnrEnabled attribute.
Definition: lte-helper.h:727
ObjectFactory m_handoverAlgorithmFactory
Factory of handover algorithm object.
Definition: lte-helper.h:655
void SetEnbAntennaModelType(std::string type)
Set the type of antenna model to be used by eNodeB devices.
Definition: lte-helper.cc:315
ObjectFactory m_dlPathlossModelFactory
Factory of path loss model object for the downlink channel.
Definition: lte-helper.h:665
void SetSpectrumChannelType(std::string type)
Set the type of spectrum channel to be used in both DL and UL.
Definition: lte-helper.cc:368
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:362
void EnableDlMacTraces(void)
Enable trace sinks for DL MAC layer.
Definition: lte-helper.cc:1198
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:1168
Ptr< SpectrumChannel > m_uplinkChannel
The uplink LTE channel used in the simulation.
Definition: lte-helper.h:644
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
Definition: lte-helper.cc:976
ObjectFactory m_schedulerFactory
Factory of MAC scheduler object.
Definition: lte-helper.h:651
void EnableUlPhyTraces(void)
Enable trace sinks for UL PHY layer.
Definition: lte-helper.cc:1222
void EnableDlTxPhyTraces(void)
Enable trace sinks for DL transmission PHY layer.
Definition: lte-helper.cc:1161
Ptr< SpectrumPropagationLossModel > m_fadingModule
The fading model used in both the downlink and uplink channels.
Definition: lte-helper.h:676
void EnableUlMacTraces(void)
Enable trace sinks for UL MAC layer.
Definition: lte-helper.cc:1206
Ptr< EpcHelper > m_epcHelper
Helper which provides implementation of core network.
Definition: lte-helper.h:703
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
Definition: lte-helper.cc:1233
virtual ~LteHelper(void)
Definition: lte-helper.cc:135
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:397
Ptr< PhyTxStatsCalculator > m_phyTxStats
Container of PHY layer statistics related to transmission.
Definition: lte-helper.h:686
Ptr< RadioBearerStatsCalculator > GetPdcpStats(void)
Definition: lte-helper.cc:1247
virtual void DoDispose(void)
Destructor implementation.
Definition: lte-helper.cc:208
Instantiate subclasses of ns3::Object.
ObjectFactory m_ffrAlgorithmFactory
Factory of FFR (frequency reuse) algorithm object.
Definition: lte-helper.h:653
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:218
void SetPathlossModelType(std::string type)
Set the type of path loss model to be used for both DL and UL channels.
Definition: lte-helper.cc:289
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB antenna model to be created.
Definition: lte-helper.cc:322
ObjectFactory m_ueNetDeviceFactory
Factory for LteUeNetDevice objects.
Definition: lte-helper.h:661
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:375
virtual void DoInitialize(void)
Initialize() implementation.
Definition: lte-helper.cc:85
void EnableMacTraces(void)
Enable trace sinks for MAC layer.
Definition: lte-helper.cc:1190
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:1030
Ptr< RadioBearerStatsCalculator > m_pdcpStats
Container of PDCP layer statistics.
Definition: lte-helper.h:694
ObjectFactory m_ueAntennaModelFactory
Factory of antenna object for UE.
Definition: lte-helper.h:663
std::string GetFfrAlgorithmType() const
Definition: lte-helper.cc:246
This class is very useful when user needs to collect statistics from PDCD 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:260
ObjectFactory m_enbNetDeviceFactory
Factory of LteEnbNetDevice objects.
Definition: lte-helper.h:657
Ptr< SpectrumChannel > m_downlinkChannel
The downlink LTE channel used in the simulation.
Definition: lte-helper.h:642
std::string GetSchedulerType() const
Definition: lte-helper.cc:233
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
Definition: lte-helper.cc:307
bool m_useIdealRrc
The UseIdealRrc attribute.
Definition: lte-helper.h:722