A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
qkd-app-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 DOTFEESA www.tk.etf.unsa.ba
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 *
7 *
8 * Author: Miralem Mehic <miralem.mehic@ieee.org>
9 */
10
11#ifndef QKD_APP_HELPER_H
12#define QKD_APP_HELPER_H
13
14#include <stdint.h>
15#include <string>
16#include "ns3/object-factory.h"
17#include "ns3/address.h"
18#include "ns3/attribute.h"
19#include "ns3/net-device.h"
20#include "ns3/net-device-container.h"
21#include "ns3/node-container.h"
22#include "ns3/application-container.h"
23#include "ns3/qkd-postprocessing-application.h"
24//#include "ns3/qkd-control.h"
25#include "ns3/qcen-control.h"
26#include "ns3/qkd-app-014.h"
27#include "ns3/qkd-app-004.h"
28#include "ns3/uuid.h"
29
30namespace ns3 {
31
32/**
33 * @ingroup qkd
34 * @brief A helper to make it easier to instantiate an ns3::QKDAppApplication
35 * on a set of nodes.
36 */
38{
39public:
40 /**
41 * Create an QKDAppHelper to make it easier to work with QKD Applications (KMS, Post-processing and other)
42 *
43 * @param protocol the name of the protocol to use to send traffic
44 * by the applications. This string identifies the socket
45 * factory type used to create sockets for the applications.
46 * A typical value would be ns3::UdpSocketFactory.
47 * @param address the address of the remote node to send traffic
48 * to.
49 */
50 QKDAppHelper ();
51 QKDAppHelper (std::string protocol, Address address);
53
54 /**
55 * Helper function used to set the underlying application attributes,
56 * _not_ the socket attributes.
57 *
58 * @param name the name of the application attribute to set
59 * @param value the value of the application attribute to set
60 */
61 void SetAttribute (std::string mFactoryName, std::string name, const AttributeValue &value);
62
63 /**
64 * Install an ns3::QKDAppApplication on each node of the input container
65 * configured with all the attributes set with SetAttribute.
66 *
67 * @param c NodeContainer of the set of nodes on which an QKDAppApplication
68 * will be installed.
69 * @returns Container of Ptr to the applications installed.
70 */
71 //ApplicationContainer Install (NodeContainer c) const;
72 void SetSettings ( std::string protocol, Ipv4Address master, Ipv4Address slave, uint32_t keyRate);
73
74 /**
75 * @brief Install key manager
76 * @param node node to install KM
77 * @param kmsAddress KM Ipv4 address
78 * @param port listening port
79 * @param controller competent controller's node
80 */
82
84
86 Ptr<Node> node1,
87 Ptr<Node> node2,
96 std::string masterUUID,
97 std::string slaveUUID
98 );
99
101 Ptr<Node> node1,
102 Ptr<Node> node2,
111 );
112
113 /**
114 * @brief Install a pair of cryptographic applications to consume keys
115 * @param node1 master application node
116 * @param node2 slave application node
117 * @param masterAddress master application address
118 * @param slaveAddress slave application address
119 * @param control1 QKDN controller node at site of master application
120 * @param control2 QKDN controller node at site of slave application
121 * @param connectionType connection type
122 * @param packetSize the size of data packets
123 * @param dataRate data rate
124 * @param applicationType the type of the application (etsi014 or etsi004)
125 * @return Container of Ptr to the applications installed
126 */
128 Ptr<Node> node1,
129 Ptr<Node> node2,
134 std::string connectionType,
137 std::string applicationType,
138 std::string masterUUID,
139 std::string slaveUUID
140 );
141
142 /**
143 * @brief Install a pair of cryptographic applications to consume keys
144 * @param node1 master application node
145 * @param node2 slave application node
146 * @param masterAddress master application address
147 * @param slaveAddress slave application address
148 * @param control1 QKDN controller node at site of master application
149 * @param control2 QKDN controller node at site of slave application
150 * @param connectionType connection type
151 * @param packetSize the size of data packets
152 * @param dataRate data rate
153 * @param applicationType the type of the application (etsi014 or etsi004)
154 * @return Container of Ptr to the applications installed
155 */
157 Ptr<Node> node1,
158 Ptr<Node> node2,
163 std::string connectionType,
166 std::string applicationType
167 );
168
169private:
170 /**
171 * Install an ns3::QKDAppApplication on the node configured with all the
172 * attributes set with SetAttribute.
173 *
174 * @param node The node on which an QKDAppApplication will be installed.
175 * @returns Ptr to the application installed.
176 */
178
179 ObjectFactory m_factory_kms_app; //!< Object factory.
180 ObjectFactory m_factory_qkd_app; //!< Object factory.
183
184 std::string m_protocol;
185
187
188};
189
190} // namespace ns3
191
192#endif /* QKD_APP_HELPER_H */
193
a polymophic address class
Definition address.h:90
holds a vector of ns3::Application pointers.
Hold a value for an Attribute.
Definition attribute.h:59
Class for representing data rates.
Definition data-rate.h:78
Ipv4 addresses are stored in host order in this class.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
A helper to make it easier to instantiate an ns3::QKDAppApplication on a set of nodes.
ApplicationContainer InstallQKDApplication(Ptr< Node > node1, Ptr< Node > node2, Address masterAddress, Address slaveAddress, Ptr< Node > control1, Ptr< Node > control2, std::string connectionType, uint32_t packetSize, DataRate dataRate, std::string applicationType, std::string masterUUID, std::string slaveUUID)
Install a pair of cryptographic applications to consume keys.
ObjectFactory m_factory_postprocessing_app
Object factory.
ObjectFactory m_factory_qkd_app
Object factory.
void InstallKeyManager(Ptr< Node > node, Ipv4Address kmsAddress, uint32_t port, Ptr< QKDControl > controller)
Install key manager.
void SetAttribute(std::string mFactoryName, std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes, not the socket attributes.
void SetSettings(std::string protocol, Ipv4Address master, Ipv4Address slave, uint32_t keyRate)
Install an ns3::QKDAppApplication on each node of the input container configured with all the attribu...
ObjectFactory m_factory_kms_app
Object factory.
std::string m_protocol
ObjectFactory m_factory_lr_app
QKDAppHelper()
Create an QKDAppHelper to make it easier to work with QKD Applications (KMS, Post-processing and othe...
ApplicationContainer InstallPostProcessing(Ptr< Node > node1, Ptr< Node > node2, Address masterAddress, Address slaveAddress, Ptr< Node > control1, Ptr< Node > control2, uint32_t keySize, DataRate keyRate, uint32_t packetSize, DataRate dataRate, std::string masterUUID, std::string slaveUUID)
QKDAppHelper(std::string protocol, Address address)
ApplicationContainer InstallPriv(Ptr< NetDevice > net1, Ptr< NetDevice > net2) const
Install an ns3::QKDAppApplication on the node configured with all the attributes set with SetAttribut...
static uint32_t appCounter
uint16_t port
Definition dsdv-manet.cc:33
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.
static unsigned int value(char c)
static const uint32_t packetSize
Packet size generated at the AP.