QKDNetSim implements Key Management System(KMS) as an application that listens on TCP port 80. More...
#include "qkd-key-manager-system-application.h"
Inheritance diagram for ns3::QKDKeyManagerSystemApplication:
Collaboration diagram for ns3::QKDKeyManagerSystemApplication:Classes | |
| struct | AddressHash |
| Hashing for the Address class. More... | |
| struct | Association004 |
| struct | ChunkKey |
| struct | HttpQuery |
| struct | QoS |
Public Types | |
| enum | RequestType { EMPTY = -1 , ETSI_QKD_014_GET_STATUS = 0 , ETSI_QKD_014_GET_KEY = 1 , ETSI_QKD_014_GET_KEY_WITH_KEY_IDS = 2 , ETSI_QKD_004_OPEN_CONNECT = 3 , ETSI_QKD_004_GET_KEY = 4 , ETSI_QKD_004_CLOSE = 5 , NEW_APP = 6 , REGISTER = 7 , FILL = 8 , STORE_KEY = 9 , TRANSFORM_KEYS = 10 , ETSI_QKD_004_KMS_CLOSE = 11 , RELAY_KEYS = 12 } |
| Request types. More... | |
Public Types inherited from ns3::Application | |
| typedef void(* | DelayAddressCallback) (const Time &delay, const Address &from) |
| Common callback signature for packet delay and address. | |
| typedef void(* | StateTransitionCallback) (const std::string &oldState, const std::string &newState) |
| Common signature used by callbacks to application's state transition trace source. | |
Public Member Functions | |
| QKDKeyManagerSystemApplication () | |
| QKDKeyManagerSystemApplication constructor. | |
| ~QKDKeyManagerSystemApplication () override | |
| QKDKeyManagerSystemApplication destructor. | |
| void | CreateQBuffer (uint32_t dstId, Ptr< QBuffer > bufferConf) |
| Create Q buffer shared with remote key manager node. | |
| void | EstablishKMLinkSockets (Ipv4Address remoteKmAddress) |
| Create sink socket to listen requests exchanged between KMSs. | |
| Ipv4Address | GetAddress () |
| Get local address. | |
| std::string | GetAddressString (Ipv4Address address) |
| Get address as string. | |
| Ptr< QCenController > | GetCenController () |
| Ptr< QKDControl > | GetController () |
| Get QKDN controller object. | |
| std::string | GetId () |
| Get key menager ID. | |
| uint32_t | GetMaxKeyPerRequest () |
| Get maximum number of keys per request(ETSI QKD 014) | |
| Ptr< Node > | GetNode () |
| Get node. | |
| uint32_t | GetPort () const |
| Get local port. | |
| Ptr< QBuffer > | GetQBuffer (uint32_t remoteKmNodeId, std::string type="ns3::QBuffer") |
| Get q-buffer established with remote key manager. | |
| std::vector< Ptr< QBuffer > > | GetQBuffersVector () |
| Get all QBuffers created on the KMS. | |
| Ptr< Socket > | GetSocket () const |
| Get sink socket. | |
| uint32_t | GetTotalRx () const |
| Get the total amount of bytes received. | |
| void | RegisterQKDModule (uint32_t dstId, std::string moduleId) |
| Registers a QKD module in key manager. | |
| void | SetAddress (Ipv4Address address) |
| Set local address. | |
| void | SetCenController (Ptr< QCenController > controller) |
| void | SetController (Ptr< QKDControl > controller) |
| Assign QKDN controller. | |
| void | SetId (std::string id) |
| Set key manager ID. | |
| void | SetId (UUID id) |
| Set key manager ID. | |
| void | SetNode (Ptr< Node > n) |
| Set node. | |
| void | SetPeerKmAddress (uint32_t dstKmNodeId, Ipv4Address dstKmAddress) |
| Set peer KM node address. | |
| void | SetPort (uint32_t port) |
| Set local port. | |
| void | SetSocket (std::string type, Ptr< Socket > socket) |
| Set sink socket. | |
| void | UpdateLinkState (uint32_t dstKmNodeId) |
| Check the QKD link state to given destination. | |
Public Member Functions inherited from ns3::Application | |
| Application () | |
| ~Application () override | |
| virtual int64_t | AssignStreams (int64_t stream) |
| Assign a fixed random variable stream number to the random variables used by this Application object. | |
| Ptr< Node > | GetNode () const |
| void | SetNode (Ptr< Node > node) |
| void | SetStartTime (Time start) |
| Specify application start time. | |
| void | SetStopTime (Time stop) |
| Specify application stop time. | |
Public Member Functions inherited from ns3::Object | |
| Object () | |
| Constructor. | |
| ~Object () override | |
| Destructor. | |
| void | AggregateObject (Ptr< Object > other) |
| Aggregate two Objects together. | |
| void | Dispose () |
| Dispose of this Object. | |
| AggregateIterator | GetAggregateIterator () const |
| Get an iterator to the Objects aggregated to this one. | |
| TypeId | GetInstanceTypeId () const override |
| Get the most derived TypeId for this Object. | |
| template<typename T > | |
| Ptr< T > | GetObject () const |
| Get a pointer to the requested aggregated Object. | |
| template<> | |
| Ptr< Object > | GetObject () const |
| Specialization of () for objects of type ns3::Object. | |
| template<typename T > | |
| Ptr< T > | GetObject (TypeId tid) const |
| Get a pointer to the requested aggregated Object by TypeId. | |
| template<> | |
| Ptr< Object > | GetObject (TypeId tid) const |
| Specialization of (TypeId tid) for objects of type ns3::Object. | |
| void | Initialize () |
| Invoke DoInitialize on all Objects aggregated to this one. | |
| bool | IsInitialized () const |
| Check if the object has been initialized. | |
| void | UnidirectionalAggregateObject (Ptr< Object > other) |
| Aggregate an Object to another Object. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
| SimpleRefCount () | |
| Default constructor. | |
| SimpleRefCount (const SimpleRefCount &o) | |
| Copy constructor. | |
| uint32_t | GetReferenceCount () const |
| Get the reference count of the object. | |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| Assignment operator. | |
| void | Ref () const |
| Increment the reference count. | |
| void | Unref () const |
| Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
| virtual | ~ObjectBase () |
| Virtual destructor. | |
| void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
| Get the value of an attribute, raising fatal errors if unsuccessful. | |
| bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
| Get the value of an attribute without raising errors. | |
| void | SetAttribute (std::string name, const AttributeValue &value) |
| Set a single attribute, raising fatal errors if unsuccessful. | |
| bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
| Set a single attribute without raising errors. | |
| bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
| Connect a TraceSource to a Callback with a context. | |
| bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
| Connect a TraceSource to a Callback without a context. | |
| bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected with a context. | |
| bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
Static Public Member Functions inherited from ns3::Application | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
Static Public Member Functions inherited from ns3::Object | |
| static TypeId | GetTypeId () |
| Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
Protected Member Functions | |
| void | DoDispose () override |
| Destructor implementation. | |
Protected Member Functions inherited from ns3::Application | |
| void | DoInitialize () override |
| Initialize() implementation. | |
Protected Member Functions inherited from ns3::Object | |
| Object (const Object &o) | |
| Copy an Object. | |
| virtual void | NotifyNewAggregate () |
| Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
| void | ConstructSelf (const AttributeConstructionList &attributes) |
| Complete construction of ObjectBase; invoked by derived classes. | |
| virtual void | NotifyConstructionCompleted () |
| Notifier called once the ObjectBase is fully constructed. | |
Private Member Functions | |
| void | AddKeyToAssociationDedicatedStore (std::string ksid, Ptr< QKDKey > key) |
| Add key to dedicated key store corresponding to association identified with KSID. | |
| nlohmann::json | Check014GetKeyRequest (uint32_t number, uint32_t size, Ptr< SBuffer > buffer) |
| Validate request and probe ability to fullfil valid request. | |
| void | CheckEtsi004Association (std::string ksid) |
| Check the state of a single assocation. | |
| void | CheckSocketsKMS (Ipv4Address dstSaeId) |
| Prepare send socket to communicate with peer KMS Application. | |
| void | ConnectionFailed (Ptr< Socket > socket) |
| void | ConnectionFailedKMSs (Ptr< Socket > socket) |
| void | ConnectionSucceeded (Ptr< Socket > socket) |
| @toDo:following functions | |
| void | ConnectionSucceededKMSs (Ptr< Socket > socket) |
| nlohmann::json | CreateKeyContainer (std::vector< Ptr< QKDKey > > keys) |
| Create key container data structure described in ETSI014 document. | |
| std::string | CreateKeyStreamSession (std::string srcSaeId, std::string dstSaeId, QKDKeyManagerSystemApplication::QoS inQos, std::string ksid) |
| Create a new assocation. | |
| Ptr< SBuffer > | CreateRelaySBuffer (uint32_t srcNodeId, uint32_t dstNodeId, std::string description) |
| Help function to create relay SBuffers. | |
| void | DataSend (Ptr< Socket >, uint32_t) |
| void | DataSendKMSs (Ptr< Socket >, uint32_t) |
| QKDKeyManagerSystemApplication::RequestType | FetchRequestType (std::string s) |
| Get request type. | |
| void | Fill (uint32_t dstKmNodeId, std::string direction, uint32_t amount) |
| Fill s-buffer. | |
| std::string | GenerateRandomString (const int len, const uint32_t seed=0) |
| Generate random string with given length. | |
| std::string | GenerateUUID () |
| Generate UUID. | |
| Ipv4Address | GetDestinationKmsAddress (Ptr< Socket > socket) |
| Ipv4Address | GetPeerKmAddress (uint32_t dstKmNodeId) |
| HttpQuery | GetProxyQuery (std::string reqId) |
| Get saved query. | |
| Ptr< SBuffer > | GetSBuffer (uint32_t dstKmNodeId, std::string type) |
| Ptr< Socket > | GetSendSocketKMS (Ipv4Address kmsDstAddress) |
| Obtain send socket. | |
| Ptr< Socket > | GetSocketFromHttp004AppQuery (std::string saeId) |
| void | HandleAccept (Ptr< Socket > s, const Address &from) |
| Handle an incoming connection. | |
| void | HandleAcceptKMSs (Ptr< Socket > s, const Address &from) |
| Handle an incoming connection. | |
| void | HandlePeerClose (Ptr< Socket > socket) |
| Handle an connection close. | |
| void | HandlePeerCloseKMSs (Ptr< Socket > socket) |
| Handle an connection close. | |
| void | HandlePeerError (Ptr< Socket > socket) |
| Handle an connection error. | |
| void | HandlePeerErrorKMSs (Ptr< Socket > socket) |
| Handle an connection error. | |
| void | HandleRead (Ptr< Socket > socket) |
| Handle a packet received by the KMS application. | |
| void | HandleReadKMSs (Ptr< Socket > socket) |
| Handle a packet received by the KMS from KMS. | |
| void | Http004AppQuery (std::string saeId, Ptr< Socket > socket) |
| void | Http004AppQueryComplete (std::string saeId) |
| void | HttpKMSAddQuery (Ipv4Address dstKms, HttpQuery request) |
| remember HTTP request made to peer KMS | |
| void | HttpKMSCompleteQuery (Ipv4Address dstKms) |
| remove mapped HTTP response from query | |
| void | HttpProxyRequestAdd (HttpQuery query) |
| Save query. | |
| RequestType | HttpQueryMethod (Ipv4Address dstKms) |
| obtain method_type to map the HTTP response | |
| void | NewAppRequest (std::string ksid) |
| Make NEW_APP request to peer KMS. | |
| void | PacketReceived (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket) |
| Assemble byte stream to extract HTTPMessage. | |
| void | PacketReceivedKMSs (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket) |
| Assemble byte stream to extract HTTPMessage. | |
| std::string | PacketToString (Ptr< Packet > packet) |
| Convert packet to string. | |
| void | PrepareSinkSocket () |
| void | ProcessCloseRequest (std::string ksid, HTTPMessage header, Ptr< Socket > socket) |
| void | ProcessFillRequest (HTTPMessage headerIn, std::string resource, Ptr< Socket > socket) |
| void | ProcessFillResponse (HTTPMessage headerIn, Ipv4Address from) |
| void | ProcessGetKey004Request (std::string ksid, HTTPMessage header, Ptr< Socket > socket) |
| void | ProcessKMSCloseRequest (HTTPMessage header, Ptr< Socket > socket, std::string ksid) |
| process close request from peer KMS | |
| void | ProcessKMSCloseResponse (HTTPMessage header, Ptr< Socket > socket) |
| process close response from peer KMS | |
| void | ProcessNewAppRequest (HTTPMessage header, Ptr< Socket > socket) |
| void | ProcessNewAppResponse (HTTPMessage header, Ptr< Socket > socket) |
| void | ProcessOpenConnectRequest (HTTPMessage header, Ptr< Socket > socket) |
| void | ProcessPacketKMSs (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket) |
| QKD key manager system application process the request peer KMS, and complete certain actions to respond on received request. | |
| void | ProcessPPRequest (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket) |
| void | ProcessRegisterRequest (HTTPMessage header, std::string ksid, Ptr< Socket > socket) |
| void | ProcessRegisterResponse (HTTPMessage header, Ptr< Socket > socket) |
| void | ProcessRelayRequest (HTTPMessage headerIn, Ptr< Socket > socket) |
| Process key relay request. | |
| void | ProcessRelayResponse (HTTPMessage headerIn) |
| Process key relay response. | |
| void | ProcessRequest (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket) |
| QKD key manager system application process the request from QKDApp, and complete certain actions to respond on received request. | |
| void | ProcessRequestKMS (HTTPMessage header, Ptr< Socket > socket) |
| void | ProcessResponseKMS (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket) |
| void | ProcessSKeyCreateRequest (HTTPMessage header, Ptr< Socket > socket) |
| process transform request | |
| void | ProcessSKeyCreateResponse (HTTPMessage header, Ptr< Socket > socket) |
| process transform response | |
| void | ReadJsonQos (QKDKeyManagerSystemApplication::QoS &inQos, nlohmann::json jOpenConnectRequest) |
| Read the parameters from the JSON OPEN_CONNECT structure! | |
| std::vector< std::string > | ReadUri (std::string s) |
| Read parameters from URI. | |
| void | RegisterRequest (std::string ksid) |
| void | Relay (uint32_t dstKmNodeId, uint32_t amount) |
| Start key relay function. | |
| void | ReleaseAssociation (std::string ksid, std::string surplusKeyId, uint32_t syncIndex) |
| release key stream association | |
| void | RemoveProxyQuery (std::string reqId) |
| Remove proxy query when processed. | |
| void | SBufferClientCheck (uint32_t dstKmNodeId) |
| check s-buffer levels | |
| void | ScheduleCheckEtsi004Association (Time t, std::string action, std::string ksid) |
| schedule next event in an attempt to fill association buffer | |
| void | ScheduleReleaseAssociation (Time t, std::string action, std::string ksid, std::string surplusKeyId, uint32_t syncIndex) |
| void | SendToSocketPair (Ptr< Socket > socket, Ptr< Packet > packet) |
| Send packet to the pair socket. | |
| void | SendToSocketPairKMS (Ptr< Socket > socket, Ptr< Packet > packet) |
| Send packet to the pair socket. | |
| void | StartApplication () override |
| Start KMS Application. | |
| void | StartSBufferClients (uint32_t dstKmNodeId) |
| Start s-buffers control – monitoring. | |
| void | StopApplication () override |
| Stop KMS Application. | |
Static Private Attributes | |
| static uint32_t | nKMS |
| number of created KMSs - static value | |
Additional Inherited Members | |
Protected Attributes inherited from ns3::Application | |
| Ptr< Node > | m_node |
| The node that this application is installed on. | |
| EventId | m_startEvent |
| The event that will fire at m_startTime to start the application. | |
| Time | m_startTime |
| The simulation time that the application will start. | |
| EventId | m_stopEvent |
| The event that will fire at m_stopTime to end the application. | |
| Time | m_stopTime |
| The simulation time that the application will end. | |
Related Symbols inherited from ns3::ObjectBase | |
| static TypeId | GetObjectIid () |
| Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
QKDNetSim implements Key Management System(KMS) as an application that listens on TCP port 80.
The KMS can be installed on any node but the QKD post-processing application expects the existence of a local KMS application on the same nodes where the post-processing application is implemented. The local KMS is contacted to add the keys to the QKD buffer and is contacted during the operation of the QKD application to retrieve the keys from the QKD buffer as described in the following section. Communication between KMS systems installed on different nodes is under construction and will be based on the ETSI QKD 004 standard. The KMS application tracks REST-full design serving status and key retrieval requests from QKD applications. The KMS follows HTTP 1.1 specification including Request-URI for mapping of request-response values. More details available at https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html
ns3::QKDKeyManagerSystemApplication is accessible through the following paths with Config::Set and Config::Connect:
Ipv4Address TypeId Time -9.22337e+18ns:+9.22337e+18ns Time -9.22337e+18ns:+9.22337e+18ns Group: Applications
Size of this type is 1272 bytes (on a 64-bit architecture).
Definition at line 82 of file qkd-key-manager-system-application.h.
Request types.
Definition at line 89 of file qkd-key-manager-system-application.h.
| ns3::QKDKeyManagerSystemApplication::QKDKeyManagerSystemApplication | ( | ) |
QKDKeyManagerSystemApplication constructor.
Definition at line 100 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_encryptor, m_kms_key_id, m_queueLogic, m_totalRx, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
override |
QKDKeyManagerSystemApplication destructor.
Definition at line 110 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
|
private |
Add key to dedicated key store corresponding to association identified with KSID.
| ksid | Unique identifier of the association |
| key | The QKD key being added to the store |
|
private |
Validate request and probe ability to fullfil valid request.
| number | number of requested keys |
| size | requested keys size |
| buffer | associated buffer |
Funtion returns an empty json if the request is valid and can be fullfiled.
Definition at line 3568 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
|
private |
Check the state of a single assocation.
| ksid | Unique identifier of the association |
@toDo The amount of key material to be assigned to the association must be determined by the QoS parameters.
Definition at line 3668 of file qkd-key-manager-system-application.cc.
References NS_LOG_DEBUG, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by ScheduleCheckEtsi004Association().
Here is the caller graph for this function:
|
private |
Prepare send socket to communicate with peer KMS Application.
| uint32_t | destination SAE ID |
Definition at line 864 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ConnectionFailedKMSs(), ConnectionSucceededKMSs(), ns3::Create(), ns3::Socket::CreateSocket(), DataSendKMSs(), EstablishKMLinkSockets(), GetNode(), ns3::TcpSocketFactory::GetTypeId(), ns3::UdpSocketFactory::GetTypeId(), m_socketPairsKMS, ns3::MakeCallback(), ns3::Socket::NS3_SOCK_SEQPACKET, ns3::Socket::NS3_SOCK_STREAM, and NS_LOG_FUNCTION.
Referenced by CheckSocketsKMS(), Fill(), HandleAcceptKMSs(), and Relay().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 777 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Definition at line 784 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by CheckSocketsKMS().
Here is the caller graph for this function:@toDo:following functions
Definition at line 752 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_packetQueues, m_txTrace, and NS_LOG_FUNCTION.
Here is the call graph for this function:Definition at line 770 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by CheckSocketsKMS().
Here is the caller graph for this function:
|
private |
Create key container data structure described in ETSI014 document.
| keys | vector of pointers on the QKD key |
Definition at line 3628 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
|
private |
Create a new assocation.
| srcSaeId | source secure application entity |
| dstSaeId | destination secure application entity |
| inQos | Quality of Service |
| ksid | Unique identifier of the association |
Input ksid can be empty if it is not predefined. In that case new ksid is generated for this new association and return from the function.
Definition at line 3751 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyManagerSystemApplication::QoS::chunkSize, ns3::QKDGraphManager::CreateGraphForBuffer(), and NS_LOG_FUNCTION.
Here is the call graph for this function:| void ns3::QKDKeyManagerSystemApplication::CreateQBuffer | ( | uint32_t | dstId, |
| Ptr< QBuffer > | bufferConf | ||
| ) |
Create Q buffer shared with remote key manager node.
| dstId | remote key manager node ID |
| bufferConf | QKD buffer configuration |
Definition at line 215 of file qkd-key-manager-system-application.cc.
References ns3::Create(), GetId(), GetNode(), m_keys_dec, m_keys_enc, m_link_states, m_qbuffers, m_qbuffersVector, NS_LOG_FUNCTION, and StartSBufferClients().
Here is the call graph for this function:
|
private |
Help function to create relay SBuffers.
| srcNodeId | source KM node ID |
| dstNodeId | peer KM node ID |
| descrition | buffer description used for QKDGraph |
It is called to create new SBuffers for relay on demand.
Definition at line 2008 of file qkd-key-manager-system-application.cc.
References ns3::QKDGraphManager::CreateGraphForBuffer(), and NS_LOG_FUNCTION.
Referenced by ProcessRequest().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 791 of file qkd-key-manager-system-application.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Here is the call graph for this function:Definition at line 797 of file qkd-key-manager-system-application.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Referenced by CheckSocketsKMS().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overrideprotectedvirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Application.
Definition at line 691 of file qkd-key-manager-system-application.cc.
References ns3::Create(), ns3::Application::DoDispose(), m_sinkSocket, m_socketPairsKMS, and NS_LOG_FUNCTION.
Here is the call graph for this function:| void ns3::QKDKeyManagerSystemApplication::EstablishKMLinkSockets | ( | Ipv4Address | remoteKmAddress | ) |
Create sink socket to listen requests exchanged between KMSs.
| remoteKmAddress | Ipv4 address of remote key manager |
Definition at line 3536 of file qkd-key-manager-system-application.cc.
References ns3::MakeCallback(), ns3::MakeNullCallback(), and NS_LOG_FUNCTION.
Referenced by CheckSocketsKMS().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Get request type.
| s | string from HTTP URI |
Definition at line 3467 of file qkd-key-manager-system-application.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by ProcessRequest().
Here is the caller graph for this function:
|
private |
Fill s-buffer.
| dstKmNodeId | remote KM node ID |
| direction | s-buffer type |
| amount | key amount |
Definition at line 511 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ns3::Create(), ns3::HTTPMessage::CreateRequest(), FILL, GetAddressString(), ns3::Node::GetId(), GetNode(), GetPeerKmAddress(), GetQBuffer(), GetSBuffer(), GetSendSocketKMS(), HttpKMSAddQuery(), ns3::QKDKey::INIT, m_associations004, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HTTPMessage::ToString(), and UpdateLinkState().
Referenced by SBufferClientCheck().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Generate random string with given length.
| len | string length |
Definition at line 3815 of file qkd-key-manager-system-application.cc.
|
private |
Generate UUID.
KMS 004 Association operations, monitoring
Definition at line 3657 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION, and ns3::UUID::string().
Referenced by Relay().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Get local address.
Definition at line 203 of file qkd-key-manager-system-application.h.
References m_local.
Referenced by ProcessRequest().
Here is the caller graph for this function:| std::string ns3::QKDKeyManagerSystemApplication::GetAddressString | ( | Ipv4Address | address | ) |
Get address as string.
| address | address |
Definition at line 124 of file qkd-key-manager-system-application.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Referenced by Fill(), ProcessRequest(), and Relay().
Here is the call graph for this function:
Here is the caller graph for this function:| Ptr< QCenController > ns3::QKDKeyManagerSystemApplication::GetCenController | ( | ) |
Definition at line 148 of file qkd-key-manager-system-application.cc.
References m_cen_controller, and NS_LOG_FUNCTION.
Referenced by UpdateLinkState().
Here is the caller graph for this function:| Ptr< QKDControl > ns3::QKDKeyManagerSystemApplication::GetController | ( | ) |
Get QKDN controller object.
Definition at line 187 of file qkd-key-manager-system-application.cc.
References m_controller, and NS_LOG_FUNCTION.
Referenced by ProcessRequest(), Relay(), SBufferClientCheck(), and SetController().
Here is the caller graph for this function:
|
private |
Definition at line 3444 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
|
inline |
Get key menager ID.
Definition at line 187 of file qkd-key-manager-system-application.h.
References m_km_id.
Referenced by CreateQBuffer(), Relay(), StartSBufferClients(), and UpdateLinkState().
Here is the caller graph for this function:| uint32_t ns3::QKDKeyManagerSystemApplication::GetMaxKeyPerRequest | ( | ) |
Get maximum number of keys per request(ETSI QKD 014)
Definition at line 3462 of file qkd-key-manager-system-application.cc.
Referenced by ProcessRequest().
Here is the caller graph for this function:Get node.
Definition at line 163 of file qkd-key-manager-system-application.h.
References m_node.
Referenced by CheckSocketsKMS(), CreateQBuffer(), Fill(), PrepareSinkSocket(), ProcessRequest(), Relay(), SetController(), StartSBufferClients(), and UpdateLinkState().
Here is the caller graph for this function:
|
private |
Definition at line 201 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_peerAddressTable, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by Fill(), and Relay().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Get local port.
Definition at line 226 of file qkd-key-manager-system-application.h.
References m_port.
Referenced by HandleAcceptKMSs().
Here is the caller graph for this function:
|
private |
Get saved query.
| reqId | request identifier |
Definition at line 3414 of file qkd-key-manager-system-application.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
| Ptr< QBuffer > ns3::QKDKeyManagerSystemApplication::GetQBuffer | ( | uint32_t | remoteKmNodeId, |
| std::string | type = "ns3::QBuffer" |
||
| ) |
Get q-buffer established with remote key manager.
| remoteKmNodeId | remote key manager node ID |
Definition at line 653 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_qbuffers, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by Fill(), SBufferClientCheck(), StartSBufferClients(), and UpdateLinkState().
Here is the call graph for this function:
Here is the caller graph for this function:Get all QBuffers created on the KMS.
Function used for plotting QKD Graphs
Definition at line 297 of file qkd-key-manager-system-application.h.
References m_qbuffersVector.
|
private |
Definition at line 625 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_keys_dec, m_keys_enc, and NS_LOG_FUNCTION.
Referenced by Fill(), ProcessRequest(), SBufferClientCheck(), and UpdateLinkState().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Obtain send socket.
| kmsDstAddress | Address of the destination KMS |
Definition at line 926 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_socketPairsKMS, NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by Fill(), and Relay().
Here is the call graph for this function:
Here is the caller graph for this function:Get sink socket.
SOCKET functions
Definition at line 677 of file qkd-key-manager-system-application.cc.
References m_sinkSocket, and NS_LOG_FUNCTION.
|
private |
Definition at line 3390 of file qkd-key-manager-system-application.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
| uint32_t ns3::QKDKeyManagerSystemApplication::GetTotalRx | ( | ) | const |
Get the total amount of bytes received.
Definition at line 117 of file qkd-key-manager-system-application.cc.
References m_totalRx, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 35 of file qkd-key-manager-system-application.cc.
References ns3::Create(), ns3::TcpSocketFactory::GetTypeId(), m_keyConsumedLink, m_keyConsumedRelay, m_keyServedTrace, m_keyWasteRelay, m_local, m_maxKeyPerRequest, m_maxKeySize, m_minKeySize, m_qbuffersVector, m_qkdKeyGeneratedTrace, m_rxTrace, m_rxTraceKMSs, m_tid, m_txTrace, m_txTraceKMSs, ns3::MakeIpv4AddressAccessor(), ns3::MakeIpv4AddressChecker(), ns3::MakeObjectVectorAccessor(), ns3::MakeTraceSourceAccessor(), ns3::MakeTypeIdAccessor(), ns3::MakeTypeIdChecker(), ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().
Here is the call graph for this function:
|
private |
Handle an incoming connection.
| s | the incoming connection socket |
| from | the address the connection is from |
Definition at line 714 of file qkd-key-manager-system-application.cc.
References ns3::InetSocketAddress::ConvertFrom(), HandleRead(), ns3::MakeCallback(), and NS_LOG_FUNCTION.
Referenced by PrepareSinkSocket().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Handle an incoming connection.
| s | the incoming connection socket |
| from | the address the connection is from |
Definition at line 721 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), ns3::InetSocketAddress::GetIpv4(), GetPort(), HandleReadKMSs(), m_socketPairsKMS, ns3::MakeCallback(), and NS_LOG_FUNCTION.
Here is the call graph for this function:Handle an connection close.
| socket | the connected socket |
Definition at line 803 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSinkSocket().
Here is the caller graph for this function:Handle an connection close.
| socket | the connected socket |
Definition at line 809 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Handle an connection error.
| socket | the connected socket |
Definition at line 815 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSinkSocket().
Here is the caller graph for this function:Handle an connection error.
| socket | the connected socket |
Definition at line 821 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Handle a packet received by the KMS application.
| socket | the receiving socket |
Definition at line 952 of file qkd-key-manager-system-application.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::InetSocketAddress::IsMatchingType(), m_rxTrace, m_totalRx, ns3::Simulator::Now(), NS_LOG_FUNCTION, and PacketReceived().
Referenced by HandleAccept(), and PrepareSinkSocket().
Here is the call graph for this function:
Here is the caller graph for this function:Handle a packet received by the KMS from KMS.
| socket | the receiving socket |
Definition at line 986 of file qkd-key-manager-system-application.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::InetSocketAddress::IsMatchingType(), m_rxTraceKMSs, m_totalRx, m_totalRxKMSs, ns3::Simulator::Now(), NS_LOG_FUNCTION, and PacketReceivedKMSs().
Referenced by HandleAcceptKMSs().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 3367 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
|
private |
Definition at line 3374 of file qkd-key-manager-system-application.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
|
private |
remember HTTP request made to peer KMS
| dstKms | destination kms IP address |
| request | request parameters |
HTTP handling
Definition at line 3325 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by Fill().
Here is the caller graph for this function:
|
private |
remove mapped HTTP response from query
| dstKms | destination kms IP address |
Definition at line 3336 of file qkd-key-manager-system-application.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Save query.
| query | http query |
Definition at line 3407 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION, and ns3::QKDKeyManagerSystemApplication::HttpQuery::req_id.
Referenced by Relay().
Here is the caller graph for this function:
|
private |
obtain method_type to map the HTTP response
| dstKms | destination KMS IP address |
Definition at line 3354 of file qkd-key-manager-system-application.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
|
private |
Make NEW_APP request to peer KMS.
| ksid | Unique identifier of the association |
Definition at line 2398 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateRequest(), ns3::QKDKeyManagerSystemApplication::HttpQuery::destination_sae, ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDKeyManagerSystemApplication::HttpQuery::source_sae, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
Assemble byte stream to extract HTTPMessage.
| p | received packet |
| from | from address |
The method assembles a received byte stream and extracts HTTPMessage instances from the stream to export in a trace source.
Definition at line 1020 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_buffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ProcessRequest().
Referenced by HandleRead().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Assemble byte stream to extract HTTPMessage.
| p | received packet |
| from | from address |
The method assembles a received byte stream and extracts HTTPMessage instances from the stream to export in a trace source.
Definition at line 1065 of file qkd-key-manager-system-application.cc.
References ns3::Create(), ns3::HTTPMessage::GetContentLength(), m_bufferKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, ProcessPacketKMSs(), and ns3::HTTPMessage::ToString().
Referenced by HandleReadKMSs().
Here is the call graph for this function:
Here is the caller graph for this function:Convert packet to string.
| packet | the packet |
|
private |
Definition at line 1126 of file qkd-key-manager-system-application.cc.
References ns3::Socket::Bind(), ns3::Create(), ns3::Socket::CreateSocket(), ns3::Ipv4Address::GetAny(), GetNode(), HandleAccept(), HandlePeerClose(), HandlePeerError(), HandleRead(), ns3::Socket::Listen(), m_port, m_sinkSocket, m_tid, ns3::MakeCallback(), ns3::MakeNullCallback(), NS_LOG_FUNCTION, ns3::Socket::SetAcceptCallback(), ns3::Socket::SetCloseCallbacks(), and ns3::Socket::SetRecvCallback().
Referenced by StartApplication().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1956 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateRequest(), ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QKDKeyManagerSystemApplication::HttpQuery::surplus_key_ID, ns3::QKDKeyManagerSystemApplication::HttpQuery::sync_index, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
Definition at line 2697 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetMessageBodyString(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Definition at line 2817 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Definition at line 1865 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
process close request from peer KMS
| header | receiving http header |
| socket | receiving socket |
| ksid | unique key stream identifier |
When QKDApp initiate etsi004 close request, its local KMS should release quantum keys currently assign to the key stream association. To do so, KMS should sync with peer KMS. This function perform necessery processing on the peer KMS to do sync.
Definition at line 3073 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
process close response from peer KMS
| header | receiving http header |
| socket | receiving socket |
Definition at line 3241 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Definition at line 2448 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_ERROR, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
Definition at line 2512 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
ETSI004 APP-KMS functions
@toDo First some sort of CAC is neccessary. Do we have enough resources to allow this association? Second, even if it seems that we do not have resources, if the request has high priority can we gather enough key material that is reserved for different associations that have lower priority. Or allow association, and from now on do not fill low priority association and generated key use to fill this high priority association.
For now, in the point-to-point link scenario, the open_connect request is always accepted!
Definition at line 1770 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::QKDLocationRegisterEntry::GetHop(), ns3::HTTPMessage::GetMessageBodyString(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
QKD key manager system application process the request peer KMS, and complete certain actions to respond on received request.
| header | received HTTP header |
| packet | received packet |
| socket | the receiving socket |
Data structure of key managment respond is described in ETSI004 document.
Definition at line 1678 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetUri(), and NS_LOG_FUNCTION.
Referenced by PacketReceivedKMSs().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
|
private |
Definition at line 2613 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
Definition at line 2655 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), NS_FATAL_ERROR, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Process key relay request.
| header | http request |
| socket | receiving socket |
KMS-KMS functions
Definition at line 2058 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateRequest(), ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetMessageBodyString(), ns3::QKDLocationRegisterEntry::GetNextHop(), ns3::HTTPMessage::GetUri(), ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::QKDKeyManagerSystemApplication::HttpQuery::peerNodeId, ns3::QKDKeyManagerSystemApplication::HttpQuery::prev_hop_id, ns3::QKDKeyManagerSystemApplication::HttpQuery::req_id, ns3::QKDKeyManagerSystemApplication::HttpQuery::request_uri, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
Process key relay response.
| headerIn | http response |
Definition at line 2321 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::QKDKeyManagerSystemApplication::HttpQuery::prev_hop_id.
Here is the call graph for this function:
|
private |
QKD key manager system application process the request from QKDApp, and complete certain actions to respond on received request.
| header | received HTTP header |
| packet | received packet |
| socket | the receiving socket |
Data structure of key managment respond is described in ETSI014 document.
Southbound interface functions(ETSI 014 & ETSI 004)
Currently we will go with the following idea:
The verfication procedure is not implemented. It should be similar to a Q3P STORE subprotocol.
In my opinion, KM should not transform the QKD-key in different block sizes, but rather choose one, most appropriate. In fact, when provisioning keys, KM would have to rendezvous with peer KM anyway, so the question is really about key transformation operation and memory organization in key storage.
@toDo How to choose this default key size?
Definition at line 1217 of file qkd-key-manager-system-application.cc.
References ns3::Create(), CreateRelaySBuffer(), ns3::HTTPMessage::CreateResponse(), EMPTY, ETSI_QKD_014_GET_STATUS, FetchRequestType(), GetAddress(), GetAddressString(), GetController(), ns3::Node::GetId(), GetMaxKeyPerRequest(), GetNode(), GetSBuffer(), m_keys_dec, m_keys_enc, m_maxKeySize, m_minKeySize, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::HTTPMessage::Ok, ReadUri(), SBufferClientCheck(), and SendToSocketPair().
Referenced by PacketReceived().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1689 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Definition at line 1733 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetRequestUri(), NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
process transform request
| header | receiving http header |
| socket | receiving socket |
Definition at line 2923 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateResponse(), ns3::QKDLocationRegisterEntry::GetDestinationKmsAddress(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetUri(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:
|
private |
process transform response
| header | receiving http header |
| socket | receiving socket |
Definition at line 3033 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), NS_ASSERT, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Read the parameters from the JSON OPEN_CONNECT structure!
| &dstSaeId | destination secure application entity |
| &srcSaeId | source secure application entity |
| &inQos | requested QoS |
| &ksid | Unique identifier of the association |
| jOpenConncetRequest | JSON structure of the OPEN_CONNECT call |
Definition at line 3714 of file qkd-key-manager-system-application.cc.
References ns3::QKDKeyManagerSystemApplication::QoS::chunkSize, and NS_ASSERT.
|
private |
Read parameters from URI.
| s | string URI |
Definition at line 3729 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION.
Referenced by ProcessRequest().
Here is the caller graph for this function:| void ns3::QKDKeyManagerSystemApplication::RegisterQKDModule | ( | uint32_t | dstId, |
| std::string | moduleId | ||
| ) |
Registers a QKD module in key manager.
| dstId | remote key manager node ID |
| moduleId | local QKD module ID |
Definition at line 643 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_qkdmodules, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Definition at line 2577 of file qkd-key-manager-system-application.cc.
References ns3::HTTPMessage::CreateRequest(), ns3::QKDKeyManagerSystemApplication::HttpQuery::ksid, ns3::QKDKeyManagerSystemApplication::HttpQuery::method_type, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::HTTPMessage::ToString().
Here is the call graph for this function:Start key relay function.
| dstKmNodeId | destination KM node |
| amount | amount of key material |
Chain of responsibility pattern. HTTP chain of proxies!
Definition at line 409 of file qkd-key-manager-system-application.cc.
References CheckSocketsKMS(), ns3::Create(), ns3::HTTPMessage::CreateRequest(), GenerateUUID(), GetAddressString(), GetController(), GetId(), ns3::Node::GetId(), GetNode(), GetPeerKmAddress(), GetSendSocketKMS(), HttpProxyRequestAdd(), ns3::QKDKey::INIT, m_keyConsumedRelay, m_keys_enc, NS_ASSERT, NS_LOG_FUNCTION, RELAY_KEYS, ns3::QKDKeyManagerSystemApplication::HttpQuery::req_id, SBufferClientCheck(), and ns3::HTTPMessage::ToString().
Referenced by SBufferClientCheck().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
release key stream association
| ksid | unique key stream identifier |
| surplusKeyId | unique key identifier for surplus key material in dedicated association buffer |
| syncIndex | unique key index in dedicated association buffer for synchronisation |
Definition at line 3165 of file qkd-key-manager-system-application.cc.
References NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ScheduleReleaseAssociation().
Here is the caller graph for this function:
|
private |
Remove proxy query when processed.
| reqId | request identifier |
Definition at line 3429 of file qkd-key-manager-system-application.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
check s-buffer levels
| dstKmNodeId | remote KM node ID |
Definition at line 300 of file qkd-key-manager-system-application.cc.
References ns3::Create(), Fill(), GetController(), GetQBuffer(), GetSBuffer(), ns3::SBuffer::LOCAL_SBUFFER, m_keys_dec, m_keys_enc, NS_ASSERT, NS_LOG_FUNCTION, Relay(), ns3::SBuffer::RELAY_SBUFFER, and UpdateLinkState().
Referenced by ProcessRequest(), Relay(), and StartSBufferClients().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
schedule next event in an attempt to fill association buffer
| t | time shift |
| action | name of the action |
| ksid | unique identifier of the association |
Definition at line 1170 of file qkd-key-manager-system-application.cc.
References CheckEtsi004Association(), ns3::Create(), m_scheduledChecks, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Here is the call graph for this function:
|
private |
Definition at line 1189 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_scheduledChecks, NS_FATAL_ERROR, NS_LOG_FUNCTION, ReleaseAssociation(), and ns3::Simulator::Schedule().
Here is the call graph for this function:
|
private |
Send packet to the pair socket.
| socket | receiving socket |
| packet | packet to send |
Definition at line 827 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_packetQueues, m_txTrace, and NS_LOG_FUNCTION.
Referenced by ProcessRequest().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Send packet to the pair socket.
| socket | receiving socket |
| packet | packet to send |
Definition at line 848 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_socketPairsKMS, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
inline |
Set local address.
| Ipv4Address | address |
Definition at line 195 of file qkd-key-manager-system-application.h.
References m_local.
| void ns3::QKDKeyManagerSystemApplication::SetCenController | ( | Ptr< QCenController > | controller | ) |
Definition at line 141 of file qkd-key-manager-system-application.cc.
References m_cen_controller, and NS_LOG_FUNCTION.
| void ns3::QKDKeyManagerSystemApplication::SetController | ( | Ptr< QKDControl > | controller | ) |
Assign QKDN controller.
| controller | pointer on QKDN controller |
Definition at line 133 of file qkd-key-manager-system-application.cc.
References GetController(), GetNode(), m_controller, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
inline |
Set key manager ID.
| id | string ID |
Definition at line 179 of file qkd-key-manager-system-application.h.
References m_km_id.
Set key manager ID.
| id | UUID ID |
Definition at line 171 of file qkd-key-manager-system-application.h.
References m_km_id.
Referenced by ns3::QKDAppHelper::InstallKeyManager(), and ns3::QKDAppHelper::InstallKeyManager().
Here is the caller graph for this function:Set node.
| n | node to be set |
Definition at line 155 of file qkd-key-manager-system-application.h.
References m_node.
| void ns3::QKDKeyManagerSystemApplication::SetPeerKmAddress | ( | uint32_t | dstKmNodeId, |
| Ipv4Address | dstKmAddress | ||
| ) |
Set peer KM node address.
| dstKmNodeId | peer KM node ID |
| dstKmAddress | peer KM address |
It is called from qkd-control to register peer KM address.
Definition at line 194 of file qkd-key-manager-system-application.cc.
References ns3::Create(), m_peerAddressTable, and NS_LOG_FUNCTION.
Here is the call graph for this function:Set local port.
| uint32_t | port |
Definition at line 218 of file qkd-key-manager-system-application.h.
Set sink socket.
| type | socket type |
| socket | pointer to socket to be set |
Definition at line 684 of file qkd-key-manager-system-application.cc.
References m_sinkSocket, and NS_LOG_FUNCTION.
|
overrideprivatevirtual |
Start KMS Application.
APPLICATION functions
Reimplemented from ns3::Application.
Definition at line 1119 of file qkd-key-manager-system-application.cc.
References NS_LOG_FUNCTION, and PrepareSinkSocket().
Here is the call graph for this function:Start s-buffers control – monitoring.
| dstKmNodeId | remote KM node ID |
Definition at line 265 of file qkd-key-manager-system-application.cc.
References ns3::Create(), GetId(), GetNode(), GetQBuffer(), ns3::SBuffer::LOCAL_SBUFFER, m_keys_dec, m_keys_enc, NS_LOG_FUNCTION, and SBufferClientCheck().
Referenced by CreateQBuffer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overrideprivatevirtual |
Stop KMS Application.
Reimplemented from ns3::Application.
Definition at line 1159 of file qkd-key-manager-system-application.cc.
References ns3::Socket::Close(), m_sinkSocket, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().
Here is the call graph for this function:Check the QKD link state to given destination.
| dstKmNodeId | The destination KM node identifier. |
Definition at line 155 of file qkd-key-manager-system-application.cc.
References ns3::Create(), GetCenController(), GetId(), ns3::Node::GetId(), GetNode(), GetQBuffer(), GetSBuffer(), m_link_states, ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by Fill(), and SBufferClientCheck().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 668 of file qkd-key-manager-system-application.h.
Referenced by Fill().
|
private |
Buffer for received packets(TCP segmentation)
Definition at line 727 of file qkd-key-manager-system-application.h.
Referenced by PacketReceived().
|
private |
Buffer for received packets(TCP segmentation)
Definition at line 728 of file qkd-key-manager-system-application.h.
Referenced by PacketReceivedKMSs().
|
private |
Asigned Q centralized controler for routing!
Definition at line 684 of file qkd-key-manager-system-application.h.
Referenced by GetCenController(), and SetCenController().
|
private |
Definition at line 702 of file qkd-key-manager-system-application.h.
|
private |
Asigned QKDN controller.
Definition at line 686 of file qkd-key-manager-system-application.h.
Referenced by GetController(), and SetController().
|
private |
Definition at line 937 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication().
Definition at line 761 of file qkd-key-manager-system-application.h.
|
private |
Definition at line 760 of file qkd-key-manager-system-application.h.
|
private |
HTTP handling
Each application can open only one connection with its local KMS(current socket). Each KMS can have only one connection with arbitrary KMS(current socket).
Definition at line 758 of file qkd-key-manager-system-application.h.
|
private |
Definition at line 714 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId().
|
private |
Definition at line 715 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and Relay().
LOCAL S-buffers for the inbound point-to-poit usage.
Definition at line 694 of file qkd-key-manager-system-application.h.
Referenced by CreateQBuffer(), GetSBuffer(), ProcessRequest(), SBufferClientCheck(), and StartSBufferClients().
LOCAL S-buffers for the outbound point-to-point usage.
Definition at line 692 of file qkd-key-manager-system-application.h.
Referenced by CreateQBuffer(), GetSBuffer(), ProcessRequest(), Relay(), SBufferClientCheck(), and StartSBufferClients().
|
private |
Definition at line 713 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId().
|
private |
Definition at line 716 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId().
|
private |
Definition at line 682 of file qkd-key-manager-system-application.h.
|
private |
Definition at line 698 of file qkd-key-manager-system-application.h.
|
private |
Definition at line 700 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication().
Notified link states!
Definition at line 688 of file qkd-key-manager-system-application.h.
Referenced by CreateQBuffer(), and UpdateLinkState().
|
private |
Local address to bind to.
Definition at line 672 of file qkd-key-manager-system-application.h.
Referenced by GetAddress(), GetTypeId(), and SetAddress().
|
private |
Definition at line 718 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId().
|
private |
Definition at line 720 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessRequest().
|
private |
Definition at line 723 of file qkd-key-manager-system-application.h.
|
private |
Definition at line 719 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and ProcessRequest().
|
private |
Definition at line 724 of file qkd-key-manager-system-application.h.
Definition at line 732 of file qkd-key-manager-system-application.h.
Buffering unsend messages due to connection problems.
Definition at line 733 of file qkd-key-manager-system-application.h.
Referenced by ConnectionSucceeded(), and SendToSocketPair().
|
private |
IP address of peer KM nodes.
Definition at line 935 of file qkd-key-manager-system-application.h.
Referenced by GetPeerKmAddress(), and SetPeerKmAddress().
|
private |
Local port to bind to.
Definition at line 674 of file qkd-key-manager-system-application.h.
Referenced by GetPort(), PrepareSinkSocket(), and SetPort().
Q-buffers for every QKD connection.
Definition at line 690 of file qkd-key-manager-system-application.h.
Referenced by CreateQBuffer(), and GetQBuffer().
The list of QBuffers is necessary for plotting.
Definition at line 737 of file qkd-key-manager-system-application.h.
Referenced by CreateQBuffer(), GetQBuffersVector(), and GetTypeId().
|
private |
Definition at line 712 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId().
|
private |
QKD modules and KM node ID they connect to.
Definition at line 696 of file qkd-key-manager-system-application.h.
Referenced by RegisterQKDModule().
|
private |
KMS Queue Logic for ETSI 004 QoS handling.
Definition at line 735 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication().
|
private |
Traced Callback: received packets, source address.
Definition at line 707 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and HandleRead().
|
private |
Definition at line 709 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and HandleReadKMSs().
|
private |
Definition at line 704 of file qkd-key-manager-system-application.h.
Referenced by ScheduleCheckEtsi004Association(), and ScheduleReleaseAssociation().
Definition at line 670 of file qkd-key-manager-system-application.h.
Referenced by DoDispose(), GetSocket(), PrepareSinkSocket(), SetSocket(), and StopApplication().
|
private |
we do not know which KMS is going to initialize new TCP connection to peer KMS.
Therefore, we have two sockets(sink and send) per node.
Definition at line 730 of file qkd-key-manager-system-application.h.
Referenced by CheckSocketsKMS(), DoDispose(), GetSendSocketKMS(), HandleAcceptKMSs(), and SendToSocketPairKMS().
|
private |
Definition at line 725 of file qkd-key-manager-system-application.h.
|
private |
Definition at line 680 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId(), and PrepareSinkSocket().
|
private |
Total bytes received.
Definition at line 676 of file qkd-key-manager-system-application.h.
Referenced by QKDKeyManagerSystemApplication(), GetTotalRx(), HandleRead(), and HandleReadKMSs().
|
private |
Total bytes received between KMSs.
Definition at line 678 of file qkd-key-manager-system-application.h.
Referenced by HandleReadKMSs().
|
private |
Definition at line 708 of file qkd-key-manager-system-application.h.
Referenced by ConnectionSucceeded(), GetTypeId(), and SendToSocketPair().
|
private |
Definition at line 710 of file qkd-key-manager-system-application.h.
Referenced by GetTypeId().
|
staticprivate |
number of created KMSs - static value
Definition at line 307 of file qkd-key-manager-system-application.h.