A Discrete-Event Network Simulator
API
lena-rlc-traces.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Manuel Requena <manuel.requena@cttc.es>
18  */
19 
20 #include "ns3/config-store-module.h"
21 #include "ns3/core-module.h"
22 #include "ns3/lte-module.h"
23 #include "ns3/mobility-module.h"
24 #include "ns3/network-module.h"
25 
26 using namespace ns3;
27 
28 int
29 main(int argc, char* argv[])
30 {
31  // Command line arguments
32  CommandLine cmd(__FILE__);
33  cmd.Parse(argc, argv);
34 
35  ConfigStore inputConfig;
36  inputConfig.ConfigureDefaults();
37 
38  // parse again so you can override default values from the command line
39  cmd.Parse(argc, argv);
40 
41  Ptr<LteHelper> lteHelper = CreateObject<LteHelper>();
42 
43  lteHelper->SetAttribute("PathlossModel", StringValue("ns3::FriisSpectrumPropagationLossModel"));
44  // Enable LTE log components
45  // lteHelper->EnableLogComponents ();
46 
47  // Create Nodes: eNodeB and UE
48  NodeContainer enbNodes;
49  NodeContainer ueNodes;
50  enbNodes.Create(1);
51  ueNodes.Create(3);
52 
53  // Install Mobility Model
55  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
56  mobility.Install(enbNodes);
57  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
58  mobility.Install(ueNodes);
59 
60  // Create Devices and install them in the Nodes (eNB and UE)
61  NetDeviceContainer enbDevs;
62  NetDeviceContainer ueDevs;
63  enbDevs = lteHelper->InstallEnbDevice(enbNodes);
64  ueDevs = lteHelper->InstallUeDevice(ueNodes);
65 
66  // Attach a UE to a eNB
67  lteHelper->Attach(ueDevs, enbDevs.Get(0));
68 
69  // Activate an EPS bearer
71  EpsBearer bearer(q);
72  lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
73 
75 
76  lteHelper->EnablePhyTraces();
77  lteHelper->EnableMacTraces();
78  lteHelper->EnableRlcTraces();
79 
80  double distance_temp[] = {1000, 1000, 1000};
81  std::vector<double> userDistance;
82  userDistance.assign(distance_temp, distance_temp + 3);
83  for (int i = 0; i < 3; i++)
84  {
87  mm->SetPosition(Vector(userDistance[i], 0.0, 0.0));
88  }
89 
91 
92  // Uncomment to show available paths
93  // GtkConfigStore config;
94  // config.ConfigureAttributes ();
95 
97 
98  return 0;
99 }
Parse command-line arguments.
Definition: command-line.h:232
void ConfigureDefaults()
Configure the default values.
Mobility model for which the current position does not change once it has been set and until it is se...
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
Qci
QoS Class Indicator.
Definition: eps-bearer.h:106
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition: eps-bearer.h:107
void EnablePhyTraces()
Enable trace sinks for PHY layer.
Definition: lte-helper.cc:1616
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:485
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:1039
void EnableRlcTraces()
Enable trace sinks for RLC layer.
Definition: lte-helper.cc:1558
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
Definition: lte-helper.cc:1436
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:500
void EnableMacTraces()
Enable trace sinks for MAC layer.
Definition: lte-helper.cc:1659
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:204
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition: object.h:471
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:142
static void Run()
Run the simulation.
Definition: simulator.cc:178
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:186
Hold variables of type string.
Definition: string.h:56
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Every class exported by the ns3 library is enclosed in the ns3 namespace.
cmd
Definition: second.py:40
mobility
Definition: third.py:105