A Discrete-Event Network Simulator
API
qkd-key-association-link-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_KEY_ASSOCIATION_LINK_H
22 #define QKD_KEY_ASSOCIATION_LINK_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 #include "ns3/qkd-buffer.h"
38 
39 #include <map>
40 #include <iostream>
41 #include <sstream>
42 #include <vector>
43 
44 namespace ns3 {
45 
63 {
64  public:
65 
70  static TypeId GetTypeId (void);
71 
76  virtual TypeId GetInstanceTypeId (void) const;
77 
79 
81  uint32_t local_qkd_node_id,
82  uint32_t remote_qkd_node_id,
83  uint32_t nextHop,
84  uint32_t hops,
85  uint32_t type, //Virtual (multi-hop) - value 1 or Direct - value 0.
86  Ipv4Address kmsSrcAddress,
87  Ipv4Address kmsDstAddress,
88  Ptr<QKDBuffer> qkdBuffer
89  );
90 
92  UUID qkdl_id,
93  uint32_t local_qkd_node_id,
94  uint32_t remote_qkd_node_id,
95  uint32_t nextHop,
96  uint32_t hops,
97  uint32_t type, //Virtual (multi-hop) - value 1 or Direct - value 0.
98  Ipv4Address kmsSrcAddress,
99  Ipv4Address kmsDstAddress,
100  Ptr<QKDBuffer> qkdBuffer
101  );
102 
104 
111  {
112  return m_kmsSrcAddress;
113  }
120  {
121  return m_kmsDstAddress;
122  }
123  uint32_t
125  return m_qkdl_local_qkdn_id;
126  }
127  uint32_t
129  return m_qkdl_remote_qkdn_id;
130  }
131  UUID
132  GetId(){
133  return m_qkdl_id;
134  }
135  void
136  SetId(UUID id){
137  m_qkdl_id = id;
138  }
141  return m_srcQKDBuffer;
142  }
143 
144  void
146 
147  bool
149 
150  void
152 
153  uint32_t
154  GetHop(){
155  return (uint32_t) m_hops;
156  }
157  uint32_t
159  return m_qkdl_type;
160  }
161  bool
163  return m_valid;
164  }
165 
166  void SetUpdateStatusInterval(double statusInterval);
167 
168  double GetUpdateStatusInterval();
169 
170  double GetSKR();
171 
172  void SetSKR(double value);
173 
174  double GetExpectedConsumption();
175 
176  void SetExpectedConsumption(double value);
177 
178  double GetEffectiveSKR();
179 
180  void SetEffectiveSKR(double value);
181 
185  void
191  void
192  Print (Ptr<OutputStreamWrapper> stream) const;
193 
194  UUID m_qkdl_id; // !< Unique ID of the QKD link (key association).
195  bool m_qkdl_enable; // !< This value allows to enable or disable the key generation process for a given link.
196  uint32_t m_qkdl_local_qkdn_id; // !< Unique ID of the local SD-QKD node.
197  uint32_t m_qkdl_local_qkdi_id; // !< Interface used to create the key association link
198  uint32_t m_qkdl_remote_qkdn_id; // !< Unique ID of the remote QKD node. This value is provided by the SDN controller when the key association link request arrives.
199  uint32_t m_qkdl_remote_qkdi_id; // !< Interface used to create the link.
200  uint32_t m_qkdl_type; // !< Key Association Link type: Virtual (multi-hop) - value 1 or Direct - value 0.
201  std::vector<UUID> m_qkdl_applications; // !< SAE Applications which are consuming keys from this key association link.
202  uint32_t m_virt_prev_hop; // !< Previous hop in a multi-hop/virtual key association link config
203  uint32_t m_virt_next_hop; // !< Next hop(s) in a multi-hop/virtual key association link config. Defined as a list for multicast over shared sub-paths.
204  double m_virt_bandwidth; // !< Required bandwidth (in bits per second) for that key association link. Used to reserve bandwidth from the physical QKD links to support the virtual key association link as an internal application
205  double m_phys_channel_att; // !< Expected attenuation on the quantum channel (in dB) between the Source/qkd_node and Destination/qkd_node.
206  double m_phys_wavelength; // !< Wavelength (in nm) to be used for the quantum channel. If the interface is not tunable, this configuration could be bypassed.
207  uint32_t m_phys_qkd_role; // !< Transmitter/receiver mode for the QKD module. If there is no multi-role support, this could be ignored
208 
209  double m_qkdl_performance_expected_consumption; // !< Sum of all the application's bandwidth (in bits per second) on this particular key association link.
210  double m_qkdl_performance_skr; // !< Secret key rate generation (in bits per second) of the key association link.
211  double m_qkdl_performance_eskr; // !< Effective secret key rate (in bits per second) generation of the key association link available after internal consumption
212 
213  double m_update_status_interval; // !< Time (Seconds) period to send update to SDN
214 
215  Ipv4Address m_kmsSrcAddress; // !< IP address of master KMS
216  Ipv4Address m_kmsDstAddress; // !< IP address of slave KMS
217  uint32_t m_hops; // !< Total number of hops forming the link. If dirrect - value 0
218  bool m_valid; // !< Internal check whether all fields are set correctly
219 
221 
222 };
223 
224 } // namespace ns3
225 
226 #endif /* QKD_KEY_ASSOCIATION_LINK_H */
227 
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
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Introspection did not find any typical Config paths.
uint32_t m_virt_next_hop
Ipv4Address m_kmsSrcAddress
Ipv4Address m_kmsDstAddress
void SetId(UUID id)
uint32_t m_qkdl_remote_qkdn_id
double GetEffectiveSKR()
uint32_t GetHop()
virtual TypeId GetInstanceTypeId(void) const
Get the type ID for the instance.
Ipv4Address GetDestinationKmsAddress() const
Get destination KMS Address.
void SetExpectedConsumption(double value)
void PrintRegistryInfo()
Print registry info.
uint32_t m_qkdl_type
UUID GetId()
bool IsValid()
bool m_valid
double m_qkdl_performance_eskr
QKDKeyAssociationLinkEntry()
Ptr< QKDBuffer > GetSourceBuffer()
uint32_t m_hops
double GetSKR()
double m_qkdl_performance_skr
double m_phys_wavelength
std::vector< UUID > m_qkdl_applications
uint32_t m_qkdl_local_qkdi_id
double GetExpectedConsumption()
bool m_qkdl_enable
double m_virt_bandwidth
Ipv4Address GetSourceKmsAddress() const
Get source KMS Address.
void SetUpdateStatusInterval(double statusInterval)
double m_qkdl_performance_expected_consumption
uint32_t GetType()
double GetUpdateStatusInterval()
void SetSKR(double value)
void PrintSAEApplications()
double m_phys_channel_att
~QKDKeyAssociationLinkEntry()
void Print(Ptr< OutputStreamWrapper > stream) const
Print routing table entry.
static TypeId GetTypeId(void)
Get the type ID.
bool CheckSAEApplicationExists(UUID saeId)
void UpdateQKDApplications(UUID saeId)
uint32_t GetSourceNodeId()
uint32_t GetDestinationNodeId()
Ptr< QKDBuffer > m_srcQKDBuffer
double m_update_status_interval
void SetEffectiveSKR(double value)
uint32_t m_phys_qkd_role
uint32_t m_qkdl_local_qkdn_id
UUID m_qkdl_id
uint32_t m_qkdl_remote_qkdi_id
uint32_t m_virt_prev_hop
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.