24 #include "ns3/packet.h"
25 #include "ns3/simulator.h"
27 #include "ns3/boolean.h"
28 #include "ns3/double.h"
29 #include "ns3/uinteger.h"
44 .SetGroupName (
"QKDControl")
46 .AddAttribute (
"BufferList",
"The list of buffers associated to this QKD Control.",
49 MakeObjectVectorChecker<QKDControl> ())
112 std::map<uint32_t, QKDControl::QKDLink >::iterator i =
m_destinations.find ( b->GetId() );
120 struct QKDControl::QKDLink newLink;
123 newLink.publicChannelMetric = 0;
124 newLink.quantumChannelMetric = 0;
127 newLink.qkdBufferAlice = CreateObject<QKDBuffer> ();
128 newLink.qkdBufferAlice->Init(
138 newLink.qkdBufferAlice->SetIndex(
m_qkdbuffers.size() - 1 );
141 newLink.qkdBufferBob = CreateObject<QKDBuffer> ();
142 newLink.qkdBufferBob->Init(
155 Ptr<QKDKeyManagerSystemApplication> lkmsA;
156 Ptr<QKDKeyManagerSystemApplication> lkmsB;
157 for (uint32_t i = 0; i < aKMS->GetNApplications (); ++i){
158 lkmsA = aKMS->GetApplication (i)->GetObject <QKDKeyManagerSystemApplication> ();
161 for (uint32_t i = 0; i < bKMS->GetNApplications (); ++i){
162 lkmsB = bKMS->GetApplication (i)->GetObject <QKDKeyManagerSystemApplication> ();
171 newLink.qkdBufferAlice
179 newLink.qkdBufferBob,
221 std::map<uint32_t, QKDControl::QKDLink >::iterator i =
m_destinations.find ( dst->
GetId() );
223 return i->second.qkdBufferAlice;
248 std::vector<std::string>
257 std::vector<std::string> output;
265 alice->GetAttribute (
"EncryptionType", aliceEncryptionType);
266 alice->GetAttribute (
"AuthenticationType", aliceAuthenticationType);
268 bob->GetAttribute (
"EncryptionType", bobEncryptionType);
269 bob->GetAttribute (
"AuthenticationType", bobAuthenticationType);
272 NS_ASSERT (aliceAuthenticationType.
Get() == bobAuthenticationType.
Get());
275 alice->GetAttribute (
"Priority", priorityAttrValue);
276 uint32_t priority = priorityAttrValue.
Get();
278 UUID aliceId = alice->GetId();
279 UUID bobId = bob->GetId();
295 output.push_back(appId);
309 alice->SetKsidEncryption(appEntry.
GetId());
310 bob->SetKsidEncryption(appEntry.
GetId());
326 output.push_back(appId);
338 NS_LOG_FUNCTION(
this <<
"Authentication SAE connections established!");
340 alice->SetKsidAuthentication(appEntry.
GetId());
341 bob->SetKsidAuthentication(appEntry.
GetId());
350 std::vector<std::string>
359 std::vector<std::string> output;
367 alice->GetAttribute (
"EncryptionType", aliceEncryptionType);
368 alice->GetAttribute (
"AuthenticationType", aliceAuthenticationType);
370 bob->GetAttribute (
"EncryptionType", bobEncryptionType);
371 bob->GetAttribute (
"AuthenticationType", bobAuthenticationType);
374 NS_ASSERT (aliceAuthenticationType.
Get() == bobAuthenticationType.
Get());
378 uint32_t priority = 0;
380 UUID aliceId = alice->GetId();
381 UUID bobId = bob->GetId();
397 output.push_back(appId);
411 alice->SetKsidEncryption(appEntry.
GetId());
412 bob->SetKsidEncryption(appEntry.
GetId());
428 output.push_back(appId);
440 NS_LOG_FUNCTION(
this <<
"Authentication SAE connections established!");
442 alice->SetKsidAuthentication(appEntry.
GetId());
443 bob->SetKsidAuthentication(appEntry.
GetId());
uint32_t GetId(void) const
A base class which provides memory management and object aggregation.
virtual void DoDispose(void)
Destructor implementation.
virtual void DoInitialize(void)
Initialize() implementation.
Container for a set of ns3::Object pointers.
Smart pointer class similar to boost::intrusive_ptr.
Introspection did not find any typical Config paths.
UUID GetKeyAssociationId()
Get the association identifier.
UUID GetId()
Get the application identifier.
QKD control is a network component with the knowledge of the network status.
Ptr< Node > m_node
The controller node.
std::vector< std::string > RegisterQKDApplications(Ptr< QKDApp004 > alice, Ptr< QKDApp004 > bob, Ptr< QKDKeyManagerSystemApplication > kmsA, Ptr< QKDKeyManagerSystemApplication > kmsB)
Register the QKD application pair (that implements ETSI QKD 004 API) on the site.
uint32_t GetNQKDBuffers(void) const
Get the number of QKDBuffers associated to this QKDControl.
virtual void DoDispose(void)
The dispose method.
std::vector< Ptr< QKDBuffer > > m_qkdbuffers
The list of associated QKDBuffers.
virtual ~QKDControl()
Destructor.
std::map< uint32_t, QKDLink > m_destinations
Ptr< QKDBuffer > GetBufferByDestinationNode(Ptr< Node >)
Get the QKDBuffer for the given destination node.
virtual void DoInitialize(void)
Initialization function.
Ptr< Node > GetNode()
Get the controller node.
void SetNode(Ptr< Node >)
Set the controller node.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID for the instance.
static TypeId GetTypeId(void)
Get the type ID.
void AddLinkRecord(struct QKDControl::QKDLink)
Record details about the new QKD link.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Universally unique identifier (UUID)
std::string string() const
Get string from the current UUID in format "00000000-0000-0000-0000-000000000000".
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Description of a QKD link.
std::string keyAssociationId
Ptr< QKDBuffer > qkdBufferBob