A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
aloha-throughput.cc File Reference
#include "ns3/building-allocator.h"
#include "ns3/building-penetration-loss.h"
#include "ns3/buildings-helper.h"
#include "ns3/callback.h"
#include "ns3/command-line.h"
#include "ns3/constant-position-mobility-model.h"
#include "ns3/correlated-shadowing-propagation-loss-model.h"
#include "ns3/double.h"
#include "ns3/end-device-lora-phy.h"
#include "ns3/end-device-lorawan-mac.h"
#include "ns3/forwarder-helper.h"
#include "ns3/gateway-lora-phy.h"
#include "ns3/gateway-lorawan-mac.h"
#include "ns3/log.h"
#include "ns3/lora-device-address.h"
#include "ns3/lora-frame-header.h"
#include "ns3/lora-helper.h"
#include "ns3/lora-net-device.h"
#include "ns3/lora-phy.h"
#include "ns3/lorawan-mac-header.h"
#include "ns3/mobility-helper.h"
#include "ns3/network-server-helper.h"
#include "ns3/node-container.h"
#include "ns3/periodic-sender-helper.h"
#include "ns3/pointer.h"
#include "ns3/position-allocator.h"
#include "ns3/random-variable-stream.h"
#include "ns3/simulator.h"
#include <algorithm>
#include <ctime>
+ 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 83 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 68 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

int nDevices = 200

Number of end device nodes to create.

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

◆ nGateways

int nGateways = 1

Number of gateway nodes to create.

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

◆ packetsReceived

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

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

Definition at line 59 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 57 of file aloha-throughput.cc.

Referenced by OnTransmissionCallback().

◆ radiusMeters

double radiusMeters = 1000

Radius (m) of the deployment.

Definition at line 49 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 53 of file aloha-throughput.cc.

◆ simulationTimeSeconds

double simulationTimeSeconds = 100

Scenario duration (s) in simulated time.

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