9#include "ns3/applications-module.h"
10#include "ns3/core-module.h"
11#include "ns3/epc-helper.h"
12#include "ns3/internet-module.h"
13#include "ns3/ipv4-global-routing-helper.h"
14#include "ns3/ipv6-static-routing.h"
15#include "ns3/lte-helper.h"
16#include "ns3/lte-module.h"
17#include "ns3/mobility-module.h"
18#include "ns3/network-module.h"
19#include "ns3/point-to-point-helper.h"
32main(
int argc,
char* argv[])
35 cmd.Parse(argc, argv);
39 lteHelper->SetEpcHelper(epcHelper);
45 remoteHostContainer.
Create(1);
48 internet.Install(remoteHostContainer);
64 for (uint16_t i = 0; i < 2; i++)
66 positionAlloc->Add(Vector(60.0 * i, 0, 0));
69 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
70 mobility.SetPositionAllocator(positionAlloc);
97 remoteHostStaticRouting
109 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress6(), 1);
113 lteHelper->Attach(ueLteDevs1.
Get(0), enbLteDevs.
Get(0));
114 lteHelper->Attach(ueLteDevs2.
Get(0), enbLteDevs.
Get(1));
151 internet.EnablePcapIpv6(
"LenaIpv6-AddrConf-Ue0.pcap", ueNodes.
Get(0)->
GetId(), 1,
true);
152 internet.EnablePcapIpv6(
"LenaIpv6-AddrConf-Ue1.pcap", ueNodes.
Get(1)->
GetId(), 1,
true);
153 internet.EnablePcapIpv6(
"LenaIpv6-AddrConf-RH.pcap",
154 remoteHostContainer.
Get(0)->
GetId(),
157 internet.EnablePcapIpv6(
"LenaIpv6-AddrConf-Pgw-Iface1.pcap", pgw->GetId(), 1,
true);
158 internet.EnablePcapIpv6(
"LenaIpv6-AddrConf-Pgw-Iface2.pcap", pgw->GetId(), 2,
true);
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
Parse command-line arguments.
Class for representing data rates.
aggregate IP/TCP/UDP functionality to existing Nodes.
Helper class to auto-assign global IPv6 unicast addresses.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Ipv6InterfaceContainer Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
Describes an IPv6 address.
Access to the IPv6 forwarding table, interfaces, and configuration.
Keep track of a set of IPv6 interfaces.
void SetForwarding(uint32_t i, bool state)
Set the state of the stack (act as a router or as an host) for the specified index.
void SetDefaultRouteInAllNodes(uint32_t router)
Set the default route for all the devices (except the router itself).
Ipv6Address GetAddress(uint32_t i, uint32_t j) const
Get the address for the specified index.
void Add(Ptr< Ipv6 > ipv6, uint32_t interface)
Add a couple IPv6/interface.
Describes an IPv6 prefix.
Helper class that adds ns3::Ipv6StaticRouting objects.
Ptr< Ipv6StaticRouting > GetStaticRouting(Ptr< Ipv6 > ipv6) const
Get Ipv6StaticRouting pointer from IPv6 stack.
Helper class used to assign positions and mobility models to nodes.
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.
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.
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)
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Create an application which sends a UDP packet and waits for an echo of this packet.
Create a server application which waits for input UDP packets and sends them back to the original sen...
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
@ LOG_LEVEL_ALL
Print everything.