A Discrete-Event Network Simulator
API
qkd-app-helper.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 QKD_APP_HELPER_H
22 #define QKD_APP_HELPER_H
23 
24 #include <stdint.h>
25 #include <string>
26 #include "ns3/object-factory.h"
27 #include "ns3/address.h"
28 #include "ns3/attribute.h"
29 #include "ns3/net-device.h"
30 #include "ns3/net-device-container.h"
31 #include "ns3/node-container.h"
32 #include "ns3/application-container.h"
33 #include "ns3/qkd-postprocessing-application.h"
34 
35 namespace ns3 {
36 
43 {
44 public:
59  QKDAppHelper ();
60 
66  QKDAppHelper (std::string protocol, Address address);
67 
75  QKDAppHelper (std::string protocol, Ipv4Address addressSrc, Ipv4Address addressDst, uint32_t keyRate);
76 
84  void SetAttribute (std::string mFactoryName, std::string name, const AttributeValue &value);
85 
94  //ApplicationContainer Install (NodeContainer c) const;
95  void SetSettings ( std::string protocol, Ipv4Address master, Ipv4Address slave, uint32_t keyRate);
96 
105 
114  Ptr<QKDKeyManagerSystemApplication> InstallKMS (Ptr<Node> node, Ipv4Address kmsAddress, uint32_t port) const;
115 
123  void InstallSDN (Ptr<Node> node, Ipv4Address sdnAddress) const;
124 
133  void InstallSDN (Ptr<Node> node, Ipv4Address sdnAddress, uint32_t port) const;
134 
151  Ptr<Node> node1,
152  Ptr<Node> node2,
153  Address masterAddress,
154  Address slaveAddress,
155  Address masterKMSAddress,
156  Address slaveKMSAddress,
157  uint32_t keySizeInBits,
158  DataRate keyRate,
159  uint32_t packetSize,
160  DataRate dataRate
161  );
162 
163  void ConnectKMSToSDN(Ptr<Node> kmsNode, Ipv4Address sdnAddress, uint32_t port);
164 
165 private:
174 
180 
181  std::string m_protocol;
182 
183  static uint32_t appCounter;
184 
185 };
186 
187 } // namespace ns3
188 
189 #endif /* QKD_APP_HELPER_H */
190 
a polymophic address class
Definition: address.h:91
holds a vector of ns3::Application pointers.
Hold a value for an Attribute.
Definition: attribute.h:69
Class for representing data rates.
Definition: data-rate.h:89
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
A helper to make it easier to instantiate an ns3::QKDAppApplication on a set of nodes.
void ConnectKMSToSDN(Ptr< Node > kmsNode, Ipv4Address sdnAddress, uint32_t port)
ObjectFactory m_factory_postprocessing_app
Object factory.
ObjectFactory m_factory_qkd_app
Object factory.
ApplicationContainer InstallPostProcessing(Ptr< Node > node1, Ptr< Node > node2, Address masterAddress, Address slaveAddress, Address masterKMSAddress, Address slaveKMSAddress, uint32_t keySizeInBits, DataRate keyRate, uint32_t packetSize, DataRate dataRate)
Install an ns3::QKDPostprocessingApplication on the node configured with all the attributes set with ...
void InstallSDN(Ptr< Node > node, Ipv4Address sdnAddress) const
Install an ns3::QKDKeyManagmentSystem on the node configured with all the attributes set with SetAttr...
void SetAttribute(std::string mFactoryName, std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes, not the socket attributes.
ApplicationContainer InstallQKDApp(Ptr< Node > node) const
Install an ns3::QKDApp on the node configured with all the attributes set with SetAttribute.
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_sdn_app
Object factory.
Ptr< QKDKeyManagerSystemApplication > InstallKMS(Ptr< Node > node, Ipv4Address kmsAddress) const
Install an ns3::QKDKeyManagmentSystem on the node configured with all the attributes set with SetAttr...
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...
QKDAppHelper(std::string protocol, Address address)
Constructor.
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:45
address
Definition: first.py:44
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint32_t packetSize