#include "qkd-key-manager-system-application.h"
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< Node > | GetNode () |
Get the node. More... | |
uint32_t | GetPort () |
Get the local port. More... | |
Ptr< Socket > | GetSocket (void) const |
Get the sink socket. More... | |
uint32_t | GetTotalRx () const |
Get the total amount of received bytes. More... | |
QKDApplicationEntry | RegisterApplicationEntry (UUID keyAssociationId, UUID applicationEntryId, UUID srcSaeId, UUID dstSaeId, std::string type, Ipv4Address dstKmsAddress, uint32_t priority, double expirationTime) |
Register a new pair of QKD applications. More... | |
QKDApplicationEntry | RegisterApplicationEntry (UUID srcSaeId, UUID dstSaeId, std::string type, Ipv4Address dstKmsAddress, uint32_t priority, double expirationTime) |
Register a new pair of QKD applications. More... | |
void | SaveKeyAssociation (QKDKeyAssociationLinkEntry &rt) |
Add the key association. More... | |
void | SendQKDLinkStatusToSDN (UUID linkId, double updatePeriod) |
Send the QKD link statistics to the SDN controller. More... | |
void | SetAddress (Ipv4Address address) |
Set the local IP address. More... | |
void | SetNode (Ptr< Node > n) |
Set the node. More... | |
void | SetPort (uint32_t port) |
Set the local port. More... | |
void | SetSDNControllerAddress (Address sdnAddress) |
Set the SDN controller address. More... | |
void | SetSocket (std::string type, Ptr< Socket > socket) |
Set the sink socket. More... | |
Public Member Functions inherited from ns3::Application | |
Application () | |
~Application () override | |
Ptr< Node > | GetNode () const |
void | SetNode (Ptr< Node > node) |
void | SetStartTime (Time start) |
Specify application start time. More... | |
void | SetStopTime (Time stop) |
Specify application stop time. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () 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< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Application | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
Protected Member Functions inherited from ns3::Application | |
void | DoDispose () override |
Destructor implementation. More... | |
void | DoInitialize () override |
Initialize() implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
void | AddKeyToAssociationDedicatedStore (std::string ksid, Ptr< QKDKey > key) |
Add the key to the key stream session buffer. More... | |
std::string | Base64Decode (std::string input) |
Base64 decoder. More... | |
std::string | Base64Encode (std::string input) |
Base64 encoder. More... | |
nlohmann::json | Check014GetKeyRequest (nlohmann::json request, QKDKeyAssociationLinkEntry conn) |
Validate the request and probe if the KMS can meet the request requirements. More... | |
void | CheckAssociation (std::string ksid) |
Check the state of a single key stream session. More... | |
bool | CheckDoSAttack (HTTPMessage headerIn, Ptr< Socket > socket) |
Check for the DoS attack. More... | |
void | CheckSessionList (std::string ksid) |
Check whether a new OPEN_CONNECT was received before the previously established session expired. More... | |
void | CheckSocketsKMS (Ipv4Address dstSaeId) |
Prepare the send socket to communicate with the peer KMS. More... | |
void | ConnectionFailed (Ptr< Socket > socket) |
Callback function after the connection to the APP has failed. More... | |
void | ConnectionFailedKMSs (Ptr< Socket > socket) |
Callback function after the connection to the peer KMS has failed. More... | |
void | ConnectionSucceeded (Ptr< Socket > socket) |
Callback function after the connection to the APP is complete. More... | |
void | ConnectionSucceededKMSs (Ptr< Socket > socket) |
Callback function after the connection to the peer KMS is complete. More... | |
void | ConnectionToSDNFailed (Ptr< Socket > socket) |
Callback function after the connection to the SDN controller has failed. More... | |
void | ConnectionToSDNSucceeded (Ptr< Socket > socket) |
Callback function after the connection to the SDN controller is complete. More... | |
nlohmann::json | CreateKeyContainer (std::vector< Ptr< QKDKey >> keys) |
Create the key container data structure. More... | |
void | CreateNew004Association (std::string srcSaeId, std::string dstSaeId, QKDKeyManagerSystemApplication::QoS &inQos, Ipv4Address dstKms, std::string &ksid, std::string appConnectionId) |
Create a new key stream session. More... | |
void | DataSend (Ptr< Socket >, uint32_t) |
Callback function for the data sent. More... | |
void | DataSendKMSs (Ptr< Socket >, uint32_t) |
Callback function for the data sent to the peer KMS. More... | |
void | DataToSDNSend (Ptr< Socket >, uint32_t) |
Callback function for the data sent to the SDN controller. More... | |
QKDKeyManagerSystemApplication::RequestType | FetchRequestType (std::string s) |
Read the request method from the request URI. More... | |
std::string | GenerateKeyId () |
Generate unique key identifier. More... | |
std::string | GenerateKsid () |
Generate a new key stream session identifier (ksid). More... | |
QKDApplicationEntry | GetApplicationConnectionDetails (std::string saeId) |
Get the application connection details. More... | |
QKDApplicationEntry | GetApplicationConnectionDetailsBySaeIDsAndType (std::string srcSaeId, std::string dstSaeId, QKDApplicationEntry::ConnectionType type) |
Get the application connection details. More... | |
Ipv4Address | GetDestinationKmsAddress (Ptr< Socket > socket) |
Get the destiantion KMS IP address based on the connected socket. More... | |
QKDKeyAssociationLinkEntry | GetKeyAssociationById (UUID keyAssociationId) |
Get the key association link details. More... | |
QKDKeyAssociationLinkEntry | GetKeyAssociationByNodeIds (uint32_t srcNodeId, uint32_t dstNodeId) |
Get the key association link details. More... | |
QKDKeyAssociationLinkEntry | GetKeyAssociationLinkDetailsByApplicationId (std::string appId) |
Get the key association link details. More... | |
Ptr< Socket > | GetSendSocketKMS (Ipv4Address kmsDstAddress) |
Obtain the send socket. More... | |
Ptr< Socket > | GetSocketFromHttp004AppQuery (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, Association004 > | m_associations004 |
The list of active key stream sessions. More... | |
std::unordered_map< uint64_t, Ptr< Packet >, AddressHash > | m_buffer |
The buffer for the received packets from the applications (TCP segmentation). More... | |
std::unordered_map< Address, Ptr< Packet >, AddressHash > | m_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< Node > | m_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< QKDKMSQueueLogic > | m_queueLogic |
The KMS Queue Logic for the ETSI 004 QoS handling. More... | |
Ptr< UniformRandomVariable > | m_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, EventId > | m_scheduledChecks |
The scheduled events. More... | |
Address | m_sdnControllerAddress |
The SDN controller address. More... | |
uint32_t | m_sdnSupportEnabled |
The support for the SDN. More... | |
Ptr< Socket > | m_sendSocketToSDN |
The send socket to the SDN controller. More... | |
std::map< std::string, uint32_t > | m_sessionList |
A list of sessions. More... | |
Ptr< Socket > | m_sinkSocket |
The sink socket. More... | |
Ptr< Socket > | m_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< Node > | m_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... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Definition at line 78 of file qkd-key-manager-system-application.h.
Request methods.
Definition at line 85 of file qkd-key-manager-system-application.h.
ns3::QKDKeyManagerSystemApplication::QKDKeyManagerSystemApplication | ( | ) |
Constructor.
Definition at line 153 of file qkd-key-manager-system-application.cc.
References connectedToSDN, m_kms_id, m_kms_key_id, m_queueLogic, m_random, m_sdnSupportEnabled, m_totalRx, nKMS, and NS_LOG_FUNCTION.
|
virtual |
Destructor.
Definition at line 167 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
|
private |
Add the key to the key stream session buffer.
ksid | The key stream identifier. |
key | The key. |
Definition at line 4124 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyManagerSystemApplication::ChunkKey::chunkSize, ns3::QKDKeyManagerSystemApplication::ChunkKey::index, ns3::QKDKeyManagerSystemApplication::ChunkKey::key, m_associations004, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::QKDKeyManagerSystemApplication::ChunkKey::ready.
Referenced by ProcessAddKeysRequest(), and ProcessAddKeysResponse().
bool ns3::QKDKeyManagerSystemApplication::AddNewKey | ( | Ptr< QKDKey > | key, |
uint32_t | srcNodeId, | ||
uint32_t | dstNodeId | ||
) |
Add new keys to the QKD buffer.
key | The QKD key. |
srcNodeId | The source node identifier. |
dstNodeId | The destination node identifier. |
Definition at line 3891 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyAssociationLinkEntry::GetEffectiveSKR(), ns3::QKDKeyAssociationLinkEntry::GetExpectedConsumption(), ns3::QKDKeyAssociationLinkEntry::GetId(), GetKeyAssociationByNodeIds(), ns3::QKDKeyAssociationLinkEntry::GetSKR(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), NS_FATAL_ERROR, NS_LOG_FUNCTION, SaveKeyAssociation(), ns3::QKDKeyAssociationLinkEntry::SetEffectiveSKR(), ns3::QKDKeyAssociationLinkEntry::SetExpectedConsumption(), and ns3::QKDKeyAssociationLinkEntry::SetSKR().
Referenced by ProcessRequest().
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.
srcSaeId | The source application identifier. |
dstSaeId | The destination application identifier. |
kmsDstAddress | The destination KMS address. |
srcQKDBuffer | The QKD key buffer. |
Definition at line 3347 of file qkd-key-manager-system-application.cc.
std::string ns3::QKDKeyManagerSystemApplication::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.
srcSaeId | The source application identifier. |
dstSaeId | The destination application identifier. |
kmsDstAddress | The destination KMS address. |
srcQKDBuffer | The QKD key buffer. |
keyAssociationId | The key association identifier. |
Definition at line 3366 of file qkd-key-manager-system-application.cc.
References ns3::Socket::Bind(), connectedToSDN, ns3::InetSocketAddress::ConvertFrom(), ns3::HTTPMessage::CreateRequest(), ns3::Socket::CreateSocket(), ns3::QKDKeyAssociationLinkEntry::GetId(), ns3::InetSocketAddress::GetIpv4(), GetNode(), ns3::Object::GetObject(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), HandleAcceptKMSs(), HandlePeerCloseKMSs(), HandlePeerErrorKMSs(), HandleReadKMSs(), ns3::Socket::Listen(), m_local, m_packetQueuesToSDN, m_sdnControllerAddress, m_sdnSupportEnabled, m_sendSocketToSDN, m_socketPairsKMS, m_tid, ns3::MakeCallback(), ns3::MakeNullCallback(), NS_ASSERT, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), ns3::Socket::Send(), ns3::Socket::SetAcceptCallback(), ns3::Socket::SetCloseCallbacks(), ns3::Socket::SetRecvCallback(), ns3::Socket::ShutdownSend(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().
|
private |
Base64 decoder.
input | The input data. |
Definition at line 4235 of file qkd-key-manager-system-application.cc.
|
private |
Base64 encoder.
input | The input data. |
Definition at line 4223 of file qkd-key-manager-system-application.cc.
Referenced by CreateKeyContainer().
|
private |
Validate the request and probe if the KMS can meet the request requirements.
request | The JSON payload of the ETSI 014 GET_KEY request. |
conn | The connection details. |
Definition at line 3812 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyAssociationLinkEntry::GetId(), GetMaxKeyPerRequest(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), m_defaultKeySize, m_maxKeySize, m_minKeySize, NS_LOG_FUNCTION, and nlohmann::to_string().
Referenced by ProcessRequest().
|
private |
Check the state of a single key stream session.
ksid | The key stream identifier. |
Definition at line 3980 of file qkd-key-manager-system-application.cc.
References m_associations004, NegotiateKeysForAssociation(), NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ProcessAddKeysResponse(), ProcessGetKey004Request(), ProcessRegisterRequest(), and ScheduleCheckAssociation().
|
private |
Check for the DoS attack.
header | The received HTTP message. |
socket | The receiving socket. |
ETSI004 APP-KMS functions
Definition at line 1719 of file qkd-key-manager-system-application.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::Socket::GetPeerName(), m_flagedIPAdr, m_maliciousBlocking, and NS_LOG_FUNCTION.
Referenced by ProcessGetKey004Request(), and ProcessOpenConnectRequest().
|
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.
ksid | The 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
std::string | KSID |
Definition at line 1753 of file qkd-key-manager-system-application.cc.
References m_associations004, m_sessionList, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ProcessOpenConnectRequest().
|
private |
Prepare the send socket to communicate with the peer KMS.
dstSaeId | The destination KMS IP address. |
Definition at line 472 of file qkd-key-manager-system-application.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), ConnectionFailedKMSs(), ConnectionSucceededKMSs(), ns3::Socket::CreateSocket(), DataSendKMSs(), GetNode(), ns3::Socket::GetSocketType(), ns3::TcpSocketFactory::GetTypeId(), ns3::UdpSocketFactory::GetTypeId(), m_local, m_socketPairsKMS, ns3::MakeCallback(), ns3::Socket::NS3_SOCK_SEQPACKET, ns3::Socket::NS3_SOCK_STREAM, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), and ns3::Socket::ShutdownRecv().
Referenced by HandleAcceptKMSs(), NegotiateKeysForAssociation(), NewAppRequest(), ProcessCloseRequest(), RegisterRequest(), and TransformKeys().
Callback function after the connection to the APP has failed.
socket | The connected socket. |
Definition at line 331 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by HandleAccept().
Callback function after the connection to the peer KMS has failed.
socket | The connected socket. |
Definition at line 338 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by CheckSocketsKMS().
Callback function after the connection to the APP is complete.
socket | The 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().
Callback function after the connection to the peer KMS is complete.
socket | The connected socket. |
Definition at line 324 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by CheckSocketsKMS().
Callback function after the connection to the SDN controller has failed.
socket | The connected socket. |
Definition at line 380 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by ConnectToSDNController().
Callback function after the connection to the SDN controller is complete.
socket | The 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().
void ns3::QKDKeyManagerSystemApplication::ConnectToSDNController | ( | ) |
Connect to the SDN controller.
Definition at line 900 of file qkd-key-manager-system-application.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), ConnectionToSDNFailed(), ConnectionToSDNSucceeded(), ns3::InetSocketAddress::ConvertFrom(), ns3::Socket::CreateSocket(), DataToSDNSend(), ns3::Ipv4Address::GetAny(), ns3::InetSocketAddress::GetIpv4(), GetNode(), GetPort(), ns3::InetSocketAddress::GetPort(), ns3::TcpSocketFactory::GetTypeId(), HandleAcceptSDN(), HandlePeerCloseSDN(), HandlePeerErrorSDN(), HandleReadSDN(), ns3::Address::IsInvalid(), ns3::Socket::Listen(), m_local, m_sdnControllerAddress, m_sendSocketToSDN, m_sinkSocket, m_sinkSocketFromSDN, m_tid, ns3::MakeCallback(), ns3::MakeNullCallback(), NS_LOG_FUNCTION, ns3::Socket::SetAcceptCallback(), ns3::Socket::SetCloseCallbacks(), ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), ns3::Socket::SetRecvCallback(), ns3::Socket::ShutdownRecv(), and ns3::Socket::ShutdownSend().
Referenced by StartApplication().
|
private |
Create the key container data structure.
keys | The vector QKD keys to supply. |
Definition at line 3944 of file qkd-key-manager-system-application.cc.
References Base64Encode(), GetId(), and NS_LOG_FUNCTION.
Referenced by ProcessRequest().
|
private |
Create a new key stream session.
srcSaeId | The source application identifier |
dstSaeId | The destination application identifier. |
inQos | The Quality of Service details. |
dstKms | The destination KMS IP address. |
ksid | The key stream identifier. |
Input ksid can be empty if it is not predefined. In that case a new ksid is generated for this new association and returned from the function.
Definition at line 4287 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyManagerSystemApplication::Association004::associationDirection, ns3::QKDKeyManagerSystemApplication::Association004::dstKmsNode, ns3::QKDKeyManagerSystemApplication::Association004::dstSaeId, ns3::Time::GetSeconds(), ns3::QKDKeyManagerSystemApplication::Association004::ksid, ns3::QKDKeyManagerSystemApplication::Association004::lastIndex, m_associations004, m_local, m_sessionList, ns3::Simulator::Now(), NS_LOG_FUNCTION, ns3::QKDKeyManagerSystemApplication::Association004::peerRegistered, ns3::QKDKeyManagerSystemApplication::Association004::qos, ns3::QKDKeyManagerSystemApplication::Association004::srcSaeId, and ns3::QKDKeyManagerSystemApplication::QoS::TTL.
Referenced by ProcessNewAppRequest(), and ProcessOpenConnectRequest().
Callback function for the data sent.
The | connected socket. |
The | amount of data sent. |
Definition at line 345 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by HandleAccept().
Callback function for the data sent to the peer KMS.
The | connected socket. |
The | amount of data sent. |
Definition at line 351 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by CheckSocketsKMS().
Callback function for the data sent to the SDN controller.
The | connected socket. |
The | amount of data sent. |
Definition at line 387 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by ConnectToSDNController().
|
protectedvirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 216 of file qkd-key-manager-system-application.cc.
References ns3::Application::DoDispose(), m_sinkSocket, m_socketPairs, and NS_LOG_FUNCTION.
|
private |
Read the request method from the request URI.
s | The HTTP request URI. |
Definition at line 3283 of file qkd-key-manager-system-application.cc.
References ETSI_QKD_004_CLOSE, ETSI_QKD_004_GET_KEY, ETSI_QKD_004_KMS_CLOSE, ETSI_QKD_004_OPEN_CONNECT, ETSI_QKD_014_GET_KEY, ETSI_QKD_014_GET_KEY_WITH_KEY_IDS, ETSI_QKD_014_GET_STATUS, FILL, NEW_APP, NONE, NS_FATAL_ERROR, NS_LOG_FUNCTION, REGISTER, STORE_PP_KEYS, and TRANSFORM_KEYS.
Referenced by ProcessRequest(), and ProcessRequestKMS().
|
private |
Generate unique key identifier.
Definition at line 4530 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION, ns3::UUID::Random(), and ns3::UUID::string().
Referenced by ProcessCloseRequest(), and TransformKeys().
|
private |
Generate a new key stream session identifier (ksid).
KMS 004 Association operations, monitoring
Definition at line 3968 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION, ns3::UUID::Random(), and ns3::UUID::string().
std::map< Ptr< Socket >, Ptr< Socket > > ns3::QKDKeyManagerSystemApplication::GetAcceptedSockets | ( | void | ) | const |
Get the list of all the accepted sockets.
Definition at line 185 of file qkd-key-manager-system-application.cc.
References m_socketPairs, and NS_LOG_FUNCTION.
|
inline |
Get the local IP address.
Definition at line 267 of file qkd-key-manager-system-application.h.
References m_local.
Referenced by ProcessRequest().
|
private |
Get the application connection details.
saeId | The application identifier. |
Definition at line 3713 of file qkd-key-manager-system-application.cc.
References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by NegotiateKeysForAssociation(), ProcessAddKeysRequest(), ProcessAddKeysResponse(), ProcessCloseRequest(), ProcessGetKey004Request(), ProcessNewAppRequest(), ProcessNewAppResponse(), ProcessRequest(), ProcessTransformRequest(), ProcessTransformResponse(), ReleaseAssociation(), and TransformKeys().
|
private |
Get the application connection details.
srcSaeId | The source application identifier. |
dstSaeId | The destination application identifier. |
type | The connection type. |
Definition at line 3686 of file qkd-key-manager-system-application.cc.
References ns3::QKDApplicationEntry::GetId(), GetNode(), ns3::Object::GetObject(), NS_ASSERT, NS_LOG_FUNCTION, and check-style-clang-format::type.
Referenced by ProcessOpenConnectRequest().
|
private |
Get the destiantion KMS IP address based on the connected socket.
socket | The connected socket. |
Definition at line 3260 of file qkd-key-manager-system-application.cc.
References m_socketPairsKMS, and NS_LOG_FUNCTION.
Referenced by ProcessAddKeysResponse(), ProcessKMSCloseResponse(), ProcessNewAppResponse(), ProcessRegisterResponse(), ProcessResponseKMS(), and ProcessTransformResponse().
uint32_t ns3::QKDKeyManagerSystemApplication::GetId | ( | void | ) |
Get the KMS identifier.
Definition at line 173 of file qkd-key-manager-system-application.cc.
References m_kms_id.
Referenced by CreateKeyContainer().
|
private |
Get the key association link details.
keyAssociationId | The key association identifier. |
Definition at line 3767 of file qkd-key-manager-system-application.cc.
References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ProcessResponseSDN(), RegisterApplicationEntry(), and SendQKDLinkStatusToSDN().
|
private |
Get the key association link details.
srcNodeId | The source node identifier. |
dstNodeId | The destination node identifier. |
Definition at line 3751 of file qkd-key-manager-system-application.cc.
References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by AddNewKey().
|
private |
Get the key association link details.
appId | The application identifier. |
Definition at line 3733 of file qkd-key-manager-system-application.cc.
References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by NegotiateKeysForAssociation(), ProcessAddKeysRequest(), ProcessAddKeysResponse(), ProcessCloseRequest(), ProcessGetKey004Request(), ProcessNewAppResponse(), ProcessOpenConnectRequest(), ProcessRequest(), ProcessTransformRequest(), ProcessTransformResponse(), ReleaseAssociation(), and TransformKeys().
uint32_t ns3::QKDKeyManagerSystemApplication::GetMaxKeyPerRequest | ( | ) |
Get maximum number of keys that can be supplied via a single response (ETSI QKD 014).
Definition at line 3278 of file qkd-key-manager-system-application.cc.
References m_maxKeyPerRequest.
Referenced by Check014GetKeyRequest(), and ProcessRequest().
Get the node.
Definition at line 3795 of file qkd-key-manager-system-application.cc.
References m_node.
Referenced by AddNewLink(), CheckSocketsKMS(), ConnectToSDNController(), GetApplicationConnectionDetails(), GetApplicationConnectionDetailsBySaeIDsAndType(), GetKeyAssociationById(), GetKeyAssociationByNodeIds(), GetKeyAssociationLinkDetailsByApplicationId(), HandleAccept(), PrepareSinkSocket(), ProcessRequest(), RegisterApplicationEntry(), and SaveKeyAssociation().
|
inline |
Get the local port.
Definition at line 283 of file qkd-key-manager-system-application.h.
References m_port.
Referenced by ConnectToSDNController(), HandleAccept(), HandleAcceptKMSs(), and HandleAcceptSDN().
|
private |
Obtain the send socket.
kmsDstAddress | The destination KMS IP address. |
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().
Get the sink socket.
SOCKET functions
Definition at line 202 of file qkd-key-manager-system-application.cc.
References m_sinkSocket, and NS_LOG_FUNCTION.
|
private |
Lookup the HTTP request and obtain connected socket.
saeId | The application identifier. |
Definition at line 3244 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by ProcessNewAppResponse().
uint32_t ns3::QKDKeyManagerSystemApplication::GetTotalRx | ( | ) | const |
Get the total amount of received bytes.
Definition at line 178 of file qkd-key-manager-system-application.cc.
References m_totalRx, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 49 of file qkd-key-manager-system-application.cc.
References ns3::TcpSocketFactory::GetTypeId(), m_default_ttl, m_defaultKeySize, m_dropTrace, m_keyServedETSI004Trace, m_keyServedETSI014Trace, m_keyServedTraceEmir, m_local, m_maliciousBlocking, m_maxKeyPerRequest, m_maxKeyRate, m_maxKeySize, m_minKeyRate, m_minKeySize, m_newKeyGeneratedTrace, m_newKeyGeneratedTraceEmir, m_providedQoS, m_qos_maxrate_threshold, m_rxTrace, m_rxTraceKMSs, m_tid, m_txTrace, m_txTraceKMSs, ns3::MakeDoubleAccessor(), ns3::MakeTraceSourceAccessor(), ns3::MakeTypeIdAccessor(), ns3::MakeTypeIdChecker(), ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().
|
private |
Handle an incoming connection from the application.
s | The incoming connection socket. |
from | The address the connection is from. |
Definition at line 225 of file qkd-key-manager-system-application.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), ConnectionFailed(), ConnectionSucceeded(), ns3::InetSocketAddress::ConvertFrom(), ns3::Socket::CreateSocket(), DataSend(), GetNode(), GetPort(), ns3::Socket::GetSocketType(), ns3::TcpSocketFactory::GetTypeId(), ns3::UdpSocketFactory::GetTypeId(), HandleRead(), m_socketPairs, ns3::MakeCallback(), ns3::Socket::NS3_SOCK_SEQPACKET, ns3::Socket::NS3_SOCK_STREAM, NS_LOG_FUNCTION, ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), ns3::Socket::SetRecvCallback(), and ns3::Socket::ShutdownRecv().
Referenced by PrepareSinkSocket().
|
private |
Handle an incoming connection from the KMS.
s | The incoming connection socket. |
from | The 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().
|
private |
Handle an incoming connection from the SDN.
s | The incoming connection socket. |
from | The 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().
Handle an connection close from the application.
socket | The connected socket. |
Definition at line 393 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSinkSocket().
Handle a connection close from the KMS.
socket | The connected socket. |
Definition at line 399 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by AddNewLink().
Handle a connection close from the SDN.
socket | The connected socket. |
Definition at line 405 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by ConnectToSDNController().
Handle a connection error from the application.
socket | The connected socket. |
Definition at line 411 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSinkSocket().
Handle a connection error from the KMS.
socket | The connected socket. |
Definition at line 417 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by AddNewLink().
Handle a connection error from the SDN.
socket | The connected socket. |
Definition at line 423 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by ConnectToSDNController().
Handle a packet received from the application.
socket | The 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().
Handle a packet received from the KMS.
socket | The 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().
Handle a packet received from the SDN.
socket | The 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().
|
private |
Remember the HTTP request received from the application.
saeId | The application identifier. |
socket | The receiving socket. |
Definition at line 3223 of file qkd-key-manager-system-application.cc.
References m_http004App, and NS_LOG_FUNCTION.
Referenced by ProcessOpenConnectRequest().
|
private |
Remove the HTTP request from the list.
saeId | The application identifier. |
Definition at line 3230 of file qkd-key-manager-system-application.cc.
References m_http004App, and NS_LOG_FUNCTION.
Referenced by ProcessNewAppResponse().
|
private |
Remember the HTTP request made to the peer KMS.
dstKms | The destination KMS IP address. |
request | The HTTP request details. |
HTTP handling
Definition at line 3185 of file qkd-key-manager-system-application.cc.
References m_httpRequestsQueryKMS, and NS_LOG_FUNCTION.
Referenced by NegotiateKeysForAssociation(), NewAppRequest(), ProcessCloseRequest(), RegisterRequest(), and TransformKeys().
|
private |
Remove the HTTP request from the list.
dstKms | The destination KMS IP address. |
Definition at line 3196 of file qkd-key-manager-system-application.cc.
References m_httpRequestsQueryKMS, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by ProcessAddKeysResponse(), ProcessKMSCloseResponse(), ProcessNewAppResponse(), ProcessRegisterResponse(), and ProcessTransformResponse().
|
private |
Map the HTTP response and obtain the request method.
dstKms | The destination KMS IP address. |
Definition at line 3210 of file qkd-key-manager-system-application.cc.
References m_httpRequestsQueryKMS, NONE, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by ProcessResponseKMS().
|
private |
\breif Monitor the state of the existing key stream sessions.
|
private |
Add new keys to the key stream session buffer.
ksid | The key stream identifier. |
keyAmount | The minimal amount of key material in bits to be assigned to the buffer (1024 bits as default). |
priority | The priority of the application (0 as default). Defines whether to mantain the key association after keys are depleted. |
Definition at line 4033 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ns3::HTTPMessage::CreateRequest(), ns3::QKDKeyManagerSystemApplication::HttpQuery::destination_sae, FILL, GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), GetSendSocketKMS(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::Packet::GetUid(), HttpKMSAddQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, m_associations004, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), PurgeExpiredAssociations(), ScheduleCheckAssociation(), ns3::Socket::Send(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().
Referenced by CheckAssociation().
|
private |
Make a NEW_APP request to the peer KMS.
ksid | The key stream identifier. |
KMS-KMS functions
Definition at line 2181 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ns3::HTTPMessage::CreateRequest(), ns3::QKDKeyManagerSystemApplication::HttpQuery::destination_sae, GetSendSocketKMS(), HttpKMSAddQuery(), ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, m_associations004, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Socket::Send(), ns3::QKDKeyManagerSystemApplication::HttpQuery::source_sae, and ns3::HTTPMessage::ToString().
Referenced by ProcessOpenConnectRequest().
|
private |
Assemble a byte stream from the application to extract the HTTP message.
p | The received packet. |
from | The packet origin address. |
socket | The receiving socket. |
Definition at line 654 of file qkd-key-manager-system-application.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::CopyData(), ns3::Packet::CreateFragment(), ns3::HTTPMessage::GetSize(), ns3::Packet::GetSize(), ns3::HTTPMessage::GetStatusMessage(), ns3::Packet::GetUid(), ns3::HTTPMessage::IsFragmented(), m_bufferKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, check-style-clang-format::parser, ProcessRequest(), ns3::Packet::RemoveAtStart(), ns3::HTTPMessage::ToString(), and ns3::Packet::ToString().
Referenced by HandleRead().
|
private |
Assemble a byte stream from the peer KMS to extract the HTTP message.
p | The received packet. |
from | The packet origin address. |
socket | The receiving socket. |
Definition at line 718 of file qkd-key-manager-system-application.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::CopyData(), ns3::Packet::CreateFragment(), ns3::HTTPMessage::GetSize(), ns3::Packet::GetSize(), ns3::HTTPMessage::GetStatusMessage(), ns3::Packet::GetUid(), ns3::HTTPMessage::IsFragmented(), m_bufferKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, check-style-clang-format::parser, ProcessPacketKMSs(), ns3::Packet::RemoveAtStart(), ns3::HTTPMessage::ToString(), and ns3::Packet::ToString().
Referenced by HandleReadKMSs().
|
private |
Assemble a byte stream from the SDN to extract the HTTP message.
p | The received packet. |
from | The packet origin address. |
socket | The receiving socket. |
Definition at line 782 of file qkd-key-manager-system-application.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::CopyData(), ns3::Packet::CreateFragment(), ns3::HTTPMessage::GetSize(), ns3::Packet::GetSize(), ns3::HTTPMessage::GetStatusMessage(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), ns3::HTTPMessage::IsFragmented(), m_bufferKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, check-style-clang-format::parser, ProcessRequestSDN(), ProcessResponseSDN(), ns3::Packet::RemoveAtStart(), ns3::HTTPMessage::ToString(), and ns3::Packet::ToString().
Referenced by HandleReadSDN().
Convert the packet to a string.
packet | The packet. |
|
private |
Prepare the sink socket.
Definition at line 872 of file qkd-key-manager-system-application.cc.
References ns3::Socket::Bind(), ns3::Socket::CreateSocket(), GetNode(), HandleAccept(), HandlePeerClose(), HandlePeerError(), HandleRead(), ns3::Socket::Listen(), m_local, m_port, m_sinkSocket, m_tid, ns3::MakeCallback(), ns3::MakeNullCallback(), NS_LOG_FUNCTION, ns3::Socket::SetAcceptCallback(), ns3::Socket::SetCloseCallbacks(), ns3::Socket::SetRecvCallback(), and ns3::Socket::ShutdownSend().
Referenced by StartApplication().
|
private |
Process the FILL request.
h | The received HTTP message. |
socket | The receiving socket. |
ksid | The key stream session identifier. |
The KMS processes the proposal of keys to be assigned to the key stream session identifier with the given KSID. The proposal is issued by the initiating KMS, the one that serves the sender application.
Definition at line 2486 of file qkd-key-manager-system-application.cc.
References AddKeyToAssociationDedicatedStore(), ns3::HTTPMessage::CreateResponse(), GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_associations004, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::QKDKey::READY, SendToSocketPair(), SendToSocketPairKMS(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().
Referenced by ProcessRequestKMS().
|
private |
Process the FILL response.
header | The received HTTP message. |
socket | The receiving socket. |
Process the response of the FILL request. The KMS assignes QKD keys that have been accepted by the peer KMS, to the key stream session.
Definition at line 2575 of file qkd-key-manager-system-application.cc.
References AddKeyToAssociationDedicatedStore(), CheckAssociation(), GetApplicationConnectionDetails(), GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::HTTPMessage::GetStatusCode(), HttpKMSCompleteQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_associations004, m_httpRequestsQueryKMS, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), and ns3::UUID::string().
Referenced by ProcessResponseKMS().
|
private |
Definition at line 2111 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ns3::HTTPMessage::CreateRequest(), ETSI_QKD_004_KMS_CLOSE, GenerateKeyId(), GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), GetSendSocketKMS(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), HttpKMSAddQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, m_associations004, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::Socket::Send(), ns3::UUID::string(), ns3::QKDKeyManagerSystemApplication::HttpQuery::surplus_key_ID, ns3::QKDKeyManagerSystemApplication::HttpQuery::sync_index, and ns3::HTTPMessage::ToString().
Referenced by ProcessRequest().
|
private |
Definition at line 1966 of file qkd-key-manager-system-application.cc.
References CheckAssociation(), CheckDoSAttack(), ns3::HTTPMessage::CreateResponse(), GetApplicationConnectionDetails(), ns3::QKDKeyAssociationLinkEntry::GetEffectiveSKR(), ns3::QKDKeyAssociationLinkEntry::GetExpectedConsumption(), ns3::QKDApplicationEntry::GetId(), ns3::QKDKeyAssociationLinkEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::QKDKeyAssociationLinkEntry::GetSKR(), ns3::HTTPMessage::GetUri(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_associations004, m_keyServedETSI004Trace, m_keyServedTraceEmir, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), SendToSocketPair(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().
Referenced by ProcessRequest().
|
private |
Process the close request from the peer KMS.
header | The received HTTP message. |
socket | The receiving socket. |
ksid | The key sream identifier. |
When the QKDApp initiates ETSI 004 close request, the local KMS should release QKD keys currently assign to the key stream session. To do so, the KMS should sync with the peer KMS. This function perform the necessery processing on the peer KMS to do sync.
Definition at line 2947 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetMessageBodyString(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), m_associations004, m_keyServedTraceEmir, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ReleaseAssociation(), SendToSocketPairKMS(), and ns3::HTTPMessage::ToString().
Referenced by ProcessRequestKMS().
|
private |
Process close response from the peer KMS.
header | The received HTTP message. |
socket | The receiving socket. |
Definition at line 3100 of file qkd-key-manager-system-application.cc.
References GetDestinationKmsAddress(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetStatusCode(), HttpKMSCompleteQuery(), m_associations004, m_httpRequestsQueryKMS, m_keyServedTraceEmir, ns3::HTTPMessage::NotAcceptable, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, and ReleaseAssociation().
Referenced by ProcessResponseKMS().
|
private |
Definition at line 2236 of file qkd-key-manager-system-application.cc.
References CreateNew004Association(), ns3::HTTPMessage::CreateResponse(), GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetUri(), ns3::QKDApplicationEntry::IsValid(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ReadJsonQos(), SendToSocketPairKMS(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().
Referenced by ProcessRequestKMS().
|
private |
Process the NEW_APP response.
header | The received HTTP message. |
socket | The receiving socket. |
The KMS receives a response on a NEW_APP request. This response idicates success of registering the key stream session from the peer KMS.
Definition at line 2309 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), GetApplicationConnectionDetails(), GetDestinationKmsAddress(), ns3::QKDKeyAssociationLinkEntry::GetHop(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), GetSocketFromHttp004AppQuery(), ns3::HTTPMessage::GetStatusCode(), ns3::HTTPMessage::GetUri(), Http004AppQueryComplete(), HttpKMSCompleteQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_associations004, m_httpRequestsQueryKMS, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), SendToSocketPair(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().
Referenced by ProcessResponseKMS().
|
private |
Definition at line 1788 of file qkd-key-manager-system-application.cc.
References CheckDoSAttack(), CheckSessionList(), ns3::QKDKeyManagerSystemApplication::QoS::chunkSize, CreateNew004Association(), ns3::HTTPMessage::CreateResponse(), ns3::QKDApplicationEntry::ETSI_QKD_004_AUTHENTICATION, ns3::QKDApplicationEntry::ETSI_QKD_004_ENCRYPTION, GetApplicationConnectionDetailsBySaeIDsAndType(), ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetType(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), Http004AppQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), ns3::QKDKeyManagerSystemApplication::QoS::jitter, m_associations004, ns3::QKDKeyManagerSystemApplication::QoS::maxRate, ns3::QKDKeyManagerSystemApplication::QoS::minRate, NewAppRequest(), ns3::QKDApplicationEntry::NONE, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::QKDKeyManagerSystemApplication::QoS::priority, ProcessQoSRequest(), ProcessUriParams(), ReadJsonQos(), RegisterRequest(), SendToSocketPair(), ns3::UUID::string(), ns3::QKDKeyManagerSystemApplication::QoS::timeout, ns3::HTTPMessage::ToString(), ns3::QKDKeyManagerSystemApplication::QoS::TTL, and check-style-clang-format::type.
Referenced by ProcessRequest().
|
private |
Process incoming request at the KM link.
header | The received HTTP message. |
packet | The received packet. |
socket | The receiving socket. |
Definition at line 1422 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetUri(), NS_LOG_FUNCTION, ProcessRequestKMS(), and ProcessResponseKMS().
Referenced by PacketReceivedKMSs().
|
private |
Process request from the QKD post-processing application.
header | The received HTTP message. |
packet | The received packet. |
socket | The receiving socket. |
|
private |
Process the QoS requirements.
&appConnection | The application connection details. |
&keyAssociation | The key association details. |
&inQoS | The requested QoS levels. |
&outQoS | The best QoS levels that the KMS can meet (in inQoS can not be satified). |
ksid | The key stream identifier. |
Definition at line 4321 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyManagerSystemApplication::QoS::chunkSize, ns3::DataRate::GetBitRate(), ns3::QKDKeyAssociationLinkEntry::GetEffectiveSKR(), ns3::QKDKeyAssociationLinkEntry::GetExpectedConsumption(), ns3::QKDApplicationEntry::GetId(), ns3::QKDKeyAssociationLinkEntry::GetId(), ns3::QKDKeyAssociationLinkEntry::GetSKR(), ns3::UniformRandomVariable::GetValue(), ns3::QKDKeyManagerSystemApplication::QoS::jitter, m_default_ttl, m_minKeyRate, m_providedQoS, m_qos_maxrate_threshold, m_random, m_sessionList, ns3::QKDKeyManagerSystemApplication::QoS::maxRate, ns3::QKDKeyManagerSystemApplication::QoS::minRate, NS_ASSERT, NS_LOG_FUNCTION, ns3::QKDKeyManagerSystemApplication::QoS::priority, ns3::UUID::string(), ns3::QKDKeyManagerSystemApplication::QoS::timeout, and ns3::QKDKeyManagerSystemApplication::QoS::TTL.
Referenced by ProcessOpenConnectRequest().
|
private |
Process the REGISTER request.
header | The received HTTP message. |
ksid | The key stream identifier. |
socket | The receiving socket. |
The KMS process the REGISTER request, and starts assigning key material to the key stream session.
Definition at line 2429 of file qkd-key-manager-system-application.cc.
References CheckAssociation(), ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetUri(), m_associations004, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, SendToSocketPairKMS(), and ns3::HTTPMessage::ToString().
Referenced by ProcessRequestKMS().
|
private |
Process the REGISTER response.
header | The received message. |
socket | The receiving socket. |
The KMS simply acknowledges that the peer KMS has process the REGISTER request.
Definition at line 2462 of file qkd-key-manager-system-application.cc.
References GetDestinationKmsAddress(), ns3::HTTPMessage::GetStatusCode(), HttpKMSCompleteQuery(), m_associations004, m_httpRequestsQueryKMS, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::HTTPMessage::Ok.
Referenced by ProcessResponseKMS().
|
private |
Process incoming requests from the service layer, i.e., QKD applications.
header | The received HTTP message. |
packet | The received packet. |
socket | The receiving socket. |
Southbound interface functions (ETSI 014 & ETSI 004)
Definition at line 1015 of file qkd-key-manager-system-application.cc.
References AddNewKey(), Check014GetKeyRequest(), ns3::InetSocketAddress::ConvertFrom(), CreateKeyContainer(), ns3::HTTPMessage::CreateResponse(), ETSI_QKD_004_CLOSE, ETSI_QKD_004_GET_KEY, ETSI_QKD_004_OPEN_CONNECT, ETSI_QKD_014_GET_KEY, ETSI_QKD_014_GET_KEY_WITH_KEY_IDS, ETSI_QKD_014_GET_STATUS, FetchRequestType(), GetAddress(), GetApplicationConnectionDetails(), ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), ns3::QKDKeyAssociationLinkEntry::GetId(), ns3::Node::GetId(), ns3::InetSocketAddress::GetIpv4(), GetKeyAssociationLinkDetailsByApplicationId(), GetMaxKeyPerRequest(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetMethod(), GetNode(), ns3::Socket::GetPeerName(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::httpMessage, ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), two-ray-to-three-gpp-ch-calibration::k, ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::ksid, m_defaultKeySize, m_dropTrace, m_keyServedETSI014Trace, m_keyServedTraceEmir, m_maxKeySize, m_minKeySize, m_newKeyGeneratedTrace, m_newKeyGeneratedTraceEmir, m_queueLogic, NONE, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::packet, ns3::Ipv4Address::Print(), ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ProcessCloseRequest(), ProcessGetKey004Request(), ProcessOpenConnectRequest(), ProcessUriParams(), SendToSocketPair(), ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::socket, STORE_PP_KEYS, ns3::UUID::string(), ns3::HTTPMessage::ToString(), and TransformKeys().
Referenced by PacketReceived().
|
private |
Process request from the peer KMS.
header | The received HTTP message. |
socket | The receiving socket. |
Definition at line 1650 of file qkd-key-manager-system-application.cc.
References ETSI_QKD_004_KMS_CLOSE, FetchRequestType(), FILL, ns3::HTTPMessage::GetUri(), NEW_APP, NONE, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ProcessAddKeysRequest(), ProcessKMSCloseRequest(), ProcessNewAppRequest(), ProcessRegisterRequest(), ProcessTransformRequest(), ProcessUriParams(), REGISTER, and TRANSFORM_KEYS.
Referenced by ProcessPacketKMSs().
|
private |
Process request from the SDN controller.
header | The received HTTP message. |
packet | The received packet. |
socket | The receiving socket. |
Definition at line 1598 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatusCode(), NS_LOG_FUNCTION, and ProcessUriParams().
Referenced by PacketReceivedSDN().
|
private |
Process response from the peer KMS.
header | The received HTTP message. |
packet | The received packet. |
socket | The receiving socket. |
Definition at line 1688 of file qkd-key-manager-system-application.cc.
References ETSI_QKD_004_KMS_CLOSE, FILL, GetDestinationKmsAddress(), HttpQueryMethod(), NEW_APP, NS_FATAL_ERROR, NS_LOG_FUNCTION, ProcessAddKeysResponse(), ProcessKMSCloseResponse(), ProcessNewAppResponse(), ProcessRegisterResponse(), ProcessTransformResponse(), REGISTER, and TRANSFORM_KEYS.
Referenced by ProcessPacketKMSs().
|
private |
Process response from the SDN controller.
header | The received HTTP message. |
packet | The received packet. |
socket | The receiving socket. |
Definition at line 1432 of file qkd-key-manager-system-application.cc.
References GetKeyAssociationById(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatusCode(), ns3::QKDKeyAssociationLinkEntry::IsValid(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ProcessUriParams(), SaveKeyAssociation(), ns3::Simulator::Schedule(), ns3::Seconds(), SendQKDLinkStatusToSDN(), and ns3::QKDKeyAssociationLinkEntry::SetUpdateStatusInterval().
Referenced by PacketReceivedSDN().
|
private |
Process the transform request.
header | The received HTTP message. |
socket | The receiving socket. |
The KMS processes transform request by transformim the same set of keys to a given number and size, as requested from the peer KMS. The success indicator is sent as a response.
Definition at line 2726 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::QKDApplicationEntry::GetSrcSaeId(), ns3::HTTPMessage::GetUri(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::QKDKey::READY, SendToSocketPairKMS(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().
Referenced by ProcessRequestKMS().
|
private |
Process the transform response.
header | The received HTTP message. |
socket | The receiving socket. |
The KMS acknowledges the peer KMS response status. On success, it mark transformed keys are READY.
Definition at line 2864 of file qkd-key-manager-system-application.cc.
References GetApplicationConnectionDetails(), GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::HTTPMessage::GetMessageBodyString(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::HTTPMessage::GetStatusCode(), HttpKMSCompleteQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_httpRequestsQueryKMS, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::QKDKey::RESERVED, ns3::UUID::string(), ns3::QKDKeyManagerSystemApplication::HttpQuery::surplus_key_ID, ns3::QKDKeyManagerSystemApplication::HttpQuery::to_transform_key_IDs, ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_IDs, ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_number, and ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_size.
Referenced by ProcessResponseKMS().
|
private |
Read the URI parameters in a vector.
s | The HTTP request URI. |
Definition at line 1623 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by ProcessOpenConnectRequest(), ProcessRequest(), ProcessRequestKMS(), ProcessRequestSDN(), and ProcessResponseSDN().
|
private |
Purge (delete) the expired ETSI 004 key stream sessions based on the QoS - TTL value.
Definition at line 4010 of file qkd-key-manager-system-application.cc.
References ns3::Time::GetSeconds(), m_associations004, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by NegotiateKeysForAssociation().
|
private |
Read the QoS parameters from the JSON OPEN_CONNECT structure.
&inQoS | The QoS structure to write read parameters. |
jOpenConncetRequest | The JSON structure to read. |
Definition at line 4247 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyManagerSystemApplication::QoS::chunkSize, ns3::QKDKeyManagerSystemApplication::QoS::jitter, ns3::QKDKeyManagerSystemApplication::QoS::maxRate, ns3::QKDKeyManagerSystemApplication::QoS::minRate, NS_ASSERT, NS_LOG_FUNCTION, ns3::QKDKeyManagerSystemApplication::QoS::priority, ns3::QKDKeyManagerSystemApplication::QoS::timeout, and ns3::QKDKeyManagerSystemApplication::QoS::TTL.
Referenced by ProcessNewAppRequest(), and ProcessOpenConnectRequest().
QKDApplicationEntry ns3::QKDKeyManagerSystemApplication::RegisterApplicationEntry | ( | UUID | keyAssociationId, |
UUID | applicationEntryId, | ||
UUID | srcSaeId, | ||
UUID | dstSaeId, | ||
std::string | type, | ||
Ipv4Address | dstKmsAddress, | ||
uint32_t | priority = 0 , |
||
double | expirationTime = 100 |
||
) |
Register a new pair of QKD applications.
This function register the pair of QKDApps (srcSaeId, dstSaeId) to use keys that are produced by the QKD systems on nodes srcNode and dstNode via this KMS We assume QKD link (key association) between SAE nodes is established.
keyAssociationId | The key association identifier. |
applicationEntryId | The application pair entry identifier. |
srcSaeId | The source application identifier. |
dstSaeId | The destination application identifier. |
type | The application type based on the selected key-supply interaface. |
dstKmsAddress | The destination KMS address. |
priority | The key association priority. |
expirationTime | The key association expiration time. |
Hence, we only need keyAssociationId!
Definition at line 3552 of file qkd-key-manager-system-application.cc.
References connectedToSDN, ns3::InetSocketAddress::ConvertFrom(), ns3::HTTPMessage::CreateRequest(), ns3::QKDApplicationEntry::ETSI_QKD_004_AUTHENTICATION, ns3::QKDApplicationEntry::ETSI_QKD_004_ENCRYPTION, ns3::QKDApplicationEntry::ETSI_QKD_014_AUTHENTICATION, ns3::QKDApplicationEntry::ETSI_QKD_014_ENCRYPTION, ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), ns3::QKDKeyAssociationLinkEntry::GetId(), ns3::InetSocketAddress::GetIpv4(), GetKeyAssociationById(), GetNode(), ns3::Object::GetObject(), ns3::GetQKDApplicationEntryText(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceKmsAddress(), ns3::Packet::GetUid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_local, m_packetQueuesToSDN, m_sdnControllerAddress, m_sdnSupportEnabled, m_sendSocketToSDN, ns3::UUID::Nil(), ns3::QKDApplicationEntry::NONE, NS_ASSERT, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::Socket::Send(), ns3::QKDApplicationEntry::SetId(), ns3::UUID::string(), ns3::HTTPMessage::ToString(), and check-style-clang-format::type.
Referenced by RegisterApplicationEntry().
QKDApplicationEntry ns3::QKDKeyManagerSystemApplication::RegisterApplicationEntry | ( | UUID | srcSaeId, |
UUID | dstSaeId, | ||
std::string | type, | ||
Ipv4Address | dstKmsAddress, | ||
uint32_t | priority = 0 , |
||
double | expirationTime = 100 |
||
) |
Register a new pair of QKD applications.
This function register the pair of QKDApps (srcSaeId, dstSaeId) to use keys that are produced by the QKD systems on nodes srcNode and dstNode via this KMS.
srcSaeId | The source application identifier. |
dstSaeId | The destination application identifier. |
type | The application type based on the selected key-supply interaface. |
dstKmsAddress | The destination KMS address. |
priority | The key association priority. |
expirationTime | The key association expiration time. |
Definition at line 3512 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyAssociationLinkEntry::GetId(), GetNode(), ns3::Object::GetObject(), ns3::QKDKeyAssociationLinkEntry::IsValid(), ns3::UUID::Nil(), NS_ASSERT, NS_LOG_FUNCTION, ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), RegisterApplicationEntry(), and check-style-clang-format::type.
|
private |
Send the REGISTER request.
ksid | The key stream identifier. |
The KMS notifies peer KMS that receiving application has registered for the established key stream session by submitting OPEN_CONNECT request.
Definition at line 2391 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ns3::HTTPMessage::CreateRequest(), GetSendSocketKMS(), HttpKMSAddQuery(), ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, m_associations004, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), REGISTER, ns3::Socket::Send(), and ns3::HTTPMessage::ToString().
Referenced by ProcessOpenConnectRequest().
|
private |
Release the key stream session.
ksid | The key stream session identifier. |
surplusKeyId | The key identifier for the surplus key material in the key stream session buffer. |
syncIndex | The key index in the key stream session buffer for synchronisation purposes. |
Definition at line 3048 of file qkd-key-manager-system-application.cc.
References GetApplicationConnectionDetails(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_associations004, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), and ns3::UUID::string().
Referenced by ProcessKMSCloseRequest(), and ProcessKMSCloseResponse().
void ns3::QKDKeyManagerSystemApplication::SaveKeyAssociation | ( | QKDKeyAssociationLinkEntry & | rt | ) |
Add the key association.
rt | The key association link entry. |
Definition at line 3779 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyAssociationLinkEntry::GetId(), GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by AddNewKey(), ProcessResponseSDN(), and SendQKDLinkStatusToSDN().
|
private |
Schedule the next event in the attempt to fill the key stream session buffer.
t | The time shift. |
action | The name of the action. |
ksid | The key stream identifier. |
Definition at line 990 of file qkd-key-manager-system-application.cc.
References check-style-clang-format::action, CheckAssociation(), NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by NegotiateKeysForAssociation().
void ns3::QKDKeyManagerSystemApplication::SendQKDLinkStatusToSDN | ( | UUID | linkId, |
double | updatePeriod | ||
) |
Send the QKD link statistics to the SDN controller.
linkId | The link identifier. |
updatePeriod | The update period. |
Definition at line 1501 of file qkd-key-manager-system-application.cc.
References connectedToSDN, ns3::InetSocketAddress::ConvertFrom(), ns3::HTTPMessage::CreateRequest(), ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDKeyAssociationLinkEntry::GetEffectiveSKR(), ns3::QKDKeyAssociationLinkEntry::GetExpectedConsumption(), ns3::QKDKeyAssociationLinkEntry::GetId(), ns3::InetSocketAddress::GetIpv4(), GetKeyAssociationById(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSKR(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::Packet::GetUid(), ns3::QKDKeyAssociationLinkEntry::GetUpdateStatusInterval(), ns3::QKDKeyAssociationLinkEntry::IsValid(), m_sdnControllerAddress, m_sdnSupportEnabled, m_sendSocketToSDN, NS_ASSERT, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), SaveKeyAssociation(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::Socket::Send(), ns3::QKDKeyAssociationLinkEntry::SetEffectiveSKR(), ns3::QKDKeyAssociationLinkEntry::SetExpectedConsumption(), ns3::QKDKeyAssociationLinkEntry::SetSKR(), ns3::UUID::string(), and ns3::HTTPMessage::ToString().
Referenced by ProcessResponseSDN().
|
private |
Send the packet to the pair socket.
socket | The receiving socket. |
packet | The packet to send. |
Definition at line 429 of file qkd-key-manager-system-application.cc.
References ns3::Socket::GetPeerName(), ns3::Packet::GetUid(), m_packetQueues, m_socketPairs, m_txTrace, NS_LOG_FUNCTION, and ns3::Socket::Send().
Referenced by ProcessAddKeysRequest(), ProcessGetKey004Request(), ProcessNewAppResponse(), ProcessOpenConnectRequest(), and ProcessRequest().
|
private |
Send the packet to the pair socket.
socket | The receiving socket. |
packet | The packet to send. |
Definition at line 456 of file qkd-key-manager-system-application.cc.
References ns3::Packet::GetUid(), m_socketPairsKMS, NS_LOG_FUNCTION, and ns3::Socket::Send().
Referenced by ProcessAddKeysRequest(), ProcessKMSCloseRequest(), ProcessNewAppRequest(), ProcessRegisterRequest(), and ProcessTransformRequest().
|
inline |
Set the local IP address.
address | The local IP address. |
Definition at line 259 of file qkd-key-manager-system-application.h.
References first::address, and m_local.
Set the node.
n | The node to be set. |
Definition at line 3790 of file qkd-key-manager-system-application.cc.
References m_node.
|
inline |
Set the local port.
port | The port number. |
Definition at line 275 of file qkd-key-manager-system-application.h.
|
inline |
Set the SDN controller address.
sdnAddress | The address. |
Definition at line 296 of file qkd-key-manager-system-application.h.
References m_sdnControllerAddress, and m_sdnSupportEnabled.
Set the sink socket.
type | The socket type. |
socket | The socket to be set. |
Definition at line 209 of file qkd-key-manager-system-application.cc.
References m_sinkSocket, NS_LOG_FUNCTION, and check-style-clang-format::type.
|
privatevirtual |
Start the KMS Application.
APPLICATION functions
Reimplemented from ns3::Application.
Definition at line 863 of file qkd-key-manager-system-application.cc.
References ConnectToSDNController(), ns3::Address::IsInvalid(), m_sdnControllerAddress, m_sdnSupportEnabled, NS_LOG_FUNCTION, and PrepareSinkSocket().
|
privatevirtual |
Stop the KMS Application.
Reimplemented from ns3::Application.
Definition at line 965 of file qkd-key-manager-system-application.cc.
References ns3::Socket::Close(), m_sinkSocket, m_socketPairs, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().
|
private |
Transform a number of keys to a given size.
keySize | The key size. |
keyNumber | The key number. |
slave_SAE_ID | The destination (receiver) application identifier. |
The KMS uses available keys and transforms them to a given number and size. Transformed keys are assigned a new key identifiers. The transformation request is sent to the peer KMS.
Definition at line 2627 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ns3::HTTPMessage::CreateRequest(), GenerateKeyId(), GetApplicationConnectionDetails(), ns3::QKDKeyAssociationLinkEntry::GetDestinationKmsAddress(), ns3::QKDApplicationEntry::GetId(), GetKeyAssociationLinkDetailsByApplicationId(), GetSendSocketKMS(), ns3::Packet::GetSize(), ns3::QKDKeyAssociationLinkEntry::GetSourceBuffer(), ns3::Packet::GetUid(), HttpKMSAddQuery(), ns3::QKDApplicationEntry::IsValid(), ns3::QKDKeyAssociationLinkEntry::IsValid(), two-ray-to-three-gpp-ch-calibration::k, ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Ipv4Address::Print(), ns3::QKDApplicationEntry::PrintRegistryInfo(), ns3::QKDKeyAssociationLinkEntry::PrintRegistryInfo(), ns3::Socket::Send(), ns3::UUID::string(), ns3::QKDKeyManagerSystemApplication::HttpQuery::surplus_key_ID, ns3::QKDKeyManagerSystemApplication::HttpQuery::to_transform_key_IDs, ns3::HTTPMessage::ToString(), ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_IDs, ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_number, and ns3::QKDKeyManagerSystemApplication::HttpQuery::transform_key_size.
Referenced by ProcessRequest().
|
private |
Is conncted to the SDN controller?
Definition at line 926 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication(), AddNewLink(), ConnectionToSDNSucceeded(), RegisterApplicationEntry(), and SendQKDLinkStatusToSDN().
|
private |
The list of active key stream sessions.
Definition at line 846 of file qkd-key-manager-system-application.h.
Referenced by AddKeyToAssociationDedicatedStore(), CheckAssociation(), CheckSessionList(), CreateNew004Association(), NegotiateKeysForAssociation(), NewAppRequest(), ProcessAddKeysRequest(), ProcessAddKeysResponse(), ProcessCloseRequest(), ProcessGetKey004Request(), ProcessKMSCloseRequest(), ProcessKMSCloseResponse(), ProcessNewAppResponse(), ProcessOpenConnectRequest(), ProcessRegisterRequest(), ProcessRegisterResponse(), PurgeExpiredAssociations(), RegisterRequest(), and ReleaseAssociation().
|
private |
The buffer for the received packets from the applications (TCP segmentation).
Definition at line 895 of file qkd-key-manager-system-application.h.
|
private |
The buffer for the received packets from the peer KMS (TCP segmentation).
Definition at line 896 of file qkd-key-manager-system-application.h.
Referenced by PacketReceived(), PacketReceivedKMSs(), and PacketReceivedSDN().
|
private |
The close socket event.
Definition at line 857 of file qkd-key-manager-system-application.h.
|
private |
The default value of TTL.
Definition at line 924 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessQoSRequest().
|
private |
The default key size KMS will deliver if the size was not defined in the request.
Definition at line 893 of file qkd-key-manager-system-application.h.
Referenced by Check014GetKeyRequest(), GetTypeId(), and ProcessRequest().
|
private |
A trace for the dropped packets.
Definition at line 870 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessRequest().
|
private |
A list of flaged IP addresses.
Definition at line 861 of file qkd-key-manager-system-application.h.
Referenced by CheckDoSAttack().
The list of HTTP requests (without response) set to the application.
Definition at line 993 of file qkd-key-manager-system-application.h.
Referenced by Http004AppQuery(), and Http004AppQueryComplete().
|
private |
The list of HTTP request (without response) sent to the peer KMS.
Definition at line 992 of file qkd-key-manager-system-application.h.
Referenced by HttpKMSAddQuery(), HttpKMSCompleteQuery(), HttpQueryMethod(), ProcessAddKeysResponse(), ProcessKMSCloseResponse(), ProcessNewAppResponse(), ProcessRegisterResponse(), and ProcessTransformResponse().
|
private |
A trace for the consumed keys by the ETSI 004 clients.
Definition at line 878 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessGetKey004Request().
|
private |
A trace for the consumed keys by the ETSI 014 clients.
Definition at line 877 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessRequest().
|
private |
A trace for the consumed keys.
Definition at line 873 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), ProcessGetKey004Request(), ProcessKMSCloseRequest(), ProcessKMSCloseResponse(), and ProcessRequest().
|
private |
The KMS identifier.
Definition at line 855 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication(), and GetId().
|
private |
The counter value to assure generation of the unique key identifiers.
Definition at line 856 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication().
|
private |
Local address to bind to.
Definition at line 850 of file qkd-key-manager-system-application.h.
Referenced by AddNewLink(), CheckSocketsKMS(), ConnectToSDNController(), CreateNew004Association(), GetAddress(), GetTypeId(), PrepareSinkSocket(), RegisterApplicationEntry(), and SetAddress().
|
private |
Should KMS detect and block malicious requests?
Definition at line 862 of file qkd-key-manager-system-application.h.
Referenced by CheckDoSAttack(), and GetTypeId().
|
private |
The maximal number of keys per request application can ask for.
Definition at line 890 of file qkd-key-manager-system-application.h.
Referenced by GetMaxKeyPerRequest(), and GetTypeId().
|
private |
The maximal key rate.
Definition at line 922 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId().
|
private |
The maximal size of the key application can request.
Definition at line 892 of file qkd-key-manager-system-application.h.
Referenced by Check014GetKeyRequest(), GetTypeId(), and ProcessRequest().
|
private |
The minimal key rate.
Definition at line 923 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessQoSRequest().
|
private |
The minimal size of the key application can request.
Definition at line 891 of file qkd-key-manager-system-application.h.
Referenced by Check014GetKeyRequest(), GetTypeId(), and ProcessRequest().
|
private |
A trace for the generated keys.
Definition at line 875 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessRequest().
|
private |
A trace for the generated keys.
Definition at line 872 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessRequest().
Definition at line 904 of file qkd-key-manager-system-application.h.
Buffering unsend messages due to the connection problems.
Definition at line 905 of file qkd-key-manager-system-application.h.
Referenced by ConnectionSucceeded(), and SendToSocketPair().
|
private |
Buffering unsend messages due to the connection problems.
Definition at line 906 of file qkd-key-manager-system-application.h.
Referenced by AddNewLink(), ConnectionToSDNSucceeded(), and RegisterApplicationEntry().
|
private |
Local port to bind to.
Definition at line 851 of file qkd-key-manager-system-application.h.
Referenced by GetPort(), PrepareSinkSocket(), and SetPort().
|
private |
A trace for the admitted QoS.
Definition at line 888 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessQoSRequest().
|
private |
The maximal rate threshold.
Definition at line 911 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessQoSRequest().
|
private |
The KMS Queue Logic for the ETSI 004 QoS handling.
Definition at line 908 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication(), and ProcessRequest().
|
private |
The uniform random variable.
Definition at line 858 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication(), and ProcessQoSRequest().
|
private |
A trace for the received packets from the applications.
Definition at line 864 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and HandleRead().
|
private |
A trace for the received packets from the peer KMS.
Definition at line 866 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and HandleReadKMSs().
|
private |
A trace for the received packets from the SDN controller.
Definition at line 868 of file qkd-key-manager-system-application.h.
Referenced by HandleReadSDN().
|
private |
The scheduled events.
Definition at line 860 of file qkd-key-manager-system-application.h.
|
private |
The SDN controller address.
Definition at line 323 of file qkd-key-manager-system-application.h.
Referenced by AddNewLink(), ConnectToSDNController(), RegisterApplicationEntry(), SendQKDLinkStatusToSDN(), SetSDNControllerAddress(), and StartApplication().
|
private |
The support for the SDN.
Definition at line 322 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication(), AddNewLink(), RegisterApplicationEntry(), SendQKDLinkStatusToSDN(), SetSDNControllerAddress(), and StartApplication().
The send socket to the SDN controller.
Definition at line 848 of file qkd-key-manager-system-application.h.
Referenced by AddNewLink(), ConnectionToSDNSucceeded(), ConnectToSDNController(), RegisterApplicationEntry(), and SendQKDLinkStatusToSDN().
|
private |
A list of sessions.
Definition at line 910 of file qkd-key-manager-system-application.h.
Referenced by CheckSessionList(), CreateNew004Association(), and ProcessQoSRequest().
The sink socket.
Definition at line 847 of file qkd-key-manager-system-application.h.
Referenced by ConnectToSDNController(), DoDispose(), GetSocket(), PrepareSinkSocket(), SetSocket(), and StopApplication().
The sink socket from the SND controller.
Definition at line 849 of file qkd-key-manager-system-application.h.
Referenced by ConnectToSDNController().
The accepted sockets.
Definition at line 900 of file qkd-key-manager-system-application.h.
Referenced by DoDispose(), GetAcceptedSockets(), HandleAccept(), SendToSocketPair(), and StopApplication().
|
private |
The accepted sockets for the communication between KMSs.
Definition at line 902 of file qkd-key-manager-system-application.h.
Referenced by AddNewLink(), CheckSocketsKMS(), GetDestinationKmsAddress(), GetSendSocketKMS(), HandleAcceptKMSs(), and SendToSocketPairKMS().
|
private |
The object type identifier.
Definition at line 854 of file qkd-key-manager-system-application.h.
Referenced by AddNewLink(), ConnectToSDNController(), GetTypeId(), and PrepareSinkSocket().
|
private |
Total bytes received.
Definition at line 852 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication(), GetTotalRx(), HandleRead(), HandleReadKMSs(), and HandleReadSDN().
|
private |
Total bytes sent between KMSs.
Definition at line 853 of file qkd-key-manager-system-application.h.
Referenced by HandleReadKMSs(), and HandleReadSDN().
|
private |
A trace for the sent packets to the applications.
Definition at line 865 of file qkd-key-manager-system-application.h.
Referenced by ConnectionSucceeded(), GetTypeId(), and SendToSocketPair().
|
private |
A trace for the sent packets to the peer KMS.
Definition at line 867 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId().
|
private |
A trace for the sent packets to the SDN controller.
Definition at line 869 of file qkd-key-manager-system-application.h.
|
staticprivate |
The number of created KMSs.
A static value.
Definition at line 320 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication().