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

QKDNetSim implements Key Management System(KMS) as an application that listens on TCP port 80. More...

#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
 
struct  ChunkKey
 
struct  HttpQuery
 
struct  QoS
 

Public Types

enum  RequestType {
  EMPTY = -1 , 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_KEY = 9 , TRANSFORM_KEYS = 10 ,
  ETSI_QKD_004_KMS_CLOSE = 11 , RELAY_KEYS = 12
}
 Request types. More...
 
- Public Types inherited from ns3::Application
typedef void(* DelayAddressCallback) (const Time &delay, const Address &from)
 Common callback signature for packet delay and address.
 
typedef void(* StateTransitionCallback) (const std::string &oldState, const std::string &newState)
 Common signature used by callbacks to application's state transition trace source.
 

Public Member Functions

 QKDKeyManagerSystemApplication ()
 QKDKeyManagerSystemApplication constructor.
 
 ~QKDKeyManagerSystemApplication () override
 QKDKeyManagerSystemApplication destructor.
 
void CreateQBuffer (uint32_t dstId, Ptr< QBuffer > bufferConf)
 Create Q buffer shared with remote key manager node.
 
void EstablishKMLinkSockets (Ipv4Address remoteKmAddress)
 Create sink socket to listen requests exchanged between KMSs.
 
Ipv4Address GetAddress ()
 Get local address.
 
std::string GetAddressString (Ipv4Address address)
 Get address as string.
 
Ptr< QCenControllerGetCenController ()
 
Ptr< QKDControlGetController ()
 Get QKDN controller object.
 
std::string GetId ()
 Get key menager ID.
 
uint32_t GetMaxKeyPerRequest ()
 Get maximum number of keys per request(ETSI QKD 014)
 
Ptr< NodeGetNode ()
 Get node.
 
uint32_t GetPort () const
 Get local port.
 
Ptr< QBufferGetQBuffer (uint32_t remoteKmNodeId, std::string type="ns3::QBuffer")
 Get q-buffer established with remote key manager.
 
std::vector< Ptr< QBuffer > > GetQBuffersVector ()
 Get all QBuffers created on the KMS.
 
Ptr< SocketGetSocket () const
 Get sink socket.
 
uint32_t GetTotalRx () const
 Get the total amount of bytes received.
 
void RegisterQKDModule (uint32_t dstId, std::string moduleId)
 Registers a QKD module in key manager.
 
void SetAddress (Ipv4Address address)
 Set local address.
 
void SetCenController (Ptr< QCenController > controller)
 
void SetController (Ptr< QKDControl > controller)
 Assign QKDN controller.
 
void SetId (std::string id)
 Set key manager ID.
 
void SetId (UUID id)
 Set key manager ID.
 
void SetNode (Ptr< Node > n)
 Set node.
 
void SetPeerKmAddress (uint32_t dstKmNodeId, Ipv4Address dstKmAddress)
 Set peer KM node address.
 
void SetPort (uint32_t port)
 Set local port.
 
void SetSocket (std::string type, Ptr< Socket > socket)
 Set sink socket.
 
void UpdateLinkState (uint32_t dstKmNodeId)
 Check the QKD link state to given destination.
 
- Public Member Functions inherited from ns3::Application
 Application ()
 
 ~Application () override
 
virtual int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this Application object.
 
Ptr< NodeGetNode () const
 
void SetNode (Ptr< Node > node)
 
void SetStartTime (Time start)
 Specify application start time.
 
void SetStopTime (Time stop)
 Specify application stop time.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

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

Protected Member Functions

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

Private Member Functions

void AddKeyToAssociationDedicatedStore (std::string ksid, Ptr< QKDKey > key)
 Add key to dedicated key store corresponding to association identified with KSID.
 
nlohmann::json Check014GetKeyRequest (uint32_t number, uint32_t size, Ptr< SBuffer > buffer)
 Validate request and probe ability to fullfil valid request.
 
void CheckEtsi004Association (std::string ksid)
 Check the state of a single assocation.
 
void CheckSocketsKMS (Ipv4Address dstSaeId)
 Prepare send socket to communicate with peer KMS Application.
 
void ConnectionFailed (Ptr< Socket > socket)
 
void ConnectionFailedKMSs (Ptr< Socket > socket)
 
void ConnectionSucceeded (Ptr< Socket > socket)
 @toDo:following functions
 
void ConnectionSucceededKMSs (Ptr< Socket > socket)
 
nlohmann::json CreateKeyContainer (std::vector< Ptr< QKDKey > > keys)
 Create key container data structure described in ETSI014 document.
 
std::string CreateKeyStreamSession (std::string srcSaeId, std::string dstSaeId, QKDKeyManagerSystemApplication::QoS inQos, std::string ksid)
 Create a new assocation.
 
Ptr< SBufferCreateRelaySBuffer (uint32_t srcNodeId, uint32_t dstNodeId, std::string description)
 Help function to create relay SBuffers.
 
void DataSend (Ptr< Socket >, uint32_t)
 
void DataSendKMSs (Ptr< Socket >, uint32_t)
 
QKDKeyManagerSystemApplication::RequestType FetchRequestType (std::string s)
 Get request type.
 
void Fill (uint32_t dstKmNodeId, std::string direction, uint32_t amount)
 Fill s-buffer.
 
std::string GenerateRandomString (const int len, const uint32_t seed=0)
 Generate random string with given length.
 
std::string GenerateUUID ()
 Generate UUID.
 
Ipv4Address GetDestinationKmsAddress (Ptr< Socket > socket)
 
Ipv4Address GetPeerKmAddress (uint32_t dstKmNodeId)
 
HttpQuery GetProxyQuery (std::string reqId)
 Get saved query.
 
Ptr< SBufferGetSBuffer (uint32_t dstKmNodeId, std::string type)
 
Ptr< SocketGetSendSocketKMS (Ipv4Address kmsDstAddress)
 Obtain send socket.
 
Ptr< SocketGetSocketFromHttp004AppQuery (std::string saeId)
 
void HandleAccept (Ptr< Socket > s, const Address &from)
 Handle an incoming connection.
 
void HandleAcceptKMSs (Ptr< Socket > s, const Address &from)
 Handle an incoming connection.
 
void HandlePeerClose (Ptr< Socket > socket)
 Handle an connection close.
 
void HandlePeerCloseKMSs (Ptr< Socket > socket)
 Handle an connection close.
 
void HandlePeerError (Ptr< Socket > socket)
 Handle an connection error.
 
void HandlePeerErrorKMSs (Ptr< Socket > socket)
 Handle an connection error.
 
void HandleRead (Ptr< Socket > socket)
 Handle a packet received by the KMS application.
 
void HandleReadKMSs (Ptr< Socket > socket)
 Handle a packet received by the KMS from KMS.
 
void Http004AppQuery (std::string saeId, Ptr< Socket > socket)
 
void Http004AppQueryComplete (std::string saeId)
 
void HttpKMSAddQuery (Ipv4Address dstKms, HttpQuery request)
 remember HTTP request made to peer KMS
 
void HttpKMSCompleteQuery (Ipv4Address dstKms)
 remove mapped HTTP response from query
 
void HttpProxyRequestAdd (HttpQuery query)
 Save query.
 
RequestType HttpQueryMethod (Ipv4Address dstKms)
 obtain method_type to map the HTTP response
 
void NewAppRequest (std::string ksid)
 Make NEW_APP request to peer KMS.
 
void PacketReceived (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket)
 Assemble byte stream to extract HTTPMessage.
 
void PacketReceivedKMSs (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket)
 Assemble byte stream to extract HTTPMessage.
 
std::string PacketToString (Ptr< Packet > packet)
 Convert packet to string.
 
void PrepareSinkSocket ()
 
void ProcessCloseRequest (std::string ksid, HTTPMessage header, Ptr< Socket > socket)
 
void ProcessFillRequest (HTTPMessage headerIn, std::string resource, Ptr< Socket > socket)
 
void ProcessFillResponse (HTTPMessage headerIn, Ipv4Address from)
 
void ProcessGetKey004Request (std::string ksid, HTTPMessage header, Ptr< Socket > socket)
 
void ProcessKMSCloseRequest (HTTPMessage header, Ptr< Socket > socket, std::string ksid)
 process close request from peer KMS
 
void ProcessKMSCloseResponse (HTTPMessage header, Ptr< Socket > socket)
 process close response from peer KMS
 
void ProcessNewAppRequest (HTTPMessage header, Ptr< Socket > socket)
 
void ProcessNewAppResponse (HTTPMessage header, Ptr< Socket > socket)
 
void ProcessOpenConnectRequest (HTTPMessage header, Ptr< Socket > socket)
 
void ProcessPacketKMSs (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 QKD key manager system application process the request peer KMS, and complete certain actions to respond on received request.
 
void ProcessPPRequest (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 
void ProcessRegisterRequest (HTTPMessage header, std::string ksid, Ptr< Socket > socket)
 
void ProcessRegisterResponse (HTTPMessage header, Ptr< Socket > socket)
 
void ProcessRelayRequest (HTTPMessage headerIn, Ptr< Socket > socket)
 Process key relay request.
 
void ProcessRelayResponse (HTTPMessage headerIn)
 Process key relay response.
 
void ProcessRequest (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 QKD key manager system application process the request from QKDApp, and complete certain actions to respond on received request.
 
void ProcessRequestKMS (HTTPMessage header, Ptr< Socket > socket)
 
void ProcessResponseKMS (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket)
 
void ProcessSKeyCreateRequest (HTTPMessage header, Ptr< Socket > socket)
 process transform request
 
void ProcessSKeyCreateResponse (HTTPMessage header, Ptr< Socket > socket)
 process transform response
 
void ReadJsonQos (QKDKeyManagerSystemApplication::QoS &inQos, nlohmann::json jOpenConnectRequest)
 Read the parameters from the JSON OPEN_CONNECT structure!
 
std::vector< std::string > ReadUri (std::string s)
 Read parameters from URI.
 
void RegisterRequest (std::string ksid)
 
void Relay (uint32_t dstKmNodeId, uint32_t amount)
 Start key relay function.
 
void ReleaseAssociation (std::string ksid, std::string surplusKeyId, uint32_t syncIndex)
 release key stream association
 
void RemoveProxyQuery (std::string reqId)
 Remove proxy query when processed.
 
void SBufferClientCheck (uint32_t dstKmNodeId)
 check s-buffer levels
 
void ScheduleCheckEtsi004Association (Time t, std::string action, std::string ksid)
 schedule next event in an attempt to fill association buffer
 
void ScheduleReleaseAssociation (Time t, std::string action, std::string ksid, std::string surplusKeyId, uint32_t syncIndex)
 
void SendToSocketPair (Ptr< Socket > socket, Ptr< Packet > packet)
 Send packet to the pair socket.
 
void SendToSocketPairKMS (Ptr< Socket > socket, Ptr< Packet > packet)
 Send packet to the pair socket.
 
void StartApplication () override
 Start KMS Application.
 
void StartSBufferClients (uint32_t dstKmNodeId)
 Start s-buffers control – monitoring.
 
void StopApplication () override
 Stop KMS Application.
 

Private Attributes

std::map< std::string, Association004m_associations004
 
std::unordered_map< Address, Ptr< Packet >, AddressHashm_buffer
 Buffer for received packets(TCP segmentation)
 
std::unordered_map< Address, Ptr< Packet >, AddressHashm_bufferKMS
 Buffer for received packets(TCP segmentation)
 
Ptr< QCenControllerm_cen_controller
 Asigned Q centralized controler for routing!
 
EventId m_closeSocketEvent
 
Ptr< QKDControlm_controller
 Asigned QKDN controller.
 
Ptr< QKDEncryptorm_encryptor
 
std::multimap< std::string, Ptr< Socket > > m_http004App
 
std::unordered_map< std::string, HttpQuerym_httpProxyRequests
 
std::map< Ipv4Address, std::vector< HttpQuery > > m_httpRequestsQueryKMS
 
TracedCallback< const uint32_t &, const uint32_t &, const uint32_t & > m_keyConsumedLink
 
TracedCallback< const uint32_t &, const uint32_t &, const uint32_t &, const uint32_t & > m_keyConsumedRelay
 
std::map< uint32_t, Ptr< SBuffer > > m_keys_dec
 LOCAL S-buffers for the inbound point-to-poit usage.
 
std::map< uint32_t, Ptr< SBuffer > > m_keys_enc
 LOCAL S-buffers for the outbound point-to-point usage.
 
TracedCallback< const std::string &, const std::string &, const uint32_t & > m_keyServedTrace
 
TracedCallback< const uint32_t &, const uint32_t &, const uint32_t & > m_keyWasteRelay
 
std::string m_km_id
 
uint32_t m_kms_id
 
uint32_t m_kms_key_id
 
std::map< uint32_t, uint32_tm_link_states
 Notified link states!
 
Ipv4Address m_local
 Local address to bind to.
 
uint32_t m_maxKeyPerRequest
 
uint32_t m_maxKeySize
 
uint32_t m_maxSBufferSizeInBits
 
uint32_t m_minKeySize
 
uint32_t m_minSBufferSizeInBits
 
Ptr< Nodem_node
 
std::map< Ptr< Socket >, Ptr< Packet > > m_packetQueues
 Buffering unsend messages due to connection problems.
 
std::map< uint32_t, Ipv4Addressm_peerAddressTable
 IP address of peer KM nodes.
 
uint32_t m_port
 Local port to bind to.
 
std::map< uint32_t, Ptr< QBuffer > > m_qbuffers
 Q-buffers for every QKD connection.
 
std::vector< Ptr< QBuffer > > m_qbuffersVector
 The list of QBuffers is necessary for plotting.
 
TracedCallback< const std::string &, const std::string &, const uint32_t & > m_qkdKeyGeneratedTrace
 
std::map< std::string, uint32_tm_qkdmodules
 QKD modules and KM node ID they connect to.
 
Ptr< QKDKMSQueueLogicm_queueLogic
 KMS Queue Logic for ETSI 004 QoS handling.
 
TracedCallback< Ptr< const Packet >, const Address & > m_rxTrace
 Traced Callback: received packets, source address.
 
TracedCallback< Ptr< const Packet >, const Address & > m_rxTraceKMSs
 
std::map< std::string, EventIdm_scheduledChecks
 
Ptr< Socketm_sinkSocket
 
std::map< Ipv4Address, std::pair< Ptr< Socket >, Ptr< Socket > > > m_socketPairsKMS
 we do not know which KMS is going to initialize new TCP connection to peer KMS.
 
uint32_t m_thrSBufferSizeInBits
 
TypeId m_tid
 
uint32_t m_totalRx
 Total bytes received.
 
uint32_t m_totalRxKMSs
 Total bytes received between KMSs.
 
TracedCallback< Ptr< const Packet > > m_txTrace
 
TracedCallback< Ptr< const Packet > > m_txTraceKMSs
 

Static Private Attributes

static uint32_t nKMS
 number of created KMSs - static value
 

Additional Inherited Members

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

Detailed Description

QKDNetSim implements Key Management System(KMS) as an application that listens on TCP port 80.

The KMS can be installed on any node but the QKD post-processing application expects the existence of a local KMS application on the same nodes where the post-processing application is implemented. The local KMS is contacted to add the keys to the QKD buffer and is contacted during the operation of the QKD application to retrieve the keys from the QKD buffer as described in the following section. Communication between KMS systems installed on different nodes is under construction and will be based on the ETSI QKD 004 standard. The KMS application tracks REST-full design serving status and key retrieval requests from QKD applications. The KMS follows HTTP 1.1 specification including Request-URI for mapping of request-response values. More details available at https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html

Config Paths

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

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

Attributes

  • BufferList: The list of Qbuffers needed for plotting QKDGraphs.
  • LocalAddress: The ipv4 address of the application
  • MaximalKeySize: The maximal size of key QKDApp can request
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 10240
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • 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: constructwriteread
    • Support level: SUPPORTED
  • MinimalKeySize: The minimal size of key QKDApp can request
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 32
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • Protocol: The type of protocol to use.

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: constructwriteread
    • Support level: SUPPORTED
  • 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: constructwriteread
    • Support level: SUPPORTED

TraceSources

  • KeyConsumedLink: The trece to monitor p2p key usage
    • Callback signature: ns3::QKDKeyManagerSystemApplication::KeyConsumedLink
    • Support level: SUPPORTED
  • KeyServed: The trece to monitor key usage
    • Callback signature: ns3::QKDKeyManagerSystemApplication::KeyServed
    • Support level: SUPPORTED
  • QKDKeyGenerated: The trace to monitor key material received from QL
    • Callback signature: ns3::QKDKeyManagerSystemApplication::QKDKeyGenerated
    • Support level: SUPPORTED
  • RelayConsumption: The trace to monitor key material consumed for key relay
    • Callback signature: ns3::QKDKeyManagerSystemApplication::RelayConsumption
    • Support level: SUPPORTED
  • Rx: A packet from the APP has been received
    • Callback signature: ns3::QKDKeyManagerSystemApplication::Rx
    • Support level: SUPPORTED
  • RxKMSs: A packet from the APP has been received
    • Callback signature: ns3::QKDKeyManagerSystemApplication::RxKMSs
    • Support level: SUPPORTED
  • Tx: A new packet is created and is sent to the APP
    • Callback signature: ns3::QKDKeyManagerSystemApplication::Tx
    • Support level: SUPPORTED
  • TxKMSs: A new packet is created and is sent to the APP
    • Callback signature: ns3::QKDKeyManagerSystemApplication::TxKMSs
    • Support level: SUPPORTED
  • WasteRelay: The trace to monitor failed relays
    • Callback signature: ns3::QKDKeyManagerSystemApplication::WasteRelay
    • Support level: SUPPORTED

Group: Applications

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

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

Member Enumeration Documentation

◆ RequestType

Request types.

Enumerator
EMPTY 
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_KEY 
TRANSFORM_KEYS 
ETSI_QKD_004_KMS_CLOSE 
RELAY_KEYS 

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

Constructor & Destructor Documentation

◆ QKDKeyManagerSystemApplication()

ns3::QKDKeyManagerSystemApplication::QKDKeyManagerSystemApplication ( )

QKDKeyManagerSystemApplication constructor.

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

References ns3::Create(), m_encryptor, m_kms_key_id, m_queueLogic, m_totalRx, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ~QKDKeyManagerSystemApplication()

ns3::QKDKeyManagerSystemApplication::~QKDKeyManagerSystemApplication ( )
override

QKDKeyManagerSystemApplication destructor.

Definition at line 110 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

Add key to dedicated key store corresponding to association identified with KSID.

Parameters
ksidUnique identifier of the association
keyThe QKD key being added to the store

◆ Check014GetKeyRequest()

nlohmann::json ns3::QKDKeyManagerSystemApplication::Check014GetKeyRequest ( uint32_t  number,
uint32_t  size,
Ptr< SBuffer buffer 
)
private

Validate request and probe ability to fullfil valid request.

Parameters
numbernumber of requested keys
sizerequested keys size
bufferassociated buffer
Returns
json error structure

Funtion returns an empty json if the request is valid and can be fullfiled.

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

References NS_LOG_FUNCTION.

◆ CheckEtsi004Association()

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

Check the state of a single assocation.

Parameters
ksidUnique identifier of the association

@toDo The amount of key material to be assigned to the association must be determined by the QoS parameters.

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

References NS_LOG_DEBUG, NS_LOG_ERROR, and NS_LOG_FUNCTION.

Referenced by ScheduleCheckEtsi004Association().

+ Here is the caller graph for this function:

◆ CheckSocketsKMS()

void ns3::QKDKeyManagerSystemApplication::CheckSocketsKMS ( Ipv4Address  dstSaeId)
private

◆ ConnectionFailed()

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

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

References NS_LOG_FUNCTION.

◆ ConnectionFailedKMSs()

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

Definition at line 784 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

@toDo:following functions

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

References ns3::Create(), m_packetQueues, m_txTrace, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ConnectionSucceededKMSs()

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

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

References NS_LOG_FUNCTION.

Referenced by CheckSocketsKMS().

+ Here is the caller graph for this function:

◆ CreateKeyContainer()

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

Create key container data structure described in ETSI014 document.

Parameters
keysvector of pointers on the QKD key
Returns
json data structure for key container

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

References NS_LOG_FUNCTION.

◆ CreateKeyStreamSession()

std::string ns3::QKDKeyManagerSystemApplication::CreateKeyStreamSession ( std::string  srcSaeId,
std::string  dstSaeId,
QKDKeyManagerSystemApplication::QoS  inQos,
std::string  ksid 
)
private

Create a new assocation.

Parameters
srcSaeIdsource secure application entity
dstSaeIddestination secure application entity
inQosQuality of Service
ksidUnique identifier of the association
Returns
string Unique identifier of the association

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

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

References ns3::QKDKeyManagerSystemApplication::QoS::chunkSize, ns3::QKDGraphManager::CreateGraphForBuffer(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ CreateQBuffer()

void ns3::QKDKeyManagerSystemApplication::CreateQBuffer ( uint32_t  dstId,
Ptr< QBuffer bufferConf 
)

Create Q buffer shared with remote key manager node.

Parameters
dstIdremote key manager node ID
bufferConfQKD buffer configuration

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

References ns3::Create(), GetId(), GetNode(), m_keys_dec, m_keys_enc, m_link_states, m_qbuffers, m_qbuffersVector, NS_LOG_FUNCTION, and StartSBufferClients().

+ Here is the call graph for this function:

◆ CreateRelaySBuffer()

Ptr< SBuffer > ns3::QKDKeyManagerSystemApplication::CreateRelaySBuffer ( uint32_t  srcNodeId,
uint32_t  dstNodeId,
std::string  description 
)
private

Help function to create relay SBuffers.

Parameters
srcNodeIdsource KM node ID
dstNodeIdpeer KM node ID
descritionbuffer description used for QKDGraph

It is called to create new SBuffers for relay on demand.

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

References ns3::QKDGraphManager::CreateGraphForBuffer(), and NS_LOG_FUNCTION.

Referenced by ProcessRequest().

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

◆ DataSend()

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

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

References ns3::Create(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DataSendKMSs()

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

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

References ns3::Create(), and NS_LOG_FUNCTION.

Referenced by CheckSocketsKMS().

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

◆ DoDispose()

void ns3::QKDKeyManagerSystemApplication::DoDispose ( )
overrideprotectedvirtual

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 691 of file qkd-key-manager-system-application.cc.

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

+ Here is the call graph for this function:

◆ EstablishKMLinkSockets()

void ns3::QKDKeyManagerSystemApplication::EstablishKMLinkSockets ( Ipv4Address  remoteKmAddress)

Create sink socket to listen requests exchanged between KMSs.

Parameters
remoteKmAddressIpv4 address of remote key manager

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

References ns3::MakeCallback(), ns3::MakeNullCallback(), and NS_LOG_FUNCTION.

Referenced by CheckSocketsKMS().

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

◆ FetchRequestType()

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

Get request type.

Parameters
sstring from HTTP URI
Returns
request type

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

References NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by ProcessRequest().

+ Here is the caller graph for this function:

◆ Fill()

void ns3::QKDKeyManagerSystemApplication::Fill ( uint32_t  dstKmNodeId,
std::string  direction,
uint32_t  amount 
)
private

◆ GenerateRandomString()

std::string ns3::QKDKeyManagerSystemApplication::GenerateRandomString ( const int  len,
const uint32_t  seed = 0 
)
private

Generate random string with given length.

Parameters
lenstring length
Returns
string random string

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

◆ GenerateUUID()

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

Generate UUID.

Returns
string UUID

   KMS 004 Association operations, monitoring

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

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

Referenced by Relay().

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

◆ GetAddress()

Ipv4Address ns3::QKDKeyManagerSystemApplication::GetAddress ( )
inline

Get local address.

Returns
return local address

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

References m_local.

Referenced by ProcessRequest().

+ Here is the caller graph for this function:

◆ GetAddressString()

std::string ns3::QKDKeyManagerSystemApplication::GetAddressString ( Ipv4Address  address)

Get address as string.

Parameters
addressaddress
Returns
string address

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

References ns3::Create(), and NS_LOG_FUNCTION.

Referenced by Fill(), ProcessRequest(), and Relay().

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

◆ GetCenController()

Ptr< QCenController > ns3::QKDKeyManagerSystemApplication::GetCenController ( )

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

References m_cen_controller, and NS_LOG_FUNCTION.

Referenced by UpdateLinkState().

+ Here is the caller graph for this function:

◆ GetController()

Ptr< QKDControl > ns3::QKDKeyManagerSystemApplication::GetController ( )

Get QKDN controller object.

Returns
QKDN controller

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

References m_controller, and NS_LOG_FUNCTION.

Referenced by ProcessRequest(), Relay(), SBufferClientCheck(), and SetController().

+ Here is the caller graph for this function:

◆ GetDestinationKmsAddress()

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

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

References NS_LOG_FUNCTION.

◆ GetId()

std::string ns3::QKDKeyManagerSystemApplication::GetId ( )
inline

Get key menager ID.

Returns
string key manager ID

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

References m_km_id.

Referenced by CreateQBuffer(), Relay(), StartSBufferClients(), and UpdateLinkState().

+ Here is the caller graph for this function:

◆ GetMaxKeyPerRequest()

uint32_t ns3::QKDKeyManagerSystemApplication::GetMaxKeyPerRequest ( )

Get maximum number of keys per request(ETSI QKD 014)

Returns
uint32_t maximum number of keys per request

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

Referenced by ProcessRequest().

+ Here is the caller graph for this function:

◆ GetNode()

Ptr< Node > ns3::QKDKeyManagerSystemApplication::GetNode ( )
inline

Get node.

Returns
pointer to node

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

References m_node.

Referenced by CheckSocketsKMS(), CreateQBuffer(), Fill(), PrepareSinkSocket(), ProcessRequest(), Relay(), SetController(), StartSBufferClients(), and UpdateLinkState().

+ Here is the caller graph for this function:

◆ GetPeerKmAddress()

Ipv4Address ns3::QKDKeyManagerSystemApplication::GetPeerKmAddress ( uint32_t  dstKmNodeId)
private

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

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

Referenced by Fill(), and Relay().

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

◆ GetPort()

uint32_t ns3::QKDKeyManagerSystemApplication::GetPort ( ) const
inline

Get local port.

Returns
return local port

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

References m_port.

Referenced by HandleAcceptKMSs().

+ Here is the caller graph for this function:

◆ GetProxyQuery()

QKDKeyManagerSystemApplication::HttpQuery ns3::QKDKeyManagerSystemApplication::GetProxyQuery ( std::string  reqId)
private

Get saved query.

Parameters
reqIdrequest identifier
Returns
HttpQuery query

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

References NS_FATAL_ERROR, and NS_LOG_FUNCTION.

◆ GetQBuffer()

Ptr< QBuffer > ns3::QKDKeyManagerSystemApplication::GetQBuffer ( uint32_t  remoteKmNodeId,
std::string  type = "ns3::QBuffer" 
)

Get q-buffer established with remote key manager.

Parameters
remoteKmNodeIdremote key manager node ID
Returns
Ptr on q-buffer

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

References ns3::Create(), m_qbuffers, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by Fill(), SBufferClientCheck(), StartSBufferClients(), and UpdateLinkState().

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

◆ GetQBuffersVector()

std::vector< Ptr< QBuffer > > ns3::QKDKeyManagerSystemApplication::GetQBuffersVector ( )
inline

Get all QBuffers created on the KMS.

Function used for plotting QKD Graphs

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

References m_qbuffersVector.

◆ GetSBuffer()

Ptr< SBuffer > ns3::QKDKeyManagerSystemApplication::GetSBuffer ( uint32_t  dstKmNodeId,
std::string  type 
)
private

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

References ns3::Create(), m_keys_dec, m_keys_enc, and NS_LOG_FUNCTION.

Referenced by Fill(), ProcessRequest(), SBufferClientCheck(), and UpdateLinkState().

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

◆ GetSendSocketKMS()

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

Obtain send socket.

Parameters
kmsDstAddressAddress of the destination KMS
Returns
Socket send socket

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

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

Referenced by Fill(), and Relay().

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

◆ GetSocket()

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

Get sink socket.

Returns
pointer to the sink socket

SOCKET functions


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

References m_sinkSocket, and NS_LOG_FUNCTION.

◆ GetSocketFromHttp004AppQuery()

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

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

References NS_FATAL_ERROR, and NS_LOG_FUNCTION.

◆ GetTotalRx()

uint32_t ns3::QKDKeyManagerSystemApplication::GetTotalRx ( ) const

Get the total amount of bytes received.

Returns
the total bytes received in this sink app

Definition at line 117 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

Handle an incoming connection.

Parameters
sthe incoming connection socket
fromthe address the connection is from

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

References ns3::InetSocketAddress::ConvertFrom(), HandleRead(), ns3::MakeCallback(), and NS_LOG_FUNCTION.

Referenced by PrepareSinkSocket().

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

◆ HandleAcceptKMSs()

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

Handle an incoming connection.

Parameters
sthe incoming connection socket
fromthe address the connection is from

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

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

+ Here is the call graph for this function:

◆ HandlePeerClose()

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

Handle an connection close.

Parameters
socketthe connected socket

Definition at line 803 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 an connection close.

Parameters
socketthe connected socket

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

References NS_LOG_FUNCTION.

◆ HandlePeerError()

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

Handle an connection error.

Parameters
socketthe connected socket

Definition at line 815 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 an connection error.

Parameters
socketthe connected socket

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

References NS_LOG_FUNCTION.

◆ HandleRead()

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

Handle a packet received by the KMS application.

Parameters
socketthe receiving socket

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

References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::InetSocketAddress::IsMatchingType(), m_rxTrace, m_totalRx, ns3::Simulator::Now(), NS_LOG_FUNCTION, and PacketReceived().

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 by the KMS from KMS.

Parameters
socketthe receiving socket

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

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

Referenced by HandleAcceptKMSs().

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

◆ Http004AppQuery()

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

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

References NS_LOG_FUNCTION.

◆ Http004AppQueryComplete()

void ns3::QKDKeyManagerSystemApplication::Http004AppQueryComplete ( std::string  saeId)
private

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

References NS_FATAL_ERROR, and NS_LOG_FUNCTION.

◆ HttpKMSAddQuery()

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

remember HTTP request made to peer KMS

Parameters
dstKmsdestination kms IP address
requestrequest parameters

   HTTP handling

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

References NS_LOG_FUNCTION.

Referenced by Fill().

+ Here is the caller graph for this function:

◆ HttpKMSCompleteQuery()

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

remove mapped HTTP response from query

Parameters
dstKmsdestination kms IP address

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

References NS_FATAL_ERROR, and NS_LOG_FUNCTION.

◆ HttpProxyRequestAdd()

void ns3::QKDKeyManagerSystemApplication::HttpProxyRequestAdd ( HttpQuery  query)
private

Save query.

Parameters
queryhttp query

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

References NS_LOG_FUNCTION, and ns3::QKDKeyManagerSystemApplication::HttpQuery::req_id.

Referenced by Relay().

+ Here is the caller graph for this function:

◆ HttpQueryMethod()

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

obtain method_type to map the HTTP response

Parameters
dstKmsdestination KMS IP address
Returns
RequestType method function

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

References NS_FATAL_ERROR, and NS_LOG_FUNCTION.

◆ 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 byte stream to extract HTTPMessage.

Parameters
preceived packet
fromfrom address

The method assembles a received byte stream and extracts HTTPMessage instances from the stream to export in a trace source.

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

References ns3::Create(), m_buffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ProcessRequest().

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 byte stream to extract HTTPMessage.

Parameters
preceived packet
fromfrom address

The method assembles a received byte stream and extracts HTTPMessage instances from the stream to export in a trace source.

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

References ns3::Create(), ns3::HTTPMessage::GetContentLength(), m_bufferKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, ProcessPacketKMSs(), and ns3::HTTPMessage::ToString().

Referenced by HandleReadKMSs().

+ 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 packet to string.

Parameters
packetthe packet
Returns
string packet

◆ PrepareSinkSocket()

◆ ProcessCloseRequest()

◆ ProcessFillRequest()

void ns3::QKDKeyManagerSystemApplication::ProcessFillRequest ( HTTPMessage  headerIn,
std::string  resource,
Ptr< Socket socket 
)
private

◆ ProcessFillResponse()

void ns3::QKDKeyManagerSystemApplication::ProcessFillResponse ( HTTPMessage  headerIn,
Ipv4Address  from 
)
private

◆ ProcessGetKey004Request()

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

◆ ProcessKMSCloseRequest()

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

process close request from peer KMS

Parameters
headerreceiving http header
socketreceiving socket
ksidunique key stream identifier

When QKDApp initiate etsi004 close request, its local KMS should release quantum keys currently assign to the key stream association. To do so, KMS should sync with peer KMS. This function perform necessery processing on the peer KMS to do sync.

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

References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().

+ Here is the call graph for this function:

◆ ProcessKMSCloseResponse()

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

process close response from peer KMS

Parameters
headerreceiving http header
socketreceiving socket

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

References ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ProcessNewAppRequest()

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

◆ ProcessNewAppResponse()

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

◆ ProcessOpenConnectRequest()

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

   ETSI004 APP-KMS functions

@toDo First some sort of CAC is neccessary. Do we have enough resources to allow this association? Second, even if it seems that we do not have resources, if the request has high priority can we gather enough key material that is reserved for different associations that have lower priority. Or allow association, and from now on do not fill low priority association and generated key use to fill this high priority association.

For now, in the point-to-point link scenario, the open_connect request is always accepted!

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

References ns3::HTTPMessage::CreateResponse(), ns3::QKDLocationRegisterEntry::GetHop(), ns3::HTTPMessage::GetMessageBodyString(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ProcessPacketKMSs()

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

QKD key manager system application process the request peer KMS, and complete certain actions to respond on received request.

Parameters
headerreceived HTTP header
packetreceived packet
socketthe receiving socket

Data structure of key managment respond is described in ETSI004 document.

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

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

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

◆ ProcessRegisterRequest()

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

◆ ProcessRegisterResponse()

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

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

References ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), NS_FATAL_ERROR, NS_LOG_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ProcessRelayRequest()

◆ ProcessRelayResponse()

void ns3::QKDKeyManagerSystemApplication::ProcessRelayResponse ( HTTPMessage  headerIn)
private

◆ ProcessRequest()

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

QKD key manager system application process the request from QKDApp, and complete certain actions to respond on received request.

Parameters
headerreceived HTTP header
packetreceived packet
socketthe receiving socket

Data structure of key managment respond is described in ETSI014 document.


   Southbound interface functions(ETSI 014 & ETSI 004)

Todo:
id1124 What if remote App ID is not known? Respond with an error.

Currently we will go with the following idea:

  • KM with a higher Node ID is selected as a master.
  • Master and slave reformats keys to a default size for THIS connection!
  • Master and slave KM store keys. Keys are marked as READY. Key IDs are: for master: HASH-SHA1(QKD-key ID | QKD module ID | matching QKD module ID | chunk number) for slave: HASH-SHA1(QKD-key ID | matching QKD module ID | QKD module ID | chunk number)

The verfication procedure is not implemented. It should be similar to a Q3P STORE subprotocol.

In my opinion, KM should not transform the QKD-key in different block sizes, but rather choose one, most appropriate. In fact, when provisioning keys, KM would have to rendezvous with peer KM anyway, so the question is really about key transformation operation and memory organization in key storage.

@toDo How to choose this default key size?

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

References ns3::Create(), CreateRelaySBuffer(), ns3::HTTPMessage::CreateResponse(), EMPTY, ETSI_QKD_014_GET_STATUS, FetchRequestType(), GetAddress(), GetAddressString(), GetController(), ns3::Node::GetId(), GetMaxKeyPerRequest(), GetNode(), GetSBuffer(), m_keys_dec, m_keys_enc, m_maxKeySize, m_minKeySize, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::HTTPMessage::Ok, ReadUri(), SBufferClientCheck(), and SendToSocketPair().

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

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

References ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ProcessResponseKMS()

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

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

References ns3::HTTPMessage::GetRequestUri(), NS_FATAL_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ProcessSKeyCreateRequest()

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

process transform request

Parameters
headerreceiving http header
socketreceiving socket

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

References ns3::HTTPMessage::CreateResponse(), ns3::QKDLocationRegisterEntry::GetDestinationKmsAddress(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().

+ Here is the call graph for this function:

◆ ProcessSKeyCreateResponse()

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

process transform response

Parameters
headerreceiving http header
socketreceiving socket

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

References ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), NS_ASSERT, NS_LOG_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ReadJsonQos()

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

Read the parameters from the JSON OPEN_CONNECT structure!

Parameters
&dstSaeIddestination secure application entity
&srcSaeIdsource secure application entity
&inQosrequested QoS
&ksidUnique identifier of the association
jOpenConncetRequestJSON structure of the OPEN_CONNECT call

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

References ns3::QKDKeyManagerSystemApplication::QoS::chunkSize, and NS_ASSERT.

◆ ReadUri()

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

Read parameters from URI.

Parameters
sstring URI
Returns
vector of uri parameters

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

References NS_LOG_FUNCTION.

Referenced by ProcessRequest().

+ Here is the caller graph for this function:

◆ RegisterQKDModule()

void ns3::QKDKeyManagerSystemApplication::RegisterQKDModule ( uint32_t  dstId,
std::string  moduleId 
)

Registers a QKD module in key manager.

Parameters
dstIdremote key manager node ID
moduleIdlocal QKD module ID

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

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

+ Here is the call graph for this function:

◆ RegisterRequest()

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

◆ Relay()

void ns3::QKDKeyManagerSystemApplication::Relay ( uint32_t  dstKmNodeId,
uint32_t  amount 
)
private

Start key relay function.

Parameters
dstKmNodeIddestination KM node
amountamount of key material

Chain of responsibility pattern. HTTP chain of proxies!

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

References CheckSocketsKMS(), ns3::Create(), ns3::HTTPMessage::CreateRequest(), GenerateUUID(), GetAddressString(), GetController(), GetId(), ns3::Node::GetId(), GetNode(), GetPeerKmAddress(), GetSendSocketKMS(), HttpProxyRequestAdd(), ns3::QKDKey::INIT, m_keyConsumedRelay, m_keys_enc, NS_ASSERT, NS_LOG_FUNCTION, RELAY_KEYS, ns3::QKDKeyManagerSystemApplication::HttpQuery::req_id, SBufferClientCheck(), and ns3::HTTPMessage::ToString().

Referenced by SBufferClientCheck().

+ 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 key stream association

Parameters
ksidunique key stream identifier
surplusKeyIdunique key identifier for surplus key material in dedicated association buffer
syncIndexunique key index in dedicated association buffer for synchronisation

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

References NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ScheduleReleaseAssociation().

+ Here is the caller graph for this function:

◆ RemoveProxyQuery()

void ns3::QKDKeyManagerSystemApplication::RemoveProxyQuery ( std::string  reqId)
private

Remove proxy query when processed.

Parameters
reqIdrequest identifier

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

References NS_FATAL_ERROR, and NS_LOG_FUNCTION.

◆ SBufferClientCheck()

void ns3::QKDKeyManagerSystemApplication::SBufferClientCheck ( uint32_t  dstKmNodeId)
private

check s-buffer levels

Parameters
dstKmNodeIdremote KM node ID

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

References ns3::Create(), Fill(), GetController(), GetQBuffer(), GetSBuffer(), ns3::SBuffer::LOCAL_SBUFFER, m_keys_dec, m_keys_enc, NS_ASSERT, NS_LOG_FUNCTION, Relay(), ns3::SBuffer::RELAY_SBUFFER, and UpdateLinkState().

Referenced by ProcessRequest(), Relay(), and StartSBufferClients().

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

◆ ScheduleCheckEtsi004Association()

void ns3::QKDKeyManagerSystemApplication::ScheduleCheckEtsi004Association ( Time  t,
std::string  action,
std::string  ksid 
)
private

schedule next event in an attempt to fill association buffer

Parameters
ttime shift
actionname of the action
ksidunique identifier of the association
Returns
uint32_t schedule event ID

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

References CheckEtsi004Association(), ns3::Create(), m_scheduledChecks, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ ScheduleReleaseAssociation()

void ns3::QKDKeyManagerSystemApplication::ScheduleReleaseAssociation ( Time  t,
std::string  action,
std::string  ksid,
std::string  surplusKeyId,
uint32_t  syncIndex 
)
private

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

References ns3::Create(), m_scheduledChecks, NS_FATAL_ERROR, NS_LOG_FUNCTION, ReleaseAssociation(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ SendToSocketPair()

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

Send packet to the pair socket.

Parameters
socketreceiving socket
packetpacket to send

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

References ns3::Create(), m_packetQueues, m_txTrace, and NS_LOG_FUNCTION.

Referenced by 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 packet to the pair socket.

Parameters
socketreceiving socket
packetpacket to send

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

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

+ Here is the call graph for this function:

◆ SetAddress()

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

Set local address.

Parameters
Ipv4Addressaddress

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

References m_local.

◆ SetCenController()

void ns3::QKDKeyManagerSystemApplication::SetCenController ( Ptr< QCenController controller)

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

References m_cen_controller, and NS_LOG_FUNCTION.

◆ SetController()

void ns3::QKDKeyManagerSystemApplication::SetController ( Ptr< QKDControl controller)

Assign QKDN controller.

Parameters
controllerpointer on QKDN controller

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

References GetController(), GetNode(), m_controller, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetId() [1/2]

void ns3::QKDKeyManagerSystemApplication::SetId ( std::string  id)
inline

Set key manager ID.

Parameters
idstring ID

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

References m_km_id.

◆ SetId() [2/2]

void ns3::QKDKeyManagerSystemApplication::SetId ( UUID  id)
inline

Set key manager ID.

Parameters
idUUID ID

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

References m_km_id.

Referenced by ns3::QKDAppHelper::InstallKeyManager(), and ns3::QKDAppHelper::InstallKeyManager().

+ Here is the caller graph for this function:

◆ SetNode()

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

Set node.

Parameters
nnode to be set

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

References m_node.

◆ SetPeerKmAddress()

void ns3::QKDKeyManagerSystemApplication::SetPeerKmAddress ( uint32_t  dstKmNodeId,
Ipv4Address  dstKmAddress 
)

Set peer KM node address.

Parameters
dstKmNodeIdpeer KM node ID
dstKmAddresspeer KM address

It is called from qkd-control to register peer KM address.

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

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

+ Here is the call graph for this function:

◆ SetPort()

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

Set local port.

Parameters
uint32_tport

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

References m_port, and port.

◆ SetSocket()

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

Set sink socket.

Parameters
typesocket type
socketpointer to socket to be set

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

References m_sinkSocket, and NS_LOG_FUNCTION.

◆ StartApplication()

void ns3::QKDKeyManagerSystemApplication::StartApplication ( )
overrideprivatevirtual

Start KMS Application.


   APPLICATION functions

Reimplemented from ns3::Application.

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

References NS_LOG_FUNCTION, and PrepareSinkSocket().

+ Here is the call graph for this function:

◆ StartSBufferClients()

void ns3::QKDKeyManagerSystemApplication::StartSBufferClients ( uint32_t  dstKmNodeId)
private

Start s-buffers control – monitoring.

Parameters
dstKmNodeIdremote KM node ID

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

References ns3::Create(), GetId(), GetNode(), GetQBuffer(), ns3::SBuffer::LOCAL_SBUFFER, m_keys_dec, m_keys_enc, NS_LOG_FUNCTION, and SBufferClientCheck().

Referenced by CreateQBuffer().

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

◆ StopApplication()

void ns3::QKDKeyManagerSystemApplication::StopApplication ( )
overrideprivatevirtual

Stop KMS Application.

Reimplemented from ns3::Application.

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

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

+ Here is the call graph for this function:

◆ UpdateLinkState()

void ns3::QKDKeyManagerSystemApplication::UpdateLinkState ( uint32_t  dstKmNodeId)

Check the QKD link state to given destination.

Parameters
dstKmNodeIdThe destination KM node identifier.
Note
Is used for centralized routing, to enable re-routing.

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

References ns3::Create(), GetCenController(), GetId(), ns3::Node::GetId(), GetNode(), GetQBuffer(), GetSBuffer(), m_link_states, ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by Fill(), and SBufferClientCheck().

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

Member Data Documentation

◆ m_associations004

std::map<std::string, Association004> ns3::QKDKeyManagerSystemApplication::m_associations004
private

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

Referenced by Fill().

◆ m_buffer

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

Buffer for received packets(TCP segmentation)

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

Referenced by PacketReceived().

◆ m_bufferKMS

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

Buffer for received packets(TCP segmentation)

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

Referenced by PacketReceivedKMSs().

◆ m_cen_controller

Ptr<QCenController> ns3::QKDKeyManagerSystemApplication::m_cen_controller
private

Asigned Q centralized controler for routing!

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

Referenced by GetCenController(), and SetCenController().

◆ m_closeSocketEvent

EventId ns3::QKDKeyManagerSystemApplication::m_closeSocketEvent
private

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

◆ m_controller

Ptr<QKDControl> ns3::QKDKeyManagerSystemApplication::m_controller
private

Asigned QKDN controller.

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

Referenced by GetController(), and SetController().

◆ m_encryptor

Ptr<QKDEncryptor> ns3::QKDKeyManagerSystemApplication::m_encryptor
private

◆ m_http004App

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

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

◆ m_httpProxyRequests

std::unordered_map<std::string, HttpQuery> ns3::QKDKeyManagerSystemApplication::m_httpProxyRequests
private

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

◆ m_httpRequestsQueryKMS

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

Each application can open only one connection with its local KMS(current socket). Each KMS can have only one connection with arbitrary KMS(current socket).

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

◆ m_keyConsumedLink

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

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

Referenced by GetTypeId().

◆ m_keyConsumedRelay

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

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

Referenced by GetTypeId(), and Relay().

◆ m_keys_dec

std::map<uint32_t, Ptr<SBuffer> > ns3::QKDKeyManagerSystemApplication::m_keys_dec
private

LOCAL S-buffers for the inbound point-to-poit usage.

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

Referenced by CreateQBuffer(), GetSBuffer(), ProcessRequest(), SBufferClientCheck(), and StartSBufferClients().

◆ m_keys_enc

std::map<uint32_t, Ptr<SBuffer> > ns3::QKDKeyManagerSystemApplication::m_keys_enc
private

LOCAL S-buffers for the outbound point-to-point usage.

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

Referenced by CreateQBuffer(), GetSBuffer(), ProcessRequest(), Relay(), SBufferClientCheck(), and StartSBufferClients().

◆ m_keyServedTrace

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

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

Referenced by GetTypeId().

◆ m_keyWasteRelay

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

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

Referenced by GetTypeId().

◆ m_km_id

std::string ns3::QKDKeyManagerSystemApplication::m_km_id
private

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

Referenced by GetId(), SetId(), and SetId().

◆ m_kms_id

uint32_t ns3::QKDKeyManagerSystemApplication::m_kms_id
private

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

◆ m_kms_key_id

uint32_t ns3::QKDKeyManagerSystemApplication::m_kms_key_id
private

◆ m_link_states

std::map<uint32_t, uint32_t> ns3::QKDKeyManagerSystemApplication::m_link_states
private

Notified link states!

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

Referenced by CreateQBuffer(), and UpdateLinkState().

◆ m_local

Ipv4Address ns3::QKDKeyManagerSystemApplication::m_local
private

Local address to bind to.

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

Referenced by GetAddress(), GetTypeId(), and SetAddress().

◆ m_maxKeyPerRequest

uint32_t ns3::QKDKeyManagerSystemApplication::m_maxKeyPerRequest
private

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

Referenced by GetTypeId().

◆ m_maxKeySize

uint32_t ns3::QKDKeyManagerSystemApplication::m_maxKeySize
private

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

Referenced by GetTypeId(), and ProcessRequest().

◆ m_maxSBufferSizeInBits

uint32_t ns3::QKDKeyManagerSystemApplication::m_maxSBufferSizeInBits
private

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

◆ m_minKeySize

uint32_t ns3::QKDKeyManagerSystemApplication::m_minKeySize
private

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

Referenced by GetTypeId(), and ProcessRequest().

◆ m_minSBufferSizeInBits

uint32_t ns3::QKDKeyManagerSystemApplication::m_minSBufferSizeInBits
private

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

◆ m_node

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

Definition at line 732 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 connection problems.

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

Referenced by ConnectionSucceeded(), and SendToSocketPair().

◆ m_peerAddressTable

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

IP address of peer KM nodes.

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

Referenced by GetPeerKmAddress(), and SetPeerKmAddress().

◆ m_port

uint32_t ns3::QKDKeyManagerSystemApplication::m_port
private

Local port to bind to.

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

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

◆ m_qbuffers

std::map<uint32_t, Ptr<QBuffer> > ns3::QKDKeyManagerSystemApplication::m_qbuffers
private

Q-buffers for every QKD connection.

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

Referenced by CreateQBuffer(), and GetQBuffer().

◆ m_qbuffersVector

std::vector<Ptr<QBuffer> > ns3::QKDKeyManagerSystemApplication::m_qbuffersVector
private

The list of QBuffers is necessary for plotting.

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

Referenced by CreateQBuffer(), GetQBuffersVector(), and GetTypeId().

◆ m_qkdKeyGeneratedTrace

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

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

Referenced by GetTypeId().

◆ m_qkdmodules

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

QKD modules and KM node ID they connect to.

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

Referenced by RegisterQKDModule().

◆ m_queueLogic

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

KMS Queue Logic for ETSI 004 QoS handling.

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

Referenced by QKDKeyManagerSystemApplication().

◆ m_rxTrace

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

Traced Callback: received packets, source address.

Definition at line 707 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

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

Referenced by GetTypeId(), and HandleReadKMSs().

◆ m_scheduledChecks

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

◆ m_sinkSocket

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

◆ m_socketPairsKMS

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

we do not know which KMS is going to initialize new TCP connection to peer KMS.

Therefore, we have two sockets(sink and send) per node.

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

Referenced by CheckSocketsKMS(), DoDispose(), GetSendSocketKMS(), HandleAcceptKMSs(), and SendToSocketPairKMS().

◆ m_thrSBufferSizeInBits

uint32_t ns3::QKDKeyManagerSystemApplication::m_thrSBufferSizeInBits
private

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

◆ m_tid

TypeId ns3::QKDKeyManagerSystemApplication::m_tid
private

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

Referenced by GetTypeId(), and PrepareSinkSocket().

◆ m_totalRx

uint32_t ns3::QKDKeyManagerSystemApplication::m_totalRx
private

Total bytes received.

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

Referenced by QKDKeyManagerSystemApplication(), GetTotalRx(), HandleRead(), and HandleReadKMSs().

◆ m_totalRxKMSs

uint32_t ns3::QKDKeyManagerSystemApplication::m_totalRxKMSs
private

Total bytes received between KMSs.

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

Referenced by HandleReadKMSs().

◆ m_txTrace

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

◆ m_txTraceKMSs

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

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

Referenced by GetTypeId().

◆ nKMS

uint32_t ns3::QKDKeyManagerSystemApplication::nKMS
staticprivate

number of created KMSs - static value

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


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