A Discrete-Event Network Simulator
API
lena-radio-link-failure.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Fraunhofer ESK
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Vignesh Babu <ns3-dev@esk.fraunhofer.de>
18 */
19
20#include "ns3/applications-module.h"
21#include "ns3/core-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
28#include <iomanip>
29#include <iostream>
30#include <stdio.h>
31#include <vector>
32
33using namespace ns3;
34
35NS_LOG_COMPONENT_DEFINE("LenaRadioLinkFailure");
36
37// Global values to check the simulation
38// behavior during and after the simulation.
39uint16_t counterN310FirsteNB = 0;
43
49void
50PrintUePosition(uint64_t imsi)
51{
52 for (NodeList::Iterator it = NodeList::Begin(); it != NodeList::End(); ++it)
53 {
54 Ptr<Node> node = *it;
55 int nDevs = node->GetNDevices();
56 for (int j = 0; j < nDevs; j++)
57 {
58 Ptr<LteUeNetDevice> uedev = node->GetDevice(j)->GetObject<LteUeNetDevice>();
59 if (uedev)
60 {
61 if (imsi == uedev->GetImsi())
62 {
63 Vector pos = node->GetObject<MobilityModel>()->GetPosition();
64 std::cout << "IMSI : " << uedev->GetImsi() << " at " << pos.x << "," << pos.y
65 << std::endl;
66 }
67 }
68 }
69 }
70}
71
80void
81NotifyConnectionEstablishedUe(std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti)
82{
83 std::cout << Simulator::Now().As(Time::S) << " " << context << " UE IMSI " << imsi
84 << ": connected to cell id " << cellid << " with RNTI " << rnti << std::endl;
85}
86
95void
96NotifyConnectionEstablishedEnb(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
97{
98 std::cout << Simulator::Now().As(Time::S) << " " << context << " eNB cell id " << cellId
99 << ": successful connection of UE with IMSI " << imsi << " RNTI " << rnti
100 << std::endl;
101 // In this example, a UE should experience RLF at least one time in
102 // cell 1. For the case, when there is only one eNB with ideal RRC,
103 // a UE might reconnects to the eNB multiple times due to more than
104 // one RLF. To handle this, we reset the counter here so, even if the UE
105 // connects multiple time to cell 1 we count N310
106 // indication correctly, i.e., for each RLF UE RRC should receive
107 // configured number of N310 indications.
108 if (cellId == 1)
109 {
111 }
112}
113
115static const std::string g_ueRrcStateName[LteUeRrc::NUM_STATES] = {"IDLE_START",
116 "IDLE_CELL_SEARCH",
117 "IDLE_WAIT_MIB_SIB1",
118 "IDLE_WAIT_MIB",
119 "IDLE_WAIT_SIB1",
120 "IDLE_CAMPED_NORMALLY",
121 "IDLE_WAIT_SIB2",
122 "IDLE_RANDOM_ACCESS",
123 "IDLE_CONNECTING",
124 "CONNECTED_NORMALLY",
125 "CONNECTED_HANDOVER",
126 "CONNECTED_PHY_PROBLEM",
127 "CONNECTED_REESTABLISHING"};
128
133static const std::string&
135{
136 return g_ueRrcStateName[s];
137}
138
148void
149UeStateTransition(uint64_t imsi,
150 uint16_t cellId,
151 uint16_t rnti,
152 LteUeRrc::State oldState,
153 LteUeRrc::State newState)
154{
155 std::cout << Simulator::Now().As(Time::S) << " UE with IMSI " << imsi << " RNTI " << rnti
156 << " connected to cell " << cellId << " transitions from " << ToString(oldState)
157 << " to " << ToString(newState) << std::endl;
158}
159
168void
169EnbRrcTimeout(uint64_t imsi, uint16_t rnti, uint16_t cellId, std::string cause)
170{
171 std::cout << Simulator::Now().As(Time::S) << " IMSI " << imsi << ", RNTI " << rnti
172 << ", Cell id " << cellId << ", ENB RRC " << cause << std::endl;
173}
174
182void
183NotifyConnectionReleaseAtEnodeB(uint64_t imsi, uint16_t cellId, uint16_t rnti)
184{
185 std::cout << Simulator::Now() << " IMSI " << imsi << ", RNTI " << rnti << ", Cell id " << cellId
186 << ", UE context destroyed at eNodeB" << std::endl;
187}
188
199void
200PhySyncDetection(uint16_t n310,
201 uint64_t imsi,
202 uint16_t rnti,
203 uint16_t cellId,
204 std::string type,
205 uint8_t count)
206{
207 std::cout << Simulator::Now().As(Time::S) << " IMSI " << imsi << ", RNTI " << rnti
208 << ", Cell id " << cellId << ", " << type << ", no of sync indications: " << +count
209 << std::endl;
210
211 if (type == "Notify out of sync" && cellId == 1)
212 {
214 if (counterN310FirsteNB == n310)
215 {
217 }
218 NS_LOG_DEBUG("counterN310FirsteNB = " << counterN310FirsteNB);
219 }
220}
221
230void
231RadioLinkFailure(Time t310, uint64_t imsi, uint16_t cellId, uint16_t rnti)
232{
233 std::cout << Simulator::Now() << " IMSI " << imsi << ", RNTI " << rnti << ", Cell id " << cellId
234 << ", radio link failure detected" << std::endl
235 << std::endl;
236
237 PrintUePosition(imsi);
238
239 if (cellId == 1)
240 {
242 "T310 timer expired at wrong time");
243 }
244}
245
253void
254NotifyRandomAccessErrorUe(uint64_t imsi, uint16_t cellId, uint16_t rnti)
255{
256 std::cout << Simulator::Now().As(Time::S) << " IMSI " << imsi << ", RNTI " << rnti
257 << ", Cell id " << cellId << ", UE RRC Random access Failed" << std::endl;
258}
259
268void
269NotifyConnectionTimeoutUe(uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t connEstFailCount)
270{
271 std::cout << Simulator::Now().As(Time::S) << " IMSI " << imsi << ", RNTI " << rnti
272 << ", Cell id " << cellId << ", T300 expiration counter "
273 << (uint16_t)connEstFailCount << ", UE RRC Connection timeout" << std::endl;
274}
275
284void
286 bool contention,
287 uint8_t preambleTxCounter,
288 uint8_t maxPreambleTxLimit)
289{
290 std::cout << Simulator::Now().As(Time::S) << " IMSI " << imsi << ", Contention flag "
291 << contention << ", preamble Tx Counter " << (uint16_t)preambleTxCounter
292 << ", Max Preamble Tx Limit " << (uint16_t)maxPreambleTxLimit
293 << ", UE RA response timeout" << std::endl;
294}
295
301void
303{
304 ByteCounter += packet->GetSize();
305}
306
314void
315Throughput(bool firstWrite, Time binSize, std::string fileName)
316{
317 std::ofstream output;
318
319 if (firstWrite == true)
320 {
321 output.open(fileName, std::ofstream::out);
322 firstWrite = false;
323 }
324 else
325 {
326 output.open(fileName, std::ofstream::app);
327 }
328
329 // Instantaneous throughput every 200 ms
330
331 double throughput = (ByteCounter - oldByteCounter) * 8 / binSize.GetSeconds() / 1024 / 1024;
332 output << Simulator::Now().As(Time::S) << " " << throughput << std::endl;
334 Simulator::Schedule(binSize, &Throughput, firstWrite, binSize, fileName);
335}
336
352int
353main(int argc, char* argv[])
354{
355 // Configurable parameters
356 Time simTime = Seconds(25);
357 uint16_t numberOfEnbs = 1;
358 double interSiteDistance = 1200;
359 uint16_t n311 = 1;
360 uint16_t n310 = 1;
361 Time t310 = Seconds(1);
362 bool useIdealRrc = true;
363 bool enableCtrlErrorModel = true;
364 bool enableDataErrorModel = true;
365 bool enableNsLogs = false;
366
367 CommandLine cmd(__FILE__);
368 cmd.AddValue("simTime", "Total duration of the simulation (in seconds)", simTime);
369 cmd.AddValue("numberOfEnbs", "Number of eNBs", numberOfEnbs);
370 cmd.AddValue("n311", "Number of in-synch indication", n311);
371 cmd.AddValue("n310", "Number of out-of-synch indication", n310);
372 cmd.AddValue("t310", "Timer for detecting the Radio link failure (in seconds)", t310);
373 cmd.AddValue("interSiteDistance", "Inter-site distance in meter", interSiteDistance);
374 cmd.AddValue("useIdealRrc", "Use ideal RRC protocol", useIdealRrc);
375 cmd.AddValue("enableCtrlErrorModel", "Enable control error model", enableCtrlErrorModel);
376 cmd.AddValue("enableDataErrorModel", "Enable data error model", enableDataErrorModel);
377 cmd.AddValue("enableNsLogs", "Enable ns-3 logging (debug builds)", enableNsLogs);
378 cmd.Parse(argc, argv);
379
380 if (enableNsLogs)
381 {
382 LogLevel logLevel =
384 LogComponentEnable("LteUeRrc", logLevel);
385 LogComponentEnable("LteUeMac", logLevel);
386 LogComponentEnable("LteUePhy", logLevel);
387
388 LogComponentEnable("LteEnbRrc", logLevel);
389 LogComponentEnable("LteEnbMac", logLevel);
390 LogComponentEnable("LteEnbPhy", logLevel);
391
392 LogComponentEnable("LenaRadioLinkFailure", logLevel);
393 }
394
395 uint16_t numberOfUes = 1;
396 uint16_t numBearersPerUe = 1;
397 double eNodeB_txPower = 43;
398
399 Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(useIdealRrc));
400 Config::SetDefault("ns3::LteSpectrumPhy::CtrlErrorModelEnabled",
401 BooleanValue(enableCtrlErrorModel));
402 Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled",
403 BooleanValue(enableDataErrorModel));
404
405 Config::SetDefault("ns3::LteRlcUm::MaxTxBufferSize", UintegerValue(60 * 1024));
406
407 Ptr<LteHelper> lteHelper = CreateObject<LteHelper>();
408 Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper>();
409 lteHelper->SetEpcHelper(epcHelper);
410
411 lteHelper->SetPathlossModelType(TypeId::LookupByName("ns3::LogDistancePropagationLossModel"));
412 lteHelper->SetPathlossModelAttribute("Exponent", DoubleValue(3.9));
413 lteHelper->SetPathlossModelAttribute("ReferenceLoss",
414 DoubleValue(38.57)); // ref. loss in dB at 1m for 2.025GHz
415 lteHelper->SetPathlossModelAttribute("ReferenceDistance", DoubleValue(1));
416
417 //----power related (equal for all base stations)----
418 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(eNodeB_txPower));
419 Config::SetDefault("ns3::LteUePhy::TxPower", DoubleValue(23));
420 Config::SetDefault("ns3::LteUePhy::NoiseFigure", DoubleValue(7));
421 Config::SetDefault("ns3::LteEnbPhy::NoiseFigure", DoubleValue(2));
422 Config::SetDefault("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue(true));
423 Config::SetDefault("ns3::LteUePowerControl::ClosedLoop", BooleanValue(true));
424 Config::SetDefault("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue(true));
425
426 //----frequency related----
427 lteHelper->SetEnbDeviceAttribute("DlEarfcn", UintegerValue(100)); // 2120MHz
428 lteHelper->SetEnbDeviceAttribute("UlEarfcn", UintegerValue(18100)); // 1930MHz
429 lteHelper->SetEnbDeviceAttribute("DlBandwidth", UintegerValue(25)); // 5MHz
430 lteHelper->SetEnbDeviceAttribute("UlBandwidth", UintegerValue(25)); // 5MHz
431
432 //----others----
433 lteHelper->SetSchedulerType("ns3::PfFfMacScheduler");
434 Config::SetDefault("ns3::LteAmc::AmcModel", EnumValue(LteAmc::PiroEW2010));
435 Config::SetDefault("ns3::LteAmc::Ber", DoubleValue(0.01));
436 Config::SetDefault("ns3::PfFfMacScheduler::HarqEnabled", BooleanValue(true));
437
438 Config::SetDefault("ns3::FfMacScheduler::UlCqiFilter", EnumValue(FfMacScheduler::SRS_UL_CQI));
439
440 // Radio link failure detection parameters
441 Config::SetDefault("ns3::LteUeRrc::N310", UintegerValue(n310));
442 Config::SetDefault("ns3::LteUeRrc::N311", UintegerValue(n311));
443 Config::SetDefault("ns3::LteUeRrc::T310", TimeValue(t310));
444
445 NS_LOG_INFO("Create the internet");
446 Ptr<Node> pgw = epcHelper->GetPgwNode();
447 // Create a single RemoteHost0x18ab460
448 NodeContainer remoteHostContainer;
449 remoteHostContainer.Create(1);
450 Ptr<Node> remoteHost = remoteHostContainer.Get(0);
451 InternetStackHelper internet;
452 internet.Install(remoteHostContainer);
454 p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
455 p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
456 p2ph.SetChannelAttribute("Delay", TimeValue(Seconds(0.010)));
457 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
458 Ipv4AddressHelper ipv4h;
459 ipv4h.SetBase("1.0.0.0", "255.0.0.0");
460 Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
461 Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress(1);
462 Ipv4StaticRoutingHelper ipv4RoutingHelper;
463 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
464 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
465 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"), Ipv4Mask("255.0.0.0"), 1);
466
467 NS_LOG_INFO("Create eNodeB and UE nodes");
468 NodeContainer enbNodes;
469 NodeContainer ueNodes;
470 enbNodes.Create(numberOfEnbs);
471 ueNodes.Create(numberOfUes);
472
473 NS_LOG_INFO("Assign mobility");
474 Ptr<ListPositionAllocator> positionAllocEnb = CreateObject<ListPositionAllocator>();
475
476 for (uint16_t i = 0; i < numberOfEnbs; i++)
477 {
478 positionAllocEnb->Add(Vector(interSiteDistance * i, 0, 0));
479 }
481 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
482 mobility.SetPositionAllocator(positionAllocEnb);
483 mobility.Install(enbNodes);
484
485 Ptr<ListPositionAllocator> positionAllocUe = CreateObject<ListPositionAllocator>();
486
487 for (int i = 0; i < numberOfUes; i++)
488 {
489 positionAllocUe->Add(Vector(200, 0, 0));
490 }
491
492 mobility.SetPositionAllocator(positionAllocUe);
493 mobility.SetMobilityModel("ns3::ConstantVelocityMobilityModel");
494 mobility.Install(ueNodes);
495
496 for (int i = 0; i < numberOfUes; i++)
497 {
498 ueNodes.Get(i)->GetObject<ConstantVelocityMobilityModel>()->SetVelocity(
499 Vector(30, 0.0, 0.0));
500 }
501
502 NS_LOG_INFO("Install LTE Devices in eNB and UEs and fix random number stream");
503 NetDeviceContainer enbDevs;
504 NetDeviceContainer ueDevs;
505
506 int64_t randomStream = 1;
507
508 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
509 randomStream += lteHelper->AssignStreams(enbDevs, randomStream);
510 ueDevs = lteHelper->InstallUeDevice(ueNodes);
511 randomStream += lteHelper->AssignStreams(ueDevs, randomStream);
512
513 NS_LOG_INFO("Install the IP stack on the UEs");
514 internet.Install(ueNodes);
515 Ipv4InterfaceContainer ueIpIfaces;
516 ueIpIfaces = epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueDevs));
517
518 NS_LOG_INFO("Attach a UE to a eNB");
519 lteHelper->Attach(ueDevs);
520
521 NS_LOG_INFO("Install and start applications on UEs and remote host");
522 uint16_t dlPort = 10000;
523 uint16_t ulPort = 20000;
524
525 DataRateValue dataRateValue = DataRate("18.6Mbps");
526
527 uint64_t bitRate = dataRateValue.Get().GetBitRate();
528
529 uint32_t packetSize = 1024; // bytes
530
531 NS_LOG_DEBUG("bit rate " << bitRate);
532
533 double interPacketInterval = static_cast<double>(packetSize * 8) / bitRate;
534
535 Time udpInterval = Seconds(interPacketInterval);
536
537 NS_LOG_DEBUG("UDP will use application interval " << udpInterval.As(Time::S) << " sec");
538
539 for (uint32_t u = 0; u < numberOfUes; ++u)
540 {
541 Ptr<Node> ue = ueNodes.Get(u);
542 // Set the default gateway for the UE
543 Ptr<Ipv4StaticRouting> ueStaticRouting =
544 ipv4RoutingHelper.GetStaticRouting(ue->GetObject<Ipv4>());
545 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
546
547 for (uint32_t b = 0; b < numBearersPerUe; ++b)
548 {
549 ApplicationContainer ulClientApps;
550 ApplicationContainer ulServerApps;
551 ApplicationContainer dlClientApps;
552 ApplicationContainer dlServerApps;
553
554 ++dlPort;
555 ++ulPort;
556
557 NS_LOG_LOGIC("installing UDP DL app for UE " << u + 1);
558 UdpClientHelper dlClientHelper(ueIpIfaces.GetAddress(u), dlPort);
559 dlClientHelper.SetAttribute("Interval", TimeValue(udpInterval));
560 dlClientHelper.SetAttribute("PacketSize", UintegerValue(packetSize));
561 dlClientHelper.SetAttribute("MaxPackets", UintegerValue(1000000));
562 dlClientApps.Add(dlClientHelper.Install(remoteHost));
563
564 PacketSinkHelper dlPacketSinkHelper("ns3::UdpSocketFactory",
565 InetSocketAddress(Ipv4Address::GetAny(), dlPort));
566 dlServerApps.Add(dlPacketSinkHelper.Install(ue));
567
568 NS_LOG_LOGIC("installing UDP UL app for UE " << u + 1);
569 UdpClientHelper ulClientHelper(remoteHostAddr, ulPort);
570 ulClientHelper.SetAttribute("Interval", TimeValue(udpInterval));
571 dlClientHelper.SetAttribute("PacketSize", UintegerValue(packetSize));
572 ulClientHelper.SetAttribute("MaxPackets", UintegerValue(1000000));
573 ulClientApps.Add(ulClientHelper.Install(ue));
574
575 PacketSinkHelper ulPacketSinkHelper("ns3::UdpSocketFactory",
576 InetSocketAddress(Ipv4Address::GetAny(), ulPort));
577 ulServerApps.Add(ulPacketSinkHelper.Install(remoteHost));
578
579 Ptr<EpcTft> tft = Create<EpcTft>();
581 dlpf.localPortStart = dlPort;
582 dlpf.localPortEnd = dlPort;
583 tft->Add(dlpf);
585 ulpf.remotePortStart = ulPort;
586 ulpf.remotePortEnd = ulPort;
587 tft->Add(ulpf);
588 EpsBearer bearer(EpsBearer::NGBR_IMS);
589 lteHelper->ActivateDedicatedEpsBearer(ueDevs.Get(u), bearer, tft);
590
591 dlServerApps.Start(Seconds(0.27));
592 dlClientApps.Start(Seconds(0.27));
593 ulServerApps.Start(Seconds(0.27));
594 ulClientApps.Start(Seconds(0.27));
595 } // end for b
596 }
597 NS_LOG_INFO("Enable Lte traces and connect custom trace sinks");
598
599 lteHelper->EnableTraces();
600 Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats();
601 rlcStats->SetAttribute("EpochDuration", TimeValue(Seconds(0.05)));
602 Ptr<RadioBearerStatsCalculator> pdcpStats = lteHelper->GetPdcpStats();
603 pdcpStats->SetAttribute("EpochDuration", TimeValue(Seconds(0.05)));
604
605 Config::Connect("/NodeList/*/DeviceList/*/LteEnbRrc/ConnectionEstablished",
607 Config::Connect("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionEstablished",
609 Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/LteUeRrc/StateTransition",
611 Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/LteUeRrc/PhySyncDetection",
613 Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/LteUeRrc/RadioLinkFailure",
615 Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/LteEnbRrc/NotifyConnectionRelease",
617 Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/LteEnbRrc/RrcTimeout",
619 Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/LteUeRrc/RandomAccessError",
621 Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionTimeout",
623 Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::LteUeNetDevice/"
624 "ComponentCarrierMapUe/*/LteUeMac/RaResponseTimeout",
626
627 // Trace sink for the packet sink of UE
628 std::ostringstream oss;
629 oss << "/NodeList/" << ueNodes.Get(0)->GetId() << "/ApplicationList/0/$ns3::PacketSink/Rx";
631
632 bool firstWrite = true;
633 std::string rrcType = useIdealRrc == 1 ? "ideal_rrc" : "real_rrc";
634 std::string fileName = "rlf_dl_thrput_" + std::to_string(enbNodes.GetN()) + "_eNB_" + rrcType;
635 Time binSize = Seconds(0.2);
636 Simulator::Schedule(Seconds(0.47), &Throughput, firstWrite, binSize, fileName);
637
638 NS_LOG_INFO("Starting simulation...");
639
640 Simulator::Stop(simTime);
641
642 Simulator::Run();
643
645 "UE RRC should receive " << n310
646 << " out-of-sync indications in Cell 1."
647 " Total received = "
649
650 Simulator::Destroy();
651
652 return 0;
653}
a polymophic address class
Definition: address.h:92
holds a vector of ns3::Application pointers.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
AttributeValue implementation for Boolean.
Definition: boolean.h:37
Parse command-line arguments.
Definition: command-line.h:232
Mobility model for which the current speed does not change once it has been set and until it is set a...
AttributeValue implementation for DataRate.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
Hold variables of type enum.
Definition: enum.h:56
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
an Inet address class
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
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.
Definition: ipv4-address.h:43
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:79
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
Definition: ipv4-address.h:258
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...
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:282
Ptr< RadioBearerStatsCalculator > GetRlcStats()
Definition: lte-helper.cc:1708
Ptr< RadioBearerStatsCalculator > GetPdcpStats()
Definition: lte-helper.cc:1723
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:482
void SetPathlossModelType(TypeId type)
Set the type of path loss model to be used for both DL and UL channels.
Definition: lte-helper.cc:394
void EnableTraces()
Enables trace sinks for PHY, MAC, RLC and PDCP.
Definition: lte-helper.cc:1554
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:289
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
Definition: lte-helper.cc:1044
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the path loss models to be created.
Definition: lte-helper.cc:402
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
Definition: lte-helper.cc:409
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:497
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used.
Definition: lte-helper.cc:1572
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:1159
The LteUeNetDevice class implements the UE net device.
State
The states of the UE RRC entity.
Definition: lte-ue-rrc.h:102
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
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Ptr< Node > GetPgwNode() const override
Get the PGW node.
Ipv4Address GetUeDefaultGatewayAddress() override
Ipv4InterfaceContainer AssignUeIpv4Address(NetDeviceContainer ueDevices) override
Assign IPv4 addresses to UE devices.
keep track of a set of node pointers.
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.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
uint32_t GetNDevices() const
Definition: node.cc:162
uint32_t GetId() const
Definition: node.cc:117
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition: node.cc:152
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Definition: node-list.h:44
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition: object.h:471
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:863
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)
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:402
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:417
AttributeValue implementation for Time.
Definition: nstime.h:1425
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:45
Vector3D Vector
Vector alias typedef for compatibility with mobility models.
Definition: vector.h:324
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:891
void Connect(std::string path, const CallbackBase &cb)
Definition: config.cc:975
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition: config.cc:951
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:282
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:275
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs... bargs)
Make Callbacks with varying number of bound arguments.
Definition: callback.h:752
void(* DataRate)(DataRate oldValue, DataRate newValue)
TracedValue callback signature for DataRate.
Definition: data-rate.h:328
Time Now()
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:296
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1338
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:691
LogLevel
Logging severity classes and levels.
Definition: log.h:94
@ LOG_LEVEL_ALL
Print everything.
Definition: log.h:116
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
Definition: log.h:118
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
Definition: log.h:119
@ LOG_PREFIX_NODE
Prefix all trace prints with simulation node.
Definition: log.h:120
void LogComponentEnable(const char *name, enum LogLevel level)
Enable the logging output associated with that log component.
Definition: log.cc:358
cmd
Definition: second.py:33
mobility
Definition: third.py:96
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition: epc-tft.h:71
uint16_t localPortEnd
end of the port number range of the UE
Definition: epc-tft.h:132
uint16_t remotePortEnd
end of the port number range of the remote host
Definition: epc-tft.h:130
uint16_t remotePortStart
start of the port number range of the remote host
Definition: epc-tft.h:129
uint16_t localPortStart
start of the port number range of the UE
Definition: epc-tft.h:131
static const uint32_t packetSize
Packet size generated at the AP.