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
qcen-control.h
Go to the documentation of this file.
1
/*
2
* Copyright(c) 2022 DOTFEESA www.tk.etf.unsa.ba
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*
7
*
8
* Authors: Miralem Mehic <miralem.mehic@ieee.org>
9
* Emir Dervisevic <emir.dervisevic@etf.unsa.ba>
10
*/
11
12
#ifndef QCENCONTROLLER_H
13
#define QCENCONTROLLER_H
14
15
#include "ns3/object.h"
16
#include "ns3/traced-value.h"
17
#include "ns3/trace-source-accessor.h"
18
#include "ns3/node.h"
19
20
#include "
qkd-control.h
"
21
//class QKDControl;
22
//class QKDLocationRegister;
23
24
namespace
ns3
{
25
26
/**
27
* @defgroup qkd Quantum Key Distribution(QKD)
28
* This section documents the API of the ns-3 QKD Network Simulation Module(QKDNetSim).
29
*
30
* Be sure to read the manual BEFORE going down to the API.
31
*/
32
33
/**
34
* @ingroup qkd
35
* @class QCenController
36
* @brief QCenController is a centralized controller used for re-routing.
37
*
38
* @note Distributed QControllers in every QKD node inform QCenController about the
39
* state of QKD Links. If the QKD Link is EMPTY, a notification is sent, and QCenController
40
* updates routing tables for every QController. It has two routing tables, one default, starting
41
* and one working table.
42
*
43
*
44
*/
45
class
QCenController
:
public
Object
{
46
public
:
47
48
static
TypeId
GetTypeId
();
49
50
QCenController
();
51
52
QCenController
(std::vector<
Ptr<QKDControl>
>
controllers
);
53
54
~QCenController
()
override
;
55
56
void
RegisterDControllers
(std::vector<
Ptr<QKDControl>
>
controllers
);
57
58
void
SetNode
(
Ptr<Node>
node);
59
60
uint32_t
GetColumn
(
uint32_t
nodeId);
61
62
uint32_t
ReverseColumn
(
uint32_t
position);
63
64
void
LinkDown
(
uint32_t
source
,
uint32_t
destination);
65
66
void
LinkUp
(
uint32_t
source
,
uint32_t
destination);
67
68
std::vector< std::pair<uint32_t, uint32_t> >
DijkstraSP
(std::vector< std::vector<std::pair<uint32_t, uint32_t> > >
adjList
,
uint32_t
start);
69
70
void
PopulateRoutingTables
();
71
72
private
:
73
74
std::map<uint32_t, Ptr<QKDControl> >
m_controllers
;
//<! a pair of KMNodeId and respective QKDControl
75
76
std::vector< std::vector<std::pair<uint32_t, uint32_t> > >
m_adjList
;
//<! adjecent List, used for dijkstraSP! It is a topology graph!
77
78
std::vector<Ptr<QKDControl> >
m_controllerList
;
//!< List of all controllers.
79
80
Ptr<QKDLocationRegister>
m_routingTable
;
//!< Routing Table
81
82
Ptr<Node>
m_node
;
83
84
};
85
}
86
87
#endif
/* QCENCONTROLLER_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::QCenController
QCenController is a centralized controller used for re-routing.
Definition
qcen-control.h:45
ns3::QCenController::m_adjList
std::vector< std::vector< std::pair< uint32_t, uint32_t > > > m_adjList
Definition
qcen-control.h:76
ns3::QCenController::m_node
Ptr< Node > m_node
Definition
qcen-control.h:82
ns3::QCenController::m_controllers
std::map< uint32_t, Ptr< QKDControl > > m_controllers
Definition
qcen-control.h:74
ns3::QCenController::LinkDown
void LinkDown(uint32_t source, uint32_t destination)
Definition
qcen-control.cc:152
ns3::QCenController::~QCenController
~QCenController() override
Definition
qcen-control.cc:72
ns3::QCenController::GetColumn
uint32_t GetColumn(uint32_t nodeId)
Definition
qcen-control.cc:128
ns3::QCenController::m_routingTable
Ptr< QKDLocationRegister > m_routingTable
Routing Table.
Definition
qcen-control.h:80
ns3::QCenController::GetTypeId
static TypeId GetTypeId()
Definition
qcen-control.cc:35
ns3::QCenController::LinkUp
void LinkUp(uint32_t source, uint32_t destination)
Definition
qcen-control.cc:173
ns3::QCenController::m_controllerList
std::vector< Ptr< QKDControl > > m_controllerList
List of all controllers.
Definition
qcen-control.h:78
ns3::QCenController::SetNode
void SetNode(Ptr< Node > node)
Definition
qcen-control.cc:122
ns3::QCenController::DijkstraSP
std::vector< std::pair< uint32_t, uint32_t > > DijkstraSP(std::vector< std::vector< std::pair< uint32_t, uint32_t > > > adjList, uint32_t start)
Definition
qcen-control.cc:195
ns3::QCenController::QCenController
QCenController()
Definition
qcen-control.cc:44
ns3::QCenController::PopulateRoutingTables
void PopulateRoutingTables()
Definition
qcen-control.cc:249
ns3::QCenController::RegisterDControllers
void RegisterDControllers(std::vector< Ptr< QKDControl > > controllers)
Definition
qcen-control.cc:78
ns3::QCenController::ReverseColumn
uint32_t ReverseColumn(uint32_t position)
Definition
qcen-control.cc:142
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
uint32_t
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
qkd-control.h
src
qkd
model
qcen-control.h
Generated on Mon Dec 15 2025 15:22:03 for ns-3 by
1.9.8