#include "qkd-sdn-controller.h"
Classes | |
struct | AddressHash |
Hashing for the Address class. More... | |
struct | Association004 |
struct | ChunkKey |
struct | HttpQuery |
struct | QoS |
Public Types | |
enum | RequestType { NONE = 50 , GET_ROUTE = 12 , REGISTER_SAE_LINK = 13 , REGISTER_QKD_LINK = 14 , KEY_ASSOCIATION_STATUS = 15 , ETSI_QKD_014_GET_STATUS = 0 , ETSI_QKD_014_GET_KEY = 1 , ETSI_QKD_014_GET_KEY_WITH_KEY_IDS = 2 , ETSI_QKD_004_OPEN_CONNECT = 3 , ETSI_QKD_004_GET_KEY = 4 , ETSI_QKD_004_CLOSE = 5 , NEW_APP = 6 , REGISTER = 7 , FILL = 8 , STORE_PP_KEYS = 9 , TRANSFORM_KEYS = 10 , ETSI_QKD_004_KMS_CLOSE = 11 } |
Request types. More... | |
Public Types inherited from ns3::Application | |
typedef void(* | DelayAddressCallback) (const Time &delay, const Address &from) |
Common callback signature for packet delay and address. More... | |
typedef void(* | StateTransitionCallback) (const std::string &oldState, const std::string &newState) |
Common signature used by callbacks to application's state transition trace source. More... | |
Public Member Functions | |
QKDSDNController () | |
QKDSDNController constructor. More... | |
virtual | ~QKDSDNController () |
QKDSDNController destructor. More... | |
void | AddNewLink (uint32_t srcSaeId, uint32_t dstSaeId, Ipv4Address kmsDstAddress, Ptr< QKDBuffer > srcBuffer) |
Inform KMS about the new QKD connection/link. More... | |
std::map< Ptr< Socket >, Ptr< Socket > > | GetAcceptedSockets (void) const |
Get list of all accepted sockets. More... | |
Ipv4Address | GetAddress () |
Get local address. More... | |
uint32_t | GetId () |
Get key menager system ID. More... | |
uint32_t | GetMaxKeyPerRequest () |
Get maximum number of keys per request (ETSI QKD 014) More... | |
Ptr< Node > | GetNode () |
Get node. More... | |
uint32_t | GetPort () |
Get local port. More... | |
Ptr< Socket > | GetSocket (void) const |
Get sink socket. More... | |
uint32_t | GetTotalRx () const |
Get the total amount of bytes received. More... | |
void | RegisterSaePair (Ptr< Node > srcNode, Ptr< Node > dstNode, uint32_t srcSaeId, uint32_t dstSaeId, std::string type) |
Inform KMS about the SAE connection. More... | |
void | SetAddress (Ipv4Address address) |
Set local address. More... | |
void | SetNode (Ptr< Node > n) |
Set node. More... | |
void | SetPort (uint32_t port) |
Set local port. More... | |
void | SetSocket (std::string type, Ptr< Socket > socket) |
Set sink socket. More... | |
Public Member Functions inherited from ns3::Application | |
Application () | |
virtual | ~Application () |
Ptr< Node > | GetNode () const |
void | SetNode (Ptr< Node > node) |
void | SetStartTime (Time start) |
Specify application start time. More... | |
void | SetStopTime (Time stop) |
Specify application stop time. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Application | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | DoDispose (void) |
@toDo More... | |
Protected Member Functions inherited from ns3::Application | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
std::string | Base64Decode (std::string input) |
Base64 decoder. More... | |
std::string | Base64Encode (std::string input) |
Base64 encoder. More... | |
void | CheckSocketsKMS (Ipv4Address dstSaeId) |
Prepare send socket to communicate with peer KMS Application. More... | |
void | ConnectionFailed (Ptr< Socket > socket) |
void | ConnectionFailedKMSs (Ptr< Socket > socket) |
void | ConnectionSucceeded (Ptr< Socket > socket) |
@toDo:following functions More... | |
void | ConnectionSucceededKMSs (Ptr< Socket > socket) |
nlohmann::json | CreateKeyContainer (std::vector< Ptr< QKDKey >> keys) |
Check the correctness of QKD application request and ability of KMS to fullfil correct request. More... | |
std::string | CreateNew004Association (uint32_t srcSaeId, uint32_t dstSaeId, QKDSDNController::QoS inQos, Ipv4Address dstKms, std::string ksid) |
Create a new assocation. More... | |
void | DataSend (Ptr< Socket >, uint32_t) |
void | DataSendKMSs (Ptr< Socket >, uint32_t) |
QKDSDNController::RequestType | FetchRequestType (std::string s) |
Get request type. More... | |
Ipv4Address | GetDestinationKmsAddress (Ptr< Socket > socket) |
Ptr< Socket > | GetSendSocketKMS (Ipv4Address kmsDstAddress) |
Obtain send socket. More... | |
Ptr< Socket > | GetSocketFromHttp004AppQuery (uint32_t saeId) |
void | HandleAccept (Ptr< Socket > s, const Address &from) |
Handle an incoming connection. More... | |
void | HandlePeerClose (Ptr< Socket > socket) |
Handle an connection close. More... | |
void | HandlePeerError (Ptr< Socket > socket) |
Handle an connection error. More... | |
void | HandleRead (Ptr< Socket > socket) |
Handle a packet received by the KMS application. More... | |
void | Http004AppQuery (uint32_t saeId, Ptr< Socket > socket) |
void | Http004AppQueryComplete (uint32_t saeId) |
void | HttpKMSAddQuery (Ipv4Address dstKms, HttpQuery request) |
remember HTTP request made to peer KMS More... | |
void | HttpKMSCompleteQuery (Ipv4Address dstKms) |
remove mapped HTTP response from query More... | |
RequestType | HttpQueryMethod (Ipv4Address dstKms) |
obtain method_type to map the HTTP response More... | |
void | PacketReceived (const Ptr< Packet > &p, const Address &from, Ptr< Socket > socket) |
Assemble byte stream to extract HTTPMessage. More... | |
std::string | PacketToString (Ptr< Packet > packet) |
Convert packet to string. More... | |
void | PrepareSinkSocket () |
void | ProcessAddKeysRequest (HTTPMessage h, Ptr< Socket > socket, std::string ksid) |
Process FILL request. More... | |
void | ProcessAddKeysResponse (HTTPMessage header, Ptr< Socket > socket) |
Process FILL response. More... | |
void | ProcessCloseRequest (std::string ksid, HTTPMessage header, Ptr< Socket > socket) |
void | ProcessGetKey004Request (std::string ksid, HTTPMessage header, Ptr< Socket > socket) |
void | ProcessNewAppRequest (HTTPMessage header, Ptr< Socket > socket) |
void | ProcessNewAppResponse (HTTPMessage header, Ptr< Socket > socket) |
void | ProcessOpenConnectRequest (HTTPMessage header, Ptr< Socket > socket) |
void | ProcessRegisterRequest (HTTPMessage header, std::string ksid, Ptr< Socket > socket) |
void | ProcessRegisterResponse (HTTPMessage header, Ptr< Socket > socket) |
void | ProcessRequest (HTTPMessage header, Ptr< Packet > packet, Ptr< Socket > socket) |
QKD key manager system application process the request from QKDApp, and complete certain actions to respond on received request. More... | |
void | ReadJsonQos (QKDSDNController::QoS &inQos, nlohmann::json jOpenConnectRequest) |
Read the parameters from the JSON OPEN_CONNECT structure! More... | |
void | RegisterRequest (std::string ksid) |
void | ReleaseAssociation (std::string ksid, std::string surplusKeyId, uint32_t syncIndex) |
release key stream association More... | |
void | SendToSocketPair (Ptr< Socket > socket, Ptr< Packet > packet) |
Send packet to the pair socket. More... | |
void | SendToSocketPairKMS (Ptr< Socket > socket, Ptr< Packet > packet) |
Send packet to the pair socket. More... | |
void | StartApplication (void) |
Start KMS Application. More... | |
void | StopApplication (void) |
Stop KMS Application. More... | |
Private Attributes | |
std::map< std::string, Association004 > | m_associations004 |
std::unordered_map< Address, Ptr< Packet >, AddressHash > | m_buffer |
Buffer for received packets (TCP segmentation) More... | |
std::unordered_map< Address, Ptr< Packet >, AddressHash > | m_bufferKMS |
Buffer for received packets (TCP segmentation) More... | |
EventId | m_closeSocketEvent |
uint32_t | m_defaultKeySize |
TracedCallback< const Ipv4Address &, Ptr< const Packet > > | m_dropTrace |
Traced callback: fired when a packet is dropped. More... | |
std::map< Ipv4Address, uint32_t > | m_flagedIPAdr |
std::multimap< uint32_t, Ptr< Socket > > | m_http004App |
std::map< Ipv4Address, std::vector< HttpQuery > > | m_httpRequestsQueryKMS |
TracedCallback< const std::string &, const uint32_t &, const uint32_t &, const uint32_t & > | m_keyServedETSI004Trace |
TracedCallback< const std::string &, const uint32_t &, Ptr< QKDKey > > | m_keyServedETSI014Trace |
TracedCallback< const uint32_t & > | m_keyServedTraceEmir |
uint32_t | m_kms_id |
uint32_t | m_kms_key_id |
Ipv4Address | m_local |
Local address to bind to. More... | |
uint32_t | m_maliciousBlocking |
uint32_t | m_maxKeyPerRequest |
uint32_t | m_maxKeySize |
uint32_t | m_minKeySize |
TracedCallback< const uint32_t &, const uint32_t & > | m_newKeyGeneratedTrace |
TracedCallback< const uint32_t & > | m_newKeyGeneratedTraceEmir |
Ptr< Node > | m_node |
std::map< Ptr< Socket >, Ptr< Packet > > | m_packetQueues |
Buffering unsend messages due to connection problems. More... | |
uint32_t | m_port |
Local port to bind to. More... | |
double | m_qkdLinkDefaultUpdateInterval |
Default update interval of QKD link status (seconds) More... | |
Ptr< QKDKMSQueueLogic > | m_queueLogic |
KMS Queue Logic for ETSI 004 QoS handling. More... | |
TracedCallback< Ptr< const Packet >, const Address & > | m_rxTrace |
Traced Callback: received packets, source address. More... | |
TracedCallback< Ptr< const Packet >, const Address & > | m_rxTraceSDNs |
std::map< uint32_t, EventId > | m_scheduledChecks |
Ptr< Socket > | m_sinkSocket |
std::map< Ptr< Socket >, Ptr< Socket > > | m_socketPairs |
the accepted sockets More... | |
std::map< Ipv4Address, std::pair< Ptr< Socket >, Ptr< Socket > > > | m_socketPairsKMS |
the accepted sockets for communication between KMSs More... | |
TypeId | m_tid |
uint32_t | m_totalRx |
Total bytes received More... | |
uint32_t | m_totalRxKMSs |
Total bytes received between KMSs. More... | |
TracedCallback< Ptr< const Packet > > | m_txTrace |
TracedCallback< Ptr< const Packet > > | m_txTraceSDNs |
Additional Inherited Members | |
Protected Attributes inherited from ns3::Application | |
Ptr< Node > | m_node |
The node that this application is installed on. More... | |
EventId | m_startEvent |
The event that will fire at m_startTime to start the application. More... | |
Time | m_startTime |
The simulation time that the application will start. More... | |
EventId | m_stopEvent |
The event that will fire at m_stopTime to end the application. More... | |
Time | m_stopTime |
The simulation time that the application will end. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
ns3::QKDSDNController is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 952 bytes (on a 64-bit architecture).
Definition at line 66 of file qkd-sdn-controller.h.
Request types.
Definition at line 73 of file qkd-sdn-controller.h.
ns3::QKDSDNController::QKDSDNController | ( | ) |
QKDSDNController constructor.
Definition at line 135 of file qkd-sdn-controller.cc.
References m_totalRx, and NS_LOG_FUNCTION.
|
virtual |
QKDSDNController destructor.
Definition at line 142 of file qkd-sdn-controller.cc.
References NS_LOG_FUNCTION.
void ns3::QKDSDNController::AddNewLink | ( | uint32_t | srcSaeId, |
uint32_t | dstSaeId, | ||
Ipv4Address | kmsDstAddress, | ||
Ptr< QKDBuffer > | srcBuffer | ||
) |
Inform KMS about the new QKD connection/link.
uint32_t | master SAE ID |
uint32_t | slave SAE ID |
Ipv4Address | slave KMS address |
Ptr<QKDBuffer> | srcQKDBuffer |
Definition at line 816 of file qkd-sdn-controller.cc.
References GetNode(), ns3::Object::GetObject(), m_local, NS_ASSERT, and NS_LOG_FUNCTION.
|
private |
Base64 decoder.
input | input data |
Definition at line 919 of file qkd-sdn-controller.cc.
|
private |
Base64 encoder.
input | input data |
Definition at line 907 of file qkd-sdn-controller.cc.
|
private |
Prepare send socket to communicate with peer KMS Application.
uint32_t | destination SAE ID |
Definition at line 261 of file qkd-sdn-controller.cc.
References NS_LOG_FUNCTION.
Referenced by HandleAccept().
@toDo:following functions
Definition at line 243 of file qkd-sdn-controller.cc.
References m_packetQueues, m_txTrace, and NS_LOG_FUNCTION.
Referenced by HandleAccept().
|
private |
Check the correctness of QKD application request and ability of KMS to fullfil correct request.
request | json structure of application request |
conn | connection details |
Create key container data structure described in ETSI014 document.
keys | vector of pointers on the QKD key |
|
private |
Create a new assocation.
srcSaeId | source secure application entity |
dstSaeId | destination secure application entity |
inQos | Quality of Service |
dstKms | destination KMS address |
ksid | Unique identifier of the association |
Input ksid can be empty if it is not predefined. In that case new ksid is generated for this new association and return from the function.
Definition at line 268 of file qkd-sdn-controller.cc.
References NS_LOG_FUNCTION.
Referenced by HandleAccept().
|
protectedvirtual |
@toDo
Reimplemented from ns3::Application.
Definition at line 191 of file qkd-sdn-controller.cc.
References ns3::Application::DoDispose(), m_sinkSocket, m_socketPairs, and NS_LOG_FUNCTION.
|
private |
Get request type.
s | string from HTTP URI |
Definition at line 740 of file qkd-sdn-controller.cc.
References ETSI_QKD_004_CLOSE, ETSI_QKD_004_GET_KEY, ETSI_QKD_004_KMS_CLOSE, ETSI_QKD_004_OPEN_CONNECT, ETSI_QKD_014_GET_KEY, ETSI_QKD_014_GET_KEY_WITH_KEY_IDS, ETSI_QKD_014_GET_STATUS, FILL, KEY_ASSOCIATION_STATUS, NEW_APP, NS_FATAL_ERROR, NS_LOG_FUNCTION, REGISTER, REGISTER_QKD_LINK, REGISTER_SAE_LINK, STORE_PP_KEYS, and TRANSFORM_KEYS.
Referenced by ProcessRequest().
Get list of all accepted sockets.
Definition at line 160 of file qkd-sdn-controller.cc.
References m_socketPairs, and NS_LOG_FUNCTION.
|
inline |
Get local address.
Definition at line 205 of file qkd-sdn-controller.h.
References m_local.
|
private |
uint32_t ns3::QKDSDNController::GetId | ( | void | ) |
Get key menager system ID.
Definition at line 148 of file qkd-sdn-controller.cc.
References m_kms_id.
uint32_t ns3::QKDSDNController::GetMaxKeyPerRequest | ( | ) |
Get maximum number of keys per request (ETSI QKD 014)
Definition at line 735 of file qkd-sdn-controller.cc.
References m_maxKeyPerRequest.
Get node.
Definition at line 901 of file qkd-sdn-controller.cc.
References m_node.
Referenced by AddNewLink(), HandleAccept(), PrepareSinkSocket(), ProcessRequest(), and RegisterSaePair().
|
inline |
Get local port.
Definition at line 221 of file qkd-sdn-controller.h.
References m_port.
|
private |
Get sink socket.
SOCKET functions
Definition at line 177 of file qkd-sdn-controller.cc.
References m_sinkSocket, and NS_LOG_FUNCTION.
uint32_t ns3::QKDSDNController::GetTotalRx | ( | ) | const |
Get the total amount of bytes received.
Definition at line 153 of file qkd-sdn-controller.cc.
References m_totalRx, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 49 of file qkd-sdn-controller.cc.
References ns3::TcpSocketFactory::GetTypeId(), m_defaultKeySize, m_dropTrace, m_keyServedETSI004Trace, m_keyServedETSI014Trace, m_keyServedTraceEmir, m_local, m_maliciousBlocking, m_maxKeyPerRequest, m_maxKeySize, m_minKeySize, m_newKeyGeneratedTrace, m_newKeyGeneratedTraceEmir, m_qkdLinkDefaultUpdateInterval, m_rxTrace, m_rxTraceSDNs, m_tid, m_txTrace, m_txTraceSDNs, ns3::MakeDoubleAccessor(), ns3::MakeIpv4AddressAccessor(), ns3::MakeIpv4AddressChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeTypeIdAccessor(), ns3::MakeTypeIdChecker(), ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().
Handle an incoming connection.
s | the incoming connection socket |
from | the address the connection is from |
Definition at line 200 of file qkd-sdn-controller.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), ConnectionFailed(), ConnectionSucceeded(), ns3::InetSocketAddress::ConvertFrom(), ns3::Socket::CreateSocket(), DataSend(), GetNode(), ns3::Socket::GetSocketType(), ns3::TcpSocketFactory::GetTypeId(), ns3::UdpSocketFactory::GetTypeId(), HandleRead(), m_socketPairs, ns3::MakeCallback(), ns3::Socket::NS3_SOCK_SEQPACKET, ns3::Socket::NS3_SOCK_STREAM, NS_LOG_FUNCTION, ns3::Socket::SetConnectCallback(), ns3::Socket::SetDataSentCallback(), ns3::Socket::SetRecvCallback(), and ns3::Socket::ShutdownRecv().
Referenced by PrepareSinkSocket().
Handle an connection close.
socket | the connected socket |
Definition at line 274 of file qkd-sdn-controller.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSinkSocket().
Handle an connection error.
socket | the connected socket |
Definition at line 280 of file qkd-sdn-controller.cc.
References NS_LOG_FUNCTION.
Referenced by PrepareSinkSocket().
Handle a packet received by the KMS application.
socket | the receiving socket |
Definition at line 313 of file qkd-sdn-controller.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::InetSocketAddress::IsMatchingType(), m_rxTrace, m_totalRx, ns3::Simulator::Now(), NS_LOG_FUNCTION, PacketReceived(), and ns3::Socket::RecvFrom().
Referenced by HandleAccept(), and PrepareSinkSocket().
|
private |
|
private |
remember HTTP request made to peer KMS
dstKms | destination kms IP address |
request | request parameters |
|
private |
remove mapped HTTP response from query
dstKms | destination kms IP address |
|
private |
obtain method_type to map the HTTP response
dstKms | destination KMS IP address |
|
private |
Assemble byte stream to extract HTTPMessage.
p | received packet |
from | from address |
The method assembles a received byte stream and extracts HTTPMessage instances from the stream to export in a trace source.
Definition at line 347 of file qkd-sdn-controller.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::CopyData(), ns3::Packet::CreateFragment(), ns3::HTTPMessage::GetSize(), ns3::Packet::GetSize(), ns3::HTTPMessage::GetStatusMessage(), ns3::Packet::GetUid(), ns3::HTTPMessage::IsFragmented(), m_buffer, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HTTPMessageParser::Parse(), ProcessRequest(), ns3::Packet::RemoveAtStart(), ns3::HTTPMessage::ToString(), and ns3::Packet::ToString().
Referenced by HandleRead().
Convert packet to string.
packet | the packet |
|
private |
Definition at line 425 of file qkd-sdn-controller.cc.
References ns3::Socket::Bind(), ns3::Socket::CreateSocket(), ns3::Ipv4Address::GetAny(), GetNode(), HandleAccept(), HandlePeerClose(), HandlePeerError(), HandleRead(), ns3::Socket::Listen(), m_local, m_port, m_sinkSocket, m_tid, ns3::MakeCallback(), ns3::MakeNullCallback(), NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Socket::SetAcceptCallback(), ns3::Socket::SetCloseCallbacks(), ns3::Socket::SetRecvCallback(), and ns3::Socket::ShutdownSend().
Referenced by StartApplication().
|
private |
Process FILL request.
header | received request |
socket | receiving socket |
ksid | Unique identifier of the association |
Process the proposal of keys to fill the dedicated key store reserved for association identified with KSID.
|
private |
Process FILL response.
header | received http header |
socket | receiving socket |
Process the response on the FILL method where the primary KMS (the initiator) will obtain and store QKD keys that are accepted by the replica KMS for this association.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
QKD key manager system application process the request from QKDApp, and complete certain actions to respond on received request.
header | received HTTP header |
packet | received packet |
socket | the receiving socket |
Data structure of key managment respond is described in ETSI014 document.
Southbound interface functions (ETSI 014 & ETSI 004)
Definition at line 490 of file qkd-sdn-controller.cc.
References ns3::HTTPMessage::CreateResponse(), FetchRequestType(), ns3::HTTPMessage::GetMessageBodyString(), ns3::HTTPMessage::GetMethod(), GetNode(), ns3::Object::GetObject(), ns3::Packet::GetSize(), ns3::Packet::GetUid(), ns3::HTTPMessage::GetUri(), KEY_ASSOCIATION_STATUS, m_qkdLinkDefaultUpdateInterval, NONE, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, REGISTER_QKD_LINK, REGISTER_SAE_LINK, SendToSocketPair(), ns3::QKDKeyAssociationLinkEntry::SetEffectiveSKR(), ns3::QKDKeyAssociationLinkEntry::SetExpectedConsumption(), ns3::QKDKeyAssociationLinkEntry::SetId(), ns3::QKDKeyAssociationLinkEntry::SetSKR(), ns3::QKDKeyAssociationLinkEntry::SetUpdateStatusInterval(), and ns3::HTTPMessage::ToString().
Referenced by PacketReceived().
|
private |
Read the parameters from the JSON OPEN_CONNECT structure!
&dstSaeId | destination secure application entity |
&srcSaeId | source secure application entity |
&inQos | requested QoS |
&ksid | Unique identifier of the association |
jOpenConncetRequest | JSON structure of the OPEN_CONNECT call |
|
private |
void ns3::QKDSDNController::RegisterSaePair | ( | Ptr< Node > | srcNode, |
Ptr< Node > | dstNode, | ||
uint32_t | srcSaeId, | ||
uint32_t | dstSaeId, | ||
std::string | type | ||
) |
Inform KMS about the SAE connection.
This function register the pair of QKDApps (srcSaeId, dstSaeId) to use keys that are produced by the QKD systems on nodes srcNode and dstNode via this KMS.
Ptr<Node> | source |
Ptr<Node> | destination |
uint32_t | source SAE_ID |
uint32_t | destination SAE_ID |
std::string | type |
Definition at line 849 of file qkd-sdn-controller.cc.
References GetNode(), ns3::Object::GetObject(), NS_ASSERT, and NS_LOG_FUNCTION.
|
private |
release key stream association
ksid | unique key stream identifier |
surplusKeyId | unique key identifier for surplus key material in dedicated association buffer |
syncIndex | unique key index in dedicated association buffer for synchronisation |
Send packet to the pair socket.
socket | receiving socket |
packet | packet to send |
Definition at line 286 of file qkd-sdn-controller.cc.
References ns3::Socket::GetPeerName(), ns3::Packet::GetUid(), m_packetQueues, m_socketPairs, m_txTrace, NS_LOG_FUNCTION, and ns3::Socket::Send().
Referenced by ProcessRequest().
|
private |
Send packet to the pair socket.
socket | receiving socket |
packet | packet to send |
|
inline |
Set local address.
Ipv4Address | address |
Definition at line 197 of file qkd-sdn-controller.h.
References first::address, and m_local.
Set node.
n | node to be set |
Definition at line 896 of file qkd-sdn-controller.cc.
References m_node.
|
inline |
Set sink socket.
type | socket type |
socket | pointer to socket to be set |
Definition at line 184 of file qkd-sdn-controller.cc.
References m_sinkSocket, and NS_LOG_FUNCTION.
|
privatevirtual |
Start KMS Application.
APPLICATION functions
Reimplemented from ns3::Application.
Definition at line 418 of file qkd-sdn-controller.cc.
References NS_LOG_FUNCTION, and PrepareSinkSocket().
|
privatevirtual |
Stop KMS Application.
Reimplemented from ns3::Application.
Definition at line 457 of file qkd-sdn-controller.cc.
References ns3::Socket::Close(), m_sinkSocket, m_socketPairs, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().
|
private |
Definition at line 500 of file qkd-sdn-controller.h.
|
private |
Buffer for received packets (TCP segmentation)
Definition at line 546 of file qkd-sdn-controller.h.
Referenced by PacketReceived().
|
private |
Buffer for received packets (TCP segmentation)
Definition at line 547 of file qkd-sdn-controller.h.
|
private |
Definition at line 518 of file qkd-sdn-controller.h.
|
private |
Definition at line 544 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Traced callback: fired when a packet is dropped.
Definition at line 531 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 522 of file qkd-sdn-controller.h.
Definition at line 580 of file qkd-sdn-controller.h.
|
private |
HTTP handling
Each application can open only one connection with its local KMS (current socket). Each KMS can have only one connection with arbitrary KMS (current socket).
Definition at line 579 of file qkd-sdn-controller.h.
|
private |
Definition at line 539 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 538 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 534 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 514 of file qkd-sdn-controller.h.
Referenced by GetId().
|
private |
Definition at line 516 of file qkd-sdn-controller.h.
|
private |
Local address to bind to.
Definition at line 504 of file qkd-sdn-controller.h.
Referenced by AddNewLink(), GetAddress(), GetTypeId(), PrepareSinkSocket(), and SetAddress().
|
private |
Definition at line 523 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 541 of file qkd-sdn-controller.h.
Referenced by GetMaxKeyPerRequest(), and GetTypeId().
|
private |
Definition at line 543 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 542 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 536 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 533 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
Definition at line 555 of file qkd-sdn-controller.h.
Buffering unsend messages due to connection problems.
Definition at line 556 of file qkd-sdn-controller.h.
Referenced by ConnectionSucceeded(), and SendToSocketPair().
|
private |
Local port to bind to.
Definition at line 506 of file qkd-sdn-controller.h.
Referenced by GetPort(), PrepareSinkSocket(), and SetPort().
|
private |
Default update interval of QKD link status (seconds)
Definition at line 498 of file qkd-sdn-controller.h.
Referenced by GetTypeId(), and ProcessRequest().
|
private |
KMS Queue Logic for ETSI 004 QoS handling.
Definition at line 558 of file qkd-sdn-controller.h.
|
private |
Traced Callback: received packets, source address.
Definition at line 526 of file qkd-sdn-controller.h.
Referenced by GetTypeId(), and HandleRead().
|
private |
Definition at line 528 of file qkd-sdn-controller.h.
Referenced by GetTypeId().
|
private |
Definition at line 520 of file qkd-sdn-controller.h.
Definition at line 502 of file qkd-sdn-controller.h.
Referenced by DoDispose(), GetSocket(), PrepareSinkSocket(), SetSocket(), and StopApplication().
the accepted sockets
Definition at line 551 of file qkd-sdn-controller.h.
Referenced by DoDispose(), GetAcceptedSockets(), HandleAccept(), SendToSocketPair(), and StopApplication().
|
private |
the accepted sockets for communication between KMSs
Definition at line 553 of file qkd-sdn-controller.h.
|
private |
Definition at line 512 of file qkd-sdn-controller.h.
Referenced by GetTypeId(), and PrepareSinkSocket().
|
private |
Total bytes received
Definition at line 508 of file qkd-sdn-controller.h.
Referenced by QKDSDNController(), GetTotalRx(), and HandleRead().
|
private |
Total bytes received between KMSs.
Definition at line 510 of file qkd-sdn-controller.h.
|
private |
Definition at line 527 of file qkd-sdn-controller.h.
Referenced by ConnectionSucceeded(), GetTypeId(), and SendToSocketPair().
|
private |
Definition at line 529 of file qkd-sdn-controller.h.
Referenced by GetTypeId().