A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
55 class LteHelper : public Object
56 {
57 public:
58  LteHelper (void);
59  virtual ~LteHelper (void);
60 
61  static TypeId GetTypeId (void);
62  virtual void DoDispose (void);
63 
64 
79 
85  void SetPathlossModelType (std::string type);
86 
93  void SetPathlossModelAttribute (std::string n, const AttributeValue &v);
94 
99  void SetSchedulerType (std::string type);
100 
105  std::string GetSchedulerType () const;
106 
113  void SetSchedulerAttribute (std::string n, const AttributeValue &v);
114 
119  void SetHandoverAlgorithmType (std::string type);
120 
125  std::string GetHandoverAlgorithmType () const;
126 
133  void SetHandoverAlgorithmAttribute (std::string n, const AttributeValue &v);
134 
141  void SetEnbDeviceAttribute (std::string n, const AttributeValue &v);
142 
147  void SetEnbAntennaModelType (std::string type);
148 
155  void SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v);
156 
163  void SetUeDeviceAttribute (std::string n, const AttributeValue &v);
164 
169  void SetUeAntennaModelType (std::string type);
170 
177  void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v);
178 
183  void SetSpectrumChannelType (std::string type);
184 
191  void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v);
192 
201 
210 
228  void Attach (NetDeviceContainer ueDevices);
229 
247  void Attach (Ptr<NetDevice> ueDevice);
248 
262  void Attach (NetDeviceContainer ueDevices, Ptr<NetDevice> enbDevice);
263 
276  void Attach (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
277 
292  void AttachToClosestEnb (NetDeviceContainer ueDevices, NetDeviceContainer enbDevices);
293 
308  void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
309 
318 
326  void ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer, Ptr<EpcTft> tft);
327 
328 
334  void AddX2Interface (NodeContainer enbNodes);
335 
342  void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
343 
356  void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev,
357  Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev);
358 
359 
367  void ActivateDataRadioBearer (NetDeviceContainer ueDevices, EpsBearer bearer);
368 
378  void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer);
379 
385  void SetFadingModel (std::string model);
386 
393  void SetFadingModelAttribute (std::string n, const AttributeValue &v);
394 
399  void EnableLogComponents (void);
400 
406  void EnableTraces (void);
407 
411  void EnablePhyTraces (void);
412 
413 
414 
418  void EnableDlPhyTraces (void);
419 
423  void EnableUlPhyTraces (void);
424 
428  void EnableDlTxPhyTraces (void);
429 
433  void EnableUlTxPhyTraces (void);
434 
438  void EnableDlRxPhyTraces (void);
439 
443  void EnableUlRxPhyTraces (void);
444 
448  void EnableMacTraces (void);
449 
453  void EnableDlMacTraces (void);
454 
458  void EnableUlMacTraces (void);
459 
463  void EnableRlcTraces (void);
464 
470 
474  void EnablePdcpTraces (void);
475 
481 
485  PER_BASED = 4};
486 
498  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
499 
500 protected:
501  // inherited from Object
502  virtual void DoInitialize (void);
503 
504 private:
511 
518 
530  void DoHandoverRequest (Ptr<NetDevice> ueDev,
531  Ptr<NetDevice> sourceEnbDev,
532  Ptr<NetDevice> targetEnbDev);
533 
536 
539 
547 
550 
552 
553  std::string m_fadingModelType;
557 
565 
567 
568  uint64_t m_imsiCounter;
569  uint16_t m_cellIdCounter;
570 
573 };
574 
575 
576 } // namespace ns3
577 
578 
579 
580 #endif // LTE_HELPER_H
Ptr< Object > m_uplinkPathlossModel
Definition: lte-helper.h:538
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the pathloss model to be created
Definition: lte-helper.cc:264
void EnableDlRxPhyTraces(void)
Enable trace sinks for DL reception PHY layer.
Definition: lte-helper.cc:1030
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
RadioBearerStatsConnector m_radioBearerStatsConnector
Definition: lte-helper.h:564
Ptr< NetDevice > InstallSingleEnbDevice(Ptr< Node > n)
Create an eNodeB device (LteEnbNetDevice) on the given node.
Definition: lte-helper.cc:377
static TypeId GetTypeId(void)
Definition: lte-helper.cc:140
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
Definition: lte-helper.cc:347
void EnableLogComponents(void)
Enables logging for all components of the LENA architecture.
Definition: lte-helper.cc:911
void HandoverRequest(Time hoTime, Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
Manually trigger an X2-based handover of a UE between two eNBs at a specific simulation time...
Definition: lte-helper.cc:878
bool m_fadingStreamsAssigned
Definition: lte-helper.h:556
ObjectFactory m_fadingModelFactory
Definition: lte-helper.h:554
Hold a value for an Attribute.
Definition: attribute.h:56
void EnableDlPhyTraces(void)
Enable trace sinks for DL PHY layer.
Definition: lte-helper.cc:1069
void SetUeAntennaModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the AntennaModel to be used for the UEs
Definition: lte-helper.cc:308
void SetFadingModel(std::string model)
Definition: lte-helper.cc:315
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:647
void EnableRlcTraces(void)
Enable trace sinks for RLC layer.
Definition: lte-helper.cc:957
Ptr< PhyStatsCalculator > m_phyStats
Definition: lte-helper.h:558
Ptr< PhyRxStatsCalculator > m_phyRxStats
Definition: lte-helper.h:560
std::string m_fadingModelType
Definition: lte-helper.h:553
void SetUeDeviceAttribute(std::string n, const AttributeValue &v)
set an attribute for the LteUeNetDevice to be created
Definition: lte-helper.cc:294
void SetUeAntennaModelType(std::string type)
Definition: lte-helper.cc:301
ObjectFactory m_propagationModelFactory
Definition: lte-helper.h:542
Ptr< MacStatsCalculator > m_macStats
Definition: lte-helper.h:561
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition: lte-helper.cc:965
ObjectFactory m_ulPathlossModelFactory
Definition: lte-helper.h:549
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Call ActivateDataRadioBearer (ueDevice, bearer) for each UE device in a given set.
Definition: lte-helper.cc:901
ObjectFactory m_channelFactory
Definition: lte-helper.h:551
void SetHandoverAlgorithmType(std::string type)
Definition: lte-helper.cc:238
void EnableUlRxPhyTraces(void)
Enable trace sinks for UL reception PHY layer.
Definition: lte-helper.cc:1037
void SetSchedulerType(std::string type)
Definition: lte-helper.cc:211
Ptr< RadioBearerStatsCalculator > m_rlcStats
Definition: lte-helper.h:562
std::string GetHandoverAlgorithmType() const
Definition: lte-helper.cc:232
void EnablePdcpTraces(void)
Enable trace sinks for PDCP layer.
Definition: lte-helper.cc:1094
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:723
Ptr< Object > m_downlinkPathlossModel
Definition: lte-helper.h:537
Creation and configuration of LTE entities.
Definition: lte-helper.h:55
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
void SetHandoverAlgorithmAttribute(std::string n, const AttributeValue &v)
set an attribute for the handover algorithm to be created
Definition: lte-helper.cc:246
void DoHandoverRequest(Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
The actual function to trigger a manual handover.
Definition: lte-helper.cc:886
void EnableTraces(void)
Enables trace sinks for PHY, MAC, RLC and PDCP.
Definition: lte-helper.cc:948
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
set an attribute for the scheduler to be created
Definition: lte-helper.cc:225
Ptr< NetDevice > InstallSingleUeDevice(Ptr< Node > n)
Create a UE device (LteUeNetDevice) on the given node.
Definition: lte-helper.cc:535
uint64_t m_imsiCounter
Definition: lte-helper.h:568
ObjectFactory m_enbAntennaModelFactory
Definition: lte-helper.h:544
holds a vector of ns3::NetDevice pointers
uint16_t m_cellIdCounter
Definition: lte-helper.h:569
void EnablePhyTraces(void)
Enable trace sinks for PHY layer.
Definition: lte-helper.cc:1005
bool m_isAnrEnabled
Definition: lte-helper.h:572
ObjectFactory m_handoverAlgorithmFactory
Definition: lte-helper.h:541
void SetEnbAntennaModelType(std::string type)
Definition: lte-helper.cc:280
ObjectFactory m_dlPathlossModelFactory
Definition: lte-helper.h:548
void SetSpectrumChannelType(std::string type)
Definition: lte-helper.cc:333
void SetFadingModelAttribute(std::string n, const AttributeValue &v)
set an attribute of the fading model
Definition: lte-helper.cc:327
void EnableDlMacTraces(void)
Enable trace sinks for DL MAC layer.
Definition: lte-helper.cc:1053
void ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
Definition: lte-helper.cc:755
keep track of a set of node pointers.
void EnableUlTxPhyTraces(void)
Enable trace sinks for UL transmission PHY layer.
Definition: lte-helper.cc:1023
Ptr< SpectrumChannel > m_uplinkChannel
Definition: lte-helper.h:535
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
Definition: lte-helper.cc:853
ObjectFactory m_schedulerFactory
Definition: lte-helper.h:540
void EnableUlPhyTraces(void)
Enable trace sinks for UL PHY layer.
Definition: lte-helper.cc:1077
void EnableDlTxPhyTraces(void)
Enable trace sinks for DL transmission PHY layer.
Definition: lte-helper.cc:1016
Ptr< SpectrumPropagationLossModel > m_fadingModule
Definition: lte-helper.h:555
void EnableUlMacTraces(void)
Enable trace sinks for UL MAC layer.
Definition: lte-helper.cc:1061
Ptr< EpcHelper > m_epcHelper
Definition: lte-helper.h:566
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
Definition: lte-helper.cc:1088
virtual ~LteHelper(void)
Definition: lte-helper.cc:135
NetDeviceContainer InstallUeDevice(NodeContainer c)
create a set of UE devices
Definition: lte-helper.cc:362
Ptr< PhyTxStatsCalculator > m_phyTxStats
Definition: lte-helper.h:559
Ptr< RadioBearerStatsCalculator > GetPdcpStats(void)
Definition: lte-helper.cc:1102
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: lte-helper.cc:194
instantiate subclasses of ns3::Object.
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:204
void SetPathlossModelType(std::string type)
Definition: lte-helper.cc:254
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the AntennaModel to be used for the eNBs
Definition: lte-helper.cc:287
ObjectFactory m_ueNetDeviceFactory
Definition: lte-helper.h:545
void SetSpectrumChannelAttribute(std::string n, const AttributeValue &v)
set an attribute for the SpectrumChannel to be used for the UEs
Definition: lte-helper.cc:340
virtual void DoInitialize(void)
This method is called only once by Object::Initialize.
Definition: lte-helper.cc:85
void EnableMacTraces(void)
Enable trace sinks for MAC layer.
Definition: lte-helper.cc:1045
a base class which provides memory management and object aggregation
Definition: object.h:63
Ptr< RadioBearerStatsCalculator > m_pdcpStats
Definition: lte-helper.h:563
ObjectFactory m_ueAntennaModelFactory
Definition: lte-helper.h:546
a unique identifier for an interface.
Definition: type-id.h:49
ObjectFactory m_enbNetDeviceFactory
Definition: lte-helper.h:543
Ptr< SpectrumChannel > m_downlinkChannel
Definition: lte-helper.h:534
std::string GetSchedulerType() const
Definition: lte-helper.cc:219
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
set an attribute for the LteEnbNetDevice to be created
Definition: lte-helper.cc:272
bool m_useIdealRrc
Definition: lte-helper.h:571