5#include "lena-lte-comparison.h"
7#include "flow-monitor-output-stats.h"
8#include "lena-v1-utils.h"
9#include "lena-v2-utils.h"
10#include "power-output-stats.h"
11#include "rb-output-stats.h"
12#include "sinr-output-stats.h"
13#include "slot-output-stats.h"
15#include "ns3/antenna-module.h"
16#include "ns3/applications-module.h"
17#include "ns3/config-store-module.h"
18#include "ns3/config-store.h"
19#include "ns3/core-module.h"
20#include "ns3/flow-monitor-module.h"
21#include "ns3/internet-apps-module.h"
22#include "ns3/internet-module.h"
23#include "ns3/lte-module.h"
24#include "ns3/mobility-module.h"
25#include "ns3/network-module.h"
26#include "ns3/point-to-point-module.h"
27#include "ns3/radio-environment-map-helper.h"
28#include "ns3/sqlite-output.h"
43NS_LOG_COMPONENT_DEFINE(
"LenaLteComparison");
48const Time appStartWindow = MilliSeconds(50);
52CreateLowLatTft(uint16_t start, uint16_t end, std::string dir)
55 lowLatTft = Create<T>();
56 typename T::PacketFilter dlpfLowLat;
59 dlpfLowLat.localPortStart = start;
60 dlpfLowLat.localPortEnd = end;
61 dlpfLowLat.direction = T::DOWNLINK;
65 dlpfLowLat.remotePortStart = start;
66 dlpfLowLat.remotePortEnd = end;
67 dlpfLowLat.direction = T::UPLINK;
69 lowLatTft->Add(dlpfLowLat);
73template Ptr<ns3::EpcTft> CreateLowLatTft<ns3::EpcTft>(uint16_t, uint16_t, std::string);
74template Ptr<ns3::NrEpcTft> CreateLowLatTft<ns3::NrEpcTft>(uint16_t, uint16_t, std::string);
76static std::pair<ApplicationContainer, Time>
77InstallApps(
const Ptr<Node>& ue,
78 const Ptr<NetDevice>& ueDevice,
79 const Address& ueAddress,
80 const std::string& direction,
81 UdpClientHelper* dlClientLowLat,
82 const Ptr<Node>& remoteHost,
83 const Ipv4Address& remoteHostAddr,
85 uint16_t dlPortLowLat,
86 const Ptr<UniformRandomVariable>& x,
87 Time appGenerationTime,
88 const Ptr<LteHelper>& lteHelper,
89 const Ptr<NrHelper>& nrHelper)
91 ApplicationContainer app;
94 EpsBearer lowLatBearer(EpsBearer::NGBR_VIDEO_TCP_DEFAULT);
98 Ptr<EpcTft> lowLatTft = CreateLowLatTft<EpcTft>(dlPortLowLat, dlPortLowLat, direction);
99 Ptr<NrEpcTft> nrLowLatTft = CreateLowLatTft<NrEpcTft>(dlPortLowLat, dlPortLowLat, direction);
103 if (direction ==
"DL")
105 dlClientLowLat->SetAttribute(
"RemoteAddress", AddressValue(ueAddress));
106 app = dlClientLowLat->Install(remoteHost);
110 dlClientLowLat->SetAttribute(
"RemoteAddress", AddressValue(remoteHostAddr));
111 app = dlClientLowLat->Install(ue);
114 double start = x->GetValue(udpAppStartTime.GetMilliSeconds(),
115 (udpAppStartTime + appStartWindow).GetMilliSeconds());
116 Time startTime = MilliSeconds(start);
117 app.Start(startTime);
118 app.Stop(startTime + appGenerationTime);
120 std::cout <<
"\tStarts at time " << startTime.As(Time::MS) <<
" and ends at "
121 << (startTime + appGenerationTime).As(Time::MS) << std::endl;
124 if (lteHelper !=
nullptr)
126 lteHelper->ActivateDedicatedEpsBearer(ueDevice, lowLatBearer, lowLatTft);
128 else if (nrHelper !=
nullptr)
130 nrHelper->ActivateDedicatedEpsBearer(ueDevice, nrLowLatBearer, nrLowLatTft);
133 return std::make_pair(app, startTime);
137Parameters::Validate()
const
139 NS_ABORT_MSG_IF(bandwidthMHz != 20 && bandwidthMHz != 10 && bandwidthMHz != 5,
140 "Valid bandwidth values are 20, 10, 5, you set " << bandwidthMHz);
142 NS_ABORT_MSG_IF(trafficScenario > 3,
143 "Traffic scenario " << trafficScenario
144 <<
" not valid. Valid values are 0 1 2 3");
146 NS_ABORT_MSG_IF(numerologyBwp > 4,
"At most 4 bandwidth parts supported.");
148 NS_ABORT_MSG_IF(direction !=
"DL" && direction !=
"UL",
149 "Flow direction can only be DL or UL: " << direction);
150 NS_ABORT_MSG_IF(operationMode !=
"TDD" && operationMode !=
"FDD",
151 "Operation mode can only be TDD or FDD: " << operationMode);
152 NS_ABORT_MSG_IF(radioNetwork !=
"LTE" && radioNetwork !=
"NR",
153 "Unrecognized radio network technology: " << radioNetwork);
154 NS_ABORT_MSG_IF(radioNetwork ==
"LTE" && operationMode !=
"FDD",
155 "Operation mode must be FDD in a 4G LTE network: " << operationMode);
156 NS_ABORT_MSG_IF(simulator !=
"LENA" && simulator !=
"5GLENA",
157 "Unrecognized simulator: " << simulator);
158 NS_ABORT_MSG_IF(scheduler !=
"PF" && scheduler !=
"RR",
159 "Unrecognized scheduler: " << scheduler);
163 NS_ABORT_MSG_IF(simulator !=
"5GLENA",
164 "Cannot do the REM with the simulator " << simulator);
165 NS_ABORT_MSG_IF(dlRem && ulRem,
"You selected both DL and UL REM, that is not supported");
166 NS_ABORT_MSG_IF(remSector > 3,
"Only three sectors supported for REM");
168 NS_ABORT_MSG_IF(remSector == 0 && freqScenario != 1,
169 "RemSector == 0 makes sense only in a OVERLAPPING scenario");
176LenaLteComparison(
const Parameters& params)
181 uint32_t udpPacketSize = 1000;
183 uint32_t packetCount;
185 std::cout <<
"\n----------------------------------------\n"
186 <<
"Configuring scenario" << std::endl;
188 std::cout <<
" traffic parameters\n";
189 switch (params.trafficScenario)
192 packetCount = 0xFFFFFFFF;
193 switch (params.bandwidthMHz)
196 udpPacketSize = 1000;
205 udpPacketSize = 1000;
207 lambda = 10000 / params.ueNumPergNb;
215 packetCount = 0xFFFFFFFF;
216 switch (params.bandwidthMHz)
230 lambda = 1000 / params.ueNumPergNb;
233 packetCount = 0xFFFFFFFF;
234 switch (params.bandwidthMHz)
248 lambda = 10000 / params.ueNumPergNb;
251 NS_FATAL_ERROR(
"Traffic scenario " << params.trafficScenario
252 <<
" not valid. Valid values are 0 1 2 3");
255 std::cout <<
" statistics\n";
256 SQLiteOutput db(params.outputDir +
"/" + params.simTag +
".db");
257 SinrOutputStats sinrStats;
258 PowerOutputStats ueTxPowerStats;
259 PowerOutputStats gnbRxPowerStats;
260 SlotOutputStats slotStats;
261 RbOutputStats rbStats;
263 sinrStats.SetDb(&db);
264 ueTxPowerStats.SetDb(&db,
"ueTxPower");
265 slotStats.SetDb(&db);
267 gnbRxPowerStats.SetDb(&db,
"gnbRxPower");
273 std::cout <<
" checking frequency and numerology\n";
285 std::cout <<
" logging\n";
288 LogComponentEnable(
"UdpClient", LOG_LEVEL_INFO);
289 LogComponentEnable(
"UdpServer", LOG_LEVEL_INFO);
290 LogComponentEnable(
"LtePdcp", LOG_LEVEL_INFO);
298 std::cout <<
" max tx buffer size\n";
299 Config::SetDefault(
"ns3::LteRlcUm::MaxTxBufferSize", UintegerValue(999999999));
307 ScenarioParameters scenarioParams;
308 scenarioParams.SetScenarioParameters(params.scenario);
313 uint32_t gnbSites = 0;
314 NodeContainer gnbNodes;
315 NodeContainer ueNodes;
316 double sector0AngleRad = 0;
317 const uint32_t sectors = 3;
320 NodeDistributionScenarioInterface* scenario{
nullptr};
321 FileScenarioHelper fileScenario;
322 HexagonalGridScenarioHelper gridScenario;
324 if (!params.baseStationFile.empty() and params.useSiteFile)
326 std::cout <<
" using tower positions from " << params.baseStationFile << std::endl;
327 std::cout <<
" setting sectorization" << std::endl;
328 fileScenario.SetSectorization(sectors);
329 std::cout <<
" adding site file" << std::endl;
330 fileScenario.Add(params.baseStationFile);
331 std::cout <<
" setting scenario" << std::endl;
332 fileScenario.SetScenarioParameters(params.scenario);
333 std::cout <<
" getting number of sites..." << std::flush;
334 gnbSites = fileScenario.GetNumSites();
335 std::cout << gnbSites << std::endl;
336 std::cout <<
" getting number of cells..." << std::flush;
337 uint32_t gnbNum = fileScenario.GetNumCells();
338 std::cout << gnbNum << std::endl;
339 uint32_t ueNum = params.ueNumPergNb * gnbNum;
340 std::cout <<
" setting number of UEs..." << ueNum << std::endl;
341 fileScenario.SetUtNumber(ueNum);
342 std::cout <<
" getting sector 0 angle..." << std::flush;
343 sector0AngleRad = fileScenario.GetAntennaOrientationRadians(0);
344 std::cout << sector0AngleRad << std::endl;
347 std::cout <<
" creating scenario" << std::endl;
348 fileScenario.CreateScenario();
349 std::cout <<
" getting gnbNodes..." << std::flush;
350 gnbNodes = fileScenario.GetBaseStations();
351 std::cout << gnbNodes.GetN() << std::endl;
352 std::cout <<
" getting ueNodes..." << std::flush;
353 ueNodes = fileScenario.GetUserTerminals();
354 std::cout << ueNodes.GetN() << std::endl;
355 std::cout <<
" setting scenario pointer..." << std::flush;
356 scenario = &fileScenario;
357 std::cout <<
"0x" << std::hex << scenario << std::dec << std::endl;
361 std::cout <<
" hexagonal grid: ";
362 gridScenario.SetScenarioParameters(scenarioParams);
363 gridScenario.SetNumRings(params.numOuterRings);
364 gnbSites = gridScenario.GetNumSites();
365 uint32_t ueNum = params.ueNumPergNb * gnbSites * sectors;
366 gridScenario.SetUtNumber(ueNum);
367 sector0AngleRad = gridScenario.GetAntennaOrientationRadians(0);
368 std::cout << sector0AngleRad << std::endl;
371 gridScenario.CreateScenario();
372 gnbNodes = gridScenario.GetBaseStations();
373 ueNodes = gridScenario.GetUserTerminals();
374 scenario = &gridScenario;
378 std::cout <<
"\n Topology configuration: " << gnbSites <<
" sites, " << sectors
379 <<
" sectors/site, " << gnbNodes.GetN() <<
" cells, " << ueNodes.GetN() <<
" UEs\n";
395 NodeContainer gnbSector1Container;
396 NodeContainer gnbSector2Container;
397 NodeContainer gnbSector3Container;
398 std::vector<NodeContainer*> gnbNodesBySector{&gnbSector1Container,
399 &gnbSector2Container,
400 &gnbSector3Container};
401 for (uint32_t cellId = 0; cellId < gnbNodes.GetN(); ++cellId)
403 Ptr<Node> gnb = gnbNodes.Get(cellId);
404 auto sector = scenario->GetSectorIndex(cellId);
405 gnbNodesBySector[sector]->Add(gnb);
407 std::cout <<
" gNb containers: " << gnbSector1Container.GetN() <<
", "
408 << gnbSector2Container.GetN() <<
", " << gnbSector3Container.GetN() << std::endl;
418 NodeContainer ueSector1Container;
419 NodeContainer ueSector2Container;
420 NodeContainer ueSector3Container;
421 std::vector<NodeContainer*> ueNodesBySector{&ueSector1Container,
423 &ueSector3Container};
424 for (uint32_t ueId = 0; ueId < ueNodes.GetN(); ++ueId)
426 Ptr<Node> ue = ueNodes.Get(ueId);
427 auto cellId = scenario->GetCellIndex(ueId);
428 auto sector = scenario->GetSectorIndex(cellId);
429 ueNodesBySector[sector]->Add(ue);
431 std::cout <<
" UE containers: " << ueSector1Container.GetN() <<
", "
432 << ueSector2Container.GetN() <<
", " << ueSector3Container.GetN() << std::endl;
438 std::cout <<
" helpers\n";
439 Ptr<PointToPointEpcHelper> epcHelper;
440 Ptr<NrPointToPointEpcHelper> nrEpcHelper;
442 NetDeviceContainer gnbSector1NetDev;
443 NetDeviceContainer gnbSector2NetDev;
444 NetDeviceContainer gnbSector3NetDev;
445 std::vector<NetDeviceContainer*> gnbNdBySector{&gnbSector1NetDev,
448 NetDeviceContainer ueSector1NetDev;
449 NetDeviceContainer ueSector2NetDev;
450 NetDeviceContainer ueSector3NetDev;
451 std::vector<NetDeviceContainer*> ueNdBySector{&ueSector1NetDev,
455 Ptr<LteHelper> lteHelper =
nullptr;
456 Ptr<NrHelper> nrHelper =
nullptr;
458 if (params.simulator ==
"LENA")
460 epcHelper = CreateObject<PointToPointEpcHelper>();
461 LenaV1Utils::SetLenaV1SimulatorParameters(sector0AngleRad,
484 params.downtiltAngle);
486 else if (params.simulator ==
"5GLENA")
488 nrEpcHelper = CreateObject<NrPointToPointEpcHelper>();
493 params.operationMode,
495 params.numerologyBwp,
513 params.powerAllocation,
522 params.downtiltAngle);
526 if ((lteHelper ==
nullptr) && (nrHelper ==
nullptr))
528 NS_ABORT_MSG(
"Programming error: no valid helper");
536 std::cout <<
" pgw and internet\n";
538 if (params.simulator ==
"LENA")
540 pgw = epcHelper->GetPgwNode();
544 pgw = nrEpcHelper->GetPgwNode();
546 NodeContainer remoteHostContainer;
547 remoteHostContainer.Create(1);
548 Ptr<Node> remoteHost = remoteHostContainer.Get(0);
549 InternetStackHelper internet;
550 internet.Install(remoteHostContainer);
553 PointToPointHelper p2ph;
554 p2ph.SetDeviceAttribute(
"DataRate", DataRateValue(DataRate(
"100Gb/s")));
555 p2ph.SetDeviceAttribute(
"Mtu", UintegerValue(2500));
556 p2ph.SetChannelAttribute(
"Delay", TimeValue(Seconds(0.000)));
557 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
558 Ipv4AddressHelper ipv4h;
559 Ipv4StaticRoutingHelper ipv4RoutingHelper;
560 ipv4h.SetBase(
"1.0.0.0",
"255.0.0.0");
561 Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
562 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
563 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
564 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address(
"7.0.0.0"), Ipv4Mask(
"255.0.0.0"), 1);
565 internet.Install(ueNodes);
567 NetDeviceContainer gnbNetDevs(gnbSector1NetDev, gnbSector2NetDev);
568 gnbNetDevs.Add(gnbSector3NetDev);
569 NetDeviceContainer ueNetDevs(ueSector1NetDev, ueSector2NetDev);
570 ueNetDevs.Add(ueSector3NetDev);
572 Ipv4InterfaceContainer ueIpIfaces;
573 Ipv4Address gatewayAddress;
574 if (params.simulator ==
"LENA")
576 ueIpIfaces = epcHelper->AssignUeIpv4Address(ueNetDevs);
577 gatewayAddress = epcHelper->GetUeDefaultGatewayAddress();
581 ueIpIfaces = nrEpcHelper->AssignUeIpv4Address(ueNetDevs);
582 gatewayAddress = nrEpcHelper->GetUeDefaultGatewayAddress();
585 Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress(1);
588 std::cout <<
" default gateway\n";
589 for (
auto ue = ueNodes.Begin(); ue != ueNodes.End(); ++ue)
591 Ptr<Ipv4StaticRouting> ueStaticRouting =
592 ipv4RoutingHelper.GetStaticRouting((*ue)->GetObject<Ipv4>());
593 ueStaticRouting->SetDefaultRoute(gatewayAddress, 1);
597 std::cout <<
" attach UEs to gNBs\n" << std::endl;
598 for (uint32_t ueId = 0; ueId < ueNodes.GetN(); ++ueId)
600 auto cellId = scenario->GetCellIndex(ueId);
601 Ptr<NetDevice> gnbNetDev = gnbNodes.Get(cellId)->GetDevice(0);
602 Ptr<NetDevice> ueNetDev = ueNodes.Get(ueId)->GetDevice(0);
603 if (lteHelper !=
nullptr)
605 lteHelper->Attach(ueNetDev, gnbNetDev);
607 else if (nrHelper !=
nullptr)
609 nrHelper->AttachToGnb(ueNetDev, gnbNetDev);
610 auto uePhyBwp0{nrHelper->GetUePhy(ueNetDev, 0)};
611 auto gnbPhyBwp0{nrHelper->GetGnbPhy(gnbNetDev, 0)};
612 Vector gnbpos = gnbNetDev->GetNode()->GetObject<MobilityModel>()->GetPosition();
613 Vector uepos = ueNetDev->GetNode()->GetObject<MobilityModel>()->GetPosition();
614 double distance = CalculateDistance(gnbpos, uepos);
615 std::cout <<
"ueId " << ueId <<
", cellIndex " << cellId <<
", ue freq "
616 << uePhyBwp0->GetCentralFrequency() / 1e9 <<
", gnb freq "
617 << gnbPhyBwp0->GetCentralFrequency() / 1e9 <<
", sector "
618 << scenario->GetSectorIndex(cellId) <<
", distance " << distance
619 <<
", azimuth gnb->ue:"
620 << RadiansToDegrees(Angles(gnbpos, uepos).GetAzimuth()) << std::endl;
628 std::cout <<
" server factory\n";
629 uint16_t dlPortLowLat = 1234;
631 ApplicationContainer serverApps;
634 UdpServerHelper dlPacketSinkLowLat(dlPortLowLat);
637 if (params.direction ==
"DL")
639 serverApps.Add(dlPacketSinkLowLat.Install(ueNodes));
643 serverApps.Add(dlPacketSinkLowLat.Install(remoteHost));
647 serverApps.Start(params.udpAppStartTime);
655 Time interval = Seconds(1.0 / lambda);
656 std::cout <<
" client factory:"
657 <<
"\n packet size: " << udpPacketSize <<
"\n interval: " << interval
658 <<
"\n max packets: " << packetCount << std::endl;
660 UdpClientHelper dlClientLowLat;
661 dlClientLowLat.SetAttribute(
"RemotePort", UintegerValue(dlPortLowLat));
662 dlClientLowLat.SetAttribute(
"MaxPackets", UintegerValue(packetCount));
663 dlClientLowLat.SetAttribute(
"PacketSize", UintegerValue(udpPacketSize));
664 dlClientLowLat.SetAttribute(
"Interval", TimeValue(interval));
669 std::cout <<
" applications\n";
670 ApplicationContainer clientApps;
671 Ptr<UniformRandomVariable> startRng = CreateObject<UniformRandomVariable>();
672 startRng->SetStream(RngSeedManager::GetRun());
675 for (uint32_t ueId = 0; ueId < ueNodes.GetN(); ++ueId)
677 auto cellId = scenario->GetCellIndex(ueId);
678 auto sector = scenario->GetSectorIndex(cellId);
679 auto siteId = scenario->GetSiteIndex(cellId);
680 Ptr<Node> node = ueNodes.Get(ueId);
681 Ptr<NetDevice> dev = ueNetDevs.Get(ueId);
682 Address addr = ueIpIfaces.GetAddress(ueId);
684 std::cout <<
"app for ue " << ueId <<
", cellId " << cellId <<
", sector " << sector
685 <<
", siteId " << siteId;
688 auto app = InstallApps(node,
695 params.udpAppStartTime,
698 params.appGenerationTime,
701 maxStartTime = std::max(app.second, maxStartTime);
702 clientApps.Add(app.first);
704 std::cout << clientApps.GetN() <<
" apps\n";
707 std::cout <<
" tracing\n";
710 if (lteHelper !=
nullptr)
712 lteHelper->EnableTraces();
714 else if (nrHelper !=
nullptr)
716 nrHelper->EnableTraces();
720 std::cout <<
" flowmon\n";
721 FlowMonitorHelper flowmonHelper;
722 NodeContainer endpointNodes;
723 endpointNodes.Add(remoteHost);
724 endpointNodes.Add(ueNodes);
726 Ptr<FlowMonitor> monitor = flowmonHelper.Install(endpointNodes);
727 monitor->SetAttribute(
"DelayBinWidth", DoubleValue(0.001));
728 monitor->SetAttribute(
"JitterBinWidth", DoubleValue(0.001));
729 monitor->SetAttribute(
"PacketSizeBinWidth", DoubleValue(20));
731 std::string tableName =
"e2e";
733 Ptr<NrRadioEnvironmentMapHelper>
739 if (params.dlRem || params.ulRem)
741 std::cout <<
" rem helper\n";
743 uint16_t remPhyIndex = 0;
744 if (params.operationMode ==
"FDD" && params.direction ==
"UL")
749 NetDeviceContainer remNd;
750 Ptr<NetDevice> remDevice;
753 std::vector<NetDeviceContainer*> remNdBySector{ueNdBySector};
754 std::vector<NetDeviceContainer*> remDevBySector{gnbNdBySector};
758 remNdBySector = gnbNdBySector;
759 remDevBySector = ueNdBySector;
762 uint32_t sectorIndex = 0;
764 for (uint32_t sector = sectors; sector > 0; --sector)
766 if (params.remSector == sector || params.remSector == 0)
768 sectorIndex = sector - 1;
769 remNd.Add(*remNdBySector[sectorIndex]);
770 remDevice = remDevBySector[sectorIndex]->Get(0);
777 DynamicCast<NrGnbNetDevice>(remDevice)->GetPhy(0)->GetSpectrumPhy()->GetAntenna();
778 auto antenna = DynamicCast<UniformPlanarArray>(antArray);
779 antenna->SetAttribute(
"AntennaElement",
780 PointerValue(CreateObject<IsotropicAntennaModel>()));
784 remHelper = CreateObject<NrRadioEnvironmentMapHelper>();
785 remHelper->SetMinX(params.xMinRem);
786 remHelper->SetMaxX(params.xMaxRem);
787 remHelper->SetResX(params.xResRem);
788 remHelper->SetMinY(params.yMinRem);
789 remHelper->SetMaxY(params.yMaxRem);
790 remHelper->SetResY(params.yResRem);
791 remHelper->SetZ(params.zRem);
794 for (uint32_t sector = sectors; sector > 0; --sector)
796 if ((params.remSector == sector) || (params.remSector == 0))
798 sectorIndex = sector - 1;
799 for (uint32_t siteId = 0; siteId < gnbSites; ++siteId)
801 gnbNdBySector[sectorIndex]
803 ->GetObject<NrGnbNetDevice>()
804 ->GetPhy(remPhyIndex)
805 ->ChangeBeamformingVector(
806 DynamicCast<NrUeNetDevice>(ueNdBySector[sectorIndex]->Get(siteId)));
811 remHelper->CreateRem(remNd, remDevice, remPhyIndex);
814 std::cout <<
"\n----------------------------------------\n"
815 <<
"Start simulation" << std::endl;
817 const Time appStopWindow = MilliSeconds(50);
818 Time stopTime = maxStartTime + params.appGenerationTime + appStopWindow;
819 Simulator::Stop(stopTime);
822 sinrStats.EmptyCache();
823 ueTxPowerStats.EmptyCache();
824 gnbRxPowerStats.EmptyCache();
825 slotStats.EmptyCache();
826 rbStats.EmptyCache();
835 FlowMonitorOutputStats flowMonStats;
836 flowMonStats.SetDb(&db, tableName);
837 flowMonStats.Save(monitor, flowmonHelper, params.outputDir +
"/" + params.simTag);
839 std::cout <<
"\n----------------------------------------\n"
840 <<
"End simulation" << std::endl;
842 Simulator::Destroy();
846operator<<(std::ostream& os,
const Parameters& parameters)
852 os << "\n" << m << std::left << std::setw(40 - strlen(m)) << (strlen(m) > 0 ? ":" : "")
854 MSG(
"LENA LTE Scenario Parameters");
856 MSG(
"Model version") << p.simulator << (p.simulator ==
"LENA" ?
" (v1)" :
" (v2)");
857 if (p.simulator ==
"5GLENA")
859 MSG(
"LTE Standard") << p.radioNetwork << (p.radioNetwork ==
"LTE" ?
" (4G)" :
" (5G NR)");
860 MSG(
"4G-NR calibration mode") << (p.calibration ?
"ON" :
"off");
861 MSG(
"4G-NR ULPC mode") << (p.enableUlPc ?
"Enabled" :
"Disabled");
862 MSG(
"Operation mode") << p.operationMode;
863 if (p.operationMode ==
"TDD")
865 MSG(
"Numerology") << p.numerologyBwp;
866 MSG(
"TDD pattern") << p.pattern;
868 if (!p.errorModel.empty())
870 MSG(
"Error model") << p.errorModel;
872 else if (p.radioNetwork ==
"LTE")
874 MSG(
"Error model") <<
"ns3::LenaErrorModel";
876 else if (p.radioNetwork ==
"NR")
878 MSG(
"Error model") <<
"ns3::NrEesmCcT2";
884 p.operationMode =
"FDD";
885 MSG(
"LTE Standard") <<
"4G";
886 MSG(
"Calibration mode") << (p.calibration ?
"ON" :
"off");
887 MSG(
"LTE ULPC mode") << (p.enableUlPc ?
"Enabled" :
"Disabled");
888 MSG(
"Operation mode") << p.operationMode;
891 if (!p.baseStationFile.empty() and p.useSiteFile)
893 MSG(
"Base station positions") <<
"read from file " << p.baseStationFile;
897 MSG(
"Base station positions") <<
"regular hexaonal lay down";
898 MSG(
"Number of rings") << p.numOuterRings;
902 MSG(
"Channel bandwidth") << p.bandwidthMHz <<
" MHz";
903 MSG(
"Spectrum configuration") << (p.freqScenario == 0 ?
"non-" :
"") <<
"overlapping";
904 MSG(
"LTE Scheduler") << p.scheduler;
907 MSG(
"Basic scenario") << p.scenario;
908 if (p.scenario ==
"UMa")
910 os <<
"\n (ISD: 1.7 km, BS: 30 m, UE: 1.5 m, UE-BS min: 30.2 m)";
912 else if (p.scenario ==
"UMi")
914 os <<
"\n (ISD: 0.5 km, BS: 10 m, UE: 1.5 m, UE-BS min: 10 m)";
916 else if (p.scenario ==
"RMa")
918 os <<
"\n (ISD: 7.0 km, BS: 45 m, UE: 1.5 m, UE-BS min: 44.6 m)";
922 os <<
"\n (unknown configuration)";
924 if (p.baseStationFile.empty() and p.useSiteFile)
926 MSG(
"Number of outer rings") << p.numOuterRings;
928 MSG(
"Number of UEs per sector") << p.ueNumPergNb;
929 MSG(
"Antenna downtilt angle (deg)") << p.downtiltAngle;
932 MSG(
"Network loading") << p.trafficScenario;
933 switch (p.trafficScenario)
936 MSG(
" Max loading (80 Mbps/20 MHz)");
937 MSG(
" Number of packets") <<
"infinite";
939 switch (p.bandwidthMHz)
954 MSG(
" Inter-packet interval (per UE)") << p.ueNumPergNb / 10.0 <<
" ms";
959 MSG(
" Number of packets") << 1;
960 MSG(
" Packet size") <<
"12 bytes";
961 MSG(
" Inter-packet interval (per UE)") <<
"1 s";
965 MSG(
" Moderate loading");
966 MSG(
" Number of packets") <<
"infinite";
968 switch (p.bandwidthMHz)
983 MSG(
" Inter-packet interval (per UE)") << 1 / (1000 / p.ueNumPergNb) <<
" s";
988 MSG(
" Moderate-high loading");
989 MSG(
" Number of packets") <<
"infinite";
991 switch (p.bandwidthMHz)
1006 MSG(
" Inter-packet interval (per UE)") << 1 / (10000.0 / p.ueNumPergNb) <<
" s";
1010 os <<
"\n (Unknown configuration)";
1013 MSG(
"Application start window")
1014 << p.udpAppStartTime.As(Time::MS) <<
" + " << appStartWindow.As(Time::MS);
1015 MSG(
"Application on duration") << p.appGenerationTime.As(Time::MS);
1016 MSG(
"Traffic direction") << p.direction;
1019 MSG(
"Output file name") << p.simTag;
1020 MSG(
"Output directory") << p.outputDir;
1021 MSG(
"Logging") << (p.logging ?
"ON" :
"off");
1022 MSG(
"Trace file generation") << (p.traces ?
"ON" :
"off");
1024 MSG(
"Radio environment map") << (p.dlRem ?
"DL" : (p.ulRem ?
"UL" :
"off"));
1025 if (p.dlRem || p.ulRem)
1027 MSG(
" Sector to sample");
1028 if (p.remSector == 0)
1036 MSG(
" X range") << p.xMinRem <<
" - " << p.xMaxRem <<
", in " << p.xResRem <<
" m steps";
1037 MSG(
" Y range") << p.yMinRem <<
" - " << p.yMaxRem <<
", in " << p.yResRem <<
" m steps";
1038 MSG(
" Altitude (Z)") << p.zRem <<
" m";
static void SetLenaV2SimulatorParameters(const double sector0AngleRad, const std::string &scenario, const std::string &confType, const std::string &radioNetwork, std::string errorModel, const std::string &operationMode, const std::string &direction, uint16_t numerology, const std::string &pattern, const NodeContainer &gnbSector1Container, const NodeContainer &gnbSector2Container, const NodeContainer &gnbSector3Container, const NodeContainer &ueSector1Container, const NodeContainer &ueSector2Container, const NodeContainer &ueSector3Container, const Ptr< NrPointToPointEpcHelper > &baseEpcHelper, Ptr< NrHelper > &nrHelper, NetDeviceContainer &gnbSector1NetDev, NetDeviceContainer &gnbSector2NetDev, NetDeviceContainer &gnbSector3NetDev, NetDeviceContainer &ueSector1NetDev, NetDeviceContainer &ueSector2NetDev, NetDeviceContainer &ueSector3NetDev, bool enableFading, bool enableUlPc, std::string powerAllocation, SinrOutputStats *sinrStats, PowerOutputStats *ueTxPowerStats, PowerOutputStats *gnbRxPowerStats, SlotOutputStats *slotStats, RbOutputStats *rbStats, const std::string &scheduler, uint32_t bandwidthMHz, double startingFreq, uint32_t freqScenario, double gnbTxPower, double ueTxPower, double downtiltAngle, const uint32_t gnbNumRows, const uint32_t gnbNumColumns, const uint32_t ueNumRows, const uint32_t ueNumColumns, bool gnbEnable3gppElement, bool ueEnable3gppElement, const double gnbHSpacing, const double gnbVSpacing, const double ueHSpacing, const double ueVSpacing, const double gnbNoiseFigure, const double ueNoiseFigure, bool enableRealBF, bool enableShadowing, double o2iThreshold, double o2iLowLossThreshold, bool linkO2iConditionToAntennaHeight, bool crossPolarizedGnb, bool crossPolarizedUe, double polSlantAngleGnb1, double polSlantAngleGnb2, double polSlantAngleUe1, double polSlantAngleUe2, std::string bfMethod, uint16_t beamConfSector, double beamConfElevation, double isd, bool ueBearingAngle)
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)