A Discrete-Event Network Simulator
API
lena-distributed-ffr.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Piotr Gawlowicz
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: Piotr Gawlowicz <gawlowicz.p@gmail.com>
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/spectrum-module.h"
27 #include "ns3/config-store.h"
28 #include <ns3/buildings-helper.h>
29 #include "ns3/point-to-point-epc-helper.h"
30 #include "ns3/internet-module.h"
31 #include "ns3/point-to-point-module.h"
32 #include "ns3/applications-module.h"
33 #include "ns3/log.h"
34 
35 using namespace ns3;
36 
37 NS_LOG_COMPONENT_DEFINE ("LenaDistributedFrequencyReuse");
38 
39 void
40 PrintGnuplottableUeListToFile (std::string filename)
41 {
42  std::ofstream outFile;
43  outFile.open (filename.c_str (), std::ios_base::out | std::ios_base::trunc);
44  if (!outFile.is_open ())
45  {
46  NS_LOG_ERROR ("Can't open file " << filename);
47  return;
48  }
49  for (NodeList::Iterator it = NodeList::Begin (); it != NodeList::End (); ++it)
50  {
51  Ptr<Node> node = *it;
52  int nDevs = node->GetNDevices ();
53  for (int j = 0; j < nDevs; j++)
54  {
55  Ptr<LteUeNetDevice> uedev = node->GetDevice (j)->GetObject <LteUeNetDevice> ();
56  if (uedev)
57  {
58  Vector pos = node->GetObject<MobilityModel> ()->GetPosition ();
59  outFile << "set label \"" << uedev->GetImsi ()
60  << "\" at " << pos.x << "," << pos.y << " left font \"Helvetica,4\" textcolor rgb \"grey\" front point pt 1 ps 0.3 lc rgb \"grey\" offset 0,0"
61  << std::endl;
62  }
63  }
64  }
65 }
66 
67 void
68 PrintGnuplottableEnbListToFile (std::string filename)
69 {
70  std::ofstream outFile;
71  outFile.open (filename.c_str (), std::ios_base::out | std::ios_base::trunc);
72  if (!outFile.is_open ())
73  {
74  NS_LOG_ERROR ("Can't open file " << filename);
75  return;
76  }
77  for (NodeList::Iterator it = NodeList::Begin (); it != NodeList::End (); ++it)
78  {
79  Ptr<Node> node = *it;
80  int nDevs = node->GetNDevices ();
81  for (int j = 0; j < nDevs; j++)
82  {
83  Ptr<LteEnbNetDevice> enbdev = node->GetDevice (j)->GetObject <LteEnbNetDevice> ();
84  if (enbdev)
85  {
86  Vector pos = node->GetObject<MobilityModel> ()->GetPosition ();
87  outFile << "set label \"" << enbdev->GetCellId ()
88  << "\" at " << pos.x << "," << pos.y
89  << " left font \"Helvetica,4\" textcolor rgb \"white\" front point pt 2 ps 0.3 lc rgb \"white\" offset 0,0"
90  << std::endl;
91  }
92  }
93  }
94 }
95 
96 int main (int argc, char *argv[])
97 {
98  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (true));
99  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (true));
100  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
101  Config::SetDefault ("ns3::LteHelper::UsePdschForCqiGeneration", BooleanValue (true));
102 
103  //Uplink Power Control
104  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (true));
105  Config::SetDefault ("ns3::LteUePowerControl::ClosedLoop", BooleanValue (true));
106  Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
107 
108  uint32_t runId = 3;
109  uint16_t numberOfRandomUes = 0;
110  double simTime = 5.000;
111  bool generateSpectrumTrace = false;
112  bool generateRem = false;
113  int32_t remRbId = -1;
114  uint8_t bandwidth = 25;
115  double distance = 1000;
116  Box macroUeBox = Box (-distance * 0.5, distance * 1.5, -distance * 0.5, distance * 1.5, 1.5, 1.5);
117 
118  // Command line arguments
120  cmd.AddValue ("numberOfUes", "Number of UEs", numberOfRandomUes);
121  cmd.AddValue ("simTime", "Total duration of the simulation (in seconds)", simTime);
122  cmd.AddValue ("generateSpectrumTrace", "if true, will generate a Spectrum Analyzer trace", generateSpectrumTrace);
123  cmd.AddValue ("generateRem", "if true, will generate a REM and then abort the simulation", generateRem);
124  cmd.AddValue ("remRbId", "Resource block Id, for which REM will be generated,"
125  "default value is -1, what means REM will be averaged from all RBs", remRbId);
126  cmd.AddValue ("runId", "runId", runId);
127  cmd.Parse (argc, argv);
128 
130  RngSeedManager::SetRun (runId);
131 
132  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
133  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
134  lteHelper->SetEpcHelper (epcHelper);
135  lteHelper->SetHandoverAlgorithmType ("ns3::NoOpHandoverAlgorithm"); // disable automatic handover
136 
137  Ptr<Node> pgw = epcHelper->GetPgwNode ();
138 
139  // Create a single RemoteHost
140  NodeContainer remoteHostContainer;
141  remoteHostContainer.Create (1);
142  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
143  InternetStackHelper internet;
144  internet.Install (remoteHostContainer);
145 
146  // Create the Internet
147  PointToPointHelper p2ph;
148  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
149  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
150  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
151  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
152  Ipv4AddressHelper ipv4h;
153  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
154  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
155  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
156 
157  // Routing of the Internet Host (towards the LTE network)
158  Ipv4StaticRoutingHelper ipv4RoutingHelper;
159  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
160  // interface 0 is localhost, 1 is the p2p device
161  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
162 
163  // Create Nodes: eNodeB and UE
164  NodeContainer enbNodes;
165  NodeContainer randomUeNodes;
166  enbNodes.Create (3);
167  randomUeNodes.Create (numberOfRandomUes);
168 
169  /* the topology is the following:
170  * eNB3
171  * / \
172  * / \
173  * / \
174  * / \
175  * distance / \ distance
176  * / UEs \
177  * / \
178  * / \
179  * / \
180  * / \
181  * eNB1-------------------------eNB2
182  * distance
183  */
184 
185  // Install Mobility Model
186  Ptr<ListPositionAllocator> enbPositionAlloc = CreateObject<ListPositionAllocator> ();
187  enbPositionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
188  enbPositionAlloc->Add (Vector (distance, 0.0, 0.0)); // eNB2
189  enbPositionAlloc->Add (Vector (distance * 0.5, distance * 0.866, 0.0)); // eNB3
191  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
192  mobility.SetPositionAllocator (enbPositionAlloc);
193  mobility.Install (enbNodes);
194 
195  Ptr<RandomBoxPositionAllocator> randomUePositionAlloc = CreateObject<RandomBoxPositionAllocator> ();
196  Ptr<UniformRandomVariable> xVal = CreateObject<UniformRandomVariable> ();
197  xVal->SetAttribute ("Min", DoubleValue (macroUeBox.xMin));
198  xVal->SetAttribute ("Max", DoubleValue (macroUeBox.xMax));
199  randomUePositionAlloc->SetAttribute ("X", PointerValue (xVal));
200  Ptr<UniformRandomVariable> yVal = CreateObject<UniformRandomVariable> ();
201  yVal->SetAttribute ("Min", DoubleValue (macroUeBox.yMin));
202  yVal->SetAttribute ("Max", DoubleValue (macroUeBox.yMax));
203  randomUePositionAlloc->SetAttribute ("Y", PointerValue (yVal));
204  Ptr<UniformRandomVariable> zVal = CreateObject<UniformRandomVariable> ();
205  zVal->SetAttribute ("Min", DoubleValue (macroUeBox.zMin));
206  zVal->SetAttribute ("Max", DoubleValue (macroUeBox.zMax));
207  randomUePositionAlloc->SetAttribute ("Z", PointerValue (zVal));
208  mobility.SetPositionAllocator (randomUePositionAlloc);
209  mobility.Install (randomUeNodes);
210 
211  // Create Devices and install them in the Nodes (eNB and UE)
212  NetDeviceContainer enbDevs;
213  NetDeviceContainer randomUeDevs;
214  lteHelper->SetSchedulerType ("ns3::PfFfMacScheduler");
215  lteHelper->SetSchedulerAttribute ("HarqEnabled", BooleanValue (true));
216 
217  lteHelper->SetEnbDeviceAttribute ("DlBandwidth", UintegerValue (bandwidth));
218  lteHelper->SetEnbDeviceAttribute ("UlBandwidth", UintegerValue (bandwidth));
219 
220  lteHelper->SetFfrAlgorithmType ("ns3::LteFfrDistributedAlgorithm");
221  lteHelper->SetFfrAlgorithmAttribute ("CalculationInterval", TimeValue (MilliSeconds (200)));
222  lteHelper->SetFfrAlgorithmAttribute ("RsrpDifferenceThreshold", UintegerValue (5));
223  lteHelper->SetFfrAlgorithmAttribute ("RsrqThreshold", UintegerValue (25));
224  lteHelper->SetFfrAlgorithmAttribute ("EdgeRbNum", UintegerValue (6));
225  lteHelper->SetFfrAlgorithmAttribute ("CenterPowerOffset",
227  lteHelper->SetFfrAlgorithmAttribute ("EdgePowerOffset",
229 
230  lteHelper->SetFfrAlgorithmAttribute ("CenterAreaTpc", UintegerValue (0));
231  lteHelper->SetFfrAlgorithmAttribute ("EdgeAreaTpc", UintegerValue (3));
232 
233  //ns3::LteFfrDistributedAlgorithm works with Absolute Mode Uplink Power Control
234  Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
235 
236  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
237  randomUeDevs = lteHelper->InstallUeDevice (randomUeNodes);
238 
239  // Add X2 inteface
240  lteHelper->AddX2Interface (enbNodes);
241 
242 
243  NodeContainer ueNodes;
244  ueNodes.Add (randomUeNodes);
245  NetDeviceContainer ueDevs;
246  ueDevs.Add (randomUeDevs);
247 
248  // Install the IP stack on the UEs
249  internet.Install (ueNodes);
250  Ipv4InterfaceContainer ueIpIfaces;
251  ueIpIfaces = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueDevs));
252 
253  // Attach a UE to a eNB
254  lteHelper->AttachToClosestEnb (ueDevs, enbDevs);
255 
256  // Install and start applications on UEs and remote host
257  uint16_t dlPort = 10000;
258  uint16_t ulPort = 20000;
259 
260  // randomize a bit start times to avoid simulation artifacts
261  // (e.g., buffer overflows due to packet transmissions happening
262  // exactly at the same time)
263  Ptr<UniformRandomVariable> startTimeSeconds = CreateObject<UniformRandomVariable> ();
264  startTimeSeconds->SetAttribute ("Min", DoubleValue (0));
265  startTimeSeconds->SetAttribute ("Max", DoubleValue (0.010));
266 
267  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
268  {
269  Ptr<Node> ue = ueNodes.Get (u);
270  // Set the default gateway for the UE
271  Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ue->GetObject<Ipv4> ());
272  ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
273 
274  for (uint32_t b = 0; b < 1; ++b)
275  {
276  ++dlPort;
277  ++ulPort;
278 
281 
282  UdpClientHelper dlClientHelper (ueIpIfaces.GetAddress (u), dlPort);
283  dlClientHelper.SetAttribute ("MaxPackets", UintegerValue (1000000));
284  dlClientHelper.SetAttribute ("Interval", TimeValue (MilliSeconds (1.0)));
285  clientApps.Add (dlClientHelper.Install (remoteHost));
286  PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory",
288  serverApps.Add (dlPacketSinkHelper.Install (ue));
289 
290 
291  UdpClientHelper ulClientHelper (remoteHostAddr, ulPort);
292  ulClientHelper.SetAttribute ("MaxPackets", UintegerValue (1000000));
293  ulClientHelper.SetAttribute ("Interval", TimeValue (MilliSeconds (1.0)));
294  clientApps.Add (ulClientHelper.Install (ue));
295  PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory",
297  serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
298 
299  Ptr<EpcTft> tft = Create<EpcTft> ();
301  dlpf.localPortStart = dlPort;
302  dlpf.localPortEnd = dlPort;
303  tft->Add (dlpf);
305  ulpf.remotePortStart = ulPort;
306  ulpf.remotePortEnd = ulPort;
307  tft->Add (ulpf);
309  lteHelper->ActivateDedicatedEpsBearer (ueDevs.Get (u), bearer, tft);
310 
311  Time startTime = Seconds (startTimeSeconds->GetValue ());
312  serverApps.Start (startTime);
313  clientApps.Start (startTime);
314  }
315  }
316 
317  //Spectrum analyzer
318  NodeContainer spectrumAnalyzerNodes;
319  spectrumAnalyzerNodes.Create (1);
320  SpectrumAnalyzerHelper spectrumAnalyzerHelper;
321 
322  if (generateSpectrumTrace)
323  {
324  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
325  //position of Spectrum Analyzer
326  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
327 // positionAlloc->Add (Vector (distance, 0.0, 0.0)); // eNB2
328 // positionAlloc->Add (Vector (distance*0.5, distance*0.866, 0.0)); // eNB3
329 
331  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
332  mobility.SetPositionAllocator (positionAlloc);
333  mobility.Install (spectrumAnalyzerNodes);
334 
335  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
336  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
337 
338  spectrumAnalyzerHelper.SetChannel (dlChannel);
340  spectrumAnalyzerHelper.SetRxSpectrumModel (sm);
341  spectrumAnalyzerHelper.SetPhyAttribute ("Resolution", TimeValue (MicroSeconds (10)));
342  spectrumAnalyzerHelper.SetPhyAttribute ("NoisePowerSpectralDensity", DoubleValue (1e-15)); // -120 dBm/Hz
343  spectrumAnalyzerHelper.EnableAsciiAll ("spectrum-analyzer-output");
344  spectrumAnalyzerHelper.Install (spectrumAnalyzerNodes);
345  }
346 
348  if (generateRem)
349  {
350  PrintGnuplottableEnbListToFile ("enbs.txt");
351  PrintGnuplottableUeListToFile ("ues.txt");
352 
353  remHelper = CreateObject<RadioEnvironmentMapHelper> ();
354  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
355  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
356  uint32_t dlChannelId = dlChannel->GetId ();
357  NS_LOG_INFO ("DL ChannelId: " << dlChannelId);
358  remHelper->SetAttribute ("ChannelPath", StringValue ("/ChannelList/1"));
359  remHelper->SetAttribute ("OutputFile", StringValue ("lena-frequency-reuse.rem"));
360  remHelper->SetAttribute ("XMin", DoubleValue (macroUeBox.xMin));
361  remHelper->SetAttribute ("XMax", DoubleValue (macroUeBox.xMax));
362  remHelper->SetAttribute ("YMin", DoubleValue (macroUeBox.yMin));
363  remHelper->SetAttribute ("YMax", DoubleValue (macroUeBox.yMax));
364  remHelper->SetAttribute ("Z", DoubleValue (1.5));
365  remHelper->SetAttribute ("XRes", UintegerValue (500));
366  remHelper->SetAttribute ("YRes", UintegerValue (500));
367 
368  if (remRbId >= 0)
369  {
370  remHelper->SetAttribute ("UseDataChannel", BooleanValue (true));
371  remHelper->SetAttribute ("RbId", IntegerValue (remRbId));
372  }
373 
374  remHelper->Install ();
375  // simulation will stop right after the REM has been generated
376  }
377  else
378  {
379  Simulator::Stop (Seconds (simTime));
380  }
381 
382  Simulator::Run ();
384  return 0;
385 }
Class to allow the Spectrum Analysis.
holds a vector of ns3::Application pointers.
uint8_t Add(PacketFilter f)
add a PacketFilter to the Traffic Flow Template
Definition: epc-tft.cc:171
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
an Inet address class
static Ipv4Address GetAny(void)
double zMin
The z coordinate of the down bound of the box.
Definition: box.h:101
AttributeValue implementation for Boolean.
Definition: boolean.h:36
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:484
holds a vector of std::pair of Ptr and interface index.
uint16_t GetCellId() const
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:459
Hold variables of type string.
Definition: string.h:41
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
NetDeviceContainer Install(NodeContainer c) const
NetDeviceContainer Install(NodeContainer c)
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:258
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
static Vector GetPosition(Ptr< Node > node)
Definition: multirate.cc:329
uint64_t GetImsi() const
Get the IMSI.
static void Run(void)
Run the simulation.
Definition: simulator.cc:226
Hold a signed integer type.
Definition: integer.h:44
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1001
aggregate IP/TCP/UDP functionality to existing Nodes.
void PrintGnuplottableUeListToFile(std::string filename)
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:277
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
Build a set of PointToPointNetDevice objects.
double xMax
The x coordinate of the right bound of the box.
Definition: box.h:95
Ptr< SpectrumChannel > GetChannel()
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
uint8_t ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
Definition: lte-helper.cc:1051
void SetHandoverAlgorithmType(std::string type)
Set the type of handover algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:330
tuple cmd
Definition: second.py:35
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:309
static void SetRun(uint64_t run)
Set the run number of simulation.
tuple clientApps
Definition: first.py:54
a 3d box
Definition: box.h:34
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:282
double yMax
The y coordinate of the top bound of the box.
Definition: box.h:99
uint32_t GetN(void) const
Get the number of Ptr stored in this container.
Class for representing data rates.
Definition: data-rate.h:88
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:1019
Keep track of the current position and velocity of an object.
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
tuple mobility
Definition: third.py:101
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
AttributeValue implementation for Time.
Definition: nstime.h:1055
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Hold an unsigned integer type.
Definition: uinteger.h:44
double startTime
static Iterator End(void)
Definition: node-list.cc:235
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Definition: lte-helper.cc:296
holds a vector of ns3::NetDevice pointers
static Ptr< SpectrumModel > GetSpectrumModel(uint32_t earfcn, uint8_t bandwidth)
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition: node.cc:142
void PrintGnuplottableEnbListToFile(std::string filename)
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
double yMin
The y coordinate of the bottom bound of the box.
Definition: box.h:97
Parse command-line arguments.
Definition: command-line.h:205
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Definition: simulator.cc:190
void SetPhyAttribute(std::string name, const AttributeValue &v)
tuple serverApps
Definition: first.py:45
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:76
uint32_t GetNDevices(void) const
Definition: node.cc:150
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
uint16_t remotePortEnd
end of the port number range of the remote host
Definition: epc-tft.h:113
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Hold objects of type Ptr.
Definition: pointer.h:36
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Definition: node-list.h:44
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
void Install()
Deploy the RemSpectrumPhy objects that generate the map according to the specified settings...
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
Definition: lte-helper.cc:1203
double zMax
The z coordinate of the up bound of the box.
Definition: box.h:103
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
static void SetSeed(uint32_t seed)
Set the seed.
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:499
Helper class used to assign positions and mobility models to nodes.
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container.
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
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:275
Helper class that adds ns3::Ipv4StaticRouting objects.
AttributeValue implementation for DataRate.
Definition: data-rate.h:242
static Iterator Begin(void)
Definition: node-list.cc:229
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Definition: command-line.h:498
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Definition: simulator.cc:234
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:993
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:782
void Add(Vector v)
Add a position to the list of positions.
void SetChannel(Ptr< SpectrumChannel > channel)
Set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper...
void SetRxSpectrumModel(Ptr< SpectrumModel > m)
Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals...
void EnableAsciiAll(std::string prefix)
Enable ASCII output.
void Parse(int argc, char *argv[])
Parse the program arguments.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1009
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:253
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
The eNodeB device implementation.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
Definition: lte-helper.cc:317
uint16_t remotePortStart
start of the port number range of the remote host
Definition: epc-tft.h:112
double xMin
The x coordinate of the left bound of the box.
Definition: box.h:93
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition: epc-tft.h:73
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
Definition: lte-helper.cc:403
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
uint16_t localPortStart
start of the port number range of the UE
Definition: epc-tft.h:114
The LteSpectrumPhy models the physical layer of LTE.
The LteUeNetDevice class implements the UE net device.