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 ()
 
virtual ~Application ()
 
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...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this 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...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) 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 (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= ([[maybe_unused]] const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) 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 erros. 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 (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

virtual void DoDispose (void)
 Destructor implementation. More...
 
- Protected Member Functions inherited from ns3::Application
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate (void)
 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 (void)
 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

Config Paths

ns3::QKDKeyManagerSystemApplication is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/ApplicationList/[i]/$ns3::QKDKeyManagerSystemApplication"

Attributes

  • Protocol: The type of protocol to use.
  • LocalAddress: The ipv4 address of the application
  • MaximalKeysPerRequest: The maximal number of keys per request (ESTI QKD 014)
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 20
    • Flags: construct write read
  • MinimalKeySize: The minimal size of key QKDApp can request
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 32
    • Flags: construct write read
  • MaximalKeySize: The maximal size of key QKDApp can request
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 10240
    • Flags: construct write read
  • DefaultKeySize: The default size of the key
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 512
    • Flags: construct write read
  • MaliciousRequestBlocking: Does KMS detects and blocks malicious get_key_004 request?
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 0
    • Flags: construct write read
  • ETSI004_DefaultTTL: Default value of ETSI004 TTL (in seconds)
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 10
    • Flags: construct write read
  • MaxKeyRate: The maximal key rate (encryption+authentication) provided by the KMS (QoS settings).
    • Set with class: DataRateValue
    • Underlying type: DataRate
    • Initial value: 10000bps
    • Flags: construct write read
  • MinKeyRate: The minimal key rate (encryption+authentication) provided by the KMS (QoS settings).
    • Set with class: DataRateValue
    • Underlying type: DataRate
    • Initial value: 1000bps
    • Flags: construct write read
  • QoS_maxrate_threshold: The treshold for processing low-priority requests
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.2
    • Flags: construct write read

Attributes defined in parent class ns3::Application

  • StartTime: Time at which the application will start
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +0ns
    • Flags: construct write read
  • StopTime: Time at which the application will stop
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +0ns
    • Flags: construct write read

TraceSources

  • Tx: A new packet is created and is sent to the APP
    Callback signature: ns3::QKDKeyManagerSystemApplication::Tx
  • Rx: A packet from the APP has been received
    Callback signature: ns3::QKDKeyManagerSystemApplication::Rx
  • TxKMSs: A new packet is created and is sent to the APP
    Callback signature: ns3::QKDKeyManagerSystemApplication::TxKMSs
  • RxKMSs: A packet from the APP has been received
    Callback signature: ns3::QKDKeyManagerSystemApplication::RxKMSs
  • NewKeyGeneratedEmir: The trace to monitor key material received from QL
    Callback signature: ns3::QKDKeyManagerSystemApplication::NewKeyGeneratedEmir
  • KeyServedEmir: The trace to monitor key material served to QKD Apps
    Callback signature: ns3:QKDKeyManagerSystemApplication::KeyServedEmir
  • NewKeyGenerated: The trace to monitor key material received from QL
    Callback signature: ns3::QKDKeyManagerSystemApplication::NewKeyGenerated
  • KeyServedEtsi014: The thece to monitor key usage by etsi 014
    Callback signature: ns3::QKDKeyManagerSystemApplication::KeyServedEtsi014
  • KeyServedEtsi004: The thece to monitor key usage by etsi 004
    Callback signature: ns3::QKDKeyManagerSystemApplication::KeyServedEtsi004
  • DropKMSRequest: Drop a request from the queue disc
    Callback signature: ns3::QKDKeyManagerSystemApplication::TracedCallback
  • ProvidedQoSResponse: Provide QoS response to key material request
    Callback signature: ns3::QKDKeyManagerSystemApplication::ProvidedQoSResponse

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

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 3348 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 4236 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 4224 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 3813 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 3981 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 1720 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 1754 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 3945 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 4288 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::Application.

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 3284 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 4531 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 3969 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 3714 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 3687 of file qkd-key-manager-system-application.cc.

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

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 3261 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 3768 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 3752 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 3734 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 3279 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 3245 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 3224 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 3231 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 3186 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 3197 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 3211 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, ns3::HTTPMessageParser::Parse(), 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, ns3::HTTPMessageParser::Parse(), 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, ns3::HTTPMessageParser::Parse(), 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 2487 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 2948 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 3101 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 1789 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(), and ns3::QKDKeyManagerSystemApplication::QoS::TTL.

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 1423 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 2430 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 2463 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 1016 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(), bianchi11ax::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: