A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
periodic-sender-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 University of Padova
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Davide Magrin <magrinda@dei.unipd.it>
7
*/
8
9
#ifndef PERIODIC_SENDER_HELPER_H
10
#define PERIODIC_SENDER_HELPER_H
11
12
#include "ns3/address.h"
13
#include "ns3/application-container.h"
14
#include "ns3/attribute.h"
15
#include "ns3/net-device.h"
16
#include "ns3/node-container.h"
17
#include "ns3/object-factory.h"
18
#include "ns3/periodic-sender.h"
19
20
#include <stdint.h>
21
#include <string>
22
23
namespace
ns3
24
{
25
namespace
lorawan
26
{
27
28
/**
29
* \ingroup lorawan
30
*
31
* This class can be used to install PeriodicSender applications on a wide
32
* range of nodes.
33
*/
34
class
PeriodicSenderHelper
35
{
36
public
:
37
PeriodicSenderHelper
();
//!< Default constructor
38
~PeriodicSenderHelper
();
//!< Destructor
39
40
/**
41
* Helper function used to set the underlying application attributes.
42
*
43
* \param name The name of the application attribute to set.
44
* \param value The value of the application attribute to set.
45
*/
46
void
SetAttribute
(std::string name,
const
AttributeValue
& value);
47
48
/**
49
* Install a PeriodicSender application on each node of the input container
50
* configured with all the attributes set with SetAttribute or other functions of this class.
51
*
52
* \param c NodeContainer of the set of nodes on which an PeriodicSender
53
* will be installed.
54
* \return Container of Ptr to the applications installed.
55
*/
56
ApplicationContainer
Install
(
NodeContainer
c)
const
;
57
58
/**
59
* Install a PeriodicSender application on the input Node configured with all the attributes set
60
* with SetAttribute or other functions of this class.
61
*
62
* \param node The node on which a PeriodicSender will be installed.
63
* \return Container of the Ptr to the application installed.
64
*/
65
ApplicationContainer
Install
(
Ptr<Node>
node)
const
;
66
67
/**
68
* Set the period to be used by the applications created by this helper.
69
*
70
* A value of Seconds (0) results in randomly generated periods according to
71
* the model contained in the TR 45.820 document.
72
*
73
* \param period The period to set.
74
*/
75
void
SetPeriod
(
Time
period);
76
77
/**
78
* Set a random variable to enable a random size to be added to the base packet size for
79
* each new transmission of PacketSender applications.
80
*
81
* \param rv The random variable.
82
*/
83
void
SetPacketSizeRandomVariable
(
Ptr<RandomVariableStream>
rv);
84
85
/**
86
* Set the base value for applications packet size in bytes.
87
*
88
* \param size The packet size in bytes.
89
*/
90
void
SetPacketSize
(uint8_t size);
91
92
private
:
93
/**
94
* Install a PeriodicSender application on the input Node configured with all the attributes set
95
* with SetAttribute or other functions of this class.
96
*
97
* \param node The node on which a PeriodicSender will be installed.
98
* \return A pointer to the application installed.
99
*/
100
Ptr<Application>
InstallPriv
(
Ptr<Node>
node)
const
;
101
102
ObjectFactory
m_factory
;
//!< The factory to create PeriodicSender applications
103
Ptr<UniformRandomVariable>
m_initialDelay
;
//!< The random variable used to extract a start
104
//!< off delay for each PeriodicSender application
105
Ptr<UniformRandomVariable>
106
m_intervalProb
;
//!< The random variable used to pick inter-transmission intervals of
107
//!< different applications from a discrete probability distribution
108
Time
m_period
;
//!< The base period with which the application will be set to send messages
109
Ptr<RandomVariableStream>
110
m_pktSizeRV
;
//!< Whether or not a random component is added to the packet size.
111
uint8_t
m_pktSize
;
//!< The base packet size.
112
};
113
114
}
// namespace lorawan
115
116
}
// namespace ns3
117
#endif
/* PERIODIC_SENDER_HELPER_H */
ns3::ApplicationContainer
holds a vector of ns3::Application pointers.
Definition
application-container.h:33
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::lorawan::PeriodicSenderHelper
This class can be used to install PeriodicSender applications on a wide range of nodes.
Definition
periodic-sender-helper.h:35
ns3::lorawan::PeriodicSenderHelper::m_pktSizeRV
Ptr< RandomVariableStream > m_pktSizeRV
Whether or not a random component is added to the packet size.
Definition
periodic-sender-helper.h:110
ns3::lorawan::PeriodicSenderHelper::m_pktSize
uint8_t m_pktSize
The base packet size.
Definition
periodic-sender-helper.h:111
ns3::lorawan::PeriodicSenderHelper::SetPeriod
void SetPeriod(Time period)
Set the period to be used by the applications created by this helper.
Definition
periodic-sender-helper.cc:125
ns3::lorawan::PeriodicSenderHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Definition
periodic-sender-helper.cc:49
ns3::lorawan::PeriodicSenderHelper::SetPacketSize
void SetPacketSize(uint8_t size)
Set the base value for applications packet size in bytes.
Definition
periodic-sender-helper.cc:137
ns3::lorawan::PeriodicSenderHelper::InstallPriv
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install a PeriodicSender application on the input Node configured with all the attributes set with Se...
Definition
periodic-sender-helper.cc:73
ns3::lorawan::PeriodicSenderHelper::m_intervalProb
Ptr< UniformRandomVariable > m_intervalProb
The random variable used to pick inter-transmission intervals of different applications from a discre...
Definition
periodic-sender-helper.h:106
ns3::lorawan::PeriodicSenderHelper::SetPacketSizeRandomVariable
void SetPacketSizeRandomVariable(Ptr< RandomVariableStream > rv)
Set a random variable to enable a random size to be added to the base packet size for each new transm...
Definition
periodic-sender-helper.cc:131
ns3::lorawan::PeriodicSenderHelper::m_period
Time m_period
The base period with which the application will be set to send messages.
Definition
periodic-sender-helper.h:108
ns3::lorawan::PeriodicSenderHelper::~PeriodicSenderHelper
~PeriodicSenderHelper()
Destructor.
Definition
periodic-sender-helper.cc:44
ns3::lorawan::PeriodicSenderHelper::m_factory
ObjectFactory m_factory
The factory to create PeriodicSender applications.
Definition
periodic-sender-helper.h:102
ns3::lorawan::PeriodicSenderHelper::m_initialDelay
Ptr< UniformRandomVariable > m_initialDelay
The random variable used to extract a start off delay for each PeriodicSender application.
Definition
periodic-sender-helper.h:103
ns3::lorawan::PeriodicSenderHelper::Install
ApplicationContainer Install(NodeContainer c) const
Install a PeriodicSender application on each node of the input container configured with all the attr...
Definition
periodic-sender-helper.cc:61
ns3::lorawan::PeriodicSenderHelper::PeriodicSenderHelper
PeriodicSenderHelper()
Default constructor.
Definition
periodic-sender-helper.cc:26
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
helper
periodic-sender-helper.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0