A Discrete-Event Network Simulator
API
qkd-application-entry.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: Emir Dervisevic <emir.dervisevic@etf.unsa.ba>
19  * Miralem Mehic <miralem.mehic@ieee.org>
20  */
21 #ifndef QKD_APPLICATION_ENTRY_H
22 #define QKD_APPLICATION_ENTRY_H
23 
24 #include "ns3/event-id.h"
25 #include "ns3/ptr.h"
26 #include "ns3/data-rate.h"
27 #include "ns3/traced-callback.h"
28 #include "ns3/output-stream-wrapper.h"
29 #include "ns3/packet.h"
30 #include "ns3/object.h"
31 #include "ns3/traced-value.h"
32 #include "ns3/trace-source-accessor.h"
33 #include "ns3/node.h"
34 #include "ns3/core-module.h"
35 #include "ns3/log.h"
36 #include "ns3/uuid.h"
37 
38 #include <map>
39 #include <iostream>
40 #include <vector>
41 #include <sstream>
42 
43 namespace ns3 {
44 
60 inline std::string GetQKDApplicationEntryText(const uint16_t statusCode)
61 {
62  switch (statusCode)
63  {
64  case 1:
65  return "ETSI_QKD_014_ENCRYPTION Protocol";
66  case 2:
67  return "ETSI_QKD_014_AUTHENTICATION";
68  case 3:
69  return "ETSI_QKD_004_ENCRYPTION";
70  case 4:
71  return "ETSI_QKD_004_AUTHENTICATION";
72  default:
73  return "None";
74  }
75 }
76 
77 class QKDApplicationEntry : public Object
78 {
79  public:
80 
85  {
86  NONE = 0,
91  };
92 
93 
98  static TypeId GetTypeId (void);
99 
104  virtual TypeId GetInstanceTypeId (void) const;
105 
110 
123  UUID keyAssociationId,
124  UUID srcSaeId,
125  UUID dstSaeId,
126  ConnectionType type,
127  uint32_t priority,
128  double expirationTime,
129  Ipv4Address srcKMSAddress,
130  Ipv4Address dstKMSAddress
131  );
132 
137 
144  {
145  return m_kmsSrcAddress;
146  }
153  {
154  return m_kmsDstAddress;
155  }
159  void
165  void
166  Print (Ptr<OutputStreamWrapper> stream) const;
167 
173  return m_client_app_id;
174  }
180  return m_server_app_id;
181  }
187  return m_app_id;
188  }
192  void SetId(UUID value){
193  m_app_id = value;
194  }
199  bool
201  return m_valid;
202  }
208  return m_app_type;
209  }
215  return m_backing_qkdl_id;
216  }
217 
218  UUID m_app_id; // !< This value uniquely identifies a QKD application consisting of a set of entities that are allowed to receive keys shared with each other from the SD-QKD nodes they connect to. This value is similar to a key ID or key handle.
219  double m_qos_max_bandwidth; // !< Maximum bandwidth (in bits per second) allowed for this specific application. Exceeding this value will raise an error from the local key store to the appl. This
220  double m_qos_min_bandwidth; // !< This value is an optional QoS parameter that enables a minimum key rate (in bits per second) for the application
221  double m_qos_jitter; // !< This value allows to specify the maximum jitter (in msec) to be provided by the key delivery API for applications requiring fast rekeying.
222  double m_qos_ttl; // !< This value is used to specify the maximum time (in seconds) that a key could be kept in the key store for a given application without being used.
223  bool m_qos_clients_shared_path_enable; // !< If true, multiple clients for this application might share keys to reduce service impact (consumption)
224  bool m_clients_shared_keys_required; // !< If true, multiple clients for this application might share keys to reduce service impact (consumption)
225  QKDApplicationEntry::ConnectionType m_app_type; // !< Type of the registered application. These values, defined within the types module, can be client (if an external application is requesting keys) or internal (if the application is defined to maintain the QKD - e.g. multi-hop, authentication or other encryption operations).
226  UUID m_client_app_id; // !< List of IDs that identifies the one or more entities that are allowed to receive keys from SD-QKD node(s) under the QKD application in addition to the initiating entity identified by server_app_id.
227  UUID m_server_app_id; // !< ID that identifies the entity that initiated the creation of the QKD application to receive keys shared with one or more specified target entity identified by client_app_id. It is a client in the interface to the SD-QKD node and the name server_app_id reflects that it requested the QKD application to be initiated
228  UUID m_backing_qkdl_id; // !< Unique ID of the key association link which is providing QKD keys to these applications
229  uint32_t m_local_qkdn_id; // !< Unique ID of the local SD-QKD node which is providing QKD keys to the local application.
230  uint32_t m_remote_qkdn_id; // !< Unique ID of the remote SD-QKD node which is providing QKD keys to the remote application. While unknown, the local SD-QKD will not be able to provide keys to the local application.
231  uint32_t m_app_priority; // !< The application priority.
232  double m_creation_time; // !< The association creation time.
233  double m_expiration_time; // !< The association expiration time.
234  uint32_t m_app_statistics_statistic_consumed_bits; // !< The consumption statistics.
235  bool m_valid; // !< Internal check whether all fields are set correctly
236  Ipv4Address m_kmsSrcAddress; // !< IP address of master KMS
237  Ipv4Address m_kmsDstAddress; // !< IP address of slave KMS
238 
239 };
240 
241 } // namespace ns3
242 
243 #endif /* QKD_APPLICATION_ENTRY_H */
244 
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
A base class which provides memory management and object aggregation.
Definition: object.h:88
Introspection did not find any typical Config paths.
Ipv4Address GetSourceKmsAddress() const
\briet Get the source KMS IP address.
void PrintRegistryInfo()
Print the registry information.
Ipv4Address m_kmsSrcAddress
ConnectionType
The connection types.
@ ETSI_QKD_004_AUTHENTICATION
@ ETSI_QKD_014_AUTHENTICATION
@ ETSI_QKD_004_ENCRYPTION
@ ETSI_QKD_014_ENCRYPTION
@ NONE
uint32_t m_local_qkdn_id
uint32_t m_app_statistics_statistic_consumed_bits
uint32_t m_remote_qkdn_id
static TypeId GetTypeId(void)
Get the type ID.
double m_expiration_time
uint32_t m_app_priority
double m_qos_jitter
double m_qos_ttl
bool m_valid
UUID m_backing_qkdl_id
UUID m_app_id
UUID GetDestinationSaeId()
Get the destination (receiver) application identifier.
void Print(Ptr< OutputStreamWrapper > stream) const
Print the routing table entry.
Ipv4Address m_kmsDstAddress
UUID m_server_app_id
double m_qos_max_bandwidth
double m_creation_time
QKDApplicationEntry::ConnectionType GetType()
Get the connection type.
QKDApplicationEntry::ConnectionType m_app_type
UUID GetKeyAssociationId()
Get the association identifier.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID for the instance.
UUID GetSrcSaeId()
Get the source (sender) application identifier.
void SetId(UUID value)
Set the application identifier.
bool IsValid()
Check if entry is valid.
UUID GetId()
Get the application identifier.
UUID m_client_app_id
Ipv4Address GetDestinationKmsAddress() const
Get the destination KMS IP address.
bool m_qos_clients_shared_path_enable
double m_qos_min_bandwidth
~QKDApplicationEntry()
Destructor.
QKDApplicationEntry()
Empty constructor.
bool m_clients_shared_keys_required
a unique identifier for an interface.
Definition: type-id.h:59
Universally unique identifier (UUID)
Definition: uuid.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::string GetQKDApplicationEntryText(const uint16_t statusCode)