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 SetFfrAlgorithmType (std::string type);
120 
125  std::string GetFfrAlgorithmType () const;
126 
133  void SetFfrAlgorithmAttribute (std::string n, const AttributeValue &v);
134 
139  void SetHandoverAlgorithmType (std::string type);
140 
145  std::string GetHandoverAlgorithmType () const;
146 
153  void SetHandoverAlgorithmAttribute (std::string n, const AttributeValue &v);
154 
161  void SetEnbDeviceAttribute (std::string n, const AttributeValue &v);
162 
167  void SetEnbAntennaModelType (std::string type);
168 
175  void SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v);
176 
183  void SetUeDeviceAttribute (std::string n, const AttributeValue &v);
184 
189  void SetUeAntennaModelType (std::string type);
190 
197  void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v);
198 
203  void SetSpectrumChannelType (std::string type);
204 
211  void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v);
212 
221 
230 
248  void Attach (NetDeviceContainer ueDevices);
249 
267  void Attach (Ptr<NetDevice> ueDevice);
268 
282  void Attach (NetDeviceContainer ueDevices, Ptr<NetDevice> enbDevice);
283 
296  void Attach (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
297 
312  void AttachToClosestEnb (NetDeviceContainer ueDevices, NetDeviceContainer enbDevices);
313 
328  void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
329 
338 
346  void ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer, Ptr<EpcTft> tft);
347 
348 
354  void AddX2Interface (NodeContainer enbNodes);
355 
362  void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
363 
376  void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev,
377  Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev);
378 
379 
387  void ActivateDataRadioBearer (NetDeviceContainer ueDevices, EpsBearer bearer);
388 
398  void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer);
399 
405  void SetFadingModel (std::string model);
406 
413  void SetFadingModelAttribute (std::string n, const AttributeValue &v);
414 
419  void EnableLogComponents (void);
420 
426  void EnableTraces (void);
427 
431  void EnablePhyTraces (void);
432 
433 
434 
438  void EnableDlPhyTraces (void);
439 
443  void EnableUlPhyTraces (void);
444 
448  void EnableDlTxPhyTraces (void);
449 
453  void EnableUlTxPhyTraces (void);
454 
458  void EnableDlRxPhyTraces (void);
459 
463  void EnableUlRxPhyTraces (void);
464 
468  void EnableMacTraces (void);
469 
473  void EnableDlMacTraces (void);
474 
478  void EnableUlMacTraces (void);
479 
483  void EnableRlcTraces (void);
484 
490 
494  void EnablePdcpTraces (void);
495 
501 
505  PER_BASED = 4};
506 
518  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
519 
520 protected:
521  // inherited from Object
522  virtual void DoInitialize (void);
523 
524 private:
531 
538 
550  void DoHandoverRequest (Ptr<NetDevice> ueDev,
551  Ptr<NetDevice> sourceEnbDev,
552  Ptr<NetDevice> targetEnbDev);
553 
556 
559 
568 
571 
573 
574  std::string m_fadingModelType;
578 
586 
588 
589  uint64_t m_imsiCounter;
590  uint16_t m_cellIdCounter;
591 
594 
596 };
597 
598 
599 } // namespace ns3
600 
601 
602 
603 #endif // LTE_HELPER_H
Ptr< Object > m_uplinkPathlossModel
Definition: lte-helper.h:558
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:95
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the pathloss model to be created
Definition: lte-helper.cc:299
void EnableDlRxPhyTraces(void)
Enable trace sinks for DL reception PHY layer.
Definition: lte-helper.cc:1092
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
RadioBearerStatsConnector m_radioBearerStatsConnector
Definition: lte-helper.h:585
Ptr< NetDevice > InstallSingleEnbDevice(Ptr< Node > n)
Create an eNodeB device (LteEnbNetDevice) on the given node.
Definition: lte-helper.cc:412
static TypeId GetTypeId(void)
Definition: lte-helper.cc:140
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
Definition: lte-helper.cc:382
void EnableLogComponents(void)
Enables logging for all components of the LENA architecture.
Definition: lte-helper.cc:973
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:940
bool m_fadingStreamsAssigned
Definition: lte-helper.h:577
ObjectFactory m_fadingModelFactory
Definition: lte-helper.h:575
Hold a value for an Attribute.
Definition: attribute.h:56
void EnableDlPhyTraces(void)
Enable trace sinks for DL PHY layer.
Definition: lte-helper.cc:1131
void SetUeAntennaModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the AntennaModel to be used for the UEs
Definition: lte-helper.cc:343
void SetFadingModel(std::string model)
Definition: lte-helper.cc:350
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:709
void EnableRlcTraces(void)
Enable trace sinks for RLC layer.
Definition: lte-helper.cc:1019
bool m_usePdschForCqiGeneration
Definition: lte-helper.h:595
Ptr< PhyStatsCalculator > m_phyStats
Definition: lte-helper.h:579
Ptr< PhyRxStatsCalculator > m_phyRxStats
Definition: lte-helper.h:581
std::string m_fadingModelType
Definition: lte-helper.h:574
void SetUeDeviceAttribute(std::string n, const AttributeValue &v)
set an attribute for the LteUeNetDevice to be created
Definition: lte-helper.cc:329
void SetUeAntennaModelType(std::string type)
Definition: lte-helper.cc:336
ObjectFactory m_propagationModelFactory
Definition: lte-helper.h:563
Ptr< MacStatsCalculator > m_macStats
Definition: lte-helper.h:582
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:1027
ObjectFactory m_ulPathlossModelFactory
Definition: lte-helper.h:570
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Call ActivateDataRadioBearer (ueDevice, bearer) for each UE device in a given set.
Definition: lte-helper.cc:963
ObjectFactory m_channelFactory
Definition: lte-helper.h:572
void SetHandoverAlgorithmType(std::string type)
Definition: lte-helper.cc:273
void EnableUlRxPhyTraces(void)
Enable trace sinks for UL reception PHY layer.
Definition: lte-helper.cc:1099
void SetFfrAlgorithmType(std::string type)
Definition: lte-helper.cc:252
void SetSchedulerType(std::string type)
Definition: lte-helper.cc:225
Ptr< RadioBearerStatsCalculator > m_rlcStats
Definition: lte-helper.h:583
std::string GetHandoverAlgorithmType() const
Definition: lte-helper.cc:267
void EnablePdcpTraces(void)
Enable trace sinks for PDCP layer.
Definition: lte-helper.cc:1156
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:785
Ptr< Object > m_downlinkPathlossModel
Definition: lte-helper.h:557
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:281
void DoHandoverRequest(Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
The actual function to trigger a manual handover.
Definition: lte-helper.cc:948
void EnableTraces(void)
Enables trace sinks for PHY, MAC, RLC and PDCP.
Definition: lte-helper.cc:1010
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
Definition: lte-helper.h:589
ObjectFactory m_enbAntennaModelFactory
Definition: lte-helper.h:565
holds a vector of ns3::NetDevice pointers
uint16_t m_cellIdCounter
Definition: lte-helper.h:590
void EnablePhyTraces(void)
Enable trace sinks for PHY layer.
Definition: lte-helper.cc:1067
bool m_isAnrEnabled
Definition: lte-helper.h:593
ObjectFactory m_handoverAlgorithmFactory
Definition: lte-helper.h:562
void SetEnbAntennaModelType(std::string type)
Definition: lte-helper.cc:315
ObjectFactory m_dlPathlossModelFactory
Definition: lte-helper.h:569
void SetSpectrumChannelType(std::string type)
Definition: lte-helper.cc:368
void SetFadingModelAttribute(std::string n, const AttributeValue &v)
set an attribute of the fading model
Definition: lte-helper.cc:362
void EnableDlMacTraces(void)
Enable trace sinks for DL MAC layer.
Definition: lte-helper.cc:1115
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:817
keep track of a set of node pointers.
void EnableUlTxPhyTraces(void)
Enable trace sinks for UL transmission PHY layer.
Definition: lte-helper.cc:1085
Ptr< SpectrumChannel > m_uplinkChannel
Definition: lte-helper.h:555
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
Definition: lte-helper.cc:915
ObjectFactory m_schedulerFactory
Definition: lte-helper.h:560
void EnableUlPhyTraces(void)
Enable trace sinks for UL PHY layer.
Definition: lte-helper.cc:1139
void EnableDlTxPhyTraces(void)
Enable trace sinks for DL transmission PHY layer.
Definition: lte-helper.cc:1078
Ptr< SpectrumPropagationLossModel > m_fadingModule
Definition: lte-helper.h:576
void EnableUlMacTraces(void)
Enable trace sinks for UL MAC layer.
Definition: lte-helper.cc:1123
Ptr< EpcHelper > m_epcHelper
Definition: lte-helper.h:587
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
Definition: lte-helper.cc:1150
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
Definition: lte-helper.h:580
Ptr< RadioBearerStatsCalculator > GetPdcpStats(void)
Definition: lte-helper.cc:1164
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: lte-helper.cc:208
instantiate subclasses of ns3::Object.
ObjectFactory m_ffrAlgorithmFactory
Definition: lte-helper.h:561
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)
Definition: lte-helper.cc:289
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
set an attribute for the AntennaModel to be used for the eNBs
Definition: lte-helper.cc:322
ObjectFactory m_ueNetDeviceFactory
Definition: lte-helper.h:566
void SetSpectrumChannelAttribute(std::string n, const AttributeValue &v)
set an attribute for the SpectrumChannel to be used for the UEs
Definition: lte-helper.cc:375
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:1107
a base class which provides memory management and object aggregation
Definition: object.h:64
Ptr< RadioBearerStatsCalculator > m_pdcpStats
Definition: lte-helper.h:584
ObjectFactory m_ueAntennaModelFactory
Definition: lte-helper.h:567
std::string GetFfrAlgorithmType() const
Definition: lte-helper.cc:246
a unique identifier for an interface.
Definition: type-id.h:49
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
Definition: lte-helper.h:564
Ptr< SpectrumChannel > m_downlinkChannel
Definition: lte-helper.h:554
std::string GetSchedulerType() const
Definition: lte-helper.cc:233
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
set an attribute for the LteEnbNetDevice to be created
Definition: lte-helper.cc:307
bool m_useIdealRrc
Definition: lte-helper.h:592