A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lena-dual-stripe.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#include <ns3/applications-module.h>
10#include <ns3/buildings-module.h>
11#include <ns3/config-store-module.h>
12#include <ns3/core-module.h>
13#include <ns3/internet-module.h>
14#include <ns3/log.h>
15#include <ns3/lte-module.h>
16#include <ns3/mobility-module.h>
17#include <ns3/network-module.h>
18#include <ns3/point-to-point-helper.h>
19
20#include <iomanip>
21#include <ios>
22#include <string>
23#include <vector>
24
25// The topology of this simulation program is inspired from
26// 3GPP R4-092042, Section 4.2.1 Dual Stripe Model
27// note that the term "apartments" used in that document matches with
28// the term "room" used in the BuildingsMobilityModel
29
30using namespace ns3;
31
32NS_LOG_COMPONENT_DEFINE("LenaDualStripe");
33
34/**
35 * Check if two boxes are overlapping.
36 *
37 * \param a First box.
38 * \param b Second box.
39 * \return true if the boxes are overlapping, false otherwise.
40 */
41bool
43{
44 return !((a.xMin > b.xMax) || (b.xMin > a.xMax) || (a.yMin > b.yMax) || (b.yMin > a.yMax));
45}
46
47/**
48 * Class that takes care of installing blocks of the
49 * buildings in a given area. Buildings are installed in pairs
50 * as in dual stripe scenario.
51 */
53{
54 public:
55 /**
56 * Constructor
57 * \param area the total area
58 * \param nApartmentsX the number of apartments in the X direction
59 * \param nFloors the number of floors
60 */
61 FemtocellBlockAllocator(Box area, uint32_t nApartmentsX, uint32_t nFloors);
62 /**
63 * Function that creates building blocks.
64 * \param n the number of blocks to create
65 */
66 void Create(uint32_t n);
67 /// Create function
68 void Create();
69
70 private:
71 /**
72 * Function that checks if the box area is overlapping with some of previously created building
73 * blocks.
74 * \param box the area to check
75 * \returns true if there is an overlap
76 */
78 Box m_area; ///< Area
79 uint32_t m_nApartmentsX; ///< X apartments
80 uint32_t m_nFloors; ///< number of floors
81 std::list<Box> m_previousBlocks; ///< previous bocks
82 double m_xSize; ///< X size
83 double m_ySize; ///< Y size
84 Ptr<UniformRandomVariable> m_xMinVar; ///< X minimum variance
85 Ptr<UniformRandomVariable> m_yMinVar; ///< Y minimum variance
86};
87
89 : m_area(area),
90 m_nApartmentsX(nApartmentsX),
91 m_nFloors(nFloors),
92 m_xSize(nApartmentsX * 10 + 20),
93 m_ySize(70)
94{
96 m_xMinVar->SetAttribute("Min", DoubleValue(area.xMin));
97 m_xMinVar->SetAttribute("Max", DoubleValue(area.xMax - m_xSize));
99 m_yMinVar->SetAttribute("Min", DoubleValue(area.yMin));
100 m_yMinVar->SetAttribute("Max", DoubleValue(area.yMax - m_ySize));
101}
102
103void
105{
106 for (uint32_t i = 0; i < n; ++i)
107 {
108 Create();
109 }
110}
111
112void
114{
115 Box box;
116 uint32_t attempt = 0;
117 do
118 {
119 NS_ASSERT_MSG(attempt < 100,
120 "Too many failed attempts to position apartment block. Too many blocks? Too "
121 "small area?");
122 box.xMin = m_xMinVar->GetValue();
123 box.xMax = box.xMin + m_xSize;
124 box.yMin = m_yMinVar->GetValue();
125 box.yMax = box.yMin + m_ySize;
126 ++attempt;
127 } while (OverlapsWithAnyPrevious(box));
128
129 NS_LOG_LOGIC("allocated non overlapping block " << box);
130 m_previousBlocks.push_back(box);
131 Ptr<GridBuildingAllocator> gridBuildingAllocator;
132 gridBuildingAllocator = CreateObject<GridBuildingAllocator>();
133 gridBuildingAllocator->SetAttribute("GridWidth", UintegerValue(1));
134 gridBuildingAllocator->SetAttribute("LengthX", DoubleValue(10 * m_nApartmentsX));
135 gridBuildingAllocator->SetAttribute("LengthY", DoubleValue(10 * 2));
136 gridBuildingAllocator->SetAttribute("DeltaX", DoubleValue(10));
137 gridBuildingAllocator->SetAttribute("DeltaY", DoubleValue(10));
138 gridBuildingAllocator->SetAttribute("Height", DoubleValue(3 * m_nFloors));
139 gridBuildingAllocator->SetBuildingAttribute("NRoomsX", UintegerValue(m_nApartmentsX));
140 gridBuildingAllocator->SetBuildingAttribute("NRoomsY", UintegerValue(2));
141 gridBuildingAllocator->SetBuildingAttribute("NFloors", UintegerValue(m_nFloors));
142 gridBuildingAllocator->SetAttribute("MinX", DoubleValue(box.xMin + 10));
143 gridBuildingAllocator->SetAttribute("MinY", DoubleValue(box.yMin + 10));
144 gridBuildingAllocator->Create(2);
145}
146
147bool
149{
150 for (auto it = m_previousBlocks.begin(); it != m_previousBlocks.end(); ++it)
151 {
152 if (AreOverlapping(*it, box))
153 {
154 return true;
155 }
156 }
157 return false;
158}
159
160/**
161 * Print a list of buildings that can be plotted using Gnuplot.
162 *
163 * \param filename the output file name.
164 */
165void
167{
168 std::ofstream outFile;
169 outFile.open(filename, std::ios_base::out | std::ios_base::trunc);
170 if (!outFile.is_open())
171 {
172 NS_LOG_ERROR("Can't open file " << filename);
173 return;
174 }
175 uint32_t index = 0;
176 for (auto it = BuildingList::Begin(); it != BuildingList::End(); ++it)
177 {
178 ++index;
179 Box box = (*it)->GetBoundaries();
180 outFile << "set object " << index << " rect from " << box.xMin << "," << box.yMin << " to "
181 << box.xMax << "," << box.yMax << " front fs empty " << std::endl;
182 }
183}
184
185/**
186 * Print a list of UEs that can be plotted using Gnuplot.
187 *
188 * \param filename the output file name.
189 */
190void
191PrintGnuplottableUeListToFile(std::string filename)
192{
193 std::ofstream outFile;
194 outFile.open(filename, std::ios_base::out | std::ios_base::trunc);
195 if (!outFile.is_open())
196 {
197 NS_LOG_ERROR("Can't open file " << filename);
198 return;
199 }
200 for (auto it = NodeList::Begin(); it != NodeList::End(); ++it)
201 {
202 Ptr<Node> node = *it;
203 int nDevs = node->GetNDevices();
204 for (int j = 0; j < nDevs; j++)
205 {
206 Ptr<LteUeNetDevice> uedev = node->GetDevice(j)->GetObject<LteUeNetDevice>();
207 if (uedev)
208 {
209 Vector pos = node->GetObject<MobilityModel>()->GetPosition();
210 outFile << "set label \"" << uedev->GetImsi() << "\" at " << pos.x << "," << pos.y
211 << " left font \"Helvetica,4\" textcolor rgb \"grey\" front point pt 1 ps "
212 "0.3 lc rgb \"grey\" offset 0,0"
213 << std::endl;
214 }
215 }
216 }
217}
218
219/**
220 * Print a list of ENBs that can be plotted using Gnuplot.
221 *
222 * \param filename the output file name.
223 */
224void
226{
227 std::ofstream outFile;
228 outFile.open(filename, std::ios_base::out | std::ios_base::trunc);
229 if (!outFile.is_open())
230 {
231 NS_LOG_ERROR("Can't open file " << filename);
232 return;
233 }
234 for (auto it = NodeList::Begin(); it != NodeList::End(); ++it)
235 {
236 Ptr<Node> node = *it;
237 int nDevs = node->GetNDevices();
238 for (int j = 0; j < nDevs; j++)
239 {
240 Ptr<LteEnbNetDevice> enbdev = node->GetDevice(j)->GetObject<LteEnbNetDevice>();
241 if (enbdev)
242 {
243 Vector pos = node->GetObject<MobilityModel>()->GetPosition();
244 outFile << "set label \"" << enbdev->GetCellId() << "\" at " << pos.x << ","
245 << pos.y
246 << " left font \"Helvetica,4\" textcolor rgb \"white\" front point pt 2 "
247 "ps 0.3 lc rgb \"white\" offset 0,0"
248 << std::endl;
249 }
250 }
251 }
252}
253
254/// Number of femtocell blocks
256 "Number of femtocell blocks",
259
260/// Number of apartments along the X axis in a femtocell block
261static ns3::GlobalValue g_nApartmentsX("nApartmentsX",
262 "Number of apartments along the X axis in a femtocell block",
265
266/// Number of floors
268 "Number of floors",
271
272/// How many macro sites there are
273static ns3::GlobalValue g_nMacroEnbSites("nMacroEnbSites",
274 "How many macro sites there are",
277
278/// (minimum) number of sites along the X-axis of the hex grid
280 "nMacroEnbSitesX",
281 "(minimum) number of sites along the X-axis of the hex grid",
284
285/// min distance between two nearby macro cell sites
286static ns3::GlobalValue g_interSiteDistance("interSiteDistance",
287 "min distance between two nearby macro cell sites",
288 ns3::DoubleValue(500),
290
291/// how much the UE area extends outside the macrocell grid, expressed as fraction of the
292/// interSiteDistance
294 "areaMarginFactor",
295 "how much the UE area extends outside the macrocell grid, "
296 "expressed as fraction of the interSiteDistance",
297 ns3::DoubleValue(0.5),
299
300/// How many macrocell UEs there are per square meter
301static ns3::GlobalValue g_macroUeDensity("macroUeDensity",
302 "How many macrocell UEs there are per square meter",
303 ns3::DoubleValue(0.00002),
305
306/// The HeNB deployment ratio as per 3GPP R4-092042
307static ns3::GlobalValue g_homeEnbDeploymentRatio("homeEnbDeploymentRatio",
308 "The HeNB deployment ratio as per 3GPP R4-092042",
309 ns3::DoubleValue(0.2),
311
312/// The HeNB activation ratio as per 3GPP R4-092042
313static ns3::GlobalValue g_homeEnbActivationRatio("homeEnbActivationRatio",
314 "The HeNB activation ratio as per 3GPP R4-092042",
315 ns3::DoubleValue(0.5),
317
318/// How many (on average) home UEs per HeNB there are in the simulation
320 "homeUesHomeEnbRatio",
321 "How many (on average) home UEs per HeNB there are in the simulation",
322 ns3::DoubleValue(1.0),
324
325/// TX power [dBm] used by macro eNBs
326static ns3::GlobalValue g_macroEnbTxPowerDbm("macroEnbTxPowerDbm",
327 "TX power [dBm] used by macro eNBs",
328 ns3::DoubleValue(46.0),
330
331/// TX power [dBm] used by HeNBs
332static ns3::GlobalValue g_homeEnbTxPowerDbm("homeEnbTxPowerDbm",
333 "TX power [dBm] used by HeNBs",
334 ns3::DoubleValue(20.0),
336
337/// DL EARFCN used by macro eNBs
338static ns3::GlobalValue g_macroEnbDlEarfcn("macroEnbDlEarfcn",
339 "DL EARFCN used by macro eNBs",
342
343/// DL EARFCN used by HeNBs
344static ns3::GlobalValue g_homeEnbDlEarfcn("homeEnbDlEarfcn",
345 "DL EARFCN used by HeNBs",
348
349/// Bandwidth [num RBs] used by macro eNBs
350static ns3::GlobalValue g_macroEnbBandwidth("macroEnbBandwidth",
351 "bandwidth [num RBs] used by macro eNBs",
354
355/// Bandwidth [num RBs] used by HeNBs
356static ns3::GlobalValue g_homeEnbBandwidth("homeEnbBandwidth",
357 "bandwidth [num RBs] used by HeNBs",
360
361/// Total duration of the simulation [s]
363 "Total duration of the simulation [s]",
364 ns3::DoubleValue(0.25),
366
367/// If true, will generate a REM and then abort the simulation
369 "generateRem",
370 "if true, will generate a REM and then abort the simulation;"
371 "if false, will run the simulation normally (without generating any REM)",
372 ns3::BooleanValue(false),
374
375/// Resource Block Id of Data Channel, for which REM will be generated.
377 "remRbId",
378 "Resource Block Id of Data Channel, for which REM will be generated;"
379 "default value is -1, what means REM will be averaged from all RBs of "
380 "Control Channel",
383
384/// If true, will setup the EPC to simulate an end-to-end topology.
386 "epc",
387 "If true, will setup the EPC to simulate an end-to-end topology, "
388 "with real IP applications over PDCP and RLC UM (or RLC AM by changing "
389 "the default value of EpsBearerToRlcMapping e.g. to RLC_AM_ALWAYS). "
390 "If false, only the LTE radio access will be simulated with RLC SM.",
391 ns3::BooleanValue(false),
393
394/// if true, will activate data flows in the downlink when EPC is being used.
396 "epcDl",
397 "if true, will activate data flows in the downlink when EPC is being used. "
398 "If false, downlink flows won't be activated. "
399 "If EPC is not used, this parameter will be ignored.",
400 ns3::BooleanValue(true),
402
403/// if true, will activate data flows in the uplink when EPC is being used.
405 "epcUl",
406 "if true, will activate data flows in the uplink when EPC is being used. "
407 "If false, uplink flows won't be activated. "
408 "If EPC is not used, this parameter will be ignored.",
409 ns3::BooleanValue(true),
411
412/// if true, the UdpClient application will be used.
414 "useUdp",
415 "if true, the UdpClient application will be used. "
416 "Otherwise, the BulkSend application will be used over a TCP connection. "
417 "If EPC is not used, this parameter will be ignored.",
418 ns3::BooleanValue(true),
420
421/// The path of the fading trace (by default no fading trace is loaded, i.e., fading is not
422/// considered)
423static ns3::GlobalValue g_fadingTrace("fadingTrace",
424 "The path of the fading trace (by default no fading trace "
425 "is loaded, i.e., fading is not considered)",
428
429/// How many bearers per UE there are in the simulation
430static ns3::GlobalValue g_numBearersPerUe("numBearersPerUe",
431 "How many bearers per UE there are in the simulation",
434
435/// SRS Periodicity (has to be at least greater than the number of UEs per eNB)
436static ns3::GlobalValue g_srsPeriodicity("srsPeriodicity",
437 "SRS Periodicity (has to be at least "
438 "greater than the number of UEs per eNB)",
441
442/// Minimum speed value of macro UE with random waypoint model [m/s].
444 "outdoorUeMinSpeed",
445 "Minimum speed value of macro UE with random waypoint model [m/s].",
446 ns3::DoubleValue(0.0),
448
449/// Maximum speed value of macro UE with random waypoint model [m/s].
451 "outdoorUeMaxSpeed",
452 "Maximum speed value of macro UE with random waypoint model [m/s].",
453 ns3::DoubleValue(0.0),
455
456int
457main(int argc, char* argv[])
458{
459 // change some default attributes so that they are reasonable for
460 // this scenario, but do this before processing command line
461 // arguments, so that the user is allowed to override these settings
462 Config::SetDefault("ns3::UdpClient::Interval", TimeValue(MilliSeconds(1)));
463 Config::SetDefault("ns3::UdpClient::MaxPackets", UintegerValue(1000000));
464 Config::SetDefault("ns3::LteRlcUm::MaxTxBufferSize", UintegerValue(10 * 1024));
465
466 CommandLine cmd(__FILE__);
467 cmd.Parse(argc, argv);
468 ConfigStore inputConfig;
469 inputConfig.ConfigureDefaults();
470 // parse again so you can override input file default values via command line
471 cmd.Parse(argc, argv);
472
473 // the scenario parameters get their values from the global attributes defined above
474 UintegerValue uintegerValue;
475 IntegerValue integerValue;
476 DoubleValue doubleValue;
477 BooleanValue booleanValue;
478 StringValue stringValue;
479 GlobalValue::GetValueByName("nBlocks", uintegerValue);
480 uint32_t nBlocks = uintegerValue.Get();
481 GlobalValue::GetValueByName("nApartmentsX", uintegerValue);
482 uint32_t nApartmentsX = uintegerValue.Get();
483 GlobalValue::GetValueByName("nFloors", uintegerValue);
484 uint32_t nFloors = uintegerValue.Get();
485 GlobalValue::GetValueByName("nMacroEnbSites", uintegerValue);
486 uint32_t nMacroEnbSites = uintegerValue.Get();
487 GlobalValue::GetValueByName("nMacroEnbSitesX", uintegerValue);
488 uint32_t nMacroEnbSitesX = uintegerValue.Get();
489 GlobalValue::GetValueByName("interSiteDistance", doubleValue);
490 double interSiteDistance = doubleValue.Get();
491 GlobalValue::GetValueByName("areaMarginFactor", doubleValue);
492 double areaMarginFactor = doubleValue.Get();
493 GlobalValue::GetValueByName("macroUeDensity", doubleValue);
494 double macroUeDensity = doubleValue.Get();
495 GlobalValue::GetValueByName("homeEnbDeploymentRatio", doubleValue);
496 double homeEnbDeploymentRatio = doubleValue.Get();
497 GlobalValue::GetValueByName("homeEnbActivationRatio", doubleValue);
498 double homeEnbActivationRatio = doubleValue.Get();
499 GlobalValue::GetValueByName("homeUesHomeEnbRatio", doubleValue);
500 double homeUesHomeEnbRatio = doubleValue.Get();
501 GlobalValue::GetValueByName("macroEnbTxPowerDbm", doubleValue);
502 double macroEnbTxPowerDbm = doubleValue.Get();
503 GlobalValue::GetValueByName("homeEnbTxPowerDbm", doubleValue);
504 double homeEnbTxPowerDbm = doubleValue.Get();
505 GlobalValue::GetValueByName("macroEnbDlEarfcn", uintegerValue);
506 uint32_t macroEnbDlEarfcn = uintegerValue.Get();
507 GlobalValue::GetValueByName("homeEnbDlEarfcn", uintegerValue);
508 uint32_t homeEnbDlEarfcn = uintegerValue.Get();
509 GlobalValue::GetValueByName("macroEnbBandwidth", uintegerValue);
510 uint16_t macroEnbBandwidth = uintegerValue.Get();
511 GlobalValue::GetValueByName("homeEnbBandwidth", uintegerValue);
512 uint16_t homeEnbBandwidth = uintegerValue.Get();
513 GlobalValue::GetValueByName("simTime", doubleValue);
514 double simTime = doubleValue.Get();
515 GlobalValue::GetValueByName("epc", booleanValue);
516 bool epc = booleanValue.Get();
517 GlobalValue::GetValueByName("epcDl", booleanValue);
518 bool epcDl = booleanValue.Get();
519 GlobalValue::GetValueByName("epcUl", booleanValue);
520 bool epcUl = booleanValue.Get();
521 GlobalValue::GetValueByName("useUdp", booleanValue);
522 bool useUdp = booleanValue.Get();
523 GlobalValue::GetValueByName("generateRem", booleanValue);
524 bool generateRem = booleanValue.Get();
525 GlobalValue::GetValueByName("remRbId", integerValue);
526 int32_t remRbId = integerValue.Get();
527 GlobalValue::GetValueByName("fadingTrace", stringValue);
528 std::string fadingTrace = stringValue.Get();
529 GlobalValue::GetValueByName("numBearersPerUe", uintegerValue);
530 uint16_t numBearersPerUe = uintegerValue.Get();
531 GlobalValue::GetValueByName("srsPeriodicity", uintegerValue);
532 uint16_t srsPeriodicity = uintegerValue.Get();
533 GlobalValue::GetValueByName("outdoorUeMinSpeed", doubleValue);
534 uint16_t outdoorUeMinSpeed = doubleValue.Get();
535 GlobalValue::GetValueByName("outdoorUeMaxSpeed", doubleValue);
536 uint16_t outdoorUeMaxSpeed = doubleValue.Get();
537
538 Config::SetDefault("ns3::LteEnbRrc::SrsPeriodicity", UintegerValue(srsPeriodicity));
539
540 Box macroUeBox;
541 double ueZ = 1.5;
542 if (nMacroEnbSites > 0)
543 {
544 uint32_t currentSite = nMacroEnbSites - 1;
545 uint32_t biRowIndex = (currentSite / (nMacroEnbSitesX + nMacroEnbSitesX + 1));
546 uint32_t biRowRemainder = currentSite % (nMacroEnbSitesX + nMacroEnbSitesX + 1);
547 uint32_t rowIndex = biRowIndex * 2 + 1;
548 if (biRowRemainder >= nMacroEnbSitesX)
549 {
550 ++rowIndex;
551 }
552 uint32_t nMacroEnbSitesY = rowIndex;
553 NS_LOG_LOGIC("nMacroEnbSitesY = " << nMacroEnbSitesY);
554
555 macroUeBox = Box(-areaMarginFactor * interSiteDistance,
556 (nMacroEnbSitesX + areaMarginFactor) * interSiteDistance,
557 -areaMarginFactor * interSiteDistance,
558 (nMacroEnbSitesY - 1) * interSiteDistance * sqrt(0.75) +
559 areaMarginFactor * interSiteDistance,
560 ueZ,
561 ueZ);
562 }
563 else
564 {
565 // still need the box to place femtocell blocks
566 macroUeBox = Box(0, 150, 0, 150, ueZ, ueZ);
567 }
568
569 FemtocellBlockAllocator blockAllocator(macroUeBox, nApartmentsX, nFloors);
570 blockAllocator.Create(nBlocks);
571
572 uint32_t nHomeEnbs = round(4 * nApartmentsX * nBlocks * nFloors * homeEnbDeploymentRatio *
573 homeEnbActivationRatio);
574 NS_LOG_LOGIC("nHomeEnbs = " << nHomeEnbs);
575 uint32_t nHomeUes = round(nHomeEnbs * homeUesHomeEnbRatio);
576 NS_LOG_LOGIC("nHomeUes = " << nHomeUes);
577 double macroUeAreaSize =
578 (macroUeBox.xMax - macroUeBox.xMin) * (macroUeBox.yMax - macroUeBox.yMin);
579 uint32_t nMacroUes = round(macroUeAreaSize * macroUeDensity);
580 NS_LOG_LOGIC("nMacroUes = " << nMacroUes << " (density=" << macroUeDensity << ")");
581
582 NodeContainer homeEnbs;
583 homeEnbs.Create(nHomeEnbs);
584 NodeContainer macroEnbs;
585 macroEnbs.Create(3 * nMacroEnbSites);
586 NodeContainer homeUes;
587 homeUes.Create(nHomeUes);
588 NodeContainer macroUes;
589 macroUes.Create(nMacroUes);
590
592 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
593
595 lteHelper->SetAttribute("PathlossModel",
596 StringValue("ns3::HybridBuildingsPropagationLossModel"));
597 lteHelper->SetPathlossModelAttribute("ShadowSigmaExtWalls", DoubleValue(0));
598 lteHelper->SetPathlossModelAttribute("ShadowSigmaOutdoor", DoubleValue(1));
599 lteHelper->SetPathlossModelAttribute("ShadowSigmaIndoor", DoubleValue(1.5));
600 // use always LOS model
601 lteHelper->SetPathlossModelAttribute("Los2NlosThr", DoubleValue(1e6));
602 lteHelper->SetSpectrumChannelType("ns3::MultiModelSpectrumChannel");
603
604 // lteHelper->EnableLogComponents ();
605 // LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
606
607 if (!fadingTrace.empty())
608 {
609 lteHelper->SetAttribute("FadingModel", StringValue("ns3::TraceFadingLossModel"));
610 lteHelper->SetFadingModelAttribute("TraceFilename", StringValue(fadingTrace));
611 }
612
614 if (epc)
615 {
616 NS_LOG_LOGIC("enabling EPC");
618 lteHelper->SetEpcHelper(epcHelper);
619 }
620
621 // Macro eNBs in 3-sector hex grid
622
623 mobility.Install(macroEnbs);
624 BuildingsHelper::Install(macroEnbs);
625 Ptr<LteHexGridEnbTopologyHelper> lteHexGridEnbTopologyHelper =
627 lteHexGridEnbTopologyHelper->SetLteHelper(lteHelper);
628 lteHexGridEnbTopologyHelper->SetAttribute("InterSiteDistance", DoubleValue(interSiteDistance));
629 lteHexGridEnbTopologyHelper->SetAttribute("MinX", DoubleValue(interSiteDistance / 2));
630 lteHexGridEnbTopologyHelper->SetAttribute("GridWidth", UintegerValue(nMacroEnbSitesX));
631 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(macroEnbTxPowerDbm));
632 lteHelper->SetEnbAntennaModelType("ns3::ParabolicAntennaModel");
633 lteHelper->SetEnbAntennaModelAttribute("Beamwidth", DoubleValue(70));
634 lteHelper->SetEnbAntennaModelAttribute("MaxAttenuation", DoubleValue(20.0));
635 lteHelper->SetEnbDeviceAttribute("DlEarfcn", UintegerValue(macroEnbDlEarfcn));
636 lteHelper->SetEnbDeviceAttribute("UlEarfcn", UintegerValue(macroEnbDlEarfcn + 18000));
637 lteHelper->SetEnbDeviceAttribute("DlBandwidth", UintegerValue(macroEnbBandwidth));
638 lteHelper->SetEnbDeviceAttribute("UlBandwidth", UintegerValue(macroEnbBandwidth));
639 NetDeviceContainer macroEnbDevs =
640 lteHexGridEnbTopologyHelper->SetPositionAndInstallEnbDevice(macroEnbs);
641
642 if (epc)
643 {
644 // this enables handover for macro eNBs
645 lteHelper->AddX2Interface(macroEnbs);
646 }
647
648 // HomeEnbs randomly indoor
649
651 mobility.SetPositionAllocator(positionAlloc);
652 mobility.Install(homeEnbs);
653 BuildingsHelper::Install(homeEnbs);
654 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(homeEnbTxPowerDbm));
655 lteHelper->SetEnbAntennaModelType("ns3::IsotropicAntennaModel");
656 lteHelper->SetEnbDeviceAttribute("DlEarfcn", UintegerValue(homeEnbDlEarfcn));
657 lteHelper->SetEnbDeviceAttribute("UlEarfcn", UintegerValue(homeEnbDlEarfcn + 18000));
658 lteHelper->SetEnbDeviceAttribute("DlBandwidth", UintegerValue(homeEnbBandwidth));
659 lteHelper->SetEnbDeviceAttribute("UlBandwidth", UintegerValue(homeEnbBandwidth));
660 lteHelper->SetEnbDeviceAttribute("CsgId", UintegerValue(1));
661 lteHelper->SetEnbDeviceAttribute("CsgIndication", BooleanValue(true));
662 NetDeviceContainer homeEnbDevs = lteHelper->InstallEnbDevice(homeEnbs);
663
664 // home UEs located in the same apartment in which there are the Home eNBs
665 positionAlloc = CreateObject<SameRoomPositionAllocator>(homeEnbs);
666 mobility.SetPositionAllocator(positionAlloc);
667 mobility.Install(homeUes);
669 // set the home UE as a CSG member of the home eNodeBs
670 lteHelper->SetUeDeviceAttribute("CsgId", UintegerValue(1));
671 NetDeviceContainer homeUeDevs = lteHelper->InstallUeDevice(homeUes);
672
673 // macro Ues
674 NS_LOG_LOGIC("randomly allocating macro UEs in " << macroUeBox << " speedMin "
675 << outdoorUeMinSpeed << " speedMax "
676 << outdoorUeMaxSpeed);
677 if (outdoorUeMaxSpeed != 0.0)
678 {
679 mobility.SetMobilityModel("ns3::SteadyStateRandomWaypointMobilityModel");
680
681 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MinX",
682 DoubleValue(macroUeBox.xMin));
683 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MinY",
684 DoubleValue(macroUeBox.yMin));
685 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MaxX",
686 DoubleValue(macroUeBox.xMax));
687 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MaxY",
688 DoubleValue(macroUeBox.yMax));
689 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::Z", DoubleValue(ueZ));
690 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MaxSpeed",
691 DoubleValue(outdoorUeMaxSpeed));
692 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MinSpeed",
693 DoubleValue(outdoorUeMinSpeed));
694
695 // this is not used since SteadyStateRandomWaypointMobilityModel
696 // takes care of initializing the positions; however we need to
697 // reset it since the previously used PositionAllocator
698 // (SameRoom) will cause an error when used with homeDeploymentRatio=0
700 mobility.SetPositionAllocator(positionAlloc);
701 mobility.Install(macroUes);
702
703 // forcing initialization so we don't have to wait for Nodes to
704 // start before positions are assigned (which is needed to
705 // output node positions to file and to make AttachToClosestEnb work)
706 for (auto it = macroUes.Begin(); it != macroUes.End(); ++it)
707 {
708 (*it)->Initialize();
709 }
710 }
711 else
712 {
715 xVal->SetAttribute("Min", DoubleValue(macroUeBox.xMin));
716 xVal->SetAttribute("Max", DoubleValue(macroUeBox.xMax));
717 positionAlloc->SetAttribute("X", PointerValue(xVal));
719 yVal->SetAttribute("Min", DoubleValue(macroUeBox.yMin));
720 yVal->SetAttribute("Max", DoubleValue(macroUeBox.yMax));
721 positionAlloc->SetAttribute("Y", PointerValue(yVal));
723 zVal->SetAttribute("Min", DoubleValue(macroUeBox.zMin));
724 zVal->SetAttribute("Max", DoubleValue(macroUeBox.zMax));
725 positionAlloc->SetAttribute("Z", PointerValue(zVal));
726 mobility.SetPositionAllocator(positionAlloc);
727 mobility.Install(macroUes);
728 }
729 BuildingsHelper::Install(macroUes);
730
731 NetDeviceContainer macroUeDevs = lteHelper->InstallUeDevice(macroUes);
732
733 Ipv4Address remoteHostAddr;
734 NodeContainer ues;
735 Ipv4StaticRoutingHelper ipv4RoutingHelper;
736 Ipv4InterfaceContainer ueIpIfaces;
737 Ptr<Node> remoteHost;
738 NetDeviceContainer ueDevs;
739
740 if (epc)
741 {
742 NS_LOG_LOGIC("setting up internet and remote host");
743
744 // Create a single RemoteHost
745 NodeContainer remoteHostContainer;
746 remoteHostContainer.Create(1);
747 remoteHost = remoteHostContainer.Get(0);
749 internet.Install(remoteHostContainer);
750
751 // Create the Internet
753 p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
754 p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
755 p2ph.SetChannelAttribute("Delay", TimeValue(Seconds(0.010)));
756 Ptr<Node> pgw = epcHelper->GetPgwNode();
757 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
758 Ipv4AddressHelper ipv4h;
759 ipv4h.SetBase("1.0.0.0", "255.0.0.0");
760 Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
761 // in this container, interface 0 is the pgw, 1 is the remoteHost
762 remoteHostAddr = internetIpIfaces.GetAddress(1);
763
764 Ipv4StaticRoutingHelper ipv4RoutingHelper;
765 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
766 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
767 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"),
768 Ipv4Mask("255.0.0.0"),
769 1);
770
771 // for internetworking purposes, consider together home UEs and macro UEs
772 ues.Add(homeUes);
773 ues.Add(macroUes);
774 ueDevs.Add(homeUeDevs);
775 ueDevs.Add(macroUeDevs);
776
777 // Install the IP stack on the UEs
778 internet.Install(ues);
779 ueIpIfaces = epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueDevs));
780
781 // attachment (needs to be done after IP stack configuration)
782 // using initial cell selection
783 lteHelper->Attach(macroUeDevs);
784 lteHelper->Attach(homeUeDevs);
785 }
786 else
787 {
788 // macro UEs attached to the closest macro eNB
789 lteHelper->AttachToClosestEnb(macroUeDevs, macroEnbDevs);
790
791 // each home UE is attached explicitly to its home eNB
794 for (ueDevIt = homeUeDevs.Begin(), enbDevIt = homeEnbDevs.Begin();
795 ueDevIt != homeUeDevs.End();
796 ++ueDevIt, ++enbDevIt)
797 {
798 // this because of the order in which SameRoomPositionAllocator
799 // will place the UEs
800 if (enbDevIt == homeEnbDevs.End())
801 {
802 enbDevIt = homeEnbDevs.Begin();
803 }
804 lteHelper->Attach(*ueDevIt, *enbDevIt);
805 }
806 }
807
808 if (epc)
809 {
810 NS_LOG_LOGIC("setting up applications");
811
812 // Install and start applications on UEs and remote host
813 uint16_t dlPort = 10000;
814 uint16_t ulPort = 20000;
815
816 // randomize a bit start times to avoid simulation artifacts
817 // (e.g., buffer overflows due to packet transmissions happening
818 // exactly at the same time)
820 if (useUdp)
821 {
822 startTimeSeconds->SetAttribute("Min", DoubleValue(0));
823 startTimeSeconds->SetAttribute("Max", DoubleValue(0.010));
824 }
825 else
826 {
827 // TCP needs to be started late enough so that all UEs are connected
828 // otherwise TCP SYN packets will get lost
829 startTimeSeconds->SetAttribute("Min", DoubleValue(0.100));
830 startTimeSeconds->SetAttribute("Max", DoubleValue(0.110));
831 }
832
833 for (uint32_t u = 0; u < ues.GetN(); ++u)
834 {
835 Ptr<Node> ue = ues.Get(u);
836 // Set the default gateway for the UE
837 Ptr<Ipv4StaticRouting> ueStaticRouting =
838 ipv4RoutingHelper.GetStaticRouting(ue->GetObject<Ipv4>());
839 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
840
841 for (uint32_t b = 0; b < numBearersPerUe; ++b)
842 {
843 ++dlPort;
844 ++ulPort;
845
848
849 if (useUdp)
850 {
851 if (epcDl)
852 {
853 NS_LOG_LOGIC("installing UDP DL app for UE " << u);
854 UdpClientHelper dlClientHelper(ueIpIfaces.GetAddress(u), dlPort);
855 clientApps.Add(dlClientHelper.Install(remoteHost));
856 PacketSinkHelper dlPacketSinkHelper(
857 "ns3::UdpSocketFactory",
859 serverApps.Add(dlPacketSinkHelper.Install(ue));
860 }
861 if (epcUl)
862 {
863 NS_LOG_LOGIC("installing UDP UL app for UE " << u);
864 UdpClientHelper ulClientHelper(remoteHostAddr, ulPort);
865 clientApps.Add(ulClientHelper.Install(ue));
866 PacketSinkHelper ulPacketSinkHelper(
867 "ns3::UdpSocketFactory",
869 serverApps.Add(ulPacketSinkHelper.Install(remoteHost));
870 }
871 }
872 else // use TCP
873 {
874 if (epcDl)
875 {
876 NS_LOG_LOGIC("installing TCP DL app for UE " << u);
877 BulkSendHelper dlClientHelper(
878 "ns3::TcpSocketFactory",
879 InetSocketAddress(ueIpIfaces.GetAddress(u), dlPort));
880 dlClientHelper.SetAttribute("MaxBytes", UintegerValue(0));
881 clientApps.Add(dlClientHelper.Install(remoteHost));
882 PacketSinkHelper dlPacketSinkHelper(
883 "ns3::TcpSocketFactory",
885 serverApps.Add(dlPacketSinkHelper.Install(ue));
886 }
887 if (epcUl)
888 {
889 NS_LOG_LOGIC("installing TCP UL app for UE " << u);
890 BulkSendHelper ulClientHelper("ns3::TcpSocketFactory",
891 InetSocketAddress(remoteHostAddr, ulPort));
892 ulClientHelper.SetAttribute("MaxBytes", UintegerValue(0));
893 clientApps.Add(ulClientHelper.Install(ue));
894 PacketSinkHelper ulPacketSinkHelper(
895 "ns3::TcpSocketFactory",
897 serverApps.Add(ulPacketSinkHelper.Install(remoteHost));
898 }
899 } // end if (useUdp)
900
902 if (epcDl)
903 {
905 dlpf.localPortStart = dlPort;
906 dlpf.localPortEnd = dlPort;
907 tft->Add(dlpf);
908 }
909 if (epcUl)
910 {
912 ulpf.remotePortStart = ulPort;
913 ulpf.remotePortEnd = ulPort;
914 tft->Add(ulpf);
915 }
916
917 if (epcDl || epcUl)
918 {
920 lteHelper->ActivateDedicatedEpsBearer(ueDevs.Get(u), bearer, tft);
921 }
922 Time startTime = Seconds(startTimeSeconds->GetValue());
923 serverApps.Start(startTime);
924 clientApps.Start(startTime);
925
926 } // end for b
927 }
928 }
929 else // (epc == false)
930 {
931 // for radio bearer activation purposes, consider together home UEs and macro UEs
932 NetDeviceContainer ueDevs;
933 ueDevs.Add(homeUeDevs);
934 ueDevs.Add(macroUeDevs);
935 for (uint32_t u = 0; u < ueDevs.GetN(); ++u)
936 {
937 Ptr<NetDevice> ueDev = ueDevs.Get(u);
938 for (uint32_t b = 0; b < numBearersPerUe; ++b)
939 {
941 EpsBearer bearer(q);
942 lteHelper->ActivateDataRadioBearer(ueDev, bearer);
943 }
944 }
945 }
946
948 if (generateRem)
949 {
953
955 remHelper->SetAttribute("Channel", PointerValue(lteHelper->GetDownlinkSpectrumChannel()));
956 remHelper->SetAttribute("OutputFile", StringValue("lena-dual-stripe.rem"));
957 remHelper->SetAttribute("XMin", DoubleValue(macroUeBox.xMin));
958 remHelper->SetAttribute("XMax", DoubleValue(macroUeBox.xMax));
959 remHelper->SetAttribute("YMin", DoubleValue(macroUeBox.yMin));
960 remHelper->SetAttribute("YMax", DoubleValue(macroUeBox.yMax));
961 remHelper->SetAttribute("Z", DoubleValue(1.5));
962
963 if (remRbId >= 0)
964 {
965 remHelper->SetAttribute("UseDataChannel", BooleanValue(true));
966 remHelper->SetAttribute("RbId", IntegerValue(remRbId));
967 }
968
969 remHelper->Install();
970 // simulation will stop right after the REM has been generated
971 }
972 else
973 {
974 Simulator::Stop(Seconds(simTime));
975 }
976
977 lteHelper->EnableMacTraces();
978 lteHelper->EnableRlcTraces();
979 if (epc)
980 {
981 lteHelper->EnablePdcpTraces();
982 }
983
985
986 // GtkConfigStore config;
987 // config.ConfigureAttributes ();
988
989 lteHelper = nullptr;
991 return 0;
992}
Class that takes care of installing blocks of the buildings in a given area.
std::list< Box > m_previousBlocks
previous bocks
Ptr< UniformRandomVariable > m_xMinVar
X minimum variance.
Ptr< UniformRandomVariable > m_yMinVar
Y minimum variance.
uint32_t m_nApartmentsX
X apartments.
FemtocellBlockAllocator(Box area, uint32_t nApartmentsX, uint32_t nFloors)
Constructor.
uint32_t m_nFloors
number of floors
bool OverlapsWithAnyPrevious(Box box)
Function that checks if the box area is overlapping with some of previously created building blocks.
void Create()
Create function.
holds a vector of ns3::Application pointers.
bool Get() const
Definition boolean.cc:44
a 3d box
Definition box.h:24
double yMax
The y coordinate of the top bound of the box.
Definition box.h:105
double xMin
The x coordinate of the left bound of the box.
Definition box.h:99
double yMin
The y coordinate of the bottom bound of the box.
Definition box.h:103
double xMax
The x coordinate of the right bound of the box.
Definition box.h:101
double zMin
The z coordinate of the down bound of the box.
Definition box.h:107
double zMax
The z coordinate of the up bound of the box.
Definition box.h:109
static Iterator End()
static Iterator Begin()
static void Install(Ptr< Node > node)
Install the MobilityBuildingInfo to a node.
A helper to make it easier to instantiate an ns3::BulkSendApplication on a set of nodes.
Parse command-line arguments.
void ConfigureDefaults()
Configure the default values.
Class for representing data rates.
Definition data-rate.h:78
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
double Get() const
Definition double.cc:26
This class contains the specification of EPS Bearers.
Definition eps-bearer.h:80
Qci
QoS Class Indicator.
Definition eps-bearer.h:95
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition eps-bearer.h:115
Hold a so-called 'global value'.
static void GetValueByName(std::string name, AttributeValue &value)
Finds the GlobalValue with the given name and returns its value.
an Inet address class
Hold a signed integer type.
Definition integer.h:34
int64_t Get() const
Definition integer.cc:26
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ipv4 addresses are stored in host order in this class.
static Ipv4Address GetAny()
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition ipv4.h:69
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
a class to represent an Ipv4 address mask
Helper class that adds ns3::Ipv4StaticRouting objects.
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...
The eNodeB device implementation.
The LteUeNetDevice class implements the UE net device.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
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.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
uint32_t GetN() const
Get the number of Ptr<Node> stored in this container.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
static Iterator Begin()
Definition node-list.cc:226
static Iterator End()
Definition node-list.cc:233
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
NetDeviceContainer Install(NodeContainer c)
AttributeValue implementation for Pointer.
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
std::string Get() const
Definition string.cc:20
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Hold an unsigned integer type.
Definition uinteger.h:34
uint64_t Get() const
Definition uinteger.cc:26
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:883
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition log.h:243
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1320
static ns3::GlobalValue g_macroEnbTxPowerDbm("macroEnbTxPowerDbm", "TX power [dBm] used by macro eNBs", ns3::DoubleValue(46.0), ns3::MakeDoubleChecker< double >())
TX power [dBm] used by macro eNBs.
static ns3::GlobalValue g_nMacroEnbSites("nMacroEnbSites", "How many macro sites there are", ns3::UintegerValue(3), ns3::MakeUintegerChecker< uint32_t >())
How many macro sites there are.
bool AreOverlapping(Box a, Box b)
Check if two boxes are overlapping.
static ns3::GlobalValue g_generateRem("generateRem", "if true, will generate a REM and then abort the simulation;" "if false, will run the simulation normally (without generating any REM)", ns3::BooleanValue(false), ns3::MakeBooleanChecker())
If true, will generate a REM and then abort the simulation.
static ns3::GlobalValue g_homeEnbDeploymentRatio("homeEnbDeploymentRatio", "The HeNB deployment ratio as per 3GPP R4-092042", ns3::DoubleValue(0.2), ns3::MakeDoubleChecker< double >())
The HeNB deployment ratio as per 3GPP R4-092042.
static ns3::GlobalValue g_srsPeriodicity("srsPeriodicity", "SRS Periodicity (has to be at least " "greater than the number of UEs per eNB)", ns3::UintegerValue(80), ns3::MakeUintegerChecker< uint16_t >())
SRS Periodicity (has to be at least greater than the number of UEs per eNB)
static ns3::GlobalValue g_fadingTrace("fadingTrace", "The path of the fading trace (by default no fading trace " "is loaded, i.e., fading is not considered)", ns3::StringValue(""), ns3::MakeStringChecker())
The path of the fading trace (by default no fading trace is loaded, i.e., fading is not considered)
static ns3::GlobalValue g_outdoorUeMaxSpeed("outdoorUeMaxSpeed", "Maximum speed value of macro UE with random waypoint model [m/s].", ns3::DoubleValue(0.0), ns3::MakeDoubleChecker< double >())
Maximum speed value of macro UE with random waypoint model [m/s].
static ns3::GlobalValue g_macroUeDensity("macroUeDensity", "How many macrocell UEs there are per square meter", ns3::DoubleValue(0.00002), ns3::MakeDoubleChecker< double >())
How many macrocell UEs there are per square meter.
static ns3::GlobalValue g_homeEnbTxPowerDbm("homeEnbTxPowerDbm", "TX power [dBm] used by HeNBs", ns3::DoubleValue(20.0), ns3::MakeDoubleChecker< double >())
TX power [dBm] used by HeNBs.
static ns3::GlobalValue g_homeEnbBandwidth("homeEnbBandwidth", "bandwidth [num RBs] used by HeNBs", ns3::UintegerValue(25), ns3::MakeUintegerChecker< uint16_t >())
Bandwidth [num RBs] used by HeNBs.
static ns3::GlobalValue g_simTime("simTime", "Total duration of the simulation [s]", ns3::DoubleValue(0.25), ns3::MakeDoubleChecker< double >())
Total duration of the simulation [s].
static ns3::GlobalValue g_outdoorUeMinSpeed("outdoorUeMinSpeed", "Minimum speed value of macro UE with random waypoint model [m/s].", ns3::DoubleValue(0.0), ns3::MakeDoubleChecker< double >())
Minimum speed value of macro UE with random waypoint model [m/s].
static ns3::GlobalValue g_homeEnbDlEarfcn("homeEnbDlEarfcn", "DL EARFCN used by HeNBs", ns3::UintegerValue(100), ns3::MakeUintegerChecker< uint16_t >())
DL EARFCN used by HeNBs.
static ns3::GlobalValue g_nApartmentsX("nApartmentsX", "Number of apartments along the X axis in a femtocell block", ns3::UintegerValue(10), ns3::MakeUintegerChecker< uint32_t >())
Number of apartments along the X axis in a femtocell block.
void PrintGnuplottableEnbListToFile(std::string filename)
Print a list of ENBs that can be plotted using Gnuplot.
static ns3::GlobalValue g_homeEnbActivationRatio("homeEnbActivationRatio", "The HeNB activation ratio as per 3GPP R4-092042", ns3::DoubleValue(0.5), ns3::MakeDoubleChecker< double >())
The HeNB activation ratio as per 3GPP R4-092042.
static ns3::GlobalValue g_nMacroEnbSitesX("nMacroEnbSitesX", "(minimum) number of sites along the X-axis of the hex grid", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
(minimum) number of sites along the X-axis of the hex grid
static ns3::GlobalValue g_nFloors("nFloors", "Number of floors", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
Number of floors.
void PrintGnuplottableBuildingListToFile(std::string filename)
Print a list of buildings that can be plotted using Gnuplot.
static ns3::GlobalValue g_macroEnbBandwidth("macroEnbBandwidth", "bandwidth [num RBs] used by macro eNBs", ns3::UintegerValue(25), ns3::MakeUintegerChecker< uint16_t >())
Bandwidth [num RBs] used by macro eNBs.
static ns3::GlobalValue g_remRbId("remRbId", "Resource Block Id of Data Channel, for which REM will be generated;" "default value is -1, what means REM will be averaged from all RBs of " "Control Channel", ns3::IntegerValue(-1), MakeIntegerChecker< int32_t >())
Resource Block Id of Data Channel, for which REM will be generated.
static ns3::GlobalValue g_epcDl("epcDl", "if true, will activate data flows in the downlink when EPC is being used. " "If false, downlink flows won't be activated. " "If EPC is not used, this parameter will be ignored.", ns3::BooleanValue(true), ns3::MakeBooleanChecker())
if true, will activate data flows in the downlink when EPC is being used.
static ns3::GlobalValue g_homeUesHomeEnbRatio("homeUesHomeEnbRatio", "How many (on average) home UEs per HeNB there are in the simulation", ns3::DoubleValue(1.0), ns3::MakeDoubleChecker< double >())
How many (on average) home UEs per HeNB there are in the simulation.
static ns3::GlobalValue g_nBlocks("nBlocks", "Number of femtocell blocks", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
Number of femtocell blocks.
static ns3::GlobalValue g_useUdp("useUdp", "if true, the UdpClient application will be used. " "Otherwise, the BulkSend application will be used over a TCP connection. " "If EPC is not used, this parameter will be ignored.", ns3::BooleanValue(true), ns3::MakeBooleanChecker())
if true, the UdpClient application will be used.
static ns3::GlobalValue g_numBearersPerUe("numBearersPerUe", "How many bearers per UE there are in the simulation", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint16_t >())
How many bearers per UE there are in the simulation.
static ns3::GlobalValue g_epc("epc", "If true, will setup the EPC to simulate an end-to-end topology, " "with real IP applications over PDCP and RLC UM (or RLC AM by changing " "the default value of EpsBearerToRlcMapping e.g. to RLC_AM_ALWAYS). " "If false, only the LTE radio access will be simulated with RLC SM.", ns3::BooleanValue(false), ns3::MakeBooleanChecker())
If true, will setup the EPC to simulate an end-to-end topology.
static ns3::GlobalValue g_areaMarginFactor("areaMarginFactor", "how much the UE area extends outside the macrocell grid, " "expressed as fraction of the interSiteDistance", ns3::DoubleValue(0.5), ns3::MakeDoubleChecker< double >())
how much the UE area extends outside the macrocell grid, expressed as fraction of the interSiteDistan...
void PrintGnuplottableUeListToFile(std::string filename)
Print a list of UEs that can be plotted using Gnuplot.
static ns3::GlobalValue g_interSiteDistance("interSiteDistance", "min distance between two nearby macro cell sites", ns3::DoubleValue(500), ns3::MakeDoubleChecker< double >())
min distance between two nearby macro cell sites
static ns3::GlobalValue g_epcUl("epcUl", "if true, will activate data flows in the uplink when EPC is being used. " "If false, uplink flows won't be activated. " "If EPC is not used, this parameter will be ignored.", ns3::BooleanValue(true), ns3::MakeBooleanChecker())
if true, will activate data flows in the uplink when EPC is being used.
static ns3::GlobalValue g_macroEnbDlEarfcn("macroEnbDlEarfcn", "DL EARFCN used by macro eNBs", ns3::UintegerValue(100), ns3::MakeUintegerChecker< uint16_t >())
DL EARFCN used by macro eNBs.
serverApps
Definition first.py:43
clientApps
Definition first.py:53
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeChecker > MakeIntegerChecker()
Definition integer.h:99
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition double.h:82
Ptr< const AttributeChecker > MakeStringChecker()
Definition string.cc:19
mobility
Definition third.py:92
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition epc-tft.h:60
uint16_t localPortEnd
end of the port number range of the UE
Definition epc-tft.h:121
uint16_t remotePortEnd
end of the port number range of the remote host
Definition epc-tft.h:119
uint16_t remotePortStart
start of the port number range of the remote host
Definition epc-tft.h:118
uint16_t localPortStart
start of the port number range of the UE
Definition epc-tft.h:120