A Discrete-Event Network Simulator
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
24namespace 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
51
53
54 ~QCenController() override;
55
57
58 void SetNode(Ptr<Node> node);
59
61
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
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
81
83
84 };
85}
86
87#endif /* QCENCONTROLLER_H */
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
QCenController is a centralized controller used for re-routing.
std::vector< std::vector< std::pair< uint32_t, uint32_t > > > m_adjList
std::map< uint32_t, Ptr< QKDControl > > m_controllers
void LinkDown(uint32_t source, uint32_t destination)
~QCenController() override
uint32_t GetColumn(uint32_t nodeId)
Ptr< QKDLocationRegister > m_routingTable
Routing Table.
static TypeId GetTypeId()
void LinkUp(uint32_t source, uint32_t destination)
std::vector< Ptr< QKDControl > > m_controllerList
List of all controllers.
void SetNode(Ptr< Node > node)
std::vector< std::pair< uint32_t, uint32_t > > DijkstraSP(std::vector< std::vector< std::pair< uint32_t, uint32_t > > > adjList, uint32_t start)
void RegisterDControllers(std::vector< Ptr< QKDControl > > controllers)
uint32_t ReverseColumn(uint32_t position)
a unique identifier for an interface.
Definition type-id.h:49
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.