A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Manuel Requena <manuel.requena@cttc.es>
7 */
8
9#include "ns3/config-store-module.h"
10#include "ns3/core-module.h"
11#include "ns3/lte-module.h"
12#include "ns3/mobility-module.h"
13#include "ns3/network-module.h"
14
15using namespace ns3;
16
17int
18main(int argc, char* argv[])
19{
20 // Command line arguments
21 CommandLine cmd(__FILE__);
22 cmd.Parse(argc, argv);
23
24 ConfigStore inputConfig;
25 inputConfig.ConfigureDefaults();
26
27 // parse again so you can override default values from the command line
28 cmd.Parse(argc, argv);
29
31
32 lteHelper->SetAttribute("PathlossModel", StringValue("ns3::FriisSpectrumPropagationLossModel"));
33 // Enable LTE log components
34 // lteHelper->EnableLogComponents ();
35
36 // Create Nodes: eNodeB and UE
37 NodeContainer enbNodes;
38 NodeContainer ueNodes;
39 enbNodes.Create(1);
40 ueNodes.Create(3);
41
42 // Install Mobility Model
44 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
45 mobility.Install(enbNodes);
46 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
47 mobility.Install(ueNodes);
48
49 // Create Devices and install them in the Nodes (eNB and UE)
50 NetDeviceContainer enbDevs;
51 NetDeviceContainer ueDevs;
52 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
53 ueDevs = lteHelper->InstallUeDevice(ueNodes);
54
55 // Attach a UE to a eNB
56 lteHelper->Attach(ueDevs, enbDevs.Get(0));
57
58 // Activate an EPS bearer
60 EpsBearer bearer(q);
61 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
62
64
65 lteHelper->EnablePhyTraces();
66 lteHelper->EnableMacTraces();
67 lteHelper->EnableRlcTraces();
68
69 double distance_temp[] = {1000, 1000, 1000};
70 std::vector<double> userDistance;
71 userDistance.assign(distance_temp, distance_temp + 3);
72 for (int i = 0; i < 3; i++)
73 {
76 mm->SetPosition(Vector(userDistance[i], 0.0, 0.0));
77 }
78
80
81 // Uncomment to show available paths
82 // GtkConfigStore config;
83 // config.ConfigureAttributes ();
84
86
87 return 0;
88}
Parse command-line arguments.
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:80
Qci
QoS Class Indicator.
Definition eps-bearer.h:95
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition eps-bearer.h:96
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.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition object.h:511
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:131
static void Run()
Run the simulation.
Definition simulator.cc:167
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:175
Hold variables of type string.
Definition string.h:45
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mobility
Definition third.py:92