21 loss->SetPathLossExponent(3.76);
22 loss->SetReference(1, 7.7);
47 mobility.Install(endDevices);
52 helper.
Install(phyHelper, macHelper, endDevices);
74 mobility.Install(gateways);
79 helper.
Install(phyHelper, macHelper, gateways);
92 p2p.SetDeviceAttribute(
"DataRate",
StringValue(
"5Mbps"));
93 p2p.SetChannelAttribute(
"Delay",
StringValue(
"2ms"));
96 for (
auto gw = gateways.
Begin(); gw != gateways.
End(); ++gw)
98 auto container = p2p.Install(nsNode, *gw);
100 gwRegistration.emplace_back(serverP2PNetDev, *gw);
107 networkServerHelper.
Install(nsNode);
111 forwarderHelper.
Install(gateways);
125 mobility.SetPositionAllocator(
"ns3::UniformDiscPositionAllocator",
132 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
142 return {channel, endDevices, gateways, nsNode};
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Helper class used to assign positions and mobility models to nodes.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Build a set of PointToPointNetDevice objects.
Smart pointer class similar to boost::intrusive_ptr.
Hold variables of type string.
This class can be used to install Forwarder applications on a set of gateways.
ApplicationContainer Install(NodeContainer c) const
Install a Forwarder application on each node of the input container configured with all the attribute...
Helps to create LoraNetDevice objects.
virtual NetDeviceContainer Install(const LoraPhyHelper &phyHelper, const LorawanMacHelper &macHelper, NodeContainer c) const
Install LoraNetDevices on a list of nodes.
Helper to install LoraPhy instances on multiple Nodes.
void SetDeviceType(enum DeviceType dt)
Set the kind of PHY this helper will create.
void SetChannel(Ptr< LoraChannel > channel)
Set the LoraChannel to connect the PHYs to.
Helper class for configuring and installing the LorawanMac class on devices and gateways.
void SetDeviceType(enum DeviceType dt)
Set the kind of MAC this helper will create.
static std::vector< int > SetSpreadingFactorsUp(NodeContainer endDevices, NodeContainer gateways, Ptr< LoraChannel > channel)
Initialize the end devices' data rate parameter.
This class can install a NetworkServer application on a node.
void SetGatewaysP2P(const P2PGwRegistration_t ®istration)
Register gateways connected with point-to-point to this network server.
void SetEndDevices(NodeContainer endDevices)
Set which end devices will be managed by this network server.
ApplicationContainer Install(Ptr< Node > node)
Create one lorawan network server application on the Node.
int nDevices
Number of end device nodes to create.
int nGateways
Number of gateway nodes to create.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< Node > CreateNetworkServer(NodeContainer endDevices, NodeContainer gateways)
Ptr< LoraChannel > CreateChannel()
std::list< std::pair< Ptr< PointToPointNetDevice >, Ptr< Node > > > P2PGwRegistration_t
Store network server app registration details for gateway nodes having a P2P link with the network se...
NodeContainer CreateGateways(int nGateways, MobilityHelper mobility, Ptr< LoraChannel > channel)
NetworkComponents InitializeNetwork(int nDevices, int nGateways)
NodeContainer CreateEndDevices(int nDevices, MobilityHelper mobility, Ptr< LoraChannel > channel)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.