A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
lena-rlc-traces.cc
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: Manuel Requena <manuel.requena@cttc.es>
19
*/
20
21
22
#include "ns3/core-module.h"
23
#include "ns3/network-module.h"
24
#include "ns3/mobility-module.h"
25
#include "ns3/lte-module.h"
26
#include "ns3/config-store-module.h"
27
28
29
using namespace
ns3;
30
31
int
main
(
int
argc,
char
*argv[])
32
{
33
// Command line arguments
34
CommandLine
cmd;
35
cmd.
Parse
(argc, argv);
36
37
ConfigStore
inputConfig;
38
inputConfig.
ConfigureDefaults
();
39
40
// parse again so you can override default values from the command line
41
cmd.
Parse
(argc, argv);
42
43
Ptr<LteHelper>
lteHelper = CreateObject<LteHelper> ();
44
45
lteHelper->
SetAttribute
(
"PathlossModel"
,
StringValue
(
"ns3::FriisSpectrumPropagationLossModel"
));
46
// Enable LTE log components
47
//lteHelper->EnableLogComponents ();
48
49
// Create Nodes: eNodeB and UE
50
NodeContainer
enbNodes;
51
NodeContainer
ueNodes;
52
enbNodes.
Create
(1);
53
ueNodes.
Create
(3);
54
55
// Install Mobility Model
56
MobilityHelper
mobility;
57
mobility.
SetMobilityModel
(
"ns3::ConstantPositionMobilityModel"
);
58
mobility.
Install
(enbNodes);
59
mobility.
SetMobilityModel
(
"ns3::ConstantPositionMobilityModel"
);
60
mobility.
Install
(ueNodes);
61
62
// Create Devices and install them in the Nodes (eNB and UE)
63
NetDeviceContainer
enbDevs;
64
NetDeviceContainer
ueDevs;
65
enbDevs = lteHelper->
InstallEnbDevice
(enbNodes);
66
ueDevs = lteHelper->
InstallUeDevice
(ueNodes);
67
68
// Attach a UE to a eNB
69
lteHelper->
Attach
(ueDevs, enbDevs.
Get
(0));
70
71
// Activate an EPS bearer
72
enum
EpsBearer::Qci
q =
EpsBearer::GBR_CONV_VOICE
;
73
EpsBearer
bearer (q);
74
lteHelper->
ActivateDataRadioBearer
(ueDevs, bearer);
75
76
Simulator::Stop
(
Seconds
(2));
77
78
lteHelper->
EnablePhyTraces
();
79
lteHelper->
EnableMacTraces
();
80
lteHelper->
EnableRlcTraces
();
81
82
83
double
distance_temp [] = { 1000,1000,1000};
84
std::vector<double> userDistance;
85
userDistance.assign (distance_temp, distance_temp + 3);
86
for
(
int
i = 0; i < 3; i++)
87
{
88
Ptr<ConstantPositionMobilityModel>
mm = ueNodes.
Get
(i)->
GetObject
<
ConstantPositionMobilityModel
> ();
89
mm->
SetPosition
(
Vector
(userDistance[i], 0.0, 0.0));
90
}
91
92
Simulator::Run
();
93
94
// Uncomment to show available paths
95
// GtkConfigStore config;
96
// config.ConfigureAttributes ();
97
98
Simulator::Destroy
();
99
100
return
0;
101
}
src
lte
examples
lena-rlc-traces.cc
Generated on Tue May 14 2013 11:08:24 for ns-3 by
1.8.1.2