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
network-scheduler.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 NETWORK_SCHEDULER_H
10
#define NETWORK_SCHEDULER_H
11
12
#include "ns3/object.h"
13
#include "ns3/packet.h"
14
#include "ns3/traced-callback.h"
15
16
namespace
ns3
17
{
18
namespace
lorawan
19
{
20
21
class
NetworkController
;
22
class
NetworkStatus
;
23
class
LoraDeviceAddress
;
24
25
/**
26
* @ingroup lorawan
27
*
28
* Network server component in charge of scheduling downling packets onto devices' reception windows
29
*
30
* @todo We should probably add getters and setters or remove default constructor
31
*/
32
class
NetworkScheduler
:
public
Object
33
{
34
public
:
35
/**
36
* Register this type.
37
* @return The object TypeId.
38
*/
39
static
TypeId
GetTypeId
();
40
41
NetworkScheduler
();
//!< Default constructor
42
~NetworkScheduler
()
override
;
//!< Destructor
43
44
/**
45
* Construct a new NetworkScheduler providing the NetworkStatus and the NetworkController
46
* objects.
47
*
48
* @param status A pointer to the NetworkStatus object.
49
* @param controller A pointer to the NetworkController object.
50
*/
51
NetworkScheduler
(
Ptr<NetworkStatus>
status,
Ptr<NetworkController>
controller);
52
53
/**
54
* Method called by NetworkServer application to inform the Scheduler of a newly arrived uplink
55
* packet.
56
*
57
* This function schedules the OnReceiveWindowOpportunity events 1 and 2 seconds later.
58
*
59
* @param packet A pointer to the new Packet instance.
60
*/
61
void
OnReceivedPacket
(
Ptr<const Packet>
packet);
62
63
/**
64
* Method that is scheduled after packet arrival in order to take action on
65
* sender's receive windows openings.
66
*
67
* @param deviceAddress The Address of the end device.
68
* @param window The reception window number (1 or 2).
69
*/
70
void
OnReceiveWindowOpportunity
(
LoraDeviceAddress
deviceAddress,
int
window);
71
72
private
:
73
TracedCallback<Ptr<const Packet>
>
74
m_receiveWindowOpened
;
//!< Trace callback source for reception windows openings.
75
//!< \todo Never called. Place calls in the right places.
76
Ptr<NetworkStatus>
m_status
;
//!< A pointer to the NetworkStatus object.
77
Ptr<NetworkController>
m_controller
;
//!< A pointer to the NetworkController object.
78
};
79
80
}
// namespace lorawan
81
}
// namespace ns3
82
83
#endif
/* NETWORK_SCHEDULER_H */
ns3::Object::Object
Object()
Caller graph was not generated because of its size.
Definition
object.cc:93
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition
traced-callback.h:46
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:50
ns3::lorawan::LoraDeviceAddress
This class represents the device address of a LoraWAN end device.
Definition
lora-device-address.h:104
ns3::lorawan::NetworkController
This class collects a series of components that deal with various aspects of managing the network,...
Definition
network-controller.h:32
ns3::lorawan::NetworkScheduler::~NetworkScheduler
~NetworkScheduler() override
Destructor.
Definition
network-scheduler.cc:50
ns3::lorawan::NetworkScheduler::OnReceivedPacket
void OnReceivedPacket(Ptr< const Packet > packet)
Method called by NetworkServer application to inform the Scheduler of a newly arrived uplink packet.
Definition
network-scheduler.cc:55
ns3::lorawan::NetworkScheduler::m_controller
Ptr< NetworkController > m_controller
A pointer to the NetworkController object.
Definition
network-scheduler.h:77
ns3::lorawan::NetworkScheduler::m_status
Ptr< NetworkStatus > m_status
A pointer to the NetworkStatus object.
Definition
network-scheduler.h:76
ns3::lorawan::NetworkScheduler::NetworkScheduler
NetworkScheduler()
Default constructor.
Definition
network-scheduler.cc:40
ns3::lorawan::NetworkScheduler::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
network-scheduler.cc:26
ns3::lorawan::NetworkScheduler::OnReceiveWindowOpportunity
void OnReceiveWindowOpportunity(LoraDeviceAddress deviceAddress, int window)
Method that is scheduled after packet arrival in order to take action on sender's receive windows ope...
Definition
network-scheduler.cc:84
ns3::lorawan::NetworkScheduler::m_receiveWindowOpened
TracedCallback< Ptr< const Packet > > m_receiveWindowOpened
Trace callback source for reception windows openings.
Definition
network-scheduler.h:74
ns3::lorawan::NetworkStatus
This class represents the knowledge about the state of the network that is available at the network s...
Definition
network-status.h:33
ns3::lorawan
Definition
forwarder-helper.cc:19
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
network-scheduler.h
Generated on
for ns-3 by
1.15.0