21 #include "ns3/core-module.h"
22 #include "ns3/inet-socket-address.h"
23 #include "ns3/packet-socket-address.h"
24 #include "ns3/socket.h"
25 #include "ns3/string.h"
26 #include "ns3/names.h"
27 #include "ns3/uinteger.h"
28 #include "ns3/qkd-app-helper.h"
29 #include "ns3/qkd-key-manager-system-application.h"
30 #include "ns3/qkd-sdn-controller.h"
31 #include "ns3/qkd-connection-register.h"
75 if(mFactoryName ==
"kms") {
77 }
else if(mFactoryName ==
"postprocessing") {
79 }
else if(mFactoryName ==
"app") {
108 kms->SetAddress(kmsAddress);
133 sdn->SetAddress(sdnAddress);
162 uint32_t keySizeInBits,
188 appMaster->
SetAttribute (
"Local", AddressValue (masterAddress));
189 appMaster->
SetAttribute (
"Local_Sifting", AddressValue (masterAddress));
190 appMaster->
SetAttribute (
"Local_KMS", AddressValue (masterKMSAddress));
191 appMaster->
SetAttribute (
"Remote", AddressValue (slaveAddress));
192 appMaster->
SetAttribute (
"Remote_Sifting", AddressValue (slaveAddress));
194 appMaster->
SetAttribute (
"KeyRate", DataRateValue (keyRate));
196 appMaster->
SetAttribute (
"DataRate", DataRateValue (dataRate));
201 DynamicCast<QKDPostprocessingApplication> (appMaster)->SetSrc (node1);
202 DynamicCast<QKDPostprocessingApplication> (appMaster)->SetDst (node2);
207 DynamicCast<QKDPostprocessingApplication> (appMaster)->SetSocket (
"send", sckt1,
true);
208 DynamicCast<QKDPostprocessingApplication> (appMaster)->SetSocket (
"sink", sckt2,
true);
212 DynamicCast<QKDPostprocessingApplication> (appMaster)->SetSiftingSocket (
"send", sckt1_sifting);
213 DynamicCast<QKDPostprocessingApplication> (appMaster)->SetSiftingSocket (
"sink", sckt2_sifting);
229 appSlave->
SetAttribute(
"Local", AddressValue (slaveAddress));
230 appSlave->
SetAttribute(
"Local_Sifting", AddressValue (slaveAddress));
231 appSlave->
SetAttribute(
"Local_KMS", AddressValue (slaveKMSAddress));
232 appSlave->
SetAttribute(
"Remote", AddressValue (masterAddress));
233 appSlave->
SetAttribute(
"Remote_Sifting", AddressValue (masterAddress));
235 appSlave->
SetAttribute(
"KeyRate", DataRateValue (keyRate));
237 appSlave->
SetAttribute(
"DataRate", DataRateValue (dataRate));
240 DynamicCast<QKDPostprocessingApplication> (appSlave)->SetSrc (node2);
241 DynamicCast<QKDPostprocessingApplication> (appSlave)->SetDst (node1);
246 DynamicCast<QKDPostprocessingApplication> (appSlave)->SetSocket (
"send", sckt3,
false);
247 DynamicCast<QKDPostprocessingApplication> (appSlave)->SetSocket (
"sink", sckt4,
false);
251 DynamicCast<QKDPostprocessingApplication> (appSlave)->SetSiftingSocket (
"send", sckt3_sifting);
252 DynamicCast<QKDPostprocessingApplication> (appSlave)->SetSiftingSocket (
"sink", sckt4_sifting);
a polymophic address class
holds a vector of ns3::Application pointers.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
The base class for all ns3 applications.
Hold a value for an Attribute.
Class for representing data rates.
Ipv4 addresses are stored in host order in this class.
static Ipv4Address GetAny()
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
A base class which provides memory management and object aggregation.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
void ConnectKMSToSDN(Ptr< Node > kmsNode, Ipv4Address sdnAddress, uint32_t port)
ObjectFactory m_factory_postprocessing_app
Object factory.
ObjectFactory m_factory_qkd_app
Object factory.
ApplicationContainer InstallPostProcessing(Ptr< Node > node1, Ptr< Node > node2, Address masterAddress, Address slaveAddress, Address masterKMSAddress, Address slaveKMSAddress, uint32_t keySizeInBits, DataRate keyRate, uint32_t packetSize, DataRate dataRate)
Install an ns3::QKDPostprocessingApplication on the node configured with all the attributes set with ...
void InstallSDN(Ptr< Node > node, Ipv4Address sdnAddress) const
Install an ns3::QKDKeyManagmentSystem on the node configured with all the attributes set with SetAttr...
void SetAttribute(std::string mFactoryName, std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes, not the socket attributes.
ApplicationContainer InstallQKDApp(Ptr< Node > node) const
Install an ns3::QKDApp on the node configured with all the attributes set with SetAttribute.
void SetSettings(std::string protocol, Ipv4Address master, Ipv4Address slave, uint32_t keyRate)
Install an ns3::QKDAppApplication on each node of the input container configured with all the attribu...
ObjectFactory m_factory_sdn_app
Object factory.
Ptr< QKDKeyManagerSystemApplication > InstallKMS(Ptr< Node > node, Ipv4Address kmsAddress) const
Install an ns3::QKDKeyManagmentSystem on the node configured with all the attributes set with SetAttr...
ObjectFactory m_factory_kms_app
Object factory.
ObjectFactory m_factory_lr_app
QKDAppHelper()
Create an QKDAppHelper to make it easier to work with QKD Applications (KMS, Post-processing and othe...
static uint32_t appCounter
QKDConnectionRegister is a class used to keep details about distant QKD links and applications.
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
a unique identifier for an interface.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Hold an unsigned integer type.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint32_t packetSize
Packet size generated at the AP.