Establish secure communication on application lavel to use the key and test LKSM. More...
#include "qkd-app-014.h"
Inheritance diagram for ns3::QKDApp014:
Collaboration diagram for ns3::QKDApp014:Classes | |
| struct | AddressHash |
| Hashing for the Address class. More... | |
Public Types | |
| enum | State { NOT_STARTED , INITIALIZED , READY , WAIT , SEND_DATA , DECRYPT_DATA , STOPPED } |
| QKD App states(App) States that refer to QKDApp014 data transmision! 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 | |
| QKDApp014 () | |
| ~QKDApp014 () override | |
| void | CheckAppState () |
| Checks the conditions to change the application state. | |
| bool | ConnectionRequestedFromApp (Ptr< Socket > socket, const Address &address) |
| Callback function after the connection for response from KMS has been received. | |
| bool | ConnectionRequestedFromKMS (Ptr< Socket > socket, const Address &address) |
| Callback function after the connection for response from KMS has been received. | |
| bool | ConnectionRequestedSignalingFromApp (Ptr< Socket > socket, const Address &address) |
| Callback function after the connection for response from KMS has been received. | |
| void | ConnectionSignalingToAppFailed (Ptr< Socket > socket) |
| Callback function after the signaling connection to the APP has. | |
| void | ConnectionSignalingToAppSucceeded (Ptr< Socket > socket) |
| Callback function after the signaling connection to the APP is complete. | |
| void | ConnectionToAppFailed (Ptr< Socket > socket) |
| Callback function after the connection to the APP has failed. | |
| void | ConnectionToAppSucceeded (Ptr< Socket > socket) |
| Callback function after the connection to the APP is complete. | |
| void | ConnectionToKMSFailed (Ptr< Socket > socket) |
| Callback function after the connection to the KMS has failed. | |
| void | ConnectionToKMSSucceeded (Ptr< Socket > socket) |
| Callback function after the connection to the KMS is complete. | |
| void | DataToKMSSend (Ptr< Socket >, uint32_t) |
| Callback function to notify that data to KMS has been sent. | |
| std::string | GetAppStateString () const |
| Returns the current state of the application in string format. | |
| uint32_t | GetAuthenticationKeySize () |
| Get key size for defined authentication algorithm. | |
| uint32_t | GetEncryptionKeySize () |
| Get key size for defined encryption algorithm. | |
| std::string | GetId () |
| Get the application ID. | |
| Ipv4Address | GetIp () |
| Get ipv4 address of source. | |
| void | GetKeysFromKMS (std::string keyType) |
| Get keys from local KMS. | |
| void | GetKeyWithKeyIDs (std::string keyIds) |
| Get keys identified with given IDs from local KMS. | |
| Ipv4Address | GetKmsIp () |
| Get ipv4 address of local KMS. | |
| Ptr< AppKey > | GetLocalKey (std::string keyType, std::string keyId="") |
| Get key from key store. | |
| Ipv4Address | GetPeerIp () |
| Get ipv4 address of destination. | |
| State | GetState () const |
| returns application state | |
| void | GetStatusFromKMS () |
| Get status from local KMS. | |
| void | HandleAcceptFromApp (Ptr< Socket > s, const Address &from) |
| Handle an incoming connection from peer QKD application. | |
| void | HandleAcceptFromKMS (Ptr< Socket > s, const Address &from) |
| Handle an incoming connection from KMS. | |
| void | HandleAcceptSignalingFromApp (Ptr< Socket > s, const Address &from) |
| Handle a signaling incoming connection from peer QKD application. | |
| void | HandlePeerCloseFromApp (Ptr< Socket > socket) |
| Handle a connection close from peer QKD application. | |
| void | HandlePeerCloseFromKMS (Ptr< Socket > socket) |
| Handle a connection close from KMS. | |
| void | HandlePeerCloseSignalingFromApp (Ptr< Socket > socket) |
| Handle a signaling connection close from peer QKD application. | |
| void | HandlePeerErrorFromApp (Ptr< Socket > socket) |
| Handle a connection error from peer QKD application. | |
| void | HandlePeerErrorFromKMS (Ptr< Socket > socket) |
| Handle a connection error from KMS. | |
| void | HandlePeerErrorSignalingFromApp (Ptr< Socket > socket) |
| Handle a signaling connection error from peer QKD application. | |
| void | HandleReadFromApp (Ptr< Socket > socket) |
| Handle a packet received by the QKD application from peer QKD application. | |
| void | HandleReadFromKMS (Ptr< Socket > socket) |
| Handle a packet received by the QKD application from KMS application. | |
| void | HandleReadSignalingFromApp (Ptr< Socket > socket) |
| Handle a signaling packet received by the QKD application from peer QKD application. | |
| void | HttpPacketReceived (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket) |
| Check for tcp segmentation of packets received. | |
| void | InitKeyStores () |
| Initialize key stores at application layer. | |
| void | ManageStores () |
| Checks the state of the key stores. | |
| void | PrepareSocketToApp () |
| Prepare send socket to communicate with QKD Application. | |
| void | PrepareSocketToKMS () |
| Prepare send socket to communicate with KMS Application. | |
| void | PrintStoreStats () |
| Print status information on key stores. | |
| void | ProcessDataPacket (QKDAppHeader header, Ptr< Packet > packet, Ptr< Socket > socket) |
| Process data packets from peer QKD application. | |
| void | ProcessResponseFromKMS (HTTPMessage &header, Ptr< Packet > packet, Ptr< Socket > socket) |
| Process response from KMS application. | |
| void | ProcessSignalingPacketFromApp (HTTPMessage &header, Ptr< Packet > packet, Ptr< Socket > socket) |
| Process signaling packets from peer QKD application. | |
| void | QAppPacketReceived (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket) |
| Check for tcp segmentation of signaling packets received from KMS. | |
| void | ScheduleAction (Time t, std::string action) |
| Schedule action to performe. | |
| void | SetCryptoSettings (uint32_t encryptionType, uint32_t authenticationType, uint32_t authenticationTagLengthInBits) |
| Set encryption and authentication type. | |
| void | SetState (State state) |
| set application state | |
| void | Setup (std::string socketType, std::string appId, std::string remoteAppId, const Address &appAddress, const Address &remoteAppAddress, const Address &kmAddress, std::string type) |
| void | Setup (std::string socketType, std::string appId, std::string remoteAppId, const Address &appAddress, const Address &remoteAppAddress, const Address &kmAddress, uint32_t packetSize, DataRate dataRate, std::string type) |
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 std::string | GetAppStateString (State state) |
| Returns the given application state in string format. | |
| 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 | AppTransitionTree () |
| Transition tree of the application. | |
| std::string | CreateKeyIdField (std::string keyId) |
| Create encryption key id field for the QKDApp header. | |
| std::string | GetPacketContent (uint32_t msgLength=0) |
| Get the packet payload content. | |
| std::string | IpToString (Ipv4Address address) |
| Convert ipv4 address in string. | |
| std::vector< std::string > | PopHttpAppRequest () |
| Pop HTTP request from app queue. | |
| std::string | PopHttpKmsRequest () |
| Pop HTTP request from kms queue. | |
| void | PushHttpAppRequest (std::vector< std::string > keyIds) |
| Adds HTTP request to app queue to properly map response later. | |
| void | PushHttpKmsRequest (std::string input) |
| Adds HTTP request to kms queue to properly map response later. | |
| std::string | ReadKeyIdField (std::string keyId) |
| Read key ID from the encryption key ID field of the QKDApp header. | |
| std::vector< std::string > | ReadUri (std::string s) |
| Read http uri in vector. | |
| void | ScheduleTx () |
| Schedule event to send data. | |
| void | SendDataPacket () |
| Send protected data. | |
| void | SendKeyIds (std::vector< std::string > keyIds, HTTPMessage::HttpStatus statusCode=HTTPMessage::Ok) |
| Implementation of send KEY_IDS notification. | |
| void | StartApplication () override |
| Start application. | |
| void | StopApplication () override |
| Stop application. | |
| void | SwitchAppState (State state) |
| Change the state of the application. | |
Private Attributes | |
| uint32_t | m_aesLifetime |
| key lifetime in bytes | |
| std::vector< std::vector< std::string > > | m_appHttpReqQueue |
| uint32_t | m_authentication |
| authentication type | |
| TracedCallback< Ptr< Packet >, std::string > | m_authenticationTrace |
| trace callback for authentication | |
| QKDEncryptor::AuthenticationType | m_authenticationType |
| authentication type | |
| std::map< std::string, Ptr< AppKey > > | m_authStore |
| uint32_t | m_authTagSize |
| length of the authentication tag in bits | |
| std::unordered_map< Address, Ptr< Packet >, AddressHash > | m_buffer_kms |
| Buffer for received packets(fragmentation) | |
| std::unordered_map< Address, Ptr< Packet >, AddressHash > | m_buffer_QKDApp014 |
| Buffer for received packets(fragmentation) | |
| std::map< std::string, Ptr< AppKey > > | m_commonStore |
| Ptr< Socket > | m_dataSocketApp |
| TracedCallback< Ptr< Packet >, std::string > | m_deauthenticationTrace |
| trace callback for authentication check | |
| TracedCallback< Ptr< Packet > > | m_decryptionTrace |
| trace callback for decryption | |
| std::string | m_dstId |
| destination application id | |
| uint32_t | m_encryption |
| encryption type | |
| TracedCallback< Ptr< Packet > > | m_encryptionTrace |
| trace callback for encryption | |
| QKDEncryptor::EncryptionType | m_encryptionType |
| encryption type | |
| Ptr< QKDEncryptor > | m_encryptor |
| encryptor | |
| std::map< std::string, Ptr< AppKey > > | m_encStore |
| std::string | m_id |
| source application id | |
| bool | m_internalAppWait |
| bool | m_isDataConnectedToApp |
| bool | m_isSignalingConnectedToApp |
| Address | m_kms |
| local kms address | |
| std::vector< std::string > | m_kmsHttpReqQueue |
| Address | m_local |
| local address | |
| uint32_t | m_master |
| is master App014 | |
| TracedCallback< const std::string &, Ptr< const Packet > > | m_mxTrace |
| Traced Callback: missed send packet call. | |
| uint32_t | m_numberOfKeysKMS |
| number of keys to fetch per request | |
| Address | m_peer |
| peer address | |
| uint16_t | m_portSignaling |
| DataRate | m_rate |
| data rate | |
| TracedCallback< const std::string &, Ptr< const Packet > > | m_rxKmsTrace |
| Traced Callback: received packets from KMS. | |
| TracedCallback< const std::string &, Ptr< const Packet > > | m_rxSigTrace |
| Traced Callback: received signaling packets. | |
| TracedCallback< const std::string &, Ptr< const Packet > > | m_rxTrace |
| Traced Callback: received data packets. | |
| EventId | m_scheduleManageStores |
| EventId | m_sendEvent |
| Ptr< Socket > | m_signalingSocketApp |
| uint32_t | m_size |
| data packet size | |
| Ptr< Socket > | m_socketToKMS |
| std::string | m_socketType |
| State | m_state |
| application state | |
| ns3::TracedCallback< const std::string &, const std::string & > | m_stateTransitionTrace |
The StateTransition trace source. | |
| TypeId | m_tid |
| tid | |
| std::multimap< std::string, std::string > | m_transitionMatrix |
| transition map of protocol states | |
| TracedCallback< const std::string &, Ptr< const Packet > > | m_txKmsTrace |
| Traced Callback: transmitted packets to KMS. | |
| TracedCallback< const std::string &, Ptr< const Packet > > | m_txSigTrace |
| Traced Callback: transmitted signaling packets. | |
| TracedCallback< const std::string &, Ptr< const Packet > > | m_txTrace |
| Traced Callback: transmitted data packets. | |
| uint32_t | m_useCrypto |
| execute crypo algorithms | |
| Time | m_waitInsufficient |
| time wait before submitting new get_key after error | |
Static Private Attributes | |
| static uint32_t | m_applicationCounts = 0 |
| application count | |
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. | |
Establish secure communication on application lavel to use the key and test LKSM.
This application was written to complement simple application to consume keys so a generic QKDApp014 name was selected. The application(Alice) implements sockets for connection with counter-party application(Bob) and implements sockets for communication with local key management system. At the moment, application follows ETSI QKD 014 standardization exchanging HTTP requests/responses to obtain details about the key from its local key management system. Obtained keys from Get key response are stored in temporary memory on master QKDApp014(Alice) in JSON data structure, from where they are moved to an application key buffer when confirmation of keys from peer application(Bob) is recieved. Keys obtained from Get key with key IDs are directly stored to the application key buffer and confirmation message for keys is sent to its peer application(Alice). Application(Alice) use keys from the application key buffer to apply security services on its data. QKD application header is then added to the protected data and sent to peer application. Slave QKD application(Bob) will process recieved protected packet based on information in QKD header and keys from the application key buffer. Communication between peers needed to negotiate keys was not included in ETSI014, and this application use HTTP messages for this purpose.
ns3::QKDApp014 is accessible through the following paths with Config::Set and Config::Connect:
TypeId Time -9.22337e+18ns:+9.22337e+18ns Time -9.22337e+18ns:+9.22337e+18ns Time -9.22337e+18ns:+9.22337e+18ns Group: Applications
Size of this type is 1104 bytes (on a 64-bit architecture).
Definition at line 70 of file qkd-app-014.h.
QKD App states(App) States that refer to QKDApp014 data transmision!
| Enumerator | |
|---|---|
| NOT_STARTED | |
| INITIALIZED | |
| READY | |
| WAIT | |
| SEND_DATA | |
| DECRYPT_DATA | |
| STOPPED | |
Definition at line 85 of file qkd-app-014.h.
| ns3::QKDApp014::QKDApp014 | ( | ) |
SETUP
Definition at line 136 of file qkd-app-014.cc.
References m_applicationCounts, and m_transitionMatrix.
|
override |
Definition at line 166 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
|
private |
Transition tree of the application.
Change states and take actions!
STATE functions
Definition at line 1502 of file qkd-app-014.cc.
References GetAuthenticationKeySize(), GetEncryptionKeySize(), GetState(), GetStatusFromKMS(), INITIALIZED, m_master, NS_FATAL_ERROR, NS_LOG_FUNCTION, PrepareSocketToApp(), PrepareSocketToKMS(), READY, SendDataPacket(), SwitchAppState(), and WAIT.
Referenced by StartApplication().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::CheckAppState | ( | ) |
Checks the conditions to change the application state.
Based on the states of the key stores, the application will change its states between READY and WAIT.
Definition at line 912 of file qkd-app-014.cc.
References ns3::Create(), GetAppStateString(), GetAuthenticationKeySize(), GetEncryptionKeySize(), GetState(), m_authStore, m_encStore, NS_LOG_FUNCTION, READY, SwitchAppState(), and WAIT.
Referenced by ManageStores(), and ProcessSignalingPacketFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:Callback function after the connection for response from KMS has been received.
| socket | the connected socket |
| address | address of the KMS |
Definition at line 487 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), m_isDataConnectedToApp, and NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the call graph for this function:
Here is the caller graph for this function:Callback function after the connection for response from KMS has been received.
| socket | the connected socket |
| address | address of the KMS |
Definition at line 500 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), and NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
Here is the call graph for this function:
Here is the caller graph for this function:| bool ns3::QKDApp014::ConnectionRequestedSignalingFromApp | ( | Ptr< Socket > | socket, |
| const Address & | address | ||
| ) |
Callback function after the connection for response from KMS has been received.
| socket | the connected socket |
| address | address of the KMS |
Definition at line 474 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), m_isSignalingConnectedToApp, and NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the call graph for this function:
Here is the caller graph for this function:Callback function after the signaling connection to the APP has.
| socket | the connected socket |
Definition at line 581 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Callback function after the signaling connection to the APP is complete.
| socket | the connected socket |
Definition at line 567 of file qkd-app-014.cc.
References m_isSignalingConnectedToApp, and NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Callback function after the connection to the APP has failed.
| socket | the connected socket |
Definition at line 561 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Callback function after the connection to the APP is complete.
| socket | the connected socket |
Definition at line 574 of file qkd-app-014.cc.
References m_isDataConnectedToApp, and NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Callback function after the connection to the KMS has failed.
| socket | the connected socket |
Definition at line 556 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
Here is the caller graph for this function:Callback function after the connection to the KMS is complete.
| socket | the connected socket |
Definition at line 550 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
Here is the caller graph for this function:
|
private |
Create encryption key id field for the QKDApp header.
| keyId | key ID used to create encryption key id field |
Definition at line 1689 of file qkd-app-014.cc.
References ns3::Create().
Referenced by SendDataPacket().
Here is the call graph for this function:
Here is the caller graph for this function:Callback function to notify that data to KMS has been sent.
| socket | the connected socket |
| uint32_t | amount of data sent |
Definition at line 807 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
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 172 of file qkd-app-014.cc.
References ns3::Application::DoDispose(), m_dataSocketApp, m_signalingSocketApp, m_socketToKMS, and NS_LOG_FUNCTION.
Here is the call graph for this function:| std::string ns3::QKDApp014::GetAppStateString | ( | ) | const |
Returns the current state of the application in string format.
Definition at line 1575 of file qkd-app-014.cc.
References GetAppStateString(), and GetState().
Referenced by CheckAppState(), GetAppStateString(), QAppPacketReceived(), ScheduleTx(), SendDataPacket(), StartApplication(), and SwitchAppState().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns the given application state in string format.
| state | An arbitrary state of an application. |
Definition at line 1541 of file qkd-app-014.cc.
References DECRYPT_DATA, INITIALIZED, NOT_STARTED, NS_FATAL_ERROR, READY, SEND_DATA, STOPPED, and WAIT.
| uint32_t ns3::QKDApp014::GetAuthenticationKeySize | ( | ) |
Get key size for defined authentication algorithm.
Definition at line 1731 of file qkd-app-014.cc.
References m_authenticationType, ns3::QKDEncryptor::QKDCRYPTO_AUTH_MD5, ns3::QKDEncryptor::QKDCRYPTO_AUTH_SHA1, ns3::QKDEncryptor::QKDCRYPTO_AUTH_VMAC, and ns3::QKDEncryptor::UNAUTHENTICATED.
Referenced by AppTransitionTree(), CheckAppState(), GetKeysFromKMS(), ManageStores(), ProcessDataPacket(), and SendDataPacket().
Here is the caller graph for this function:| uint32_t ns3::QKDApp014::GetEncryptionKeySize | ( | ) |
Get key size for defined encryption algorithm.
Definition at line 1708 of file qkd-app-014.cc.
References m_encryptionType, m_size, NS_LOG_FUNCTION, ns3::QKDEncryptor::QKDCRYPTO_AES, ns3::QKDEncryptor::QKDCRYPTO_OTP, and ns3::QKDEncryptor::UNENCRYPTED.
Referenced by AppTransitionTree(), CheckAppState(), GetKeysFromKMS(), and ManageStores().
Here is the caller graph for this function:
|
inline |
Get the application ID.
Definition at line 428 of file qkd-app-014.h.
References m_id.
Referenced by GetKeysFromKMS(), GetKeyWithKeyIDs(), GetStatusFromKMS(), HttpPacketReceived(), QAppPacketReceived(), SendDataPacket(), and SendKeyIds().
Here is the caller graph for this function:| Ipv4Address ns3::QKDApp014::GetIp | ( | ) |
Get ipv4 address of source.
Definition at line 1777 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), m_local, and NS_LOG_FUNCTION.
Referenced by SendKeyIds().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::GetKeysFromKMS | ( | std::string | keyType | ) |
Get keys from local KMS.
| keyType | key type(encryption or authentication) |
Method defined by the ETSI QKD 014 document
Definition at line 1224 of file qkd-app-014.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), GetAuthenticationKeySize(), GetEncryptionKeySize(), GetId(), GetKmsIp(), IpToString(), m_dstId, m_numberOfKeysKMS, m_socketToKMS, m_txKmsTrace, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_ERROR, NS_LOG_FUNCTION, PrepareSocketToKMS(), PushHttpKmsRequest(), ns3::Socket::Send(), ns3::HTTPMessage::SetHeader(), and ns3::HTTPMessage::ToString().
Referenced by ManageStores(), and ProcessSignalingPacketFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::GetKeyWithKeyIDs | ( | std::string | keyIds | ) |
Get keys identified with given IDs from local KMS.
| keyIds | key identifiers in JSON key_Ids string format |
Method defined by the ETSI QKD 014 document
Definition at line 1276 of file qkd-app-014.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), GetId(), GetKmsIp(), IpToString(), m_dstId, m_socketToKMS, m_txKmsTrace, NS_ASSERT, NS_LOG_FUNCTION, PrepareSocketToKMS(), ns3::Socket::Send(), ns3::HTTPMessage::SetHeader(), and ns3::HTTPMessage::ToString().
Referenced by ProcessSignalingPacketFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:| Ipv4Address ns3::QKDApp014::GetKmsIp | ( | ) |
Get ipv4 address of local KMS.
Definition at line 1791 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), m_kms, and NS_LOG_FUNCTION.
Referenced by GetKeysFromKMS(), GetKeyWithKeyIDs(), and GetStatusFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:Get key from key store.
| keyType | key type(encryption or authentication) |
| keyId | key identifier(optional) |
Definition at line 847 of file qkd-app-014.cc.
References ns3::Create(), ns3::AppKey::ENCRYPTION, m_authStore, m_commonStore, m_encStore, m_master, m_size, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ProcessDataPacket(), and SendDataPacket().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Get the packet payload content.
| msgLength | length of random string to generate |
Definition at line 1667 of file qkd-app-014.cc.
References ns3::Create(), m_size, and NS_LOG_FUNCTION.
Referenced by SendDataPacket().
Here is the call graph for this function:
Here is the caller graph for this function:| Ipv4Address ns3::QKDApp014::GetPeerIp | ( | ) |
Get ipv4 address of destination.
Definition at line 1784 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), m_peer, and NS_LOG_FUNCTION.
Referenced by HttpPacketReceived(), and SendKeyIds().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
returns application state
Definition at line 155 of file qkd-app-014.h.
References m_state.
Referenced by AppTransitionTree(), CheckAppState(), GetAppStateString(), QAppPacketReceived(), ScheduleTx(), SendDataPacket(), and StartApplication().
Here is the caller graph for this function:| void ns3::QKDApp014::GetStatusFromKMS | ( | ) |
Get status from local KMS.
Method defined by the ETSI QKD 014 document
KEY MANAGEMENT functions
Definition at line 1195 of file qkd-app-014.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), GetId(), GetKmsIp(), IpToString(), m_dstId, m_socketToKMS, m_txKmsTrace, NS_ASSERT, NS_LOG_FUNCTION, PrepareSocketToKMS(), ns3::Socket::Send(), ns3::HTTPMessage::SetHeader(), and ns3::HTTPMessage::ToString().
Referenced by AppTransitionTree().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Get the type ID.
Definition at line 34 of file qkd-app-014.cc.
References ns3::Create(), ns3::TcpSocketFactory::GetTypeId(), m_aesLifetime, m_authentication, m_authenticationTrace, m_authTagSize, m_deauthenticationTrace, m_decryptionTrace, m_encryption, m_encryptionTrace, m_mxTrace, m_numberOfKeysKMS, m_rxKmsTrace, m_rxSigTrace, m_rxTrace, m_stateTransitionTrace, m_tid, m_txKmsTrace, m_txSigTrace, m_txTrace, m_useCrypto, m_waitInsufficient, ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeTypeIdAccessor(), ns3::MakeTypeIdChecker(), ns3::MakeUintegerAccessor(), ns3::Seconds(), and ns3::TypeId::SetParent().
Here is the call graph for this function:Handle an incoming connection from peer QKD application.
| s | the incoming connection socket |
| from | the address the connection is from |
Definition at line 524 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), HandleReadFromApp(), m_dataSocketApp, ns3::MakeCallback(), and NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the call graph for this function:
Here is the caller graph for this function:Handle an incoming connection from KMS.
| s | the incoming connection socket |
| from | the address the connection is from |
Definition at line 512 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), HandleReadFromKMS(), ns3::MakeCallback(), and NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
Here is the call graph for this function:
Here is the caller graph for this function:Handle a signaling incoming connection from peer QKD application.
| s | the incoming connection socket |
| from | the address the connection is from |
Definition at line 537 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), HandleReadSignalingFromApp(), m_signalingSocketApp, ns3::MakeCallback(), and NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the call graph for this function:
Here is the caller graph for this function:Handle a connection close from peer QKD application.
| socket | the connected socket |
Definition at line 599 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Handle a connection close from KMS.
| socket | the connected socket |
Definition at line 587 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
Here is the caller graph for this function:Handle a signaling connection close from peer QKD application.
| socket | the connected socket |
Definition at line 610 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Handle a connection error from peer QKD application.
| socket | the connected socket |
Definition at line 604 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Handle a connection error from KMS.
| socket | the connected socket |
Definition at line 593 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
Here is the caller graph for this function:Handle a signaling connection error from peer QKD application.
| socket | the connected socket |
Definition at line 616 of file qkd-app-014.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Handle a packet received by the QKD application from peer QKD application.
| socket | the receiving socket |
Definition at line 650 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::InetSocketAddress::IsMatchingType(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and QAppPacketReceived().
Referenced by HandleAcceptFromApp(), and PrepareSocketToApp().
Here is the call graph for this function:
Here is the caller graph for this function:Handle a packet received by the QKD application from KMS application.
| socket | the receiving socket |
Definition at line 622 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), HttpPacketReceived(), ns3::InetSocketAddress::IsMatchingType(), ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by HandleAcceptFromKMS(), and PrepareSocketToKMS().
Here is the call graph for this function:
Here is the caller graph for this function:Handle a signaling packet received by the QKD application from peer QKD application.
| socket | the receiving socket |
Definition at line 678 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), HttpPacketReceived(), ns3::InetSocketAddress::IsMatchingType(), ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by HandleAcceptSignalingFromApp(), and PrepareSocketToApp().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::HttpPacketReceived | ( | const Ptr< Packet > & | p, |
| const Address & | from, | ||
| Ptr< Socket > | socket | ||
| ) |
Check for tcp segmentation of packets received.
| packet | |
| address | address of the KMS |
| socket | the connected socket |
Definition at line 750 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), GetId(), ns3::InetSocketAddress::GetIpv4(), GetPeerIp(), m_buffer_kms, m_rxKmsTrace, m_rxSigTrace, NS_LOG_DEBUG, NS_LOG_FUNCTION, ProcessResponseFromKMS(), and ProcessSignalingPacketFromApp().
Referenced by HandleReadFromKMS(), and HandleReadSignalingFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::InitKeyStores | ( | ) |
Initialize key stores at application layer.
KEY BUFFER functions
Definition at line 821 of file qkd-app-014.cc.
References m_authStore, m_commonStore, m_encStore, and NS_LOG_FUNCTION.
Referenced by Setup(), and StopApplication().
Here is the caller graph for this function:
|
private |
Convert ipv4 address in string.
| address | ipv4 address |
Definition at line 1798 of file qkd-app-014.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Referenced by GetKeysFromKMS(), GetKeyWithKeyIDs(), GetStatusFromKMS(), and SendKeyIds().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::ManageStores | ( | ) |
Checks the state of the key stores.
Function checks ste state of the application key stores and submits get_key request if neccessary.
Definition at line 831 of file qkd-app-014.cc.
References CheckAppState(), GetAuthenticationKeySize(), GetEncryptionKeySize(), GetKeysFromKMS(), m_authStore, m_encStore, m_internalAppWait, m_master, NS_LOG_FUNCTION, and PrintStoreStats().
Referenced by ProcessResponseFromKMS(), ScheduleAction(), and SendDataPacket().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Pop HTTP request from app queue.
It deletes request from queue!
Definition at line 971 of file qkd-app-014.cc.
References ns3::Create(), m_appHttpReqQueue, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by ProcessSignalingPacketFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Pop HTTP request from kms queue.
It deletes request from queue!
Definition at line 958 of file qkd-app-014.cc.
References ns3::Create(), m_kmsHttpReqQueue, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by ProcessResponseFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::PrepareSocketToApp | ( | ) |
Prepare send socket to communicate with QKD Application.
Definition at line 336 of file qkd-app-014.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), ConnectionRequestedFromApp(), ConnectionRequestedSignalingFromApp(), ConnectionSignalingToAppFailed(), ConnectionSignalingToAppSucceeded(), ConnectionToAppFailed(), ConnectionToAppSucceeded(), ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), ns3::Socket::CreateSocket(), ns3::Socket::GetErrno(), ns3::Application::GetNode(), ns3::TcpSocketFactory::GetTypeId(), ns3::UdpSocketFactory::GetTypeId(), HandleAcceptFromApp(), HandleAcceptSignalingFromApp(), HandlePeerCloseFromApp(), HandlePeerCloseSignalingFromApp(), HandlePeerErrorFromApp(), HandlePeerErrorSignalingFromApp(), HandleReadFromApp(), HandleReadSignalingFromApp(), ns3::Socket::Listen(), m_dataSocketApp, m_isDataConnectedToApp, m_isSignalingConnectedToApp, m_local, m_master, m_peer, m_portSignaling, m_signalingSocketApp, m_socketType, ns3::MakeCallback(), NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Socket::SetAcceptCallback(), ns3::Socket::SetCloseCallbacks(), ns3::Socket::SetConnectCallback(), and ns3::Socket::SetRecvCallback().
Referenced by AppTransitionTree(), SendDataPacket(), SendKeyIds(), and StartApplication().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::PrepareSocketToKMS | ( | ) |
Prepare send socket to communicate with KMS Application.
SOCKET functions
Definition at line 301 of file qkd-app-014.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), ConnectionRequestedFromKMS(), ConnectionToKMSFailed(), ConnectionToKMSSucceeded(), ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), ns3::Socket::CreateSocket(), DataToKMSSend(), ns3::Application::GetNode(), ns3::TcpSocketFactory::GetTypeId(), HandleAcceptFromKMS(), HandlePeerCloseFromKMS(), HandlePeerErrorFromKMS(), HandleReadFromKMS(), m_kms, m_socketToKMS, ns3::MakeCallback(), NS_LOG_FUNCTION, ns3::Socket::SetAcceptCallback(), ns3::Socket::SetCloseCallbacks(), ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), and ns3::Socket::SetRecvCallback().
Referenced by AppTransitionTree(), GetKeysFromKMS(), GetKeyWithKeyIDs(), and GetStatusFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::PrintStoreStats | ( | ) |
Print status information on key stores.
Definition at line 904 of file qkd-app-014.cc.
References m_authStore, m_commonStore, m_encStore, and NS_LOG_FUNCTION.
Referenced by ManageStores(), and ProcessSignalingPacketFromApp().
Here is the caller graph for this function:| void ns3::QKDApp014::ProcessDataPacket | ( | QKDAppHeader | header, |
| Ptr< Packet > | packet, | ||
| Ptr< Socket > | socket | ||
| ) |
Process data packets from peer QKD application.
| header | QKDApp014 packet header |
| packet | received packet |
| socket | the receiving socket |
Definition at line 1130 of file qkd-app-014.cc.
References ns3::Create(), DECRYPT_DATA, ns3::QKDAppHeader::GetAuthenticated(), ns3::QKDAppHeader::GetAuthenticationKeyId(), GetAuthenticationKeySize(), ns3::QKDAppHeader::GetAuthTag(), ns3::QKDAppHeader::GetEncrypted(), ns3::QKDAppHeader::GetEncryptionKeyId(), GetLocalKey(), m_authTagSize, m_encryptor, m_master, m_size, m_useCrypto, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_WARN, ReadKeyIdField(), READY, SetCryptoSettings(), and SwitchAppState().
Referenced by QAppPacketReceived().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::ProcessResponseFromKMS | ( | HTTPMessage & | header, |
| Ptr< Packet > | packet, | ||
| Ptr< Socket > | socket | ||
| ) |
Process response from KMS application.
| header | received HTTP header |
| packet | received packet |
| socket | the receiving socket |
status
enc_keys
dec_keys
Definition at line 1302 of file qkd-app-014.cc.
References ns3::AppKey::AUTHENTICATION, ns3::Create(), ns3::AppKey::ENCRYPTION, ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), m_aesLifetime, m_commonStore, m_encryptionType, m_size, m_waitInsufficient, ManageStores(), NS_FATAL_ERROR, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, PopHttpKmsRequest(), ns3::QKDEncryptor::QKDCRYPTO_AES, ReadUri(), ScheduleAction(), and SendKeyIds().
Referenced by HttpPacketReceived().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::ProcessSignalingPacketFromApp | ( | HTTPMessage & | header, |
| Ptr< Packet > | packet, | ||
| Ptr< Socket > | socket | ||
| ) |
Process signaling packets from peer QKD application.
| header | HTTP packet header |
| packet | received packet |
| socket | the receiving socket |
Definition at line 1373 of file qkd-app-014.cc.
References ns3::AppKey::AUTHENTICATION, CheckAppState(), ns3::Create(), ns3::AppKey::ENCRYPTION, GetKeysFromKMS(), GetKeyWithKeyIDs(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetStatus(), m_authStore, m_commonStore, m_encStore, m_internalAppWait, m_master, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, NS_LOG_WARN, ns3::HTTPMessage::Ok, PopHttpAppRequest(), and PrintStoreStats().
Referenced by HttpPacketReceived().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Adds HTTP request to app queue to properly map response later.
| keyIds | vector of key ids |
Definition at line 950 of file qkd-app-014.cc.
References m_appHttpReqQueue, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by SendKeyIds().
Here is the caller graph for this function:
|
private |
Adds HTTP request to kms queue to properly map response later.
| input | key type |
HTTP mapping
Definition at line 942 of file qkd-app-014.cc.
References ns3::Create(), m_kmsHttpReqQueue, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by GetKeysFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::QAppPacketReceived | ( | const Ptr< Packet > & | p, |
| const Address & | from, | ||
| Ptr< Socket > | socket | ||
| ) |
Check for tcp segmentation of signaling packets received from KMS.
| packet | |
| address | address of the KMS |
| socket | the connected socket |
Definition at line 707 of file qkd-app-014.cc.
References ns3::Create(), GetAppStateString(), GetId(), ns3::QKDAppHeader::GetLength(), ns3::QKDAppHeader::GetSerializedSize(), GetState(), m_buffer_QKDApp014, m_master, m_rxTrace, NS_ABORT_IF, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ProcessDataPacket(), and READY.
Referenced by HandleReadFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Read key ID from the encryption key ID field of the QKDApp header.
| keyId | key ID from the encryption key ID field |
Definition at line 1696 of file qkd-app-014.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Referenced by ProcessDataPacket().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Read http uri in vector.
| s | uri string |
Definition at line 1754 of file qkd-app-014.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Referenced by ProcessResponseFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:Schedule action to performe.
| time | eventTime |
| string | eventAction |
Definition at line 276 of file qkd-app-014.cc.
References ns3::Create(), ns3::EventId::IsPending(), m_scheduleManageStores, ManageStores(), NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by ProcessResponseFromKMS(), and SendDataPacket().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Schedule event to send data.
SCHEDULE functions
Definition at line 264 of file qkd-app-014.cc.
References GetAppStateString(), ns3::DataRate::GetBitRate(), GetState(), ns3::EventId::IsPending(), m_rate, m_sendEvent, m_size, NOT_STARTED, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::Seconds(), SendDataPacket(), and STOPPED.
Referenced by SendDataPacket().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Send protected data.
App014 encrypts the data with obtained keys and sends this encrypted data to the peer.
Definition at line 1036 of file qkd-app-014.cc.
References ns3::Create(), CreateKeyIdField(), GetAppStateString(), GetAuthenticationKeySize(), GetId(), GetLocalKey(), GetPacketContent(), GetState(), ns3::EventId::IsPending(), m_authenticationTrace, m_authenticationType, m_dataSocketApp, m_encryptionType, m_encryptor, m_isDataConnectedToApp, m_mxTrace, m_scheduleManageStores, m_txTrace, m_useCrypto, m_waitInsufficient, ManageStores(), NS_ASSERT, NS_LOG_FUNCTION, PrepareSocketToApp(), READY, ScheduleAction(), ScheduleTx(), ns3::Socket::Send(), SEND_DATA, ns3::QKDAppHeader::SetEncrypted(), SwitchAppState(), and WAIT.
Referenced by AppTransitionTree(), and ScheduleTx().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Implementation of send KEY_IDS notification.
| keyIds | key identifiers |
| statusCode | http status code of response(default status is Ok) |
Master App014(Alice) sends key IDs of obtained keys from KMS that will be used for encryption of outgoing messages. Slave App014 (Bob) agree or disagree on proposed key IDs.
Definition at line 1434 of file qkd-app-014.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), ns3::HTTPMessage::CreateResponse(), GetId(), GetIp(), GetPeerIp(), IpToString(), m_isSignalingConnectedToApp, m_master, m_signalingSocketApp, m_txSigTrace, NS_ASSERT, NS_LOG_FUNCTION, PrepareSocketToApp(), PushHttpAppRequest(), ns3::Socket::Send(), ns3::HTTPMessage::SetHeader(), and ns3::HTTPMessage::ToString().
Referenced by ProcessResponseFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp014::SetCryptoSettings | ( | uint32_t | encryptionType, |
| uint32_t | authenticationType, | ||
| uint32_t | authenticationTagLengthInBits | ||
| ) |
Set encryption and authentication type.
| ecryptionType | encryption type |
| authenticationType | authentication type |
ADDTIONAL functions
Definition at line 1615 of file qkd-app-014.cc.
References ns3::Create(), m_authenticationType, m_encryptionType, m_encryptor, NS_LOG_FUNCTION, ns3::QKDEncryptor::QKDCRYPTO_AES, ns3::QKDEncryptor::QKDCRYPTO_AUTH_MD5, ns3::QKDEncryptor::QKDCRYPTO_AUTH_SHA1, ns3::QKDEncryptor::QKDCRYPTO_AUTH_VMAC, ns3::QKDEncryptor::QKDCRYPTO_OTP, ns3::QKDEncryptor::UNAUTHENTICATED, and ns3::QKDEncryptor::UNENCRYPTED.
Referenced by ProcessDataPacket(), and StartApplication().
Here is the call graph for this function:
Here is the caller graph for this function:set application state
| state | application state |
Definition at line 163 of file qkd-app-014.h.
References m_state.
Referenced by SwitchAppState().
Here is the caller graph for this function:| void ns3::QKDApp014::Setup | ( | std::string | socketType, |
| std::string | appId, | ||
| std::string | remoteAppId, | ||
| const Address & | appAddress, | ||
| const Address & | remoteAppAddress, | ||
| const Address & | kmAddress, | ||
| std::string | type | ||
| ) |
Definition at line 187 of file qkd-app-014.cc.
References ns3::Create(), and Setup().
Here is the call graph for this function:| void ns3::QKDApp014::Setup | ( | std::string | socketType, |
| std::string | appId, | ||
| std::string | remoteAppId, | ||
| const Address & | appAddress, | ||
| const Address & | remoteAppAddress, | ||
| const Address & | kmAddress, | ||
| uint32_t | packetSize, | ||
| DataRate | dataRate, | ||
| std::string | type | ||
| ) |
Definition at line 210 of file qkd-app-014.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), INITIALIZED, InitKeyStores(), m_applicationCounts, m_dstId, m_id, m_internalAppWait, m_kms, m_local, m_master, m_peer, m_portSignaling, m_rate, m_size, m_socketType, NS_LOG_FUNCTION, packetSize, and SwitchAppState().
Referenced by Setup().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overrideprivatevirtual |
Start application.
APPLICATION functions
Reimplemented from ns3::Application.
Definition at line 992 of file qkd-app-014.cc.
References AppTransitionTree(), ns3::Create(), GetAppStateString(), GetState(), INITIALIZED, m_aesLifetime, m_authentication, m_authTagSize, m_encryption, m_local, m_master, m_peer, m_size, NS_FATAL_ERROR, NS_LOG_FUNCTION, PrepareSocketToApp(), and SetCryptoSettings().
Here is the call graph for this function:
|
overrideprivatevirtual |
Stop application.
Reimplemented from ns3::Application.
Definition at line 1020 of file qkd-app-014.cc.
References ns3::Simulator::Cancel(), ns3::Socket::Close(), InitKeyStores(), ns3::EventId::IsPending(), m_dataSocketApp, m_sendEvent, m_signalingSocketApp, m_socketToKMS, NS_LOG_FUNCTION, STOPPED, and SwitchAppState().
Here is the call graph for this function:
|
private |
Change the state of the application.
Fires the AppStateTransition trace source.
| state | The new application state. |
Definition at line 1581 of file qkd-app-014.cc.
References ns3::Create(), GetAppStateString(), m_stateTransitionTrace, m_transitionMatrix, NS_FATAL_ERROR, NS_LOG_DEBUG, and SetState().
Referenced by AppTransitionTree(), CheckAppState(), ProcessDataPacket(), SendDataPacket(), Setup(), and StopApplication().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
key lifetime in bytes
Definition at line 630 of file qkd-app-014.h.
Referenced by GetTypeId(), ProcessResponseFromKMS(), and StartApplication().
|
private |
Definition at line 605 of file qkd-app-014.h.
Referenced by PopHttpAppRequest(), and PushHttpAppRequest().
|
staticprivate |
application count
Definition at line 608 of file qkd-app-014.h.
Referenced by QKDApp014(), and Setup().
|
private |
authentication type
Definition at line 628 of file qkd-app-014.h.
Referenced by GetTypeId(), and StartApplication().
|
private |
trace callback for authentication
Definition at line 639 of file qkd-app-014.h.
Referenced by GetTypeId(), and SendDataPacket().
|
private |
authentication type
Definition at line 633 of file qkd-app-014.h.
Referenced by GetAuthenticationKeySize(), SendDataPacket(), and SetCryptoSettings().
Definition at line 620 of file qkd-app-014.h.
Referenced by CheckAppState(), GetLocalKey(), InitKeyStores(), ManageStores(), PrintStoreStats(), and ProcessSignalingPacketFromApp().
|
private |
length of the authentication tag in bits
Definition at line 629 of file qkd-app-014.h.
Referenced by GetTypeId(), ProcessDataPacket(), and StartApplication().
|
private |
Buffer for received packets(fragmentation)
Definition at line 659 of file qkd-app-014.h.
Referenced by HttpPacketReceived().
|
private |
Buffer for received packets(fragmentation)
Definition at line 660 of file qkd-app-014.h.
Referenced by QAppPacketReceived().
Definition at line 618 of file qkd-app-014.h.
Referenced by GetLocalKey(), InitKeyStores(), PrintStoreStats(), ProcessResponseFromKMS(), and ProcessSignalingPacketFromApp().
Definition at line 594 of file qkd-app-014.h.
Referenced by DoDispose(), HandleAcceptFromApp(), PrepareSocketToApp(), SendDataPacket(), and StopApplication().
|
private |
trace callback for authentication check
Definition at line 640 of file qkd-app-014.h.
Referenced by GetTypeId().
|
private |
trace callback for decryption
Definition at line 638 of file qkd-app-014.h.
Referenced by GetTypeId().
|
private |
destination application id
Definition at line 612 of file qkd-app-014.h.
Referenced by GetKeysFromKMS(), GetKeyWithKeyIDs(), GetStatusFromKMS(), and Setup().
|
private |
encryption type
Definition at line 627 of file qkd-app-014.h.
Referenced by GetTypeId(), and StartApplication().
|
private |
trace callback for encryption
Definition at line 637 of file qkd-app-014.h.
Referenced by GetTypeId().
|
private |
encryption type
Definition at line 632 of file qkd-app-014.h.
Referenced by GetEncryptionKeySize(), ProcessResponseFromKMS(), SendDataPacket(), and SetCryptoSettings().
|
private |
encryptor
Definition at line 634 of file qkd-app-014.h.
Referenced by ProcessDataPacket(), SendDataPacket(), and SetCryptoSettings().
Definition at line 619 of file qkd-app-014.h.
Referenced by CheckAppState(), GetLocalKey(), InitKeyStores(), ManageStores(), PrintStoreStats(), and ProcessSignalingPacketFromApp().
|
private |
source application id
Definition at line 613 of file qkd-app-014.h.
|
private |
Definition at line 662 of file qkd-app-014.h.
Referenced by ManageStores(), ProcessSignalingPacketFromApp(), and Setup().
|
private |
Definition at line 592 of file qkd-app-014.h.
Referenced by ConnectionRequestedFromApp(), ConnectionToAppSucceeded(), PrepareSocketToApp(), and SendDataPacket().
|
private |
Definition at line 591 of file qkd-app-014.h.
Referenced by ConnectionRequestedSignalingFromApp(), ConnectionSignalingToAppSucceeded(), PrepareSocketToApp(), and SendKeyIds().
|
private |
local kms address
Definition at line 600 of file qkd-app-014.h.
Referenced by GetKmsIp(), PrepareSocketToKMS(), and Setup().
|
private |
Definition at line 604 of file qkd-app-014.h.
Referenced by PopHttpKmsRequest(), and PushHttpKmsRequest().
|
private |
local address
Definition at line 599 of file qkd-app-014.h.
Referenced by GetIp(), PrepareSocketToApp(), Setup(), and StartApplication().
|
private |
is master App014
Definition at line 611 of file qkd-app-014.h.
Referenced by AppTransitionTree(), GetLocalKey(), ManageStores(), PrepareSocketToApp(), ProcessDataPacket(), ProcessSignalingPacketFromApp(), QAppPacketReceived(), SendKeyIds(), Setup(), and StartApplication().
|
private |
Traced Callback: missed send packet call.
Definition at line 655 of file qkd-app-014.h.
Referenced by GetTypeId(), and SendDataPacket().
|
private |
number of keys to fetch per request
Definition at line 625 of file qkd-app-014.h.
Referenced by GetKeysFromKMS(), and GetTypeId().
|
private |
peer address
Definition at line 598 of file qkd-app-014.h.
Referenced by GetPeerIp(), PrepareSocketToApp(), Setup(), and StartApplication().
|
private |
Definition at line 601 of file qkd-app-014.h.
Referenced by PrepareSocketToApp(), and Setup().
|
private |
|
private |
Traced Callback: received packets from KMS.
Definition at line 653 of file qkd-app-014.h.
Referenced by GetTypeId(), and HttpPacketReceived().
|
private |
Traced Callback: received signaling packets.
Definition at line 651 of file qkd-app-014.h.
Referenced by GetTypeId(), and HttpPacketReceived().
|
private |
Traced Callback: received data packets.
Definition at line 649 of file qkd-app-014.h.
Referenced by GetTypeId(), and QAppPacketReceived().
|
private |
Definition at line 664 of file qkd-app-014.h.
Referenced by ScheduleAction(), and SendDataPacket().
|
private |
Definition at line 663 of file qkd-app-014.h.
Referenced by ScheduleTx(), and StopApplication().
Definition at line 593 of file qkd-app-014.h.
Referenced by DoDispose(), HandleAcceptSignalingFromApp(), PrepareSocketToApp(), SendKeyIds(), and StopApplication().
|
private |
data packet size
Definition at line 614 of file qkd-app-014.h.
Referenced by GetEncryptionKeySize(), GetLocalKey(), GetPacketContent(), ProcessDataPacket(), ProcessResponseFromKMS(), ScheduleTx(), Setup(), and StartApplication().
Definition at line 595 of file qkd-app-014.h.
Referenced by DoDispose(), GetKeysFromKMS(), GetKeyWithKeyIDs(), GetStatusFromKMS(), PrepareSocketToKMS(), and StopApplication().
|
private |
Definition at line 590 of file qkd-app-014.h.
Referenced by PrepareSocketToApp(), and Setup().
|
private |
application state
Definition at line 610 of file qkd-app-014.h.
Referenced by GetState(), and SetState().
|
private |
The StateTransition trace source.
Definition at line 657 of file qkd-app-014.h.
Referenced by GetTypeId(), and SwitchAppState().
|
private |
|
private |
transition map of protocol states
Definition at line 666 of file qkd-app-014.h.
Referenced by QKDApp014(), and SwitchAppState().
|
private |
Traced Callback: transmitted packets to KMS.
Definition at line 647 of file qkd-app-014.h.
Referenced by GetKeysFromKMS(), GetKeyWithKeyIDs(), GetStatusFromKMS(), and GetTypeId().
|
private |
Traced Callback: transmitted signaling packets.
Definition at line 645 of file qkd-app-014.h.
Referenced by GetTypeId(), and SendKeyIds().
|
private |
Traced Callback: transmitted data packets.
Definition at line 643 of file qkd-app-014.h.
Referenced by GetTypeId(), and SendDataPacket().
|
private |
execute crypo algorithms
Definition at line 626 of file qkd-app-014.h.
Referenced by GetTypeId(), ProcessDataPacket(), and SendDataPacket().
|
private |
time wait before submitting new get_key after error
Definition at line 622 of file qkd-app-014.h.
Referenced by GetTypeId(), ProcessResponseFromKMS(), and SendDataPacket().