A Discrete-Event Network Simulator
API
qkd-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 LIPTEL.ieee.org
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_HELPER_H
22 #define QKD_HELPER_H
23 
24 #include <string>
25 
26 #include "ns3/object-factory.h"
27 #include "ns3/qkd-graph-manager.h"
28 #include "ns3/net-device-container.h"
29 #include "ns3/node-container.h"
30 #include "ns3/trace-helper.h"
31 #include "ns3/ipv4-interface-address.h"
32 #include "ns3/core-module.h"
33 #include "ns3/network-module.h"
34 #include "ns3/internet-module.h"
35 #include "ns3/qkd-net-device.h"
36 #include "ns3/qkd-crypto.h"
37 
38 namespace ns3 {
39 
40 class NetDevice;
41 class Node;
42 
54 {
55 public:
56 
61  QKDHelper ();
62  virtual ~QKDHelper () {}
63 
82  void SetQueue (std::string type,
83  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
84  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
85  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
86  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
87 
98  void SetDeviceAttribute (std::string name, const AttributeValue &value);
99 
110  void SetChannelAttribute (std::string name, const AttributeValue &value);
111 
123  //NetDeviceContainer Install (NodeContainer c);
124 
134  //NetDeviceContainer Install (Ptr<Node> a, Ptr<Node> b);
135 
143  //NetDeviceContainer Install (Ptr<Node> a, std::string bName);
144 
145  //SINGLE TCP-IP STACK
147  Ptr<NetDevice> IPa,
148  Ptr<NetDevice> IPb,
149  uint32_t Mmin,
150  uint32_t Mthr,
151  uint32_t Mmax,
152  uint32_t Mcurrent
153  );
154 
155  //SINGLE TCP-IP STACK
157 
168  Ptr<NetDevice> IPa,
169  Ptr<NetDevice> IPb,
172  uint32_t Mmin,
173  uint32_t Mthr,
174  uint32_t Mmax,
175  uint32_t Mcurrent,
176  const std::string typeId
177  );
178 
180  Ptr<NetDevice> IPa,
181  Ptr<NetDevice> IPb,
184  uint32_t Mmin,
185  uint32_t Mthr,
186  uint32_t Mmax,
187  uint32_t Mcurrent
188  );
189 
191 
192  void AddGraph(Ptr<Node> node, Ptr<NetDevice> device);
193 
194  void AddGraph(Ptr<Node> node, Ptr<NetDevice> device, std::string graphName);
195 
196  void AddGraph(Ptr<Node> node, Ptr<NetDevice> device, std::string graphName, std::string graphType);
197 
198  void PrintGraphs();
199 
207  NetDeviceContainer Install (std::string aName, Ptr<Node> b);
208 
210 
218  NetDeviceContainer Install (std::string aNode, std::string bNode);
219 
225  static void CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId);
226 
236  void SetRoutingHelper (const Ipv4RoutingHelper &routing);
237 
238 private:
239 
244 
249 
251 
252  uint32_t m_channelID;
253 
255 
257 
258  uint32_t m_counter;
259 
260  uint32_t m_supportQKDL4;
261 
273  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename);
274 
287  virtual void EnableAsciiInternal (
289  std::string prefix,
290  Ptr<NetDevice> nd,
291  bool explicitFilename);
292 
295 };
296 } // namespace ns3
297 
298 #endif /* QKD_HELPER_H */
Base class providing common user-level ascii trace operations for helpers representing net devices...
Definition: trace-helper.h:641
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: qkd-helper.cc:73
virtual ~QKDHelper()
Definition: qkd-helper.h:62
static void CreateAndAggregateObjectFromTypeId(Ptr< Node > node, const std::string typeId)
create an object from its TypeId and aggregates it to the node
Definition: qkd-helper.cc:313
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
uint32_t m_counter
Definition: qkd-helper.h:258
Hold a value for an Attribute.
Definition: attribute.h:68
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
Definition: qkd-helper.cc:109
ObjectFactory m_channelFactory
Channel Factory.
Definition: qkd-helper.h:293
Base class providing common user-level pcap operations for helpers representing net devices...
Definition: trace-helper.h:552
Ptr< QKDCrypto > m_QCrypto
Definition: qkd-helper.h:256
uint32_t m_portOverlayNumber
Definition: qkd-helper.h:250
Build a set of QKDNetDevice objects.
Definition: qkd-helper.h:52
uint32_t m_channelID
Definition: qkd-helper.h:252
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
A class for an empty attribute value.
Definition: attribute.h:232
NetDeviceContainer Install(std::string aName, Ptr< Node > b)
holds a vector of ns3::NetDevice pointers
NetDeviceContainer InstallQKD(Ptr< NetDevice > IPa, Ptr< NetDevice > IPb, uint32_t Mmin, uint32_t Mthr, uint32_t Mmax, uint32_t Mcurrent)
Install and setup SINGLE TCP/IP QKD link between the nodes.
Definition: qkd-helper.cc:794
ObjectFactory m_deviceFactory
Device Factory.
Definition: qkd-helper.h:294
void SetQueue(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue())
Each point to point net device must have a queue to pass packets through.
a factory to create ns3::Ipv4RoutingProtocol objects
NetDeviceContainer InstallOverlayQKD(Ptr< NetDevice > IPa, Ptr< NetDevice > IPb, Ipv4InterfaceAddress da, Ipv4InterfaceAddress db, uint32_t Mmin, uint32_t Mthr, uint32_t Mmax, uint32_t Mcurrent, const std::string typeId)
Install and setup OVERLAY QKD link between the nodes.
Definition: qkd-helper.cc:437
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
Definition: qkd-helper.cc:64
void SetRoutingHelper(const Ipv4RoutingHelper &routing)
Set routing protocol to be used in overlay QKDNetwork.
Definition: qkd-helper.cc:301
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void InstallQKDManager(NodeContainer &n)
Install QKDManager on the node.
Definition: qkd-helper.cc:281
Instantiate subclasses of ns3::Object.
a class to store IPv4 address information on an interface
void AddGraph(Ptr< Node > node, Ptr< NetDevice > device)
ADD QKDGraph.
Definition: qkd-helper.cc:224
QKDHelper()
Create a QKDHelper to make life easier when creating point to point networks.
Definition: qkd-helper.cc:49
bool m_useRealStorages
Definition: qkd-helper.h:254
const Ipv4RoutingHelper * m_routing
IPv4 routing helper.
Definition: qkd-helper.h:248
ObjectFactory m_tcpFactory
TCP objects factory.
Definition: qkd-helper.h:243
uint32_t m_supportQKDL4
Definition: qkd-helper.h:260
void PrintGraphs()
Print QKDGraphs.
Definition: qkd-helper.cc:270