A Discrete-Event Network Simulator
API
ns3::QKDKeyManagerSystemApplication Class Reference

#include "qkd-key-manager-system-application.h"

+ Inheritance diagram for ns3::QKDKeyManagerSystemApplication:
+ Collaboration diagram for ns3::QKDKeyManagerSystemApplication:

Classes

struct  AddressHash
 Hashing for the Address class. More...
 
struct  Association004
 The key stream session details. More...
 
struct  ChunkKey
 The key within the key stream session buffer. More...
 
struct  HttpQuery
 The HTTP request details. More...
 
struct  QoS
 The Quality of service indicators. More...
 

Public Types

enum  RequestType {
  NONE = 50 , ETSI_QKD_014_GET_STATUS = 0 , ETSI_QKD_014_GET_KEY = 1 , ETSI_QKD_014_GET_KEY_WITH_KEY_IDS = 2 ,
  ETSI_QKD_004_OPEN_CONNECT = 3 , ETSI_QKD_004_GET_KEY = 4 , ETSI_QKD_004_CLOSE = 5 , NEW_APP = 6 ,
  REGISTER = 7 , FILL = 8 , STORE_PP_KEYS = 9 , TRANSFORM_KEYS = 10 ,
  ETSI_QKD_004_KMS_CLOSE = 11
}
 Request methods. More...
 
- Public Types inherited from ns3::Application
typedef void(* DelayAddressCallback) (const Time &delay, const Address &from)
 Common callback signature for packet delay and address. More...
 
typedef void(* StateTransitionCallback) (const std::string &oldState, const std::string &newState)
 Common signature used by callbacks to application's state transition trace source. More...
 

Public Member Functions

 QKDKeyManagerSystemApplication ()
 Constructor. More...
 
virtual ~QKDKeyManagerSystemApplication ()
 Destructor. More...
 
bool AddNewKey (Ptr< QKDKey > key, uint32_t srcNodeId, uint32_t dstNodeId)
 Add new keys to the QKD buffer. More...
 
std::string AddNewLink (uint32_t srcSaeId, uint32_t dstSaeId, Ipv4Address kmsDstAddress, Ptr< QKDBuffer > srcBuffer)
 Register a new QKD link, or a pair of post-processing applications. More...
 
std::string AddNewLink (uint32_t srcSaeId, uint32_t dstSaeId, Ipv4Address kmsDstAddress, Ptr< QKDBuffer > srcBuffer, std::string keyAssociationId)
 Register a new QKD link, or a pair of post-processing applications. More...
 
void ConnectToSDNController ()
 Connect to the SDN controller. More...
 
std::map< Ptr< Socket >, Ptr< Socket > > GetAcceptedSockets (void) const
 Get the list of all the accepted sockets. More...
 
Ipv4Address GetAddress ()
 Get the local IP address. More...
 
uint32_t GetId ()
 Get the KMS identifier. More...
 
uint32_t GetMaxKeyPerRequest ()
 Get maximum number of keys that can be supplied via a single response (ETSI QKD 014). More...
 
Ptr< NodeGetNode ()
 Get the node. More...
 
uint32_t GetPort ()
 Get the local port. More...
 
Ptr< SocketGetSocket (void) const
 Get the sink socket. More...
 
uint32_t GetTotalRx () const
 Get the total amount of received bytes. More...
 
QKDApplicationEntry RegisterApplicationEntry (UUID keyAssociationId, UUID applicationEntryId, UUID srcSaeId, UUID dstSaeId, std::string type, Ipv4Address dstKmsAddress, uint32_t priority, double expirationTime)
 Register a new pair of QKD applications. More...
 
QKDApplicationEntry RegisterApplicationEntry (UUID srcSaeId, UUID dstSaeId, std::string type, Ipv4Address dstKmsAddress, uint32_t priority, double expirationTime)
 Register a new pair of QKD applications. More...
 
void SaveKeyAssociation (QKDKeyAssociationLinkEntry &rt)
 Add the key association. More...
 
void SendQKDLinkStatusToSDN (UUID linkId, double updatePeriod)
 Send the QKD link statistics to the SDN controller. More...
 
void SetAddress (Ipv4Address address)
 Set the local IP address. More...
 
void SetNode (Ptr< Node > n)
 Set the node. More...
 
void SetPort (uint32_t port)
 Set the local port. More...
 
void SetSDNControllerAddress (Address sdnAddress)
 Set the SDN controller address. More...
 
void SetSocket (std::string type, Ptr< Socket > socket)
 Set the sink socket. More...
 
- Public Member Functions inherited from ns3::Application
 Application ()
 
 ~Application () override
 
Ptr< NodeGetNode () const
 
void SetNode (Ptr< Node > node)
 
void SetStartTime (Time start)
 Specify application start time. More...
 
void SetStopTime (Time stop)
 Specify application stop time. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

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

Protected Member Functions

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

Private Member Functions

void AddKeyToAssociationDedicatedStore (std::string ksid, Ptr< QKDKey > key)
 Add the key to the key stream session buffer. More...
 
std::string Base64Decode (std::string input)
 Base64 decoder. More...
 
std::string Base64Encode (std::string input)
 Base64 encoder. More...
 
nlohmann::json Check014GetKeyRequest (nlohmann::json request, QKDKeyAssociationLinkEntry conn)
 Validate the request and probe if the KMS can meet the request requirements. More...
 
void CheckAssociation (std::string ksid)
 Check the state of a single key stream session. More...
 
bool CheckDoSAttack (HTTPMessage headerIn, Ptr< Socket > socket)
 Check for the DoS attack. More...
 
void CheckSessionList (std::string ksid)
 Check whether a new OPEN_CONNECT was received before the previously established session expired. More...
 
void CheckSocketsKMS (Ipv4Address dstSaeId)
 Prepare the send socket to communicate with the peer KMS. More...
 
void ConnectionFailed (Ptr< Socket > socket)
 Callback function after the connection to the APP has failed. More...
 
void ConnectionFailedKMSs (Ptr< Socket > socket)
 Callback function after the connection to the peer KMS has failed. More...
 
void ConnectionSucceeded (Ptr< Socket > socket)
 Callback function after the connection to the APP is complete. More...
 
void ConnectionSucceededKMSs (Ptr< Socket > socket)
 Callback function after the connection to the peer KMS is complete. More...
 
void ConnectionToSDNFailed (Ptr< Socket > socket)
 Callback function after the connection to the SDN controller has failed. More...
 
void ConnectionToSDNSucceeded (Ptr< Socket > socket)
 Callback function after the connection to the SDN controller is complete. More...
 
nlohmann::json CreateKeyContainer (std::vector< Ptr< QKDKey >> keys)
 Create the key container data structure. More...
 
void CreateNew004Association (std::string srcSaeId, std::string dstSaeId, QKDKeyManagerSystemApplication::QoS &inQos, Ipv4Address dstKms, std::string &ksid, std::string appConnectionId)
 Create a new key stream session. More...
 
void DataSend (Ptr< Socket >, uint32_t)
 Callback function for the data sent. More...
 
void DataSendKMSs (Ptr< Socket >, uint32_t)
 Callback function for the data sent to the peer KMS. More...
 
void DataToSDNSend (Ptr< Socket >, uint32_t)
 Callback function for the data sent to the SDN controller. More...
 
QKDKeyManagerSystemApplication::RequestType FetchRequestType (std::string s)
 Read the request method from the request URI. More...
 
std::string GenerateKeyId ()
 Generate unique key identifier. More...
 
std::string GenerateKsid ()
 Generate a new key stream session identifier (ksid). More...
 
QKDApplicationEntry GetApplicationConnectionDetails (std::string saeId)
 Get the application connection details. More...
 
QKDApplicationEntry GetApplicationConnectionDetailsBySaeIDsAndType (std::string srcSaeId, std::string dstSaeId, QKDApplicationEntry::ConnectionType type)
 Get the application connection details. More...
 
Ipv4Address GetDestinationKmsAddress (Ptr< Socket > socket)
 Get the destiantion KMS IP address based on the connected socket. More...
 
QKDKeyAssociationLinkEntry GetKeyAssociationById (UUID keyAssociationId)
 Get the key association link details. More...
 
QKDKeyAssociationLinkEntry GetKeyAssociationByNodeIds (uint32_t srcNodeId, uint32_t dstNodeId)
 Get the key association link details. More...
 
QKDKeyAssociationLinkEntry GetKeyAssociationLinkDetailsByApplicationId (std::string appId)
 Get the key association link details. More...
 
Ptr< SocketGetSendSocketKMS (Ipv4Address kmsDstAddress)
 Obtain the send socket. More...
 
Ptr< SocketGetSocketFromHttp004AppQuery (UUID saeId)
 Lookup the HTTP request and obtain connected socket. More...
 
void HandleAccept (Ptr< Socket > s, const Address &from)
 Handle an incoming connection from the application. More...
 
void HandleAcceptKMSs (Ptr< Socket > s, const Address &from)
 Handle an incoming connection from the KMS. More...
 
void HandleAcceptSDN (Ptr< Socket > s, const Address &from)
 Handle an incoming connection from the SDN. More...
 
void HandlePeerClose (Ptr< Socket > socket)
 Handle an connection close from the application. More...
 
void HandlePeerCloseKMSs (Ptr< Socket > socket)
 Handle a connection close from the KMS. More...
 
void HandlePeerCloseSDN (Ptr< Socket > socket)
 Handle a connection close from the SDN. More...
 
void HandlePeerError (Ptr< Socket > socket)
 Handle a connection error from the application. More...
 
void HandlePeerErrorKMSs (Ptr< Socket > socket)
 Handle a connection error from the KMS. More...
 
void HandlePeerErrorSDN (Ptr< Socket > socket)
 Handle a connection error from the SDN. More...
 
void HandleRead (Ptr< Socket > socket)
 Handle a packet received from the application. More...
 
void HandleReadKMSs (Ptr< Socket > socket)
 Handle a packet received from the KMS. More...
 
void HandleReadSDN (Ptr< Socket > socket)
 Handle a packet received from the SDN. More...
 
void Http004AppQuery (UUID saeId, Ptr< Socket > socket)
 Remember the HTTP request received from the application. More...
 
void Http004AppQueryComplete (UUID saeId)
 Remove the HTTP request from the list. More...
 
void HttpKMSAddQuery (Ipv4Address dstKms, HttpQuery request)
 Remember the HTTP request made to the peer KMS. More...
 
void HttpKMSCompleteQuery (Ipv4Address dstKms)
 Remove the HTTP request from the list. More...
 
RequestType HttpQueryMethod (Ipv4Address dstKms)
 Map the HTTP response and obtain the request method. More...
 
void MonitorAssociations ()
 \breif Monitor the state of the existing key stream sessions. More...
 
void NegotiateKeysForAssociation (std::string ksid, uint32_t keyAmount=1024, uint32_t priority=0)
 Add new keys to the key stream session buffer. More...
 
void NewAppRequest (std::string ksid)
 Make a NEW_APP request to the peer KMS. More...
 
void PacketReceived (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket)
 Assemble a byte stream from the application to extract the HTTP message. More...
 
void PacketReceivedKMSs (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket)
 Assemble a byte stream from the peer KMS to extract the HTTP message. More...
 
void PacketReceivedSDN (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket)
 Assemble a byte stream from the SDN to extract the HTTP message. More...
 
std::string PacketToString (Ptr< Packet > packet)
 Convert the packet to a string. More...
 
void PrepareSinkSocket ()
 Prepare the sink socket. More...
 
void ProcessAddKeysRequest (HTTPMessage h, Ptr< Socket > socket, std::string ksid)
 Process the FILL request. More...
 
void ProcessAddKeysResponse (HTTPMessage header, Ptr< Socket > socket)
 Process the FILL response. More...
 
void ProcessCloseRequest (std::string ksid, HTTPMessage header, Ptr< Socket > socket)
 
void ProcessGetKey004Request (std::string ksid, HTTPMessage header, Ptr< Socket > socket)
 
void ProcessKMSCloseRequest (HTTPMessage header, Ptr< Socket > socket, std::string ksid)
 Process the close request from the peer KMS. More...
 
void ProcessKMSCloseResponse (HTTPMessage header, Ptr< Socket > socket)
 Process close response from the peer KMS. More...
 
void ProcessNewAppRequest (HTTPMessage header, Ptr< Socket > socket)
 
void ProcessNewAppResponse (HTTPMessage header, Ptr< Socket > socket)
 Process the NEW_APP response. More...
 
void ProcessOpenConnectRequest (HTTPMessage header, Ptr< Socket > socket)
 
void ProcessPacketKMSs (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 Process incoming request at the KM link. More...
 
void ProcessPPRequest (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 Process request from the QKD post-processing application. More...
 
bool ProcessQoSRequest (QKDApplicationEntry &appConnection, QKDKeyAssociationLinkEntry &keyAssociation, QKDKeyManagerSystemApplication::QoS &inQos, QKDKeyManagerSystemApplication::QoS &outQos, std::string ksid)
 Process the QoS requirements. More...
 
void ProcessRegisterRequest (HTTPMessage header, std::string ksid, Ptr< Socket > socket)
 Process the REGISTER request. More...
 
void ProcessRegisterResponse (HTTPMessage header, Ptr< Socket > socket)
 Process the REGISTER response. More...
 
void ProcessRequest (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 Process incoming requests from the service layer, i.e., QKD applications. More...
 
void ProcessRequestKMS (HTTPMessage header, Ptr< Socket > socket)
 Process request from the peer KMS. More...
 
void ProcessRequestSDN (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 Process request from the SDN controller. More...
 
void ProcessResponseKMS (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 Process response from the peer KMS. More...
 
void ProcessResponseSDN (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 Process response from the SDN controller. More...
 
void ProcessTransformRequest (HTTPMessage header, Ptr< Socket > socket)
 Process the transform request. More...
 
void ProcessTransformResponse (HTTPMessage header, Ptr< Socket > socket)
 Process the transform response. More...
 
std::vector< std::string > ProcessUriParams (std::string s)
 Read the URI parameters in a vector. More...
 
void PurgeExpiredAssociations ()
 Purge (delete) the expired ETSI 004 key stream sessions based on the QoS - TTL value. More...
 
void ReadJsonQos (QKDKeyManagerSystemApplication::QoS &inQos, nlohmann::json jOpenConnectRequest)
 Read the QoS parameters from the JSON OPEN_CONNECT structure. More...
 
void RegisterRequest (std::string ksid)
 Send the REGISTER request. More...
 
void ReleaseAssociation (std::string ksid, std::string surplusKeyId, uint32_t syncIndex)
 Release the key stream session. More...
 
uint32_t ScheduleCheckAssociation (Time t, std::string action, std::string ksid)
 Schedule the next event in the attempt to fill the key stream session buffer. More...
 
void SendToSocketPair (Ptr< Socket > socket, Ptr< Packet > packet)
 Send the packet to the pair socket. More...
 
void SendToSocketPairKMS (Ptr< Socket > socket, Ptr< Packet > packet)
 Send the packet to the pair socket. More...
 
void StartApplication (void)
 Start the KMS Application. More...
 
void StopApplication (void)
 Stop the KMS Application. More...
 
void TransformKeys (uint32_t keySize, uint32_t keyNumber, UUID slave_SAE_ID)
 Transform a number of keys to a given size. More...
 

Private Attributes

bool connectedToSDN
 Is conncted to the SDN controller? More...
 
std::map< std::string, Association004m_associations004
 The list of active key stream sessions. More...
 
std::unordered_map< uint64_t, Ptr< Packet >, AddressHashm_buffer
 The buffer for the received packets from the applications (TCP segmentation). More...
 
std::unordered_map< Address, Ptr< Packet >, AddressHashm_bufferKMS
 The buffer for the received packets from the peer KMS (TCP segmentation). More...
 
EventId m_closeSocketEvent
 The close socket event. More...
 
uint32_t m_default_ttl
 The default value of TTL. More...
 
uint32_t m_defaultKeySize
 The default key size KMS will deliver if the size was not defined in the request. More...
 
TracedCallback< const Ipv4Address &, Ptr< const Packet > > m_dropTrace
 A trace for the dropped packets. More...
 
std::map< Ipv4Address, uint32_t > m_flagedIPAdr
 A list of flaged IP addresses. More...
 
std::multimap< UUID, Ptr< Socket > > m_http004App
 The list of HTTP requests (without response) set to the application. More...
 
std::map< Ipv4Address, std::vector< HttpQuery > > m_httpRequestsQueryKMS
 The list of HTTP request (without response) sent to the peer KMS. More...
 
TracedCallback< const std::string &, const uint32_t &, const uint32_t & > m_keyServedETSI004Trace
 A trace for the consumed keys by the ETSI 004 clients. More...
 
TracedCallback< const std::string &, Ptr< QKDKey > > m_keyServedETSI014Trace
 A trace for the consumed keys by the ETSI 014 clients. More...
 
TracedCallback< const uint32_t & > m_keyServedTraceEmir
 A trace for the consumed keys. More...
 
uint32_t m_kms_id
 The KMS identifier. More...
 
uint32_t m_kms_key_id
 The counter value to assure generation of the unique key identifiers. More...
 
Ipv4Address m_local
 Local address to bind to. More...
 
uint32_t m_maliciousBlocking
 Should KMS detect and block malicious requests? More...
 
uint32_t m_maxKeyPerRequest
 The maximal number of keys per request application can ask for. More...
 
DataRate m_maxKeyRate
 The maximal key rate. More...
 
uint32_t m_maxKeySize
 The maximal size of the key application can request. More...
 
DataRate m_minKeyRate
 The minimal key rate. More...
 
uint32_t m_minKeySize
 The minimal size of the key application can request. More...
 
TracedCallback< const uint32_t &, const uint32_t & > m_newKeyGeneratedTrace
 A trace for the generated keys. More...
 
TracedCallback< const uint32_t & > m_newKeyGeneratedTraceEmir
 A trace for the generated keys. More...
 
Ptr< Nodem_node
 
std::map< Ptr< Socket >, Ptr< Packet > > m_packetQueues
 Buffering unsend messages due to the connection problems. More...
 
std::map< Ptr< Socket >, Ptr< Packet > > m_packetQueuesToSDN
 Buffering unsend messages due to the connection problems. More...
 
uint32_t m_port
 Local port to bind to. More...
 
TracedCallback< const std::string &, const std::string &, const uint32_t &, const uint32_t &, const uint32_t &, const uint32_t &, const uint32_t & > m_providedQoS
 A trace for the admitted QoS. More...
 
double m_qos_maxrate_threshold
 The maximal rate threshold. More...
 
Ptr< QKDKMSQueueLogicm_queueLogic
 The KMS Queue Logic for the ETSI 004 QoS handling. More...
 
Ptr< UniformRandomVariablem_random
 The uniform random variable. More...
 
TracedCallback< Ptr< const Packet >, const Address & > m_rxTrace
 A trace for the received packets from the applications. More...
 
TracedCallback< Ptr< const Packet >, const Address & > m_rxTraceKMSs
 A trace for the received packets from the peer KMS. More...
 
TracedCallback< Ptr< const Packet >, const Address & > m_rxTraceSDN
 A trace for the received packets from the SDN controller. More...
 
std::map< uint32_t, EventIdm_scheduledChecks
 The scheduled events. More...
 
Address m_sdnControllerAddress
 The SDN controller address. More...
 
uint32_t m_sdnSupportEnabled
 The support for the SDN. More...
 
Ptr< Socketm_sendSocketToSDN
 The send socket to the SDN controller. More...
 
std::map< std::string, uint32_t > m_sessionList
 A list of sessions. More...
 
Ptr< Socketm_sinkSocket
 The sink socket. More...
 
Ptr< Socketm_sinkSocketFromSDN
 The sink socket from the SND controller. More...
 
std::map< Ptr< Socket >, Ptr< Socket > > m_socketPairs
 The accepted sockets. More...
 
std::map< Ipv4Address, std::pair< Ptr< Socket >, Ptr< Socket > > > m_socketPairsKMS
 The accepted sockets for the communication between KMSs. More...
 
TypeId m_tid
 The object type identifier. More...
 
uint32_t m_totalRx
 Total bytes received. More...
 
uint32_t m_totalRxKMSs
 Total bytes sent between KMSs. More...
 
TracedCallback< Ptr< const Packet > > m_txTrace
 A trace for the sent packets to the applications. More...
 
TracedCallback< Ptr< const Packet > > m_txTraceKMSs
 A trace for the sent packets to the peer KMS. More...
 
TracedCallback< Ptr< const Packet > > m_txTraceSDN
 A trace for the sent packets to the SDN controller. More...
 

Static Private Attributes

static uint32_t nKMS = 0
 The number of created KMSs. More...
 

Additional Inherited Members

- Protected Attributes inherited from ns3::Application
Ptr< Nodem_node
 The node that this application is installed on. More...
 
EventId m_startEvent
 The event that will fire at m_startTime to start the application. More...
 
Time m_startTime
 The simulation time that the application will start. More...
 
EventId m_stopEvent
 The event that will fire at m_stopTime to end the application. More...
 
Time m_stopTime
 The simulation time that the application will end. More...
 

Detailed Description

Definition at line 78 of file qkd-key-manager-system-application.h.

Member Enumeration Documentation

◆ RequestType

Request methods.

Enumerator
NONE 
ETSI_QKD_014_GET_STATUS 

Integer equivalent = 0.

ETSI_QKD_014_GET_KEY 

Integer equivalent = 1.

ETSI_QKD_014_GET_KEY_WITH_KEY_IDS 

Integer equivalent = 2.

ETSI_QKD_004_OPEN_CONNECT 
ETSI_QKD_004_GET_KEY 
ETSI_QKD_004_CLOSE 
NEW_APP 
REGISTER 
FILL 
STORE_PP_KEYS 
TRANSFORM_KEYS 
ETSI_QKD_004_KMS_CLOSE 

Definition at line 85 of file qkd-key-manager-system-application.h.

Constructor & Destructor Documentation

◆ QKDKeyManagerSystemApplication()

ns3::QKDKeyManagerSystemApplication::QKDKeyManagerSystemApplication ( )

◆ ~QKDKeyManagerSystemApplication()

ns3::QKDKeyManagerSystemApplication::~QKDKeyManagerSystemApplication ( )
virtual

Destructor.

Definition at line 167 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddKeyToAssociationDedicatedStore()

void ns3::QKDKeyManagerSystemApplication::AddKeyToAssociationDedicatedStore ( std::string  ksid,
Ptr< QKDKey key 
)
private

◆ AddNewKey()

bool ns3::QKDKeyManagerSystemApplication::AddNewKey ( Ptr< QKDKey key,
uint32_t  srcNodeId,
uint32_t  dstNodeId 
)

◆ AddNewLink() [1/2]

std::string ns3::QKDKeyManagerSystemApplication::AddNewLink ( uint32_t  srcSaeId,
uint32_t  dstSaeId,
Ipv4Address  kmsDstAddress,
Ptr< QKDBuffer srcBuffer 
)

Register a new QKD link, or a pair of post-processing applications.

Parameters
srcSaeIdThe source application identifier.
dstSaeIdThe destination application identifier.
kmsDstAddressThe destination KMS address.
srcQKDBufferThe QKD key buffer.
Returns
The key association entry identifier.

Definition at line 3347 of file qkd-key-manager-system-application.cc.

◆ AddNewLink() [2/2]

std::string ns3::QKDKeyManagerSystemApplication::AddNewLink ( uint32_t  srcSaeId,
uint32_t  dstSaeId,
Ipv4Address  kmsDstAddress,
Ptr< QKDBuffer srcBuffer,
std::string  keyAssociationId 
)

◆ Base64Decode()

std::string ns3::QKDKeyManagerSystemApplication::Base64Decode ( std::string  input)
private

Base64 decoder.

Parameters
inputThe input data.
Returns
The decoded input.

Definition at line 4235 of file qkd-key-manager-system-application.cc.

◆ Base64Encode()

std::string ns3::QKDKeyManagerSystemApplication::Base64Encode ( std::string  input)
private

Base64 encoder.

Parameters
inputThe input data.
Returns
The Base64 encoded input.

Definition at line 4223 of file qkd-key-manager-system-application.cc.

Referenced by CreateKeyContainer().

+ Here is the caller graph for this function:

◆ Check014GetKeyRequest()

nlohmann::json ns3::QKDKeyManagerSystemApplication::Check014GetKeyRequest ( nlohmann::json  request,
QKDKeyAssociationLinkEntry  conn 
)
private

Validate the request and probe if the KMS can meet the request requirements.

Parameters
requestThe JSON payload of the ETSI 014 GET_KEY request.
connThe connection details.
Returns
The JSON error structure (if any errors).

Definition at line 3812 of file qkd-key-manager-system-application.cc.

References ns3::QKDKeyAssociationLinkEntry::GetId(), GetMaxKeyPerRequest(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), m_defaultKeySize, m_maxKeySize, m_minKeySize, NS_LOG_FUNCTION, and nlohmann::to_string().

Referenced by ProcessRequest().

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

◆ CheckAssociation()

void ns3::QKDKeyManagerSystemApplication::CheckAssociation ( std::string  ksid)
private

Check the state of a single key stream session.

Parameters
ksidThe key stream identifier.

Definition at line 3980 of file qkd-key-manager-system-application.cc.

References m_associations004, NegotiateKeysForAssociation(), NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ProcessAddKeysResponse(), ProcessGetKey004Request(), ProcessRegisterRequest(), and ScheduleCheckAssociation().

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

◆ CheckDoSAttack()

bool ns3::QKDKeyManagerSystemApplication::CheckDoSAttack ( HTTPMessage  headerIn,
Ptr< Socket socket 
)
private

Check for the DoS attack.

Parameters
headerThe received HTTP message.
socketThe receiving socket.

   ETSI004 APP-KMS functions

Definition at line 1719 of file qkd-key-manager-system-application.cc.

References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::Socket::GetPeerName(), m_flagedIPAdr, m_maliciousBlocking, and NS_LOG_FUNCTION.

Referenced by ProcessGetKey004Request(), and ProcessOpenConnectRequest().

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

◆ CheckSessionList()

void ns3::QKDKeyManagerSystemApplication::CheckSessionList ( std::string  ksid)
private

Check whether a new OPEN_CONNECT was received before the previously established session expired.

Here we check whether new OPEN_CONNECT was received before the previoulsy established session expired.

If yes, remove the KSID from the m_session_list. If not, incerment the value in m_session_list for a given KSID.

Parameters
ksidThe key stream session identifier.

If yes, we remove KSID from the m_session_list. If not, we incerment value in m_session_list for KSID

Parameters
std::stringKSID

Definition at line 1753 of file qkd-key-manager-system-application.cc.

References m_associations004, m_sessionList, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ProcessOpenConnectRequest().

+ Here is the caller graph for this function:

◆ CheckSocketsKMS()

◆ ConnectionFailed()

void ns3::QKDKeyManagerSystemApplication::ConnectionFailed ( Ptr< Socket socket)
private

Callback function after the connection to the APP has failed.

Parameters
socketThe connected socket.

Definition at line 331 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by HandleAccept().

+ Here is the caller graph for this function:

◆ ConnectionFailedKMSs()

void ns3::QKDKeyManagerSystemApplication::ConnectionFailedKMSs ( Ptr< Socket socket)
private

Callback function after the connection to the peer KMS has failed.

Parameters
socketThe connected socket.

Definition at line 338 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by CheckSocketsKMS().

+ Here is the caller graph for this function:

◆ ConnectionSucceeded()

void ns3::QKDKeyManagerSystemApplication::ConnectionSucceeded ( Ptr< Socket socket)
private

Callback function after the connection to the APP is complete.

Parameters
socketThe connected socket.

Definition at line 304 of file qkd-key-manager-system-application.cc.

References m_packetQueues, m_txTrace, and NS_LOG_FUNCTION.

Referenced by HandleAccept().

+ Here is the caller graph for this function:

◆ ConnectionSucceededKMSs()

void ns3::QKDKeyManagerSystemApplication::ConnectionSucceededKMSs ( Ptr< Socket socket)
private

Callback function after the connection to the peer KMS is complete.

Parameters
socketThe connected socket.

Definition at line 324 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by CheckSocketsKMS().

+ Here is the caller graph for this function:

◆ ConnectionToSDNFailed()

void ns3::QKDKeyManagerSystemApplication::ConnectionToSDNFailed ( Ptr< Socket socket)
private

Callback function after the connection to the SDN controller has failed.

Parameters
socketThe connected socket.

Definition at line 380 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by ConnectToSDNController().

+ Here is the caller graph for this function:

◆ ConnectionToSDNSucceeded()

void ns3::QKDKeyManagerSystemApplication::ConnectionToSDNSucceeded ( Ptr< Socket socket)
private

Callback function after the connection to the SDN controller is complete.

Parameters
socketThe connected socket.

Definition at line 357 of file qkd-key-manager-system-application.cc.

References connectedToSDN, m_packetQueuesToSDN, m_sendSocketToSDN, NS_LOG_FUNCTION, and ns3::Socket::Send().

Referenced by ConnectToSDNController().

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

◆ ConnectToSDNController()

◆ CreateKeyContainer()

nlohmann::json ns3::QKDKeyManagerSystemApplication::CreateKeyContainer ( std::vector< Ptr< QKDKey >>  keys)
private

Create the key container data structure.

Parameters
keysThe vector QKD keys to supply.
Returns
The JSON data structure for the key container.

Definition at line 3944 of file qkd-key-manager-system-application.cc.

References Base64Encode(), GetId(), and NS_LOG_FUNCTION.

Referenced by ProcessRequest().

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

◆ CreateNew004Association()

void ns3::QKDKeyManagerSystemApplication::CreateNew004Association ( std::string  srcSaeId,
std::string  dstSaeId,
QKDKeyManagerSystemApplication::QoS inQos,
Ipv4Address  dstKms,
std::string &  ksid,
std::string  appConnectionId 
)
private

Create a new key stream session.

Parameters
srcSaeIdThe source application identifier
dstSaeIdThe destination application identifier.
inQosThe Quality of Service details.
dstKmsThe destination KMS IP address.
ksidThe key stream identifier.
Returns
The key stream identifier.

Input ksid can be empty if it is not predefined. In that case a new ksid is generated for this new association and returned from the function.

Definition at line 4287 of file qkd-key-manager-system-application.cc.

References ns3::QKDKeyManagerSystemApplication::Association004::associationDirection, ns3::QKDKeyManagerSystemApplication::Association004::dstKmsNode, ns3::QKDKeyManagerSystemApplication::Association004::dstSaeId, ns3::Time::GetSeconds(), ns3::QKDKeyManagerSystemApplication::Association004::ksid, ns3::QKDKeyManagerSystemApplication::Association004::lastIndex, m_associations004, m_local, m_sessionList, ns3::Simulator::Now(), NS_LOG_FUNCTION, ns3::QKDKeyManagerSystemApplication::Association004::peerRegistered, ns3::QKDKeyManagerSystemApplication::Association004::qos, ns3::QKDKeyManagerSystemApplication::Association004::srcSaeId, and ns3::QKDKeyManagerSystemApplication::QoS::TTL.

Referenced by ProcessNewAppRequest(), and ProcessOpenConnectRequest().

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

◆ DataSend()

void ns3::QKDKeyManagerSystemApplication::DataSend ( Ptr< Socket ,
uint32_t   
)
private

Callback function for the data sent.

Parameters
Theconnected socket.
Theamount of data sent.

Definition at line 345 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by HandleAccept().

+ Here is the caller graph for this function:

◆ DataSendKMSs()

void ns3::QKDKeyManagerSystemApplication::DataSendKMSs ( Ptr< Socket ,
uint32_t   
)
private

Callback function for the data sent to the peer KMS.

Parameters
Theconnected socket.
Theamount of data sent.

Definition at line 351 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by CheckSocketsKMS().

+ Here is the caller graph for this function:

◆ DataToSDNSend()

void ns3::QKDKeyManagerSystemApplication::DataToSDNSend ( Ptr< Socket ,
uint32_t   
)
private

Callback function for the data sent to the SDN controller.

Parameters
Theconnected socket.
Theamount of data sent.

Definition at line 387 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by ConnectToSDNController().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::QKDKeyManagerSystemApplication::DoDispose ( void  )
protectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 216 of file qkd-key-manager-system-application.cc.

References ns3::Application::DoDispose(), m_sinkSocket, m_socketPairs, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ FetchRequestType()

QKDKeyManagerSystemApplication::RequestType ns3::QKDKeyManagerSystemApplication::FetchRequestType ( std::string  s)
private

Read the request method from the request URI.

Parameters
sThe HTTP request URI.
Returns
The request method.

Definition at line 3283 of file qkd-key-manager-system-application.cc.

References ETSI_QKD_004_CLOSE, ETSI_QKD_004_GET_KEY, ETSI_QKD_004_KMS_CLOSE, ETSI_QKD_004_OPEN_CONNECT, ETSI_QKD_014_GET_KEY, ETSI_QKD_014_GET_KEY_WITH_KEY_IDS, ETSI_QKD_014_GET_STATUS, FILL, NEW_APP, NONE, NS_FATAL_ERROR, NS_LOG_FUNCTION, REGISTER, STORE_PP_KEYS, and TRANSFORM_KEYS.

Referenced by ProcessRequest(), and ProcessRequestKMS().

+ Here is the caller graph for this function:

◆ GenerateKeyId()

std::string ns3::QKDKeyManagerSystemApplication::GenerateKeyId ( )
private

Generate unique key identifier.

Returns
The unique key identifier.

Definition at line 4530 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION, ns3::UUID::Random(), and ns3::UUID::string().

Referenced by ProcessCloseRequest(), and TransformKeys().

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

◆ GenerateKsid()

std::string ns3::QKDKeyManagerSystemApplication::GenerateKsid ( )
private

Generate a new key stream session identifier (ksid).

Returns
The key stream identifier.

   KMS 004 Association operations, monitoring

Definition at line 3968 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION, ns3::UUID::Random(), and ns3::UUID::string().

+ Here is the call graph for this function:

◆ GetAcceptedSockets()

std::map< Ptr< Socket >, Ptr< Socket > > ns3::QKDKeyManagerSystemApplication::GetAcceptedSockets ( void  ) const

Get the list of all the accepted sockets.

Returns
The list of accepted sockets.

Definition at line 185 of file qkd-key-manager-system-application.cc.

References m_socketPairs, and NS_LOG_FUNCTION.

◆ GetAddress()

Ipv4Address ns3::QKDKeyManagerSystemApplication::GetAddress ( )
inline

Get the local IP address.

Returns
The local IP address.

Definition at line 267 of file qkd-key-manager-system-application.h.

References m_local.

Referenced by ProcessRequest().

+ Here is the caller graph for this function:

◆ GetApplicationConnectionDetails()

QKDApplicationEntry ns3::QKDKeyManagerSystemApplication::GetApplicationConnectionDetails ( std::string  saeId)
private

Get the application connection details.

Parameters
saeIdThe application identifier.
Returns
The QKD application connection details.

Definition at line 3713 of file qkd-key-manager-system-application.cc.

References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by NegotiateKeysForAssociation(), ProcessAddKeysRequest(), ProcessAddKeysResponse(), ProcessCloseRequest(), ProcessGetKey004Request(), ProcessNewAppRequest(), ProcessNewAppResponse(), ProcessRequest(), ProcessTransformRequest(), ProcessTransformResponse(), ReleaseAssociation(), and TransformKeys().

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

◆ GetApplicationConnectionDetailsBySaeIDsAndType()

QKDApplicationEntry ns3::QKDKeyManagerSystemApplication::GetApplicationConnectionDetailsBySaeIDsAndType ( std::string  srcSaeId,
std::string  dstSaeId,
QKDApplicationEntry::ConnectionType  type 
)
private

Get the application connection details.

Parameters
srcSaeIdThe source application identifier.
dstSaeIdThe destination application identifier.
typeThe connection type.

Definition at line 3686 of file qkd-key-manager-system-application.cc.

References ns3::QKDApplicationEntry::GetId(), GetNode(), ns3::Object::GetObject(), NS_ASSERT, NS_LOG_FUNCTION, and check-style-clang-format::type.

Referenced by ProcessOpenConnectRequest().

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

◆ GetDestinationKmsAddress()

Ipv4Address ns3::QKDKeyManagerSystemApplication::GetDestinationKmsAddress ( Ptr< Socket socket)
private

Get the destiantion KMS IP address based on the connected socket.

Parameters
socketThe connected socket.
Returns
The KMS IP address.

Definition at line 3260 of file qkd-key-manager-system-application.cc.

References m_socketPairsKMS, and NS_LOG_FUNCTION.

Referenced by ProcessAddKeysResponse(), ProcessKMSCloseResponse(), ProcessNewAppResponse(), ProcessRegisterResponse(), ProcessResponseKMS(), and ProcessTransformResponse().

+ Here is the caller graph for this function:

◆ GetId()

uint32_t ns3::QKDKeyManagerSystemApplication::GetId ( void  )

Get the KMS identifier.

Returns
The KMS identifier.

Definition at line 173 of file qkd-key-manager-system-application.cc.

References m_kms_id.

Referenced by CreateKeyContainer().

+ Here is the caller graph for this function:

◆ GetKeyAssociationById()

QKDKeyAssociationLinkEntry ns3::QKDKeyManagerSystemApplication::GetKeyAssociationById ( UUID  keyAssociationId)
private

Get the key association link details.

Parameters
keyAssociationIdThe key association identifier.
Returns
The key association link details.

Definition at line 3767 of file qkd-key-manager-system-application.cc.

References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ProcessResponseSDN(), RegisterApplicationEntry(), and SendQKDLinkStatusToSDN().

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

◆ GetKeyAssociationByNodeIds()

QKDKeyAssociationLinkEntry ns3::QKDKeyManagerSystemApplication::GetKeyAssociationByNodeIds ( uint32_t  srcNodeId,
uint32_t  dstNodeId 
)
private

Get the key association link details.

Parameters
srcNodeIdThe source node identifier.
dstNodeIdThe destination node identifier.
Returns
The key association link details.

Definition at line 3751 of file qkd-key-manager-system-application.cc.

References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by AddNewKey().

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

◆ GetKeyAssociationLinkDetailsByApplicationId()

QKDKeyAssociationLinkEntry ns3::QKDKeyManagerSystemApplication::GetKeyAssociationLinkDetailsByApplicationId ( std::string  appId)
private

Get the key association link details.

Parameters
appIdThe application identifier.
Returns
The key association link details.

Definition at line 3733 of file qkd-key-manager-system-application.cc.

References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by NegotiateKeysForAssociation(), ProcessAddKeysRequest(), ProcessAddKeysResponse(), ProcessCloseRequest(), ProcessGetKey004Request(), ProcessNewAppResponse(), ProcessOpenConnectRequest(), ProcessRequest(), ProcessTransformRequest(), ProcessTransformResponse(), ReleaseAssociation(), and TransformKeys().

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

◆ GetMaxKeyPerRequest()

uint32_t ns3::QKDKeyManagerSystemApplication::GetMaxKeyPerRequest ( )

Get maximum number of keys that can be supplied via a single response (ETSI QKD 014).

Returns
The number of keys.

Definition at line 3278 of file qkd-key-manager-system-application.cc.

References m_maxKeyPerRequest.

Referenced by Check014GetKeyRequest(), and ProcessRequest().

+ Here is the caller graph for this function:

◆ GetNode()

◆ GetPort()

uint32_t ns3::QKDKeyManagerSystemApplication::GetPort ( )
inline

Get the local port.

Returns
The port number.

Definition at line 283 of file qkd-key-manager-system-application.h.

References m_port.

Referenced by ConnectToSDNController(), HandleAccept(), HandleAcceptKMSs(), and HandleAcceptSDN().

+ Here is the caller graph for this function:

◆ GetSendSocketKMS()

Ptr< Socket > ns3::QKDKeyManagerSystemApplication::GetSendSocketKMS ( Ipv4Address  kmsDstAddress)
private

Obtain the send socket.

Parameters
kmsDstAddressThe destination KMS IP address.
Returns
The send socket.

Definition at line 531 of file qkd-key-manager-system-application.cc.

References m_socketPairsKMS, NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by NegotiateKeysForAssociation(), NewAppRequest(), ProcessCloseRequest(), RegisterRequest(), and TransformKeys().

+ Here is the caller graph for this function:

◆ GetSocket()

Ptr< Socket > ns3::QKDKeyManagerSystemApplication::GetSocket ( void  ) const

Get the sink socket.

Returns
The sink socket.

   SOCKET functions

Definition at line 202 of file qkd-key-manager-system-application.cc.

References m_sinkSocket, and NS_LOG_FUNCTION.

◆ GetSocketFromHttp004AppQuery()

Ptr< Socket > ns3::QKDKeyManagerSystemApplication::GetSocketFromHttp004AppQuery ( UUID  saeId)
private

Lookup the HTTP request and obtain connected socket.

Parameters
saeIdThe application identifier.
Returns
The connected socket.

Definition at line 3244 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by ProcessNewAppResponse().

+ Here is the caller graph for this function:

◆ GetTotalRx()

uint32_t ns3::QKDKeyManagerSystemApplication::GetTotalRx ( ) const

Get the total amount of received bytes.

Returns
The total amount of bytes.

Definition at line 178 of file qkd-key-manager-system-application.cc.

References m_totalRx, and NS_LOG_FUNCTION.

◆ GetTypeId()

◆ HandleAccept()

void ns3::QKDKeyManagerSystemApplication::HandleAccept ( Ptr< Socket s,
const Address from 
)
private

◆ HandleAcceptKMSs()

void ns3::QKDKeyManagerSystemApplication::HandleAcceptKMSs ( Ptr< Socket s,
const Address from 
)
private

Handle an incoming connection from the KMS.

Parameters
sThe incoming connection socket.
fromThe address the connection is from.

Definition at line 268 of file qkd-key-manager-system-application.cc.

References CheckSocketsKMS(), ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), GetPort(), HandleReadKMSs(), m_socketPairsKMS, ns3::MakeCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().

Referenced by AddNewLink().

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

◆ HandleAcceptSDN()

void ns3::QKDKeyManagerSystemApplication::HandleAcceptSDN ( Ptr< Socket s,
const Address from 
)
private

Handle an incoming connection from the SDN.

Parameters
sThe incoming connection socket.
fromThe address the connection is from.

Definition at line 290 of file qkd-key-manager-system-application.cc.

References ns3::InetSocketAddress::ConvertFrom(), GetPort(), HandleReadSDN(), ns3::MakeCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().

Referenced by ConnectToSDNController().

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

◆ HandlePeerClose()

void ns3::QKDKeyManagerSystemApplication::HandlePeerClose ( Ptr< Socket socket)
private

Handle an connection close from the application.

Parameters
socketThe connected socket.

Definition at line 393 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by PrepareSinkSocket().

+ Here is the caller graph for this function:

◆ HandlePeerCloseKMSs()

void ns3::QKDKeyManagerSystemApplication::HandlePeerCloseKMSs ( Ptr< Socket socket)
private

Handle a connection close from the KMS.

Parameters
socketThe connected socket.

Definition at line 399 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by AddNewLink().

+ Here is the caller graph for this function:

◆ HandlePeerCloseSDN()

void ns3::QKDKeyManagerSystemApplication::HandlePeerCloseSDN ( Ptr< Socket socket)
private

Handle a connection close from the SDN.

Parameters
socketThe connected socket.

Definition at line 405 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by ConnectToSDNController().

+ Here is the caller graph for this function:

◆ HandlePeerError()

void ns3::QKDKeyManagerSystemApplication::HandlePeerError ( Ptr< Socket socket)
private

Handle a connection error from the application.

Parameters
socketThe connected socket.

Definition at line 411 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by PrepareSinkSocket().

+ Here is the caller graph for this function:

◆ HandlePeerErrorKMSs()

void ns3::QKDKeyManagerSystemApplication::HandlePeerErrorKMSs ( Ptr< Socket socket)
private

Handle a connection error from the KMS.

Parameters
socketThe connected socket.

Definition at line 417 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by AddNewLink().

+ Here is the caller graph for this function:

◆ HandlePeerErrorSDN()

void ns3::QKDKeyManagerSystemApplication::HandlePeerErrorSDN ( Ptr< Socket socket)
private

Handle a connection error from the SDN.

Parameters
socketThe connected socket.

Definition at line 423 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by ConnectToSDNController().

+ Here is the caller graph for this function:

◆ HandleRead()

void ns3::QKDKeyManagerSystemApplication::HandleRead ( Ptr< Socket socket)
private

Handle a packet received from the application.

Parameters
socketThe receiving socket.

Definition at line 557 of file qkd-key-manager-system-application.cc.

References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::InetSocketAddress::IsMatchingType(), m_rxTrace, m_totalRx, ns3::Simulator::Now(), NS_LOG_FUNCTION, PacketReceived(), and ns3::Socket::RecvFrom().

Referenced by HandleAccept(), and PrepareSinkSocket().

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

◆ HandleReadKMSs()

void ns3::QKDKeyManagerSystemApplication::HandleReadKMSs ( Ptr< Socket socket)
private

Handle a packet received from the KMS.

Parameters
socketThe receiving socket.

Definition at line 588 of file qkd-key-manager-system-application.cc.

References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::InetSocketAddress::IsMatchingType(), m_rxTraceKMSs, m_totalRx, m_totalRxKMSs, ns3::Simulator::Now(), NS_LOG_FUNCTION, PacketReceivedKMSs(), and ns3::Socket::RecvFrom().

Referenced by AddNewLink(), and HandleAcceptKMSs().

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

◆ HandleReadSDN()

void ns3::QKDKeyManagerSystemApplication::HandleReadSDN ( Ptr< Socket socket)
private

Handle a packet received from the SDN.

Parameters
socketThe receiving socket.

Definition at line 621 of file qkd-key-manager-system-application.cc.

References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::InetSocketAddress::IsMatchingType(), m_rxTraceSDN, m_totalRx, m_totalRxKMSs, ns3::Simulator::Now(), NS_LOG_FUNCTION, PacketReceivedSDN(), and ns3::Socket::RecvFrom().

Referenced by ConnectToSDNController(), and HandleAcceptSDN().

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

◆ Http004AppQuery()

void ns3::QKDKeyManagerSystemApplication::Http004AppQuery ( UUID  saeId,
Ptr< Socket socket 
)
private

Remember the HTTP request received from the application.

Parameters
saeIdThe application identifier.
socketThe receiving socket.

Definition at line 3223 of file qkd-key-manager-system-application.cc.

References m_http004App, and NS_LOG_FUNCTION.

Referenced by ProcessOpenConnectRequest().

+ Here is the caller graph for this function:

◆ Http004AppQueryComplete()

void ns3::QKDKeyManagerSystemApplication::Http004AppQueryComplete ( UUID  saeId)
private

Remove the HTTP request from the list.

Parameters
saeIdThe application identifier.

Definition at line 3230 of file qkd-key-manager-system-application.cc.

References m_http004App, and NS_LOG_FUNCTION.

Referenced by ProcessNewAppResponse().

+ Here is the caller graph for this function:

◆ HttpKMSAddQuery()

void ns3::QKDKeyManagerSystemApplication::HttpKMSAddQuery ( Ipv4Address  dstKms,
HttpQuery  request 
)
private

Remember the HTTP request made to the peer KMS.

Parameters
dstKmsThe destination KMS IP address.
requestThe HTTP request details.

   HTTP handling

Definition at line 3185 of file qkd-key-manager-system-application.cc.

References m_httpRequestsQueryKMS, and NS_LOG_FUNCTION.

Referenced by NegotiateKeysForAssociation(), NewAppRequest(), ProcessCloseRequest(), RegisterRequest(), and TransformKeys().

+ Here is the caller graph for this function:

◆ HttpKMSCompleteQuery()

void ns3::QKDKeyManagerSystemApplication::HttpKMSCompleteQuery ( Ipv4Address  dstKms)
private

Remove the HTTP request from the list.

Parameters
dstKmsThe destination KMS IP address.

Definition at line 3196 of file qkd-key-manager-system-application.cc.

References m_httpRequestsQueryKMS, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by ProcessAddKeysResponse(), ProcessKMSCloseResponse(), ProcessNewAppResponse(), ProcessRegisterResponse(), and ProcessTransformResponse().

+ Here is the caller graph for this function:

◆ HttpQueryMethod()

QKDKeyManagerSystemApplication::RequestType ns3::QKDKeyManagerSystemApplication::HttpQueryMethod ( Ipv4Address  dstKms)
private

Map the HTTP response and obtain the request method.

Parameters
dstKmsThe destination KMS IP address.
Returns
The request method.

Definition at line 3210 of file qkd-key-manager-system-application.cc.

References m_httpRequestsQueryKMS, NONE, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by ProcessResponseKMS().

+ Here is the caller graph for this function:

◆ MonitorAssociations()

void ns3::QKDKeyManagerSystemApplication::MonitorAssociations ( )
private

\breif Monitor the state of the existing key stream sessions.

◆ NegotiateKeysForAssociation()

void ns3::QKDKeyManagerSystemApplication::NegotiateKeysForAssociation ( std::string  ksid,
uint32_t  keyAmount = 1024,
uint32_t  priority = 0 
)
private

◆ NewAppRequest()

void ns3::QKDKeyManagerSystemApplication::NewAppRequest ( std::string  ksid)
private

◆ PacketReceived()

void ns3::QKDKeyManagerSystemApplication::PacketReceived ( const Ptr< Packet > &  p,
const Address from,
Ptr< Socket socket 
)
private

Assemble a byte stream from the application to extract the HTTP message.

Parameters
pThe received packet.
fromThe packet origin address.
socketThe receiving socket.

Definition at line 654 of file qkd-key-manager-system-application.cc.

References ns3::Packet::AddAtEnd(), ns3::Packet::CopyData(), ns3::Packet::CreateFragment(), ns3::HTTPMessage::GetSize(), ns3::Packet::GetSize(), ns3::HTTPMessage::GetStatusMessage(), ns3::Packet::GetUid(), ns3::HTTPMessage::IsFragmented(), m_bufferKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, check-style-clang-format::parser, ProcessRequest(), ns3::Packet::RemoveAtStart(), ns3::HTTPMessage::ToString(), and ns3::Packet::ToString().

Referenced by HandleRead().

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

◆ PacketReceivedKMSs()

void ns3::QKDKeyManagerSystemApplication::PacketReceivedKMSs ( const Ptr< Packet > &  p,
const Address from,
Ptr< Socket socket 
)
private

Assemble a byte stream from the peer KMS to extract the HTTP message.

Parameters
pThe received packet.
fromThe packet origin address.
socketThe receiving socket.

Definition at line 718 of file qkd-key-manager-system-application.cc.

References ns3::Packet::AddAtEnd(), ns3::Packet::CopyData(), ns3::Packet::CreateFragment(), ns3::HTTPMessage::GetSize(), ns3::Packet::GetSize(), ns3::HTTPMessage::GetStatusMessage(), ns3::Packet::GetUid(), ns3::HTTPMessage::IsFragmented(), m_bufferKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, check-style-clang-format::parser, ProcessPacketKMSs(), ns3::Packet::RemoveAtStart(), ns3::HTTPMessage::ToString(), and ns3::Packet::ToString().

Referenced by HandleReadKMSs().

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

◆ PacketReceivedSDN()

void ns3::QKDKeyManagerSystemApplication::PacketReceivedSDN ( const Ptr< Packet > &  p,
const Address from,
Ptr< Socket socket 
)
private

Assemble a byte stream from the SDN to extract the HTTP message.

Parameters
pThe received packet.
fromThe packet origin address.
socketThe receiving socket.

Definition at line 782 of file qkd-key-manager-system-application.cc.

References ns3::Packet::AddAtEnd(), ns3::Packet::CopyData(), ns3::Packet::CreateFragment(), ns3::HTTPMessage::GetSize(), ns3::Packet::GetSize(), ns3::HTTPMessage::GetStatusMessage(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), ns3::HTTPMessage::IsFragmented(), m_bufferKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, check-style-clang-format::parser, ProcessRequestSDN(), ProcessResponseSDN(), ns3::Packet::RemoveAtStart(), ns3::HTTPMessage::ToString(), and ns3::Packet::ToString().

Referenced by HandleReadSDN().

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

◆ PacketToString()

std::string ns3::QKDKeyManagerSystemApplication::PacketToString ( Ptr< Packet packet)
private

Convert the packet to a string.

Parameters
packetThe packet.
Returns
The packet content in the string format.

◆ PrepareSinkSocket()

void ns3::QKDKeyManagerSystemApplication::PrepareSinkSocket ( void  )
private

◆ ProcessAddKeysRequest()

void ns3::QKDKeyManagerSystemApplication::ProcessAddKeysRequest ( HTTPMessage  h,
Ptr< Socket socket,
std::string  ksid 
)
private

Process the FILL request.

Parameters
hThe received HTTP message.
socketThe receiving socket.
ksidThe key stream session identifier.

The KMS processes the proposal of keys to be assigned to the key stream session identifier with the given KSID. The proposal is issued by the initiating KMS, the one that serves the sender application.

Definition at line 2486 of file qkd-key-manager-system-application.cc.

References AddKeyToAssociationDedicatedStore(), ns3::HTTPMessage::CreateResponse(), GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_associations004, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::QKDKey::READY, SendToSocketPair(), SendToSocketPairKMS(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().

Referenced by ProcessRequestKMS().

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

◆ ProcessAddKeysResponse()

void ns3::QKDKeyManagerSystemApplication::ProcessAddKeysResponse ( HTTPMessage  header,
Ptr< Socket socket 
)
private

◆ ProcessCloseRequest()

◆ ProcessGetKey004Request()

◆ ProcessKMSCloseRequest()

void ns3::QKDKeyManagerSystemApplication::ProcessKMSCloseRequest ( HTTPMessage  header,
Ptr< Socket socket,
std::string  ksid 
)
private

Process the close request from the peer KMS.

Parameters
headerThe received HTTP message.
socketThe receiving socket.
ksidThe key sream identifier.

When the QKDApp initiates ETSI 004 close request, the local KMS should release QKD keys currently assign to the key stream session. To do so, the KMS should sync with the peer KMS. This function perform the necessery processing on the peer KMS to do sync.

Definition at line 2947 of file qkd-key-manager-system-application.cc.

References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetMessageBodyString(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), m_associations004, m_keyServedTraceEmir, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ReleaseAssociation(), SendToSocketPairKMS(), and ns3::HTTPMessage::ToString().

Referenced by ProcessRequestKMS().

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

◆ ProcessKMSCloseResponse()

void ns3::QKDKeyManagerSystemApplication::ProcessKMSCloseResponse ( HTTPMessage  header,
Ptr< Socket socket 
)
private

Process close response from the peer KMS.

Parameters
headerThe received HTTP message.
socketThe receiving socket.

Definition at line 3100 of file qkd-key-manager-system-application.cc.

References GetDestinationKmsAddress(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetStatusCode(), HttpKMSCompleteQuery(), m_associations004, m_httpRequestsQueryKMS, m_keyServedTraceEmir, ns3::HTTPMessage::NotAcceptable, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, and ReleaseAssociation().

Referenced by ProcessResponseKMS().

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

◆ ProcessNewAppRequest()

◆ ProcessNewAppResponse()

void ns3::QKDKeyManagerSystemApplication::ProcessNewAppResponse ( HTTPMessage  header,
Ptr< Socket socket 
)
private

◆ ProcessOpenConnectRequest()

void ns3::QKDKeyManagerSystemApplication::ProcessOpenConnectRequest ( HTTPMessage  header,
Ptr< Socket socket 
)
private

Definition at line 1788 of file qkd-key-manager-system-application.cc.

References CheckDoSAttack(), CheckSessionList(), ns3::QKDKeyManagerSystemApplication::QoS::chunkSize, CreateNew004Association(), ns3::HTTPMessage::CreateResponse(), ns3::QKDApplicationEntry::ETSI_QKD_004_AUTHENTICATION, ns3::QKDApplicationEntry::ETSI_QKD_004_ENCRYPTION, GetApplicationConnectionDetailsBySaeIDsAndType(), ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetType(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), Http004AppQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), ns3::QKDKeyManagerSystemApplication::QoS::jitter, m_associations004, ns3::QKDKeyManagerSystemApplication::QoS::maxRate, ns3::QKDKeyManagerSystemApplication::QoS::minRate, NewAppRequest(), ns3::QKDApplicationEntry::NONE, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::QKDKeyManagerSystemApplication::QoS::priority, ProcessQoSRequest(), ProcessUriParams(), ReadJsonQos(), RegisterRequest(), SendToSocketPair(), ns3::UUID::string(), ns3::QKDKeyManagerSystemApplication::QoS::timeout, ns3::HTTPMessage::ToString(), ns3::QKDKeyManagerSystemApplication::QoS::TTL, and check-style-clang-format::type.

Referenced by ProcessRequest().

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

◆ ProcessPacketKMSs()

void ns3::QKDKeyManagerSystemApplication::ProcessPacketKMSs ( HTTPMessage  header,
Ptr< Packet packet,
Ptr< Socket socket 
)
private

Process incoming request at the KM link.

Parameters
headerThe received HTTP message.
packetThe received packet.
socketThe receiving socket.

Definition at line 1422 of file qkd-key-manager-system-application.cc.

References ns3::HTTPMessage::GetUri(), NS_LOG_FUNCTION, ProcessRequestKMS(), and ProcessResponseKMS().

Referenced by PacketReceivedKMSs().

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

◆ ProcessPPRequest()

void ns3::QKDKeyManagerSystemApplication::ProcessPPRequest ( HTTPMessage  header,
Ptr< Packet packet,
Ptr< Socket socket 
)
private

Process request from the QKD post-processing application.

Parameters
headerThe received HTTP message.
packetThe received packet.
socketThe receiving socket.

◆ ProcessQoSRequest()

bool ns3::QKDKeyManagerSystemApplication::ProcessQoSRequest ( QKDApplicationEntry appConnection,
QKDKeyAssociationLinkEntry keyAssociation,
QKDKeyManagerSystemApplication::QoS inQos,
QKDKeyManagerSystemApplication::QoS outQos,
std::string  ksid 
)
private

◆ ProcessRegisterRequest()

void ns3::QKDKeyManagerSystemApplication::ProcessRegisterRequest ( HTTPMessage  header,
std::string  ksid,
Ptr< Socket socket 
)
private

Process the REGISTER request.

Parameters
headerThe received HTTP message.
ksidThe key stream identifier.
socketThe receiving socket.

The KMS process the REGISTER request, and starts assigning key material to the key stream session.

Definition at line 2429 of file qkd-key-manager-system-application.cc.

References CheckAssociation(), ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetUri(), m_associations004, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, SendToSocketPairKMS(), and ns3::HTTPMessage::ToString().

Referenced by ProcessRequestKMS().

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

◆ ProcessRegisterResponse()

void ns3::QKDKeyManagerSystemApplication::ProcessRegisterResponse ( HTTPMessage  header,
Ptr< Socket socket 
)
private

Process the REGISTER response.

Parameters
headerThe received message.
socketThe receiving socket.

The KMS simply acknowledges that the peer KMS has process the REGISTER request.

Definition at line 2462 of file qkd-key-manager-system-application.cc.

References GetDestinationKmsAddress(), ns3::HTTPMessage::GetStatusCode(), HttpKMSCompleteQuery(), m_associations004, m_httpRequestsQueryKMS, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::HTTPMessage::Ok.

Referenced by ProcessResponseKMS().

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

◆ ProcessRequest()

void ns3::QKDKeyManagerSystemApplication::ProcessRequest ( HTTPMessage  headerIn,
Ptr< Packet packet,
Ptr< Socket socket 
)
private

Process incoming requests from the service layer, i.e., QKD applications.

Parameters
headerThe received HTTP message.
packetThe received packet.
socketThe receiving socket.

   Southbound interface functions (ETSI 014 & ETSI 004)

Definition at line 1015 of file qkd-key-manager-system-application.cc.

References AddNewKey(), Check014GetKeyRequest(), ns3::InetSocketAddress::ConvertFrom(), CreateKeyContainer(), ns3::HTTPMessage::CreateResponse(), ETSI_QKD_004_CLOSE, ETSI_QKD_004_GET_KEY, ETSI_QKD_004_OPEN_CONNECT, ETSI_QKD_014_GET_KEY, ETSI_QKD_014_GET_KEY_WITH_KEY_IDS, ETSI_QKD_014_GET_STATUS, FetchRequestType(), GetAddress(), GetApplicationConnectionDetails(), ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), ns3::QKDKeyAssociationLinkEntry::GetId(), ns3::Node::GetId(), ns3::InetSocketAddress::GetIpv4(), GetKeyAssociationLinkDetailsByApplicationId(), GetMaxKeyPerRequest(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetMethod(), GetNode(), ns3::Socket::GetPeerName(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::httpMessage, ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), two-ray-to-three-gpp-ch-calibration::k, ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::ksid, m_defaultKeySize, m_dropTrace, m_keyServedETSI014Trace, m_keyServedTraceEmir, m_maxKeySize, m_minKeySize, m_newKeyGeneratedTrace, m_newKeyGeneratedTraceEmir, m_queueLogic, NONE, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::packet, ns3::Ipv4Address::Print(), ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ProcessCloseRequest(), ProcessGetKey004Request(), ProcessOpenConnectRequest(), ProcessUriParams(), SendToSocketPair(), ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::socket, STORE_PP_KEYS, ns3::UUID::string(), ns3::HTTPMessage::ToString(), and TransformKeys().

Referenced by PacketReceived().

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

◆ ProcessRequestKMS()

void ns3::QKDKeyManagerSystemApplication::ProcessRequestKMS ( HTTPMessage  header,
Ptr< Socket socket 
)
private

Process request from the peer KMS.

Parameters
headerThe received HTTP message.
socketThe receiving socket.

Definition at line 1650 of file qkd-key-manager-system-application.cc.

References ETSI_QKD_004_KMS_CLOSE, FetchRequestType(), FILL, ns3::HTTPMessage::GetUri(), NEW_APP, NONE, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ProcessAddKeysRequest(), ProcessKMSCloseRequest(), ProcessNewAppRequest(), ProcessRegisterRequest(), ProcessTransformRequest(), ProcessUriParams(), REGISTER, and TRANSFORM_KEYS.

Referenced by ProcessPacketKMSs().

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

◆ ProcessRequestSDN()

void ns3::QKDKeyManagerSystemApplication::ProcessRequestSDN ( HTTPMessage  header,
Ptr< Packet packet,
Ptr< Socket socket 
)
private

Process request from the SDN controller.

Parameters
headerThe received HTTP message.
packetThe received packet.
socketThe receiving socket.

Definition at line 1598 of file qkd-key-manager-system-application.cc.

References ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatusCode(), NS_LOG_FUNCTION, and ProcessUriParams().

Referenced by PacketReceivedSDN().

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

◆ ProcessResponseKMS()

void ns3::QKDKeyManagerSystemApplication::ProcessResponseKMS ( HTTPMessage  header,
Ptr< Packet packet,
Ptr< Socket socket 
)
private

Process response from the peer KMS.

Parameters
headerThe received HTTP message.
packetThe received packet.
socketThe receiving socket.

Definition at line 1688 of file qkd-key-manager-system-application.cc.

References ETSI_QKD_004_KMS_CLOSE, FILL, GetDestinationKmsAddress(), HttpQueryMethod(), NEW_APP, NS_FATAL_ERROR, NS_LOG_FUNCTION, ProcessAddKeysResponse(), ProcessKMSCloseResponse(), ProcessNewAppResponse(), ProcessRegisterResponse(), ProcessTransformResponse(), REGISTER, and TRANSFORM_KEYS.

Referenced by ProcessPacketKMSs().

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

◆ ProcessResponseSDN()

void ns3::QKDKeyManagerSystemApplication::ProcessResponseSDN ( HTTPMessage  header,
Ptr< Packet packet,
Ptr< Socket socket 
)
private

◆ ProcessTransformRequest()

void ns3::QKDKeyManagerSystemApplication::ProcessTransformRequest ( HTTPMessage  header,
Ptr< Socket socket 
)
private

Process the transform request.

Parameters
headerThe received HTTP message.
socketThe receiving socket.

The KMS processes transform request by transformim the same set of keys to a given number and size, as requested from the peer KMS. The success indicator is sent as a response.

Definition at line 2726 of file qkd-key-manager-system-application.cc.

References ns3::HTTPMessage::CreateResponse(), GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::QKDApplicationEntry::GetSrcSaeId(), ns3::HTTPMessage::GetUri(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::QKDKey::READY, SendToSocketPairKMS(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().

Referenced by ProcessRequestKMS().

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

◆ ProcessTransformResponse()

◆ ProcessUriParams()

std::vector< std::string > ns3::QKDKeyManagerSystemApplication::ProcessUriParams ( std::string  s)
private

Read the URI parameters in a vector.

Parameters
sThe HTTP request URI.
Returns
The vector of URI parameters.

Definition at line 1623 of file qkd-key-manager-system-application.cc.

References NS_LOG_FUNCTION.

Referenced by ProcessOpenConnectRequest(), ProcessRequest(), ProcessRequestKMS(), ProcessRequestSDN(), and ProcessResponseSDN().

+ Here is the caller graph for this function:

◆ PurgeExpiredAssociations()

void ns3::QKDKeyManagerSystemApplication::PurgeExpiredAssociations ( )
private

Purge (delete) the expired ETSI 004 key stream sessions based on the QoS - TTL value.

Definition at line 4010 of file qkd-key-manager-system-application.cc.

References ns3::Time::GetSeconds(), m_associations004, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by NegotiateKeysForAssociation().

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

◆ ReadJsonQos()

void ns3::QKDKeyManagerSystemApplication::ReadJsonQos ( QKDKeyManagerSystemApplication::QoS inQos,
nlohmann::json  jOpenConnectRequest 
)
private

◆ RegisterApplicationEntry() [1/2]

QKDApplicationEntry ns3::QKDKeyManagerSystemApplication::RegisterApplicationEntry ( UUID  keyAssociationId,
UUID  applicationEntryId,
UUID  srcSaeId,
UUID  dstSaeId,
std::string  type,
Ipv4Address  dstKmsAddress,
uint32_t  priority = 0,
double  expirationTime = 100 
)

Register a new pair of QKD applications.

This function register the pair of QKDApps (srcSaeId, dstSaeId) to use keys that are produced by the QKD systems on nodes srcNode and dstNode via this KMS We assume QKD link (key association) between SAE nodes is established.

Parameters
keyAssociationIdThe key association identifier.
applicationEntryIdThe application pair entry identifier.
srcSaeIdThe source application identifier.
dstSaeIdThe destination application identifier.
typeThe application type based on the selected key-supply interaface.
dstKmsAddressThe destination KMS address.
priorityThe key association priority.
expirationTimeThe key association expiration time.
Returns
The QKD application entry.

Hence, we only need keyAssociationId!

Definition at line 3552 of file qkd-key-manager-system-application.cc.

References connectedToSDN, ns3::InetSocketAddress::ConvertFrom(), ns3::HTTPMessage::CreateRequest(), ns3::QKDApplicationEntry::ETSI_QKD_004_AUTHENTICATION, ns3::QKDApplicationEntry::ETSI_QKD_004_ENCRYPTION, ns3::QKDApplicationEntry::ETSI_QKD_014_AUTHENTICATION, ns3::QKDApplicationEntry::ETSI_QKD_014_ENCRYPTION, ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), ns3::QKDKeyAssociationLinkEntry::GetId(), ns3::InetSocketAddress::GetIpv4(), GetKeyAssociationById(), GetNode(), ns3::Object::GetObject(), ns3::GetQKDApplicationEntryText(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceKmsAddress(), ns3::Packet::GetUid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_local, m_packetQueuesToSDN, m_sdnControllerAddress, m_sdnSupportEnabled, m_sendSocketToSDN, ns3::UUID::Nil(), ns3::QKDApplicationEntry::NONE, NS_ASSERT, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::Socket::Send(), ns3::QKDApplicationEntry::SetId(), ns3::UUID::string(), ns3::HTTPMessage::ToString(), and check-style-clang-format::type.

Referenced by RegisterApplicationEntry().

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

◆ RegisterApplicationEntry() [2/2]

QKDApplicationEntry ns3::QKDKeyManagerSystemApplication::RegisterApplicationEntry ( UUID  srcSaeId,
UUID  dstSaeId,
std::string  type,
Ipv4Address  dstKmsAddress,
uint32_t  priority = 0,
double  expirationTime = 100 
)

Register a new pair of QKD applications.

This function register the pair of QKDApps (srcSaeId, dstSaeId) to use keys that are produced by the QKD systems on nodes srcNode and dstNode via this KMS.

Parameters
srcSaeIdThe source application identifier.
dstSaeIdThe destination application identifier.
typeThe application type based on the selected key-supply interaface.
dstKmsAddressThe destination KMS address.
priorityThe key association priority.
expirationTimeThe key association expiration time.
Returns
The QKD application entry.

Definition at line 3512 of file qkd-key-manager-system-application.cc.

References ns3::QKDKeyAssociationLinkEntry::GetId(), GetNode(), ns3::Object::GetObject(), ns3::QKDKeyAssociationLinkEntry::IsValid(), ns3::UUID::Nil(), NS_ASSERT, NS_LOG_FUNCTION, ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), RegisterApplicationEntry(), and check-style-clang-format::type.

+ Here is the call graph for this function:

◆ RegisterRequest()

void ns3::QKDKeyManagerSystemApplication::RegisterRequest ( std::string  ksid)
private

Send the REGISTER request.

Parameters
ksidThe key stream identifier.

The KMS notifies peer KMS that receiving application has registered for the established key stream session by submitting OPEN_CONNECT request.

Definition at line 2391 of file qkd-key-manager-system-application.cc.

References CheckSocketsKMS(), ns3::HTTPMessage::CreateRequest(), GetSendSocketKMS(), HttpKMSAddQuery(), ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, m_associations004, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), REGISTER, ns3::Socket::Send(), and ns3::HTTPMessage::ToString().

Referenced by ProcessOpenConnectRequest().

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

◆ ReleaseAssociation()

void ns3::QKDKeyManagerSystemApplication::ReleaseAssociation ( std::string  ksid,
std::string  surplusKeyId,
uint32_t  syncIndex 
)
private

Release the key stream session.

Parameters
ksidThe key stream session identifier.
surplusKeyIdThe key identifier for the surplus key material in the key stream session buffer.
syncIndexThe key index in the key stream session buffer for synchronisation purposes.

Definition at line 3048 of file qkd-key-manager-system-application.cc.

References GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_associations004, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), and ns3::UUID::string().

Referenced by ProcessKMSCloseRequest(), and ProcessKMSCloseResponse().

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

◆ SaveKeyAssociation()

void ns3::QKDKeyManagerSystemApplication::SaveKeyAssociation ( QKDKeyAssociationLinkEntry rt)

Add the key association.

Parameters
rtThe key association link entry.

Definition at line 3779 of file qkd-key-manager-system-application.cc.

References ns3::QKDKeyAssociationLinkEntry::GetId(), GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by AddNewKey(), ProcessResponseSDN(), and SendQKDLinkStatusToSDN().

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

◆ ScheduleCheckAssociation()

uint32_t ns3::QKDKeyManagerSystemApplication::ScheduleCheckAssociation ( Time  t,
std::string  action,
std::string  ksid 
)
private

Schedule the next event in the attempt to fill the key stream session buffer.

Parameters
tThe time shift.
actionThe name of the action.
ksidThe key stream identifier.
Returns
The scheduled event identifier.

Definition at line 990 of file qkd-key-manager-system-application.cc.

References check-style-clang-format::action, CheckAssociation(), NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().

Referenced by NegotiateKeysForAssociation().

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

◆ SendQKDLinkStatusToSDN()

void ns3::QKDKeyManagerSystemApplication::SendQKDLinkStatusToSDN ( UUID  linkId,
double  updatePeriod 
)

◆ SendToSocketPair()

void ns3::QKDKeyManagerSystemApplication::SendToSocketPair ( Ptr< Socket socket,
Ptr< Packet packet 
)
private

Send the packet to the pair socket.

Parameters
socketThe receiving socket.
packetThe packet to send.

Definition at line 429 of file qkd-key-manager-system-application.cc.

References ns3::Socket::GetPeerName(), ns3::Packet::GetUid(), m_packetQueues, m_socketPairs, m_txTrace, NS_LOG_FUNCTION, and ns3::Socket::Send().

Referenced by ProcessAddKeysRequest(), ProcessGetKey004Request(), ProcessNewAppResponse(), ProcessOpenConnectRequest(), and ProcessRequest().

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

◆ SendToSocketPairKMS()

void ns3::QKDKeyManagerSystemApplication::SendToSocketPairKMS ( Ptr< Socket socket,
Ptr< Packet packet 
)
private

Send the packet to the pair socket.

Parameters
socketThe receiving socket.
packetThe packet to send.

Definition at line 456 of file qkd-key-manager-system-application.cc.

References ns3::Packet::GetUid(), m_socketPairsKMS, NS_LOG_FUNCTION, and ns3::Socket::Send().

Referenced by ProcessAddKeysRequest(), ProcessKMSCloseRequest(), ProcessNewAppRequest(), ProcessRegisterRequest(), and ProcessTransformRequest().

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

◆ SetAddress()

void ns3::QKDKeyManagerSystemApplication::SetAddress ( Ipv4Address  address)
inline

Set the local IP address.

Parameters
addressThe local IP address.

Definition at line 259 of file qkd-key-manager-system-application.h.

References first::address, and m_local.

◆ SetNode()

void ns3::QKDKeyManagerSystemApplication::SetNode ( Ptr< Node n)

Set the node.

Parameters
nThe node to be set.

Definition at line 3790 of file qkd-key-manager-system-application.cc.

References m_node.

◆ SetPort()

void ns3::QKDKeyManagerSystemApplication::SetPort ( uint32_t  port)
inline

Set the local port.

Parameters
portThe port number.

Definition at line 275 of file qkd-key-manager-system-application.h.

References m_port, and port.

◆ SetSDNControllerAddress()

void ns3::QKDKeyManagerSystemApplication::SetSDNControllerAddress ( Address  sdnAddress)
inline

Set the SDN controller address.

Parameters
sdnAddressThe address.

Definition at line 296 of file qkd-key-manager-system-application.h.

References m_sdnControllerAddress, and m_sdnSupportEnabled.

◆ SetSocket()

void ns3::QKDKeyManagerSystemApplication::SetSocket ( std::string  type,
Ptr< Socket socket 
)

Set the sink socket.

Parameters
typeThe socket type.
socketThe socket to be set.

Definition at line 209 of file qkd-key-manager-system-application.cc.

References m_sinkSocket, NS_LOG_FUNCTION, and check-style-clang-format::type.

◆ StartApplication()

void ns3::QKDKeyManagerSystemApplication::StartApplication ( void  )
privatevirtual

Start the KMS Application.


   APPLICATION functions

Reimplemented from ns3::Application.

Definition at line 863 of file qkd-key-manager-system-application.cc.

References ConnectToSDNController(), ns3::Address::IsInvalid(), m_sdnControllerAddress, m_sdnSupportEnabled, NS_LOG_FUNCTION, and PrepareSinkSocket().

+ Here is the call graph for this function:

◆ StopApplication()

void ns3::QKDKeyManagerSystemApplication::StopApplication ( void  )
privatevirtual

Stop the KMS Application.

Reimplemented from ns3::Application.

Definition at line 965 of file qkd-key-manager-system-application.cc.

References ns3::Socket::Close(), m_sinkSocket, m_socketPairs, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().

+ Here is the call graph for this function:

◆ TransformKeys()

void ns3::QKDKeyManagerSystemApplication::TransformKeys ( uint32_t  keySize,
uint32_t  keyNumber,
UUID  slave_SAE_ID 
)
private

Transform a number of keys to a given size.

Parameters
keySizeThe key size.
keyNumberThe key number.
slave_SAE_IDThe destination (receiver) application identifier.

The KMS uses available keys and transforms them to a given number and size. Transformed keys are assigned a new key identifiers. The transformation request is sent to the peer KMS.

Definition at line 2627 of file qkd-key-manager-system-application.cc.

References CheckSocketsKMS(), ns3::HTTPMessage::CreateRequest(), GenerateKeyId(), GetApplicationConnectionDetails(), ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), GetSendSocketKMS(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::Packet::GetUid(), HttpKMSAddQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), two-ray-to-three-gpp-ch-calibration::k, ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::Socket::Send(), ns3::UUID::string(), ns3::QKDKeyManagerSystemApplication::HttpQuery::surplus_key_ID, ns3::QKDKeyManagerSystemApplication::HttpQuery::to_transform_key_IDs, ns3::HTTPMessage::ToString(), ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_IDs, ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_number, and ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_size.

Referenced by ProcessRequest().

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

Member Data Documentation

◆ connectedToSDN

bool ns3::QKDKeyManagerSystemApplication::connectedToSDN
private

◆ m_associations004

◆ m_buffer

std::unordered_map<uint64_t, Ptr<Packet>, AddressHash> ns3::QKDKeyManagerSystemApplication::m_buffer
private

The buffer for the received packets from the applications (TCP segmentation).

Definition at line 895 of file qkd-key-manager-system-application.h.

◆ m_bufferKMS

std::unordered_map<Address, Ptr<Packet>, AddressHash> ns3::QKDKeyManagerSystemApplication::m_bufferKMS
private

The buffer for the received packets from the peer KMS (TCP segmentation).

Definition at line 896 of file qkd-key-manager-system-application.h.

Referenced by PacketReceived(), PacketReceivedKMSs(), and PacketReceivedSDN().

◆ m_closeSocketEvent

EventId ns3::QKDKeyManagerSystemApplication::m_closeSocketEvent
private

The close socket event.

Definition at line 857 of file qkd-key-manager-system-application.h.

◆ m_default_ttl

uint32_t ns3::QKDKeyManagerSystemApplication::m_default_ttl
private

The default value of TTL.

Definition at line 924 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessQoSRequest().

◆ m_defaultKeySize

uint32_t ns3::QKDKeyManagerSystemApplication::m_defaultKeySize
private

The default key size KMS will deliver if the size was not defined in the request.

Definition at line 893 of file qkd-key-manager-system-application.h.

Referenced by Check014GetKeyRequest(), GetTypeId(), and ProcessRequest().

◆ m_dropTrace

TracedCallback<const Ipv4Address&, Ptr<const Packet> > ns3::QKDKeyManagerSystemApplication::m_dropTrace
private

A trace for the dropped packets.

Definition at line 870 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessRequest().

◆ m_flagedIPAdr

std::map<Ipv4Address, uint32_t> ns3::QKDKeyManagerSystemApplication::m_flagedIPAdr
private

A list of flaged IP addresses.

Definition at line 861 of file qkd-key-manager-system-application.h.

Referenced by CheckDoSAttack().

◆ m_http004App

std::multimap<UUID, Ptr<Socket> > ns3::QKDKeyManagerSystemApplication::m_http004App
private

The list of HTTP requests (without response) set to the application.

Definition at line 993 of file qkd-key-manager-system-application.h.

Referenced by Http004AppQuery(), and Http004AppQueryComplete().

◆ m_httpRequestsQueryKMS

std::map<Ipv4Address, std::vector<HttpQuery> > ns3::QKDKeyManagerSystemApplication::m_httpRequestsQueryKMS
private

◆ m_keyServedETSI004Trace

TracedCallback<const std::string &, const uint32_t&, const uint32_t& > ns3::QKDKeyManagerSystemApplication::m_keyServedETSI004Trace
private

A trace for the consumed keys by the ETSI 004 clients.

Definition at line 878 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessGetKey004Request().

◆ m_keyServedETSI014Trace

TracedCallback<const std::string &, Ptr<QKDKey> > ns3::QKDKeyManagerSystemApplication::m_keyServedETSI014Trace
private

A trace for the consumed keys by the ETSI 014 clients.

Definition at line 877 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessRequest().

◆ m_keyServedTraceEmir

TracedCallback<const uint32_t&> ns3::QKDKeyManagerSystemApplication::m_keyServedTraceEmir
private

◆ m_kms_id

uint32_t ns3::QKDKeyManagerSystemApplication::m_kms_id
private

The KMS identifier.

Definition at line 855 of file qkd-key-manager-system-application.h.

Referenced by QKDKeyManagerSystemApplication(), and GetId().

◆ m_kms_key_id

uint32_t ns3::QKDKeyManagerSystemApplication::m_kms_key_id
private

The counter value to assure generation of the unique key identifiers.

Definition at line 856 of file qkd-key-manager-system-application.h.

Referenced by QKDKeyManagerSystemApplication().

◆ m_local

Ipv4Address ns3::QKDKeyManagerSystemApplication::m_local
private

◆ m_maliciousBlocking

uint32_t ns3::QKDKeyManagerSystemApplication::m_maliciousBlocking
private

Should KMS detect and block malicious requests?

Definition at line 862 of file qkd-key-manager-system-application.h.

Referenced by CheckDoSAttack(), and GetTypeId().

◆ m_maxKeyPerRequest

uint32_t ns3::QKDKeyManagerSystemApplication::m_maxKeyPerRequest
private

The maximal number of keys per request application can ask for.

Definition at line 890 of file qkd-key-manager-system-application.h.

Referenced by GetMaxKeyPerRequest(), and GetTypeId().

◆ m_maxKeyRate

DataRate ns3::QKDKeyManagerSystemApplication::m_maxKeyRate
private

The maximal key rate.

Definition at line 922 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId().

◆ m_maxKeySize

uint32_t ns3::QKDKeyManagerSystemApplication::m_maxKeySize
private

The maximal size of the key application can request.

Definition at line 892 of file qkd-key-manager-system-application.h.

Referenced by Check014GetKeyRequest(), GetTypeId(), and ProcessRequest().

◆ m_minKeyRate

DataRate ns3::QKDKeyManagerSystemApplication::m_minKeyRate
private

The minimal key rate.

Definition at line 923 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessQoSRequest().

◆ m_minKeySize

uint32_t ns3::QKDKeyManagerSystemApplication::m_minKeySize
private

The minimal size of the key application can request.

Definition at line 891 of file qkd-key-manager-system-application.h.

Referenced by Check014GetKeyRequest(), GetTypeId(), and ProcessRequest().

◆ m_newKeyGeneratedTrace

TracedCallback<const uint32_t& , const uint32_t&> ns3::QKDKeyManagerSystemApplication::m_newKeyGeneratedTrace
private

A trace for the generated keys.

Definition at line 875 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessRequest().

◆ m_newKeyGeneratedTraceEmir

TracedCallback<const uint32_t&> ns3::QKDKeyManagerSystemApplication::m_newKeyGeneratedTraceEmir
private

A trace for the generated keys.

Definition at line 872 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessRequest().

◆ m_node

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

Definition at line 904 of file qkd-key-manager-system-application.h.

Referenced by GetNode(), and SetNode().

◆ m_packetQueues

std::map<Ptr<Socket>, Ptr<Packet> > ns3::QKDKeyManagerSystemApplication::m_packetQueues
private

Buffering unsend messages due to the connection problems.

Definition at line 905 of file qkd-key-manager-system-application.h.

Referenced by ConnectionSucceeded(), and SendToSocketPair().

◆ m_packetQueuesToSDN

std::map<Ptr<Socket>, Ptr<Packet> > ns3::QKDKeyManagerSystemApplication::m_packetQueuesToSDN
private

Buffering unsend messages due to the connection problems.

Definition at line 906 of file qkd-key-manager-system-application.h.

Referenced by AddNewLink(), ConnectionToSDNSucceeded(), and RegisterApplicationEntry().

◆ m_port

uint32_t ns3::QKDKeyManagerSystemApplication::m_port
private

Local port to bind to.

Definition at line 851 of file qkd-key-manager-system-application.h.

Referenced by GetPort(), PrepareSinkSocket(), and SetPort().

◆ m_providedQoS

TracedCallback< const std::string &, const std::string &, const uint32_t&, const uint32_t&, const uint32_t&, const uint32_t&, const uint32_t& > ns3::QKDKeyManagerSystemApplication::m_providedQoS
private

A trace for the admitted QoS.

Definition at line 888 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessQoSRequest().

◆ m_qos_maxrate_threshold

double ns3::QKDKeyManagerSystemApplication::m_qos_maxrate_threshold
private

The maximal rate threshold.

Definition at line 911 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and ProcessQoSRequest().

◆ m_queueLogic

Ptr<QKDKMSQueueLogic> ns3::QKDKeyManagerSystemApplication::m_queueLogic
private

The KMS Queue Logic for the ETSI 004 QoS handling.

Definition at line 908 of file qkd-key-manager-system-application.h.

Referenced by QKDKeyManagerSystemApplication(), and ProcessRequest().

◆ m_random

Ptr<UniformRandomVariable> ns3::QKDKeyManagerSystemApplication::m_random
private

The uniform random variable.

Definition at line 858 of file qkd-key-manager-system-application.h.

Referenced by QKDKeyManagerSystemApplication(), and ProcessQoSRequest().

◆ m_rxTrace

TracedCallback<Ptr<const Packet>, const Address &> ns3::QKDKeyManagerSystemApplication::m_rxTrace
private

A trace for the received packets from the applications.

Definition at line 864 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and HandleRead().

◆ m_rxTraceKMSs

TracedCallback<Ptr<const Packet>, const Address &> ns3::QKDKeyManagerSystemApplication::m_rxTraceKMSs
private

A trace for the received packets from the peer KMS.

Definition at line 866 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId(), and HandleReadKMSs().

◆ m_rxTraceSDN

TracedCallback<Ptr<const Packet>, const Address &> ns3::QKDKeyManagerSystemApplication::m_rxTraceSDN
private

A trace for the received packets from the SDN controller.

Definition at line 868 of file qkd-key-manager-system-application.h.

Referenced by HandleReadSDN().

◆ m_scheduledChecks

std::map<uint32_t, EventId > ns3::QKDKeyManagerSystemApplication::m_scheduledChecks
private

The scheduled events.

Definition at line 860 of file qkd-key-manager-system-application.h.

◆ m_sdnControllerAddress

Address ns3::QKDKeyManagerSystemApplication::m_sdnControllerAddress
private

◆ m_sdnSupportEnabled

uint32_t ns3::QKDKeyManagerSystemApplication::m_sdnSupportEnabled
private

◆ m_sendSocketToSDN

Ptr<Socket> ns3::QKDKeyManagerSystemApplication::m_sendSocketToSDN
private

◆ m_sessionList

std::map<std::string, uint32_t> ns3::QKDKeyManagerSystemApplication::m_sessionList
private

A list of sessions.

Definition at line 910 of file qkd-key-manager-system-application.h.

Referenced by CheckSessionList(), CreateNew004Association(), and ProcessQoSRequest().

◆ m_sinkSocket

Ptr<Socket> ns3::QKDKeyManagerSystemApplication::m_sinkSocket
private

◆ m_sinkSocketFromSDN

Ptr<Socket> ns3::QKDKeyManagerSystemApplication::m_sinkSocketFromSDN
private

The sink socket from the SND controller.

Definition at line 849 of file qkd-key-manager-system-application.h.

Referenced by ConnectToSDNController().

◆ m_socketPairs

std::map<Ptr<Socket>, Ptr<Socket> > ns3::QKDKeyManagerSystemApplication::m_socketPairs
private

The accepted sockets.

Definition at line 900 of file qkd-key-manager-system-application.h.

Referenced by DoDispose(), GetAcceptedSockets(), HandleAccept(), SendToSocketPair(), and StopApplication().

◆ m_socketPairsKMS

std::map<Ipv4Address, std::pair<Ptr<Socket>, Ptr<Socket> > > ns3::QKDKeyManagerSystemApplication::m_socketPairsKMS
private

The accepted sockets for the communication between KMSs.

Definition at line 902 of file qkd-key-manager-system-application.h.

Referenced by AddNewLink(), CheckSocketsKMS(), GetDestinationKmsAddress(), GetSendSocketKMS(), HandleAcceptKMSs(), and SendToSocketPairKMS().

◆ m_tid

TypeId ns3::QKDKeyManagerSystemApplication::m_tid
private

The object type identifier.

Definition at line 854 of file qkd-key-manager-system-application.h.

Referenced by AddNewLink(), ConnectToSDNController(), GetTypeId(), and PrepareSinkSocket().

◆ m_totalRx

uint32_t ns3::QKDKeyManagerSystemApplication::m_totalRx
private

◆ m_totalRxKMSs

uint32_t ns3::QKDKeyManagerSystemApplication::m_totalRxKMSs
private

Total bytes sent between KMSs.

Definition at line 853 of file qkd-key-manager-system-application.h.

Referenced by HandleReadKMSs(), and HandleReadSDN().

◆ m_txTrace

TracedCallback<Ptr<const Packet> > ns3::QKDKeyManagerSystemApplication::m_txTrace
private

A trace for the sent packets to the applications.

Definition at line 865 of file qkd-key-manager-system-application.h.

Referenced by ConnectionSucceeded(), GetTypeId(), and SendToSocketPair().

◆ m_txTraceKMSs

TracedCallback<Ptr<const Packet> > ns3::QKDKeyManagerSystemApplication::m_txTraceKMSs
private

A trace for the sent packets to the peer KMS.

Definition at line 867 of file qkd-key-manager-system-application.h.

Referenced by GetTypeId().

◆ m_txTraceSDN

TracedCallback<Ptr<const Packet> > ns3::QKDKeyManagerSystemApplication::m_txTraceSDN
private

A trace for the sent packets to the SDN controller.

Definition at line 869 of file qkd-key-manager-system-application.h.

◆ nKMS

uint32_t ns3::QKDKeyManagerSystemApplication::nKMS = 0
staticprivate

The number of created KMSs.

A static value.

Definition at line 320 of file qkd-key-manager-system-application.h.

Referenced by QKDKeyManagerSystemApplication().


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