A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::QKDControl Class Reference

As described in OPENQKD deliverable D6.1(section 5), the QKD control is a network component with the knowledge of the network status. More...

#include "qkd-control.h"

+ Inheritance diagram for ns3::QKDControl:
+ Collaboration diagram for ns3::QKDControl:

Classes

struct  QKDLink
 
struct  QKDModule
 Describes QKD modules at site. More...
 

Public Member Functions

 QKDControl ()
 Constructor.
 
 ~QKDControl () override
 Destructor.
 
void AddRouteEntry (QKDLocationRegisterEntry entry)
 
void AssignKeyManager (Ptr< Node > n)
 Assign key manager.
 
void ClearRoutingTable ()
 
void ConfigureQBuffers (uint32_t Mmin, uint32_t Mthr, uint32_t Mmax, uint32_t Mcurr, uint32_t defaultKeySize)
 Configure all buffers(default conf).
 
void ConfigureRSBuffers (uint32_t Mmin, uint32_t Mthr, uint32_t Mmax, uint32_t Mcurr, uint32_t defaultKeySize)
 
Ptr< SBufferCreateRSBuffer (uint32_t remoteId)
 
void Dispose ()
 Destroy a QKDControl.
 
std::string GetApplicationId (std::string peerAppId)
 Get local application ID based on the remote application ID.
 
Ptr< QBufferGetBufferByDestinationNode (Ptr< Node >, Ptr< Node >)
 Return QKDQBuffer for plotting.
 
TypeId GetInstanceTypeId () const override
 Get the type ID for the instance.
 
Ptr< QKDKeyManagerSystemApplicationGetKeyManagerSystemApplication (Ptr< Node > n) const
 Get Key Manager System Application from node.
 
Ipv4Address GetLocalKMAddress () const
 
std::string GetLocalKMId () const
 
Ptr< NodeGetLocalKMNode () const
 
uint32_t GetLocalKMNodeId () const
 
Ptr< NodeGetNode () const
 
Ptr< QBufferGetQBufferConf (uint32_t remoteId)
 
std::vector< uint32_tGetRemoteKmNodeIds () const
 
QKDLocationRegisterEntry GetRoute (std::string remoteAppId)
 
QKDLocationRegisterEntry GetRoute (uint32_t remoteKmId)
 
void RegisterQKDApplicationPair (std::string localAppId, std::string remoteAppId, Ptr< Node > remoteKmNode)
 register a pair of QKD applications
 
void RegisterQKDModulePair (Ptr< Node > moduleLocal, Ptr< Node > moduleRemote, std::string idLocal, std::string idRemote, Ptr< Node > kmLocal, Ptr< Node > kmRemote)
 Register QKD Module / PP application pair.
 
void SetNode (Ptr< Node >)
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Protected Member Functions

void DoDispose () override
 The dispose method.
 
void DoInitialize () override
 @briefInitialization function
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Private Attributes

std::vector< std::string > m_local_qkdapps
 Vector of all the apps(IDs) connecting to local KM node.
 
Ptr< Nodem_node
 
Ptr< QBufferm_qbuffer_config
 Default QKD buffer configuration.
 
std::map< uint32_t, Ptr< QBuffer > > m_qbuffers_conf
 Dedicaded QKD buffer configuration.
 
std::vector< QKDModulem_qkd_modules
 Registered QKD modules.
 
std::map< std::string, std::string > m_qkdapp_pairs
 QKDapp pair(remoteApp, localApp)
 
std::vector< Ptr< Node > > m_remote_km_nodes
 Remote Key Manager Node(s)(direct QKD connection!)
 
std::map< std::string, uint32_tm_remote_qkdapps
 All remote apps(IDs) and their KM nodes(must keep nodes to get remote KM address in QKD network)
 
Ptr< QKDLocationRegisterm_routingTable
 Routing Table.
 
Ptr< QBufferm_rsbuffer_config
 

Additional Inherited Members

Detailed Description

As described in OPENQKD deliverable D6.1(section 5), the QKD control is a network component with the knowledge of the network status.

Introspection did not find any typical Config paths.

It should perform network management through distributed protocols or centralized entities.

Note
In the current version of QKDNetSim, QKDControl can be installed on an independent node without a direct QKD connection. It is in charge of establishing QKD links, and it contains a list of QKD links with associated QKD buffers implemented in a QKD network.


No Attributes are defined for this type.
No TraceSources are defined for this type.
Group: QKDControl

Size of this type is 304 bytes (on a 64-bit architecture).

Definition at line 63 of file qkd-control.h.

Constructor & Destructor Documentation

◆ QKDControl()

ns3::QKDControl::QKDControl ( )

Constructor.

Definition at line 46 of file qkd-control.cc.

References NS_LOG_FUNCTION_NOARGS.

◆ ~QKDControl()

ns3::QKDControl::~QKDControl ( )
override

Destructor.

Definition at line 52 of file qkd-control.cc.

Member Function Documentation

◆ AddRouteEntry()

void ns3::QKDControl::AddRouteEntry ( QKDLocationRegisterEntry  entry)

Definition at line 344 of file qkd-control.cc.

References ns3::Create(), m_routingTable, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ AssignKeyManager()

void ns3::QKDControl::AssignKeyManager ( Ptr< Node n)

Assign key manager.

Parameters
nkey manager's node

Definition at line 97 of file qkd-control.cc.

References ns3::Create(), GetLocalKMAddress(), GetNode(), m_routingTable, NS_LOG_FUNCTION, and SetNode().

+ Here is the call graph for this function:

◆ ClearRoutingTable()

void ns3::QKDControl::ClearRoutingTable ( )

Definition at line 338 of file qkd-control.cc.

◆ ConfigureQBuffers()

void ns3::QKDControl::ConfigureQBuffers ( uint32_t  Mmin,
uint32_t  Mthr,
uint32_t  Mmax,
uint32_t  Mcurr,
uint32_t  defaultKeySize 
)

Configure all buffers(default conf).

Mandatory function!

Parameters
Mminminimum amount(bits) of key material QKD buffer should maintain
Mmaxmaximum amount(bits) of key material QKD buffer can store
Mthrthresold amount(bits) of key material
Mcurrcurrent amount(bits) of key material QKD buffer maintain
defaultKeySizedefault size of stored keys

Definition at line 254 of file qkd-control.cc.

References ns3::Create(), m_qbuffer_config, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ConfigureRSBuffers()

void ns3::QKDControl::ConfigureRSBuffers ( uint32_t  Mmin,
uint32_t  Mthr,
uint32_t  Mmax,
uint32_t  Mcurr,
uint32_t  defaultKeySize 
)

Definition at line 283 of file qkd-control.cc.

References ns3::Create(), m_rsbuffer_config, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ CreateRSBuffer()

Ptr< SBuffer > ns3::QKDControl::CreateRSBuffer ( uint32_t  remoteId)

Definition at line 297 of file qkd-control.cc.

References ns3::Create(), m_rsbuffer_config, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Dispose()

void ns3::QKDControl::Dispose ( )

Destroy a QKDControl.

This is the pre-destructor function of the QKDControl.

◆ DoDispose()

void ns3::QKDControl::DoDispose ( )
overrideprotectedvirtual

The dispose method.

Subclasses must override this method and must chain up to it by calling Node::DoDispose at the end of their own DoDispose method.

Reimplemented from ns3::Object.

Definition at line 57 of file qkd-control.cc.

References ns3::Object::DoDispose().

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::QKDControl::DoInitialize ( )
overrideprotectedvirtual

@briefInitialization function

Reimplemented from ns3::Object.

Definition at line 63 of file qkd-control.cc.

References ns3::Object::DoInitialize(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetApplicationId()

std::string ns3::QKDControl::GetApplicationId ( std::string  peerAppId)

Get local application ID based on the remote application ID.

Parameters
peerAppIdremote application ID
Returns
string local application ID

Definition at line 241 of file qkd-control.cc.

References ns3::Create(), m_qkdapp_pairs, NS_LOG_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetBufferByDestinationNode()

Ptr< QBuffer > ns3::QKDControl::GetBufferByDestinationNode ( Ptr< Node src,
Ptr< Node dst 
)

Return QKDQBuffer for plotting.

Parameters
Ptr<Node>src, Ptr<Node> dst
Returns
Ptr<QBuffer>

Definition at line 70 of file qkd-control.cc.

References ns3::Create(), NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::QKDControl::GetInstanceTypeId ( ) const
overridevirtual

Get the type ID for the instance.

Returns
the instance TypeId

Reimplemented from ns3::Object.

Definition at line 41 of file qkd-control.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetKeyManagerSystemApplication()

Ptr< QKDKeyManagerSystemApplication > ns3::QKDControl::GetKeyManagerSystemApplication ( Ptr< Node n) const

Get Key Manager System Application from node.

Parameters
nnode
Returns
key manager system application

Definition at line 107 of file qkd-control.cc.

References ns3::Create(), and NS_LOG_FUNCTION.

Referenced by GetLocalKMAddress(), GetLocalKMId(), and RegisterQKDModulePair().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLocalKMAddress()

Ipv4Address ns3::QKDControl::GetLocalKMAddress ( ) const

Definition at line 121 of file qkd-control.cc.

References GetKeyManagerSystemApplication(), and GetLocalKMNode().

Referenced by AssignKeyManager().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLocalKMId()

std::string ns3::QKDControl::GetLocalKMId ( ) const

Definition at line 136 of file qkd-control.cc.

References GetKeyManagerSystemApplication(), and GetLocalKMNode().

+ Here is the call graph for this function:

◆ GetLocalKMNode()

Ptr< Node > ns3::QKDControl::GetLocalKMNode ( ) const

Definition at line 126 of file qkd-control.cc.

References GetNode().

Referenced by GetLocalKMAddress(), GetLocalKMId(), GetLocalKMNodeId(), ns3::QKDAppHelper::InstallPostProcessing(), ns3::QKDAppHelper::InstallQKDApplication(), and RegisterQKDModulePair().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLocalKMNodeId()

uint32_t ns3::QKDControl::GetLocalKMNodeId ( ) const

Definition at line 131 of file qkd-control.cc.

References ns3::Node::GetId(), and GetLocalKMNode().

Referenced by ns3::QKDAppHelper::InstallQKDApplication().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNode()

Ptr< Node > ns3::QKDControl::GetNode ( ) const

Definition at line 87 of file qkd-control.cc.

References m_node.

Referenced by AssignKeyManager(), and GetLocalKMNode().

+ Here is the caller graph for this function:

◆ GetQBufferConf()

Ptr< QBuffer > ns3::QKDControl::GetQBufferConf ( uint32_t  remoteId)

Definition at line 268 of file qkd-control.cc.

References ns3::Create(), m_qbuffer_config, m_qbuffers_conf, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by RegisterQKDModulePair().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRemoteKmNodeIds()

std::vector< uint32_t > ns3::QKDControl::GetRemoteKmNodeIds ( ) const

Definition at line 141 of file qkd-control.cc.

References ns3::Create(), and m_remote_km_nodes.

+ Here is the call graph for this function:

◆ GetRoute() [1/2]

QKDLocationRegisterEntry ns3::QKDControl::GetRoute ( std::string  remoteAppId)

Definition at line 314 of file qkd-control.cc.

References ns3::Create(), GetRoute(), m_remote_qkdapps, NS_LOG_ERROR, and NS_LOG_FUNCTION.

Referenced by GetRoute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRoute() [2/2]

QKDLocationRegisterEntry ns3::QKDControl::GetRoute ( uint32_t  remoteKmId)

Definition at line 328 of file qkd-control.cc.

References ns3::Create(), m_routingTable, NS_LOG_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::QKDControl::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 31 of file qkd-control.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterQKDApplicationPair()

void ns3::QKDControl::RegisterQKDApplicationPair ( std::string  localAppId,
std::string  remoteAppId,
Ptr< Node remoteKmNode 
)

register a pair of QKD applications

Parameters
localAppIdID of local QKD application
remoteAppIdID of remote QKD application
remoteKmNoderemote KM node

Definition at line 211 of file qkd-control.cc.

References ns3::Create(), m_local_qkdapps, m_qkdapp_pairs, m_remote_qkdapps, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ RegisterQKDModulePair()

void ns3::QKDControl::RegisterQKDModulePair ( Ptr< Node moduleLocal,
Ptr< Node moduleRemote,
std::string  idLocal,
std::string  idRemote,
Ptr< Node kmLocal,
Ptr< Node kmRemote 
)

Register QKD Module / PP application pair.

Parameters
moduleLocallocal QKD module node
moduleRemoteremote QKD module node
idLocallocal QKD module ID
idRemoteremote QKD module ID
kmLocallocal key manager node
kmRemoteremote key manager node

Definition at line 151 of file qkd-control.cc.

References ns3::Create(), GetKeyManagerSystemApplication(), GetLocalKMNode(), GetQBufferConf(), m_qkd_modules, m_remote_km_nodes, ns3::QKDControl::QKDModule::node, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetNode()

void ns3::QKDControl::SetNode ( Ptr< Node node)

Definition at line 92 of file qkd-control.cc.

References m_node.

Referenced by AssignKeyManager().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_local_qkdapps

std::vector<std::string> ns3::QKDControl::m_local_qkdapps
private

Vector of all the apps(IDs) connecting to local KM node.

Definition at line 257 of file qkd-control.h.

Referenced by RegisterQKDApplicationPair().

◆ m_node

Ptr<Node> ns3::QKDControl::m_node
private

Definition at line 243 of file qkd-control.h.

Referenced by GetNode(), and SetNode().

◆ m_qbuffer_config

Ptr<QBuffer> ns3::QKDControl::m_qbuffer_config
private

Default QKD buffer configuration.

Definition at line 251 of file qkd-control.h.

Referenced by ConfigureQBuffers(), and GetQBufferConf().

◆ m_qbuffers_conf

std::map<uint32_t, Ptr<QBuffer> > ns3::QKDControl::m_qbuffers_conf
private

Dedicaded QKD buffer configuration.

Definition at line 255 of file qkd-control.h.

Referenced by GetQBufferConf().

◆ m_qkd_modules

std::vector<QKDModule> ns3::QKDControl::m_qkd_modules
private

Registered QKD modules.

Definition at line 247 of file qkd-control.h.

Referenced by RegisterQKDModulePair().

◆ m_qkdapp_pairs

std::map<std::string, std::string> ns3::QKDControl::m_qkdapp_pairs
private

QKDapp pair(remoteApp, localApp)

Definition at line 259 of file qkd-control.h.

Referenced by GetApplicationId(), and RegisterQKDApplicationPair().

◆ m_remote_km_nodes

std::vector<Ptr<Node> > ns3::QKDControl::m_remote_km_nodes
private

Remote Key Manager Node(s)(direct QKD connection!)

Definition at line 245 of file qkd-control.h.

Referenced by GetRemoteKmNodeIds(), and RegisterQKDModulePair().

◆ m_remote_qkdapps

std::map<std::string, uint32_t > ns3::QKDControl::m_remote_qkdapps
private

All remote apps(IDs) and their KM nodes(must keep nodes to get remote KM address in QKD network)

Definition at line 261 of file qkd-control.h.

Referenced by GetRoute(), and RegisterQKDApplicationPair().

◆ m_routingTable

Ptr<QKDLocationRegister> ns3::QKDControl::m_routingTable
private

Routing Table.

Definition at line 263 of file qkd-control.h.

Referenced by AddRouteEntry(), AssignKeyManager(), and GetRoute().

◆ m_rsbuffer_config

Ptr<QBuffer> ns3::QKDControl::m_rsbuffer_config
private

Definition at line 253 of file qkd-control.h.

Referenced by ConfigureRSBuffers(), and CreateRSBuffer().


The documentation for this class was generated from the following files: