A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
aloha-throughput.cc File Reference
#include "ns3/core-module.h"
#include "ns3/lorawan-module.h"
#include "ns3/mobility-helper.h"
#include "ns3/point-to-point-helper.h"
Include dependency graph for aloha-throughput.cc:

Go to the source code of this file.

Functions

void OnPacketReceptionCallback (Ptr< const Packet > packet, uint32_t receiverNodeId)
 Record the correct reception of a packet by a gateway.
void OnTransmissionCallback (Ptr< const Packet > packet, uint32_t senderNodeId)
 Record the beginning of a transmission by an end device.

Variables

int nDevices = 200
 Number of end device nodes to create.
int nGateways = 1
 Number of gateway nodes to create.
auto packetsReceived = std::vector<int>(6, 0)
 Record received pkts by Data Rate (DR) [index 0 -> DR5, index 5 -> DR0].
auto packetsSent = std::vector<int>(6, 0)
 Record received pkts by Data Rate (DR) [index 0 -> DR5, index 5 -> DR0].
double radiusMeters = 1000
 Radius (m) of the deployment.
bool realisticChannelModel = false
 Whether to use a more realistic channel model with buildings and correlated shadowing.
double simulationTimeSeconds = 100
 Scenario duration (s) in simulated time.

Function Documentation

◆ OnPacketReceptionCallback()

void OnPacketReceptionCallback ( Ptr< const Packet > packet,
uint32_t receiverNodeId )

Record the correct reception of a packet by a gateway.

Parameters
packetA pointer to the packet received.
receiverNodeIdNode id of the receiver gateway.

Definition at line 56 of file aloha-throughput.cc.

References ns3::lorawan::LoraTag::GetSpreadingFactor(), NS_LOG_FUNCTION, and packetsReceived.

Here is the call graph for this function:

◆ OnTransmissionCallback()

void OnTransmissionCallback ( Ptr< const Packet > packet,
uint32_t senderNodeId )

Record the beginning of a transmission by an end device.

Parameters
packetA pointer to the packet sent.
senderNodeIdNode id of the sender end device.

Definition at line 41 of file aloha-throughput.cc.

References ns3::lorawan::LoraTag::GetSpreadingFactor(), NS_LOG_FUNCTION, and packetsSent.

Here is the call graph for this function:

Variable Documentation

◆ nDevices

◆ nGateways

int nGateways = 1

Number of gateway nodes to create.

Definition at line 21 of file aloha-throughput.cc.

Referenced by ns3::lorawan::CreateGateways(), and ns3::lorawan::InitializeNetwork().

◆ packetsReceived

auto packetsReceived = std::vector<int>(6, 0)

Record received pkts by Data Rate (DR) [index 0 -> DR5, index 5 -> DR0].

Definition at line 32 of file aloha-throughput.cc.

Referenced by OnPacketReceptionCallback().

◆ packetsSent

auto packetsSent = std::vector<int>(6, 0)

Record received pkts by Data Rate (DR) [index 0 -> DR5, index 5 -> DR0].

Definition at line 30 of file aloha-throughput.cc.

Referenced by OnTransmissionCallback().

◆ radiusMeters

double radiusMeters = 1000

Radius (m) of the deployment.

Definition at line 22 of file aloha-throughput.cc.

◆ realisticChannelModel

bool realisticChannelModel = false

Whether to use a more realistic channel model with buildings and correlated shadowing.

Definition at line 26 of file aloha-throughput.cc.

◆ simulationTimeSeconds

double simulationTimeSeconds = 100

Scenario duration (s) in simulated time.

Definition at line 23 of file aloha-throughput.cc.