Establish secure communication on application lavel to use the key and test LKSM. More...
#include "qkd-app-004.h"
Inheritance diagram for ns3::QKDApp004:
Collaboration diagram for ns3::QKDApp004:Classes | |
| struct | AddressHash |
| Hashing for the Address class. More... | |
| struct | KMSPacket |
Public Types | |
| enum | Method { OPEN_CONNECT , GET_KEY , CLOSE , SEND_KSID , ESTABLISH_QUEUES } |
| enum | State { NOT_STARTED , INITIALIZED , ESTABLISHING_ASSOCIATIONS , ASSOCIATIONS_ESTABLISHED , ESTABLISHING_KEY_QUEUES , KEY_QUEUES_ESTABLISHED , READY , WAIT , SEND_DATA , DECRYPT_DATA , STOPPED } |
| QKD App states(App) States that refer to QKDApp 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 | |
| QKDApp004 () | |
| ~QKDApp004 () override | |
| 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 application identifier. | |
| Ipv4Address | GetIp () |
| Get application Ipv4 address. | |
| Ipv4Address | GetKmsIp () |
| Get KMS Ipv4 address. | |
| std::string | GetPeerId () |
| Get peer application identifier. | |
| Ipv4Address | GetPeerIp () |
| Get peer application Ipv4 address. | |
| State | GetState () const |
| Returns the current state of the application. | |
| void | SetCryptoSettings (uint32_t encryptionType, uint32_t authenticationType, uint32_t authenticationTagLengthInBits) |
| Set encryption and authentication type. | |
| void | SetState (State state) |
| Set 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. | |
Public Attributes | |
| TracedCallback< const std::string &, Ptr< const Packet > > | m_mxTrace |
| Traced Callback: missed send packet call. | |
| 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. | |
| ns3::TracedCallback< const std::string &, const std::string & > | m_stateTransitionTrace |
The StateTransition trace source. | |
| 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. | |
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. | |
| void | CheckQueues () |
| Application establishing key queues before establishing data traffic. | |
| void | CheckStreamSessions () |
| Check if the associations are successfuly established. | |
| void | Close (std::string ksid) |
| Terminate the association. | |
| 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 | CreateKeyStreamSessions () |
| void | DataPacketReceived (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket) |
| Check for tcp segmentation of signaling packets received from KMS. | |
| void | DataToKMSSend (Ptr< Socket >, uint32_t) |
| Callback function to notify that data to KMS has been sent. | |
| void | EstablishQueues () |
| Sends ESTABLISH_QUEUES request(for sende App004) or response(for receiver App004) | |
| void | GetKeyFromKMS (std::string ksid) |
| Obtain the required amount of key material. | |
| std::string | GetPacketContent (uint32_t msgLength=0) |
| Get the packet payload content. | |
| std::string | GetSessionScope (KeyStreamSession::Type type) |
| 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 | HandlePeerCloseToKMS (Ptr< Socket > socket) |
| Handle a connection close to KMS. | |
| 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 | HandlePeerErrorToKMS (Ptr< Socket > socket) |
| Handle a connection error to KMS. | |
| 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. | |
| std::string | IpToString (Ipv4Address address) |
| void | OpenConnect (std::string ksid, KeyStreamSession::Type sessionType) |
| QKDApp reserves an association(Key_stream_ID) | |
| void | PacketReceivedFromKMS (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket) |
| Check for tcp segmentation of packets received from KMS. | |
| std::string | PacketToString (Ptr< Packet > packet) |
| Convert packet to string. | |
| KeyStreamSession::Type | PopHttpKmsRequest (std::string uri) |
| Pop HTTP request from the queue(mapping response) | |
| void | PrepareSocketToApp () |
| Prepare send socket to communicate with QKD Application. | |
| void | PrepareSocketToKMS () |
| Prepare send socket to communicate with KMS Application. | |
| void | ProcessCloseResponse (HTTPMessage &header) |
| Process response from KMS on CLOSE call. | |
| void | ProcessDataPacket (QKDAppHeader header, Ptr< Packet > packet, Ptr< Socket > socket) |
| Process data packets from peer QKD application. | |
| void | ProcessGetKeyResponse (HTTPMessage &header) |
| Process Get Key response from KMS. | |
| void | ProcessOpenConnectResponse (HTTPMessage &header) |
| Process response from KMS on OPEN_CONNECT call. | |
| void | ProcessPacketsToKMSFromQueue () |
| void | ProcessResponseFromKMS (HTTPMessage &header, Ptr< Packet > packet, Ptr< Socket > socket) |
| Process response from KMS application. | |
| void | ProcessSignalingPacketFromApp (HTTPMessage &header, Ptr< Socket > socket) |
| Process signaling packets from peer QKD application. | |
| void | PushHttpKmsRequest (std::string uri, KeyStreamSession::Type sessionType=KeyStreamSession::ENCRYPTION) |
| Add HTTP request to queue to map response later. | |
| std::vector< std::string > | ReadUri (std::string s) |
| void | RegisterAckTime (Time oldRtt, Time newRtt) |
| void | ScheduleTx () |
| void | SendKsid (std::string ksid, KeyStreamSession::Type sessionType, HTTPMessage::HttpStatus statusCode=HTTPMessage::Ok) |
| Sends SEND_KSID request(for sender App004) or response(for receiver App004) | |
| void | SendPacket () |
| QKDApp encrypts the data with obtained keys and sends this encrypted data to the peer QKDApp. | |
| void | SignalingPacketReceivedFromApp (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket) |
| Check for tcp segmentation of signaling packets received from APP. | |
| void | StartApplication () override |
| void | StopApplication () override |
| Application specific shutdown code. | |
Static Private Attributes | |
| static uint32_t | m_applicationCounts = 0 |
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 QKDApp 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.
ns3::QKDApp004 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 1064 bytes (on a 64-bit architecture).
Definition at line 59 of file qkd-app-004.h.
| Enumerator | |
|---|---|
| OPEN_CONNECT | |
| GET_KEY | |
| CLOSE | |
| SEND_KSID | |
| ESTABLISH_QUEUES | |
Definition at line 88 of file qkd-app-004.h.
QKD App states(App) States that refer to QKDApp data transmision!
| Enumerator | |
|---|---|
| NOT_STARTED | |
| INITIALIZED | |
| ESTABLISHING_ASSOCIATIONS | |
| ASSOCIATIONS_ESTABLISHED | |
| ESTABLISHING_KEY_QUEUES | |
| KEY_QUEUES_ESTABLISHED | |
| READY | |
| WAIT | |
| SEND_DATA | |
| DECRYPT_DATA | |
| STOPPED | |
Definition at line 74 of file qkd-app-004.h.
| ns3::QKDApp004::QKDApp004 | ( | ) |
|
override |
Definition at line 157 of file qkd-app-004.cc.
References NS_LOG_FUNCTION.
|
private |
Transition tree of the application.
Change states and take actions!
STATE functions
Definition at line 1749 of file qkd-app-004.cc.
References ASSOCIATIONS_ESTABLISHED, CheckQueues(), CreateKeyStreamSessions(), ESTABLISHING_ASSOCIATIONS, ESTABLISHING_KEY_QUEUES, EstablishQueues(), GetAuthenticationKeySize(), GetEncryptionKeySize(), GetState(), INITIALIZED, KEY_QUEUES_ESTABLISHED, m_master, NS_FATAL_ERROR, NS_LOG_FUNCTION, PrepareSocketToKMS(), READY, SendPacket(), and SetState().
Referenced by CheckQueues(), CheckStreamSessions(), ProcessSignalingPacketFromApp(), and StartApplication().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Application establishing key queues before establishing data traffic.
Application can establish key queues of desired size prior to secure communication to support fast rekeying scenarios.
Definition at line 931 of file qkd-app-004.cc.
References AppTransitionTree(), ns3::Create(), GetKeyFromKMS(), KEY_QUEUES_ESTABLISHED, m_authStream, m_encStream, m_master, m_primaryQueueEstablished, m_replicaQueueEstablished, NS_LOG_FUNCTION, and SetState().
Referenced by AppTransitionTree(), ProcessGetKeyResponse(), and ProcessSignalingPacketFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Check if the associations are successfuly established.
If the associations are established, establishing queues is started!
KEY BUFFER functions
Definition at line 907 of file qkd-app-004.cc.
References AppTransitionTree(), ASSOCIATIONS_ESTABLISHED, ns3::Create(), ESTABLISHING_ASSOCIATIONS, GetState(), m_authStream, m_encStream, m_master, NS_ASSERT, NS_LOG_FUNCTION, and SetState().
Referenced by ProcessSignalingPacketFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Terminate the association.
| ksid | Unique identifier of association |
Definition at line 1377 of file qkd-app-004.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), ns3::KeyStreamSession::ENCRYPTION, GetId(), GetKmsIp(), IpToString(), m_authStream, m_encStream, m_master, m_queue_kms, m_socketToKMS, m_txKmsTrace, NS_ASSERT, NS_LOG_ERROR, NS_LOG_FUNCTION, PrepareSocketToKMS(), PushHttpKmsRequest(), ns3::Socket::Send(), ns3::HTTPMessage::SetHeader(), and ns3::HTTPMessage::ToString().
Referenced by ProcessSignalingPacketFromApp(), and StopApplication().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Callback function after the connection for response from KMS has been received.
| socket | the connected socket |
| address | address of the KMS |
Definition at line 494 of file qkd-app-004.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:
|
private |
Callback function after the connection for response from KMS has been received.
| socket | the connected socket |
| address | address of the KMS |
Definition at line 469 of file qkd-app-004.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:
|
private |
Callback function after the connection for response from KMS has been received.
| socket | the connected socket |
| address | address of the KMS |
Definition at line 481 of file qkd-app-004.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 580 of file qkd-app-004.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 573 of file qkd-app-004.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 567 of file qkd-app-004.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 560 of file qkd-app-004.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 554 of file qkd-app-004.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 548 of file qkd-app-004.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
Here is the caller graph for this function:
|
private |
Definition at line 1720 of file qkd-app-004.cc.
References ns3::KeyStreamSession::AUTHENTICATION, ns3::KeyStreamSession::ENCRYPTION, GetAuthenticationKeySize(), GetEncryptionKeySize(), m_authStream, m_encStream, m_master, NS_ASSERT, NS_LOG_FUNCTION, and OpenConnect().
Referenced by AppTransitionTree().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Check for tcp segmentation of signaling packets received from KMS.
| packet | |
| address | address of the KMS |
| socket | the connected socket |
Definition at line 781 of file qkd-app-004.cc.
References ns3::Create(), GetAppStateString(), GetId(), ns3::QKDAppHeader::GetLength(), ns3::QKDAppHeader::GetSerializedSize(), GetState(), m_buffer_qkdapp, 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:Callback function to notify that data to KMS has been sent.
| socket | the connected socket |
| uint32_t | amount of data sent |
Definition at line 892 of file qkd-app-004.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 163 of file qkd-app-004.cc.
References ns3::Application::DoDispose(), m_dataSocketApp, m_signalingSocketApp, m_socketToKMS, and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
private |
Sends ESTABLISH_QUEUES request(for sende App004) or response(for receiver App004)
Definition at line 1686 of file qkd-app-004.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), ns3::HTTPMessage::CreateResponse(), GetId(), GetIp(), GetPeerId(), GetPeerIp(), ns3::HTTPMessage::GetStatus(), ns3::HTTPMessage::GetUri(), IpToString(), m_master, m_signalingSocketApp, m_txSigTrace, NS_ASSERT, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, 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:| std::string ns3::QKDApp004::GetAppStateString | ( | ) | const |
Returns the current state of the application in string format.
Definition at line 1848 of file qkd-app-004.cc.
References GetAppStateString(), and GetState().
Referenced by DataPacketReceived(), GetAppStateString(), ScheduleTx(), SendPacket(), SetState(), and StartApplication().
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 1802 of file qkd-app-004.cc.
References ASSOCIATIONS_ESTABLISHED, DECRYPT_DATA, ESTABLISHING_ASSOCIATIONS, ESTABLISHING_KEY_QUEUES, INITIALIZED, KEY_QUEUES_ESTABLISHED, NOT_STARTED, NS_FATAL_ERROR, READY, SEND_DATA, STOPPED, and WAIT.
| uint32_t ns3::QKDApp004::GetAuthenticationKeySize | ( | ) |
Get key size for defined authentication algorithm.
Definition at line 1970 of file qkd-app-004.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(), CreateKeyStreamSessions(), OpenConnect(), ProcessDataPacket(), ProcessGetKeyResponse(), and SendPacket().
Here is the caller graph for this function:| uint32_t ns3::QKDApp004::GetEncryptionKeySize | ( | ) |
Get key size for defined encryption algorithm.
Definition at line 1953 of file qkd-app-004.cc.
References m_encryptionType, m_packetSize, ns3::QKDEncryptor::QKDCRYPTO_AES, ns3::QKDEncryptor::QKDCRYPTO_OTP, and ns3::QKDEncryptor::UNENCRYPTED.
Referenced by AppTransitionTree(), CreateKeyStreamSessions(), OpenConnect(), ProcessGetKeyResponse(), and SendPacket().
Here is the caller graph for this function:
|
inline |
Get application identifier.
Definition at line 170 of file qkd-app-004.h.
References m_appId.
Referenced by Close(), DataPacketReceived(), EstablishQueues(), GetKeyFromKMS(), OpenConnect(), PacketReceivedFromKMS(), ProcessPacketsToKMSFromQueue(), SendKsid(), SendPacket(), and SignalingPacketReceivedFromApp().
Here is the caller graph for this function:| Ipv4Address ns3::QKDApp004::GetIp | ( | ) |
Get application Ipv4 address.
Definition at line 1997 of file qkd-app-004.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), m_peer, and NS_LOG_FUNCTION.
Referenced by EstablishQueues(), and SendKsid().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Obtain the required amount of key material.
| ksid | Unique identifier for the group of syncronized bits |
QKDApp request key via ETSI GS 004 interface. In current version QKDApps request keys in synchronous order and index is not specified!
Definition at line 1336 of file qkd-app-004.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), ns3::KeyStreamSession::ENCRYPTION, GetId(), GetKmsIp(), ns3::Socket::GetPeerName(), GetState(), IpToString(), m_master, m_queue_kms, m_socketToKMS, m_txKmsTrace, NS_ASSERT, NS_LOG_FUNCTION, PrepareSocketToKMS(), PushHttpKmsRequest(), ns3::Socket::Send(), ns3::HTTPMessage::SetHeader(), STOPPED, and ns3::HTTPMessage::ToString().
Referenced by CheckQueues(), ProcessDataPacket(), ProcessGetKeyResponse(), and SendPacket().
Here is the call graph for this function:
Here is the caller graph for this function:| Ipv4Address ns3::QKDApp004::GetKmsIp | ( | ) |
Get KMS Ipv4 address.
Definition at line 1990 of file qkd-app-004.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), m_kms, and NS_LOG_FUNCTION.
Referenced by Close(), GetKeyFromKMS(), and OpenConnect().
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 1931 of file qkd-app-004.cc.
References ns3::Create(), m_packetSize, and NS_LOG_FUNCTION.
Referenced by SendPacket().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Get peer application identifier.
Definition at line 178 of file qkd-app-004.h.
References m_dstAppId.
Referenced by EstablishQueues(), OpenConnect(), and SendKsid().
Here is the caller graph for this function:| Ipv4Address ns3::QKDApp004::GetPeerIp | ( | ) |
Get peer application Ipv4 address.
Definition at line 2004 of file qkd-app-004.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), m_peer, and NS_LOG_FUNCTION.
Referenced by EstablishQueues(), and SendKsid().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 508 of file qkd-app-004.h.
References ns3::KeyStreamSession::ENCRYPTION.
Referenced by ProcessPacketsToKMSFromQueue(), and SendKsid().
Here is the caller graph for this function:| QKDApp004::State ns3::QKDApp004::GetState | ( | ) | const |
Returns the current state of the application.
Definition at line 1796 of file qkd-app-004.cc.
References m_state.
Referenced by AppTransitionTree(), CheckStreamSessions(), DataPacketReceived(), GetAppStateString(), GetKeyFromKMS(), HandleReadFromKMS(), ProcessGetKeyResponse(), ProcessResponseFromKMS(), ScheduleTx(), SendPacket(), and StartApplication().
Here is the caller graph for this function:
|
static |
Get the type ID.
Definition at line 34 of file qkd-app-004.cc.
References ns3::Create(), ns3::TcpSocketFactory::GetTypeId(), m_aesLifetime, m_authentication, m_authenticationTagLengthInBits, m_authenticationTrace, m_deauthenticationTrace, m_decryptionTrace, m_encryption, m_encryptionTrace, m_holdTime, m_keyBufferLengthAuthentication, m_keyBufferLengthEncryption, m_mxTrace, m_rxKmsTrace, m_rxSigTrace, m_rxTrace, m_stateTransitionTrace, m_tid, m_txKmsTrace, m_txSigTrace, m_txTrace, m_useCrypto, 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 522 of file qkd-app-004.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 508 of file qkd-app-004.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), HandleReadFromKMS(), ns3::MakeCallback(), NS_LOG_FUNCTION, and ProcessPacketsToKMSFromQueue().
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 535 of file qkd-app-004.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 625 of file qkd-app-004.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 586 of file qkd-app-004.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 636 of file qkd-app-004.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Handle a connection close to KMS.
| socket | the connected socket |
Definition at line 598 of file qkd-app-004.cc.
References m_socketToKMS, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetConnectCallback().
Referenced by PrepareSocketToKMS().
Here is the call graph for this function:
Here is the caller graph for this function:Handle a connection error from peer QKD application.
| socket | the connected socket |
Definition at line 630 of file qkd-app-004.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 592 of file qkd-app-004.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 642 of file qkd-app-004.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSocketToApp().
Here is the caller graph for this function:Handle a connection error to KMS.
| socket | the connected socket |
Definition at line 611 of file qkd-app-004.cc.
References m_socketToKMS, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetConnectCallback().
Referenced by PrepareSocketToKMS().
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 peer QKD application.
| socket | the receiving socket |
Definition at line 755 of file qkd-app-004.cc.
References ns3::InetSocketAddress::ConvertFrom(), DataPacketReceived(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::InetSocketAddress::IsMatchingType(), ns3::Simulator::Now(), and NS_LOG_FUNCTION.
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 648 of file qkd-app-004.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), GetState(), ns3::InetSocketAddress::IsMatchingType(), ns3::Simulator::Now(), NS_LOG_FUNCTION, PacketReceivedFromKMS(), ProcessPacketsToKMSFromQueue(), and STOPPED.
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 823 of file qkd-app-004.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::InetSocketAddress::IsMatchingType(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and SignalingPacketReceivedFromApp().
Referenced by HandleAcceptSignalingFromApp(), and PrepareSocketToApp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 2011 of file qkd-app-004.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Referenced by Close(), EstablishQueues(), GetKeyFromKMS(), OpenConnect(), and SendKsid().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
QKDApp reserves an association(Key_stream_ID)
| ksid | unique identifier for the group of syncronized bits |
| sessionType | the purpose of given session |
Replica QKDApp always states KSID in OPEN_CONNECT call. Primary QKDApp does not state KSID(design decision). Each QKDApp is limited(by design decisions) to establish up to 2 associations(one for encryption and one for authentification).
KEY MANAGEMENT functions
Definition at line 1282 of file qkd-app-004.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), ns3::KeyStreamSession::ENCRYPTION, GetAuthenticationKeySize(), GetEncryptionKeySize(), GetId(), GetKmsIp(), GetPeerId(), IpToString(), m_master, m_queue_kms, m_socketToKMS, m_txKmsTrace, NS_ASSERT, NS_LOG_FUNCTION, PrepareSocketToKMS(), PushHttpKmsRequest(), ns3::Socket::Send(), ns3::HTTPMessage::SetHeader(), and ns3::HTTPMessage::ToString().
Referenced by CreateKeyStreamSessions(), and ProcessSignalingPacketFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Check for tcp segmentation of packets received from KMS.
| packet | |
| address | address of the KMS |
| socket | the connected socket |
Definition at line 709 of file qkd-app-004.cc.
References ns3::Create(), GetId(), m_buffer_kms, m_rxKmsTrace, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ProcessResponseFromKMS().
Referenced by HandleReadFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:Convert packet to string.
| packet | packet |
Definition at line 2020 of file qkd-app-004.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 |
Pop HTTP request from the queue(mapping response)
| uri | request URI |
Deletes request from the queue.
Definition at line 983 of file qkd-app-004.cc.
References ns3::Create(), ns3::KeyStreamSession::EMPTY, m_httpRequestsKMS, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ProcessCloseResponse(), ProcessGetKeyResponse(), and ProcessOpenConnectResponse().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Prepare send socket to communicate with QKD Application.
Definition at line 331 of file qkd-app-004.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 SendKsid(), SendPacket(), and StartApplication().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Prepare send socket to communicate with KMS Application.
SOCKET functions
Definition at line 289 of file qkd-app-004.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), ConnectionRequestedFromKMS(), ConnectionToKMSFailed(), ConnectionToKMSSucceeded(), ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), ns3::Socket::CreateSocket(), DataToKMSSend(), ns3::Application::GetNode(), ns3::Socket::GetPeerName(), ns3::TcpSocketFactory::GetTypeId(), HandleAcceptFromKMS(), HandlePeerCloseFromKMS(), HandlePeerCloseToKMS(), HandlePeerErrorFromKMS(), HandlePeerErrorToKMS(), HandleReadFromKMS(), m_kms, m_socketToKMS, ns3::MakeCallback(), NS_LOG_FUNCTION, RegisterAckTime(), ns3::Socket::SetAcceptCallback(), ns3::Socket::SetCloseCallbacks(), ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), ns3::Socket::SetRecvCallback(), and ns3::ObjectBase::TraceConnectWithoutContext().
Referenced by AppTransitionTree(), Close(), GetKeyFromKMS(), OpenConnect(), and ProcessPacketsToKMSFromQueue().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Process response from KMS on CLOSE call.
| header | received HTTP header |
Definition at line 1541 of file qkd-app-004.cc.
References ns3::Socket::Close(), ns3::Create(), ns3::KeyStreamSession::ENCRYPTION, ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), m_authStream, m_encStream, m_httpRequestsKMS, m_socketToKMS, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, and PopHttpKmsRequest().
Referenced by ProcessResponseFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Process data packets from peer QKD application.
| header | QKDApp packet header |
| packet | received packet |
| socket | the receiving socket |
Definition at line 1174 of file qkd-app-004.cc.
References ns3::Create(), DECRYPT_DATA, ns3::QKDAppHeader::GetAuthenticated(), ns3::QKDAppHeader::GetAuthenticationKeyId(), GetAuthenticationKeySize(), ns3::QKDAppHeader::GetAuthTag(), ns3::QKDAppHeader::GetEncrypted(), ns3::QKDAppHeader::GetEncryptionKeyId(), GetKeyFromKMS(), m_aesLifetime, m_authenticationTagLengthInBits, m_authStream, m_encryptionType, m_encryptor, m_encStream, m_master, m_packetSize, m_useCrypto, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, PacketToString(), ns3::QKDEncryptor::QKDCRYPTO_AES, READY, SetCryptoSettings(), and SetState().
Referenced by DataPacketReceived().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Process Get Key response from KMS.
| header | received HTTP header |
Definition at line 1481 of file qkd-app-004.cc.
References ns3::KeyStreamSession::AUTHENTICATION, ns3::AppKey::AUTHENTICATION, CheckQueues(), ns3::Create(), ns3::KeyStreamSession::ENCRYPTION, ns3::AppKey::ENCRYPTION, ESTABLISHING_KEY_QUEUES, GetAuthenticationKeySize(), GetEncryptionKeySize(), GetKeyFromKMS(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), GetState(), ns3::HTTPMessage::GetStatus(), m_aesLifetime, m_authStream, m_encStream, m_master, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, PopHttpKmsRequest(), READY, ns3::Simulator::Schedule(), SetState(), and WAIT.
Referenced by ProcessResponseFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Process response from KMS on OPEN_CONNECT call.
| header | received HTTP header |
m_master
Definition at line 1421 of file qkd-app-004.cc.
References ns3::HTTPMessage::BadRequest, ns3::Create(), ns3::KeyStreamSession::ENCRYPTION, ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), m_authStream, m_encStream, m_master, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, PopHttpKmsRequest(), and SendKsid().
Referenced by ProcessResponseFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 679 of file qkd-app-004.cc.
References ns3::Create(), GetId(), ns3::Socket::GetPeerName(), GetSessionScope(), m_queue_kms, m_socketToKMS, m_txKmsTrace, NS_LOG_FUNCTION, PrepareSocketToKMS(), PushHttpKmsRequest(), and ns3::Socket::Send().
Referenced by HandleAcceptFromKMS(), and HandleReadFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Process response from KMS application.
| header | received HTTP header |
| packet | received packet |
| socket | the receiving socket |
Definition at line 1255 of file qkd-app-004.cc.
References ns3::Create(), ns3::HTTPMessage::GetRequestUri(), GetState(), NS_LOG_DEBUG, NS_LOG_FUNCTION, ProcessCloseResponse(), ProcessGetKeyResponse(), ProcessOpenConnectResponse(), ReadUri(), and STOPPED.
Referenced by PacketReceivedFromKMS().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Process signaling packets from peer QKD application.
| header | HTTP packet header |
| packet | received packet |
| socket | the receiving socket |
Definition at line 1559 of file qkd-app-004.cc.
References AppTransitionTree(), ns3::KeyStreamSession::AUTHENTICATION, CheckQueues(), CheckStreamSessions(), Close(), ns3::KeyStreamSession::EMPTY, ns3::KeyStreamSession::ENCRYPTION, ESTABLISHING_ASSOCIATIONS, ESTABLISHING_KEY_QUEUES, ns3::HTTPMessage::GetRequestUri(), ns3::HTTPMessage::GetStatus(), ns3::HTTPMessage::GetUri(), KEY_QUEUES_ESTABLISHED, m_authStream, m_encStream, m_master, m_primaryQueueEstablished, m_replicaQueueEstablished, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HTTPMessage::Ok, OpenConnect(), ReadUri(), and SetState().
Referenced by SignalingPacketReceivedFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add HTTP request to queue to map response later.
| uri | request URI |
| sessionType | session scope |
HTTP handling to KMS
Definition at line 976 of file qkd-app-004.cc.
References ns3::Create(), m_httpRequestsKMS, and NS_LOG_FUNCTION.
Referenced by Close(), GetKeyFromKMS(), OpenConnect(), and ProcessPacketsToKMSFromQueue().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 2033 of file qkd-app-004.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Referenced by ProcessResponseFromKMS(), and ProcessSignalingPacketFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 1734 of file qkd-app-004.cc.
References ns3::Create(), and NS_LOG_FUNCTION.
Referenced by PrepareSocketToKMS().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
SCHEDULE functions
Definition at line 264 of file qkd-app-004.cc.
References ns3::Create(), GetAppStateString(), ns3::DataRate::GetBitRate(), GetState(), m_dataRate, m_packetSize, m_sendEvent, NOT_STARTED, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::Seconds(), SendPacket(), and STOPPED.
Referenced by SendPacket().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Sends SEND_KSID request(for sender App004) or response(for receiver App004)
| ksid | unique key stream identifier |
| sessionType | scope of the session |
| statusCode | HTTP status code in case is response |
Application SIGNALING
Definition at line 1646 of file qkd-app-004.cc.
References ns3::Create(), ns3::HTTPMessage::CreateRequest(), ns3::HTTPMessage::CreateResponse(), GetId(), GetIp(), GetPeerId(), GetPeerIp(), GetSessionScope(), ns3::HTTPMessage::GetStatus(), ns3::HTTPMessage::GetUri(), IpToString(), m_isSignalingConnectedToApp, m_master, m_signalingSocketApp, m_txSigTrace, NS_ASSERT, NS_LOG_FUNCTION, PrepareSocketToApp(), ns3::Socket::Send(), ns3::HTTPMessage::SetHeader(), and ns3::HTTPMessage::ToString().
Referenced by ProcessOpenConnectResponse().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
QKDApp encrypts the data with obtained keys and sends this encrypted data to the peer QKDApp.
Definition at line 1080 of file qkd-app-004.cc.
References ns3::Create(), GetAppStateString(), GetAuthenticationKeySize(), GetEncryptionKeySize(), GetId(), GetKeyFromKMS(), GetPacketContent(), GetState(), m_authenticationTrace, m_authenticationType, m_authStream, m_dataSent, m_dataSocketApp, m_encryptionType, m_encryptor, m_encStream, m_isDataConnectedToApp, m_master, m_mxTrace, m_packetSize, m_packetsSent, m_txTrace, m_useCrypto, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_ERROR, NS_LOG_FUNCTION, PrepareSocketToApp(), READY, ScheduleTx(), ns3::Socket::Send(), SEND_DATA, ns3::QKDAppHeader::SetEncrypted(), SetState(), ns3::QKDEncryptor::UNAUTHENTICATED, and WAIT.
Referenced by AppTransitionTree(), and ScheduleTx().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp004::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 1882 of file qkd-app-004.cc.
References ns3::Create(), m_authenticationType, m_encryptionType, m_encryptor, NS_LOG_FUNCTION, ns3::QKDEncryptor::QKDCRYPTO_AES, 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:| void ns3::QKDApp004::SetState | ( | QKDApp004::State | state | ) |
Set state.
| state | new application state. |
Definition at line 1854 of file qkd-app-004.cc.
References ns3::Create(), GetAppStateString(), m_authStream, m_encStream, m_state, NS_LOG_FUNCTION, and WAIT.
Referenced by AppTransitionTree(), CheckQueues(), CheckStreamSessions(), ProcessDataPacket(), ProcessGetKeyResponse(), ProcessSignalingPacketFromApp(), SendPacket(), Setup(), and StopApplication().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp004::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 178 of file qkd-app-004.cc.
References ns3::Create(), and Setup().
Referenced by Setup().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::QKDApp004::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 201 of file qkd-app-004.cc.
References ns3::KeyStreamSession::AUTHENTICATION, ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), INITIALIZED, m_appId, m_applicationCounts, m_authStream, m_dataRate, m_dstAppId, m_encStream, m_keyBufferLengthAuthentication, m_keyBufferLengthEncryption, m_kms, m_local, m_master, m_packetSize, m_peer, m_portSignaling, m_primaryQueueEstablished, m_replicaQueueEstablished, m_socketType, NS_LOG_FUNCTION, packetSize, and SetState().
Here is the call graph for this function:
|
private |
Check for tcp segmentation of signaling packets received from APP.
| packet | |
| address | address of the KMS |
| socket | the connected socket |
Definition at line 848 of file qkd-app-004.cc.
References ns3::Create(), GetId(), m_buffer_sig, m_rxSigTrace, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ProcessSignalingPacketFromApp().
Referenced by HandleReadSignalingFromApp().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overrideprivatevirtual |
APPLICATION functions
Reimplemented from ns3::Application.
Definition at line 1006 of file qkd-app-004.cc.
References AppTransitionTree(), ns3::Create(), GetAppStateString(), GetState(), INITIALIZED, m_aesLifetime, m_authentication, m_authenticationTagLengthInBits, m_encryption, m_local, m_master, m_packetSize, m_packetsSent, m_peer, NS_FATAL_ERROR, NS_LOG_FUNCTION, PrepareSocketToApp(), and SetCryptoSettings().
Here is the call graph for this function:
|
overrideprivatevirtual |
Application specific shutdown code.
The StopApplication method is called at the stop time specified by Stop This method should be overridden by all or most application subclasses.
Reimplemented from ns3::Application.
Definition at line 1042 of file qkd-app-004.cc.
References ns3::Simulator::Cancel(), ns3::Socket::Close(), Close(), ns3::EventId::IsPending(), m_authStream, m_dataSocketApp, m_encStream, m_master, m_sendEvent, m_signalingSocketApp, m_socketToKMS, NS_LOG_FUNCTION, NS_LOG_WARN, SetState(), and STOPPED.
Here is the call graph for this function:
|
private |
Definition at line 657 of file qkd-app-004.h.
Referenced by GetTypeId(), ProcessDataPacket(), ProcessGetKeyResponse(), and StartApplication().
|
private |
Definition at line 642 of file qkd-app-004.h.
|
staticprivate |
Definition at line 650 of file qkd-app-004.h.
Referenced by QKDApp004(), and Setup().
|
private |
Definition at line 655 of file qkd-app-004.h.
Referenced by GetTypeId(), and StartApplication().
|
private |
length of the authentication tag in bits(32 by default)
Definition at line 656 of file qkd-app-004.h.
Referenced by GetTypeId(), ProcessDataPacket(), and StartApplication().
|
private |
trace callback for authentication
Definition at line 660 of file qkd-app-004.h.
Referenced by GetTypeId(), and SendPacket().
|
private |
Definition at line 663 of file qkd-app-004.h.
Referenced by GetAuthenticationKeySize(), SendPacket(), and SetCryptoSettings().
|
private |
Definition at line 648 of file qkd-app-004.h.
Referenced by CheckQueues(), CheckStreamSessions(), Close(), CreateKeyStreamSessions(), ProcessCloseResponse(), ProcessDataPacket(), ProcessGetKeyResponse(), ProcessOpenConnectResponse(), ProcessSignalingPacketFromApp(), SendPacket(), SetState(), Setup(), and StopApplication().
|
private |
Buffer for received packets(fragmentation)
Definition at line 672 of file qkd-app-004.h.
Referenced by PacketReceivedFromKMS().
|
private |
Buffer for received packets(fragmentation)
Definition at line 674 of file qkd-app-004.h.
Referenced by DataPacketReceived().
|
private |
Buffer for received packets(fragmentation)
Definition at line 673 of file qkd-app-004.h.
Referenced by SignalingPacketReceivedFromApp().
|
private |
Definition at line 633 of file qkd-app-004.h.
|
private |
Definition at line 631 of file qkd-app-004.h.
Referenced by ScheduleTx(), and Setup().
|
private |
Definition at line 637 of file qkd-app-004.h.
Referenced by SendPacket().
Definition at line 617 of file qkd-app-004.h.
Referenced by DoDispose(), HandleAcceptFromApp(), PrepareSocketToApp(), SendPacket(), and StopApplication().
|
private |
trace callback for authentication check
Definition at line 661 of file qkd-app-004.h.
Referenced by GetTypeId().
|
private |
trace callback for decryption
Definition at line 659 of file qkd-app-004.h.
Referenced by GetTypeId().
|
private |
Definition at line 641 of file qkd-app-004.h.
Referenced by GetPeerId(), and Setup().
|
private |
Definition at line 654 of file qkd-app-004.h.
Referenced by GetTypeId(), and StartApplication().
|
private |
trace callback for encryption
Definition at line 658 of file qkd-app-004.h.
Referenced by GetTypeId().
|
private |
Definition at line 662 of file qkd-app-004.h.
Referenced by GetEncryptionKeySize(), ProcessDataPacket(), SendPacket(), and SetCryptoSettings().
|
private |
Definition at line 664 of file qkd-app-004.h.
Referenced by ProcessDataPacket(), SendPacket(), and SetCryptoSettings().
|
private |
Definition at line 647 of file qkd-app-004.h.
Referenced by CheckQueues(), CheckStreamSessions(), Close(), CreateKeyStreamSessions(), ProcessCloseResponse(), ProcessDataPacket(), ProcessGetKeyResponse(), ProcessOpenConnectResponse(), ProcessSignalingPacketFromApp(), SendPacket(), SetState(), Setup(), and StopApplication().
|
private |
Definition at line 634 of file qkd-app-004.h.
Referenced by GetTypeId().
|
private |
Definition at line 645 of file qkd-app-004.h.
Referenced by PopHttpKmsRequest(), ProcessCloseResponse(), and PushHttpKmsRequest().
|
private |
Definition at line 621 of file qkd-app-004.h.
Referenced by ConnectionRequestedFromApp(), ConnectionToAppSucceeded(), PrepareSocketToApp(), and SendPacket().
|
private |
Definition at line 620 of file qkd-app-004.h.
Referenced by ConnectionRequestedSignalingFromApp(), ConnectionSignalingToAppSucceeded(), PrepareSocketToApp(), and SendKsid().
|
private |
Definition at line 666 of file qkd-app-004.h.
Referenced by GetTypeId(), and Setup().
|
private |
Definition at line 665 of file qkd-app-004.h.
Referenced by GetTypeId(), and Setup().
|
private |
Definition at line 625 of file qkd-app-004.h.
Referenced by GetKmsIp(), PrepareSocketToKMS(), and Setup().
|
private |
Definition at line 624 of file qkd-app-004.h.
Referenced by PrepareSocketToApp(), Setup(), and StartApplication().
|
private |
Definition at line 639 of file qkd-app-004.h.
Referenced by AppTransitionTree(), CheckQueues(), CheckStreamSessions(), Close(), CreateKeyStreamSessions(), DataPacketReceived(), EstablishQueues(), GetKeyFromKMS(), OpenConnect(), PrepareSocketToApp(), ProcessDataPacket(), ProcessGetKeyResponse(), ProcessOpenConnectResponse(), ProcessSignalingPacketFromApp(), SendKsid(), SendPacket(), Setup(), StartApplication(), and StopApplication().
| TracedCallback<const std::string&, Ptr<const Packet> > ns3::QKDApp004::m_mxTrace |
Traced Callback: missed send packet call.
Definition at line 209 of file qkd-app-004.h.
Referenced by GetTypeId(), and SendPacket().
|
private |
Definition at line 630 of file qkd-app-004.h.
Referenced by GetEncryptionKeySize(), GetPacketContent(), ProcessDataPacket(), ScheduleTx(), SendPacket(), Setup(), and StartApplication().
|
private |
Definition at line 636 of file qkd-app-004.h.
Referenced by SendPacket(), and StartApplication().
|
private |
Definition at line 623 of file qkd-app-004.h.
Referenced by GetIp(), GetPeerIp(), PrepareSocketToApp(), Setup(), and StartApplication().
|
private |
Definition at line 626 of file qkd-app-004.h.
Referenced by PrepareSocketToApp(), and Setup().
|
private |
Definition at line 521 of file qkd-app-004.h.
Referenced by CheckQueues(), ProcessSignalingPacketFromApp(), and Setup().
|
private |
Definition at line 670 of file qkd-app-004.h.
Referenced by Close(), GetKeyFromKMS(), OpenConnect(), and ProcessPacketsToKMSFromQueue().
|
private |
Definition at line 522 of file qkd-app-004.h.
Referenced by CheckQueues(), ProcessSignalingPacketFromApp(), and Setup().
| TracedCallback<const std::string&, Ptr<const Packet> > ns3::QKDApp004::m_rxKmsTrace |
Traced Callback: received packets from KMS.
Definition at line 213 of file qkd-app-004.h.
Referenced by GetTypeId(), and PacketReceivedFromKMS().
| TracedCallback<const std::string&, Ptr<const Packet> > ns3::QKDApp004::m_rxSigTrace |
Traced Callback: received signaling packets.
Definition at line 211 of file qkd-app-004.h.
Referenced by GetTypeId(), and SignalingPacketReceivedFromApp().
| TracedCallback<const std::string&, Ptr<const Packet> > ns3::QKDApp004::m_rxTrace |
Traced Callback: received data packets.
Definition at line 207 of file qkd-app-004.h.
Referenced by DataPacketReceived(), and GetTypeId().
|
private |
Definition at line 632 of file qkd-app-004.h.
Referenced by ScheduleTx(), and StopApplication().
Definition at line 616 of file qkd-app-004.h.
Referenced by DoDispose(), EstablishQueues(), HandleAcceptSignalingFromApp(), PrepareSocketToApp(), SendKsid(), and StopApplication().
Definition at line 619 of file qkd-app-004.h.
Referenced by Close(), DoDispose(), GetKeyFromKMS(), HandlePeerCloseToKMS(), HandlePeerErrorToKMS(), OpenConnect(), PrepareSocketToKMS(), ProcessCloseResponse(), ProcessPacketsToKMSFromQueue(), and StopApplication().
|
private |
Definition at line 628 of file qkd-app-004.h.
Referenced by PrepareSocketToApp(), and Setup().
|
private |
Definition at line 668 of file qkd-app-004.h.
Referenced by GetState(), and SetState().
| ns3::TracedCallback<const std::string &, const std::string &> ns3::QKDApp004::m_stateTransitionTrace |
The StateTransition trace source.
Definition at line 215 of file qkd-app-004.h.
Referenced by GetTypeId().
|
private |
Definition at line 638 of file qkd-app-004.h.
Referenced by GetTypeId().
|
private |
transition map of protocol states
Definition at line 676 of file qkd-app-004.h.
| TracedCallback<const std::string&, Ptr<const Packet> > ns3::QKDApp004::m_txKmsTrace |
Traced Callback: transmitted packets to KMS.
Definition at line 205 of file qkd-app-004.h.
Referenced by Close(), GetKeyFromKMS(), GetTypeId(), OpenConnect(), and ProcessPacketsToKMSFromQueue().
| TracedCallback<const std::string&, Ptr<const Packet> > ns3::QKDApp004::m_txSigTrace |
Traced Callback: transmitted signaling packets.
Definition at line 203 of file qkd-app-004.h.
Referenced by EstablishQueues(), GetTypeId(), and SendKsid().
| TracedCallback<const std::string&, Ptr<const Packet> > ns3::QKDApp004::m_txTrace |
Traced Callback: transmitted data packets.
Definition at line 201 of file qkd-app-004.h.
Referenced by GetTypeId(), and SendPacket().
|
private |
Definition at line 653 of file qkd-app-004.h.
Referenced by GetTypeId(), ProcessDataPacket(), and SendPacket().