A Discrete-Event Network Simulator
API
qkd-control.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 DOTFEESA www.tk.etf.unsa.ba
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Miralem Mehic <miralem.mehic@ieee.org>
19  */
20 
21 #ifndef QKDCONTROL_H
22 #define QKDCONTROL_H
23 
24 #include <queue>
25 #include <vector>
26 #include <map>
27 #include <string>
28 
29 #include "ns3/packet.h"
30 #include "ns3/object.h"
31 #include "ns3/ipv4-header.h"
32 #include "ns3/traced-value.h"
33 #include "ns3/trace-source-accessor.h"
34 #include "ns3/event-id.h"
35 #include "ns3/node.h"
36 #include "ns3/ptr.h"
37 #include "ns3/vector.h"
38 
39 #include "ns3/names.h"
40 #include "ns3/tag.h"
41 #include "ns3/net-device.h"
42 #include "ns3/traffic-control-layer.h"
43 
44 #include "ns3/qkd-encryptor.h"
45 #include "ns3/qkd-buffer.h"
46 
47 #include "ns3/object-factory.h"
48 #include "ns3/core-module.h"
49 #include "ns3/network-module.h"
50 #include "ns3/internet-module.h"
51 #include "ns3/ipv4-interface-address.h"
52 
53 #include "ns3/applications-module.h"
54 #include "ns3/qkd-key-manager-system-application.h"
55 
56 namespace ns3 {
57 
58  class Node;
72  class QKDControl : public Object
73  {
74  public:
75 
79  struct QKDLink
80  {
87  std::string keyAssociationId;
88  };
89 
94  static TypeId GetTypeId (void);
95 
100  virtual TypeId GetInstanceTypeId (void) const;
101 
105  QKDControl ();
106 
110  virtual ~QKDControl ();
111 
117  void Dispose(void);
118 
123  uint32_t GetNQKDBuffers (void) const;
124 
141  Ptr<Node> Alice,
142  Ptr<Node> Bob,
143  Ptr<Node> AliceKMS,
144  Ptr<Node> BobKMS,
145  uint32_t Mmin,
146  uint32_t Mthr,
147  uint32_t Mmax,
148  uint32_t Mcurrent,
149  bool isMaster,
150  bool useRealStorages
151  );
152 
160  void AddLinkRecord (struct QKDControl::QKDLink);
161 
168 
174  Ptr<QKDBuffer> GetBufferByPosition (const uint32_t& bufferPosition);
175 
180  Ptr<Node> GetNode();
181 
186  void SetNode (Ptr<Node>);
187 
195  std::vector<std::string> RegisterQKDApplications (
196  Ptr<QKDApp004> alice,
197  Ptr<QKDApp004> bob,
200  );
201 
209  std::vector<std::string> RegisterQKDApplications (
210  Ptr<QKDApp014> alice,
211  Ptr<QKDApp014> bob,
214  );
215 
216  protected:
222  virtual void DoDispose (void);
223 
227  virtual void DoInitialize (void);
228 
229  private:
230 
232 
233  std::vector<Ptr<QKDBuffer> > m_qkdbuffers;
234 
235  std::map<uint32_t, QKDLink> m_destinations; //<! The map of QKD destinations including buffers.
236 
237  };
238 }
239 // namespace ns3
240 
241 #endif /* QKDCONTROL_H */
A network Node.
Definition: node.h:57
A base class which provides memory management and object aggregation.
Definition: object.h:88
QKD control is a network component with the knowledge of the network status.
Definition: qkd-control.h:73
Ptr< Node > m_node
The controller node.
Definition: qkd-control.h:231
std::vector< std::string > RegisterQKDApplications(Ptr< QKDApp004 > alice, Ptr< QKDApp004 > bob, Ptr< QKDKeyManagerSystemApplication > kmsA, Ptr< QKDKeyManagerSystemApplication > kmsB)
Register the QKD application pair (that implements ETSI QKD 004 API) on the site.
Definition: qkd-control.cc:249
uint32_t GetNQKDBuffers(void) const
Get the number of QKDBuffers associated to this QKDControl.
Definition: qkd-control.cc:231
virtual void DoDispose(void)
The dispose method.
Definition: qkd-control.cc:72
std::vector< Ptr< QKDBuffer > > m_qkdbuffers
The list of associated QKDBuffers.
Definition: qkd-control.h:233
void Dispose(void)
Destroy a QKDControl object.
virtual ~QKDControl()
Destructor.
Definition: qkd-control.cc:66
std::map< uint32_t, QKDLink > m_destinations
Definition: qkd-control.h:235
Ptr< QKDBuffer > GetBufferByDestinationNode(Ptr< Node >)
Get the QKDBuffer for the given destination node.
Definition: qkd-control.cc:217
struct QKDControl::QKDLink AddNewLink(Ptr< Node > Alice, Ptr< Node > Bob, Ptr< Node > AliceKMS, Ptr< Node > BobKMS, uint32_t Mmin, uint32_t Mthr, uint32_t Mmax, uint32_t Mcurrent, bool isMaster, bool useRealStorages)
Establish new QKD link.
Definition: qkd-control.cc:93
virtual void DoInitialize(void)
Initialization function.
Definition: qkd-control.cc:86
Ptr< Node > GetNode()
Get the controller node.
Definition: qkd-control.cc:238
void SetNode(Ptr< Node >)
Set the controller node.
Definition: qkd-control.cc:243
virtual TypeId GetInstanceTypeId(void) const
Get the type ID for the instance.
Definition: qkd-control.cc:55
QKDControl()
Constructor.
Definition: qkd-control.cc:60
static TypeId GetTypeId(void)
Get the type ID.
Definition: qkd-control.cc:40
void AddLinkRecord(struct QKDControl::QKDLink)
Record details about the new QKD link.
Definition: qkd-control.cc:191
Ptr< QKDBuffer > GetBufferByPosition(const uint32_t &bufferPosition)
Get the QKDBuffer with given position.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.