A Discrete-Event Network Simulator
API
ns3::QKDBuffer Class Reference

Introspection did not find any typical Config paths. More...

#include "qkd-buffer.h"

+ Inheritance diagram for ns3::QKDBuffer:
+ Collaboration diagram for ns3::QKDBuffer:

Classes

struct  data
 

Public Member Functions

 QKDBuffer (uint32_t srcNodeId, uint32_t dstNodeId, bool useRealStorages)
 Create a QKDBuffer. More...
 
virtual ~QKDBuffer ()
 Destroy a QKDBuffer. More...
 
bool AddNewContent (const uint32_t &keySize)
 Add new key material to the storage after post-processing is completed. More...
 
void CalculateAverageAmountOfTheKeyInTheBuffer ()
 Help function used for ploting graphs. More...
 
void CheckState (void)
 Update the state after some changes on the buffer. More...
 
void Dispose (void)
 Destroy a QKDBuffer. More...
 
double FetchAverageKeyChargingTimePeriod ()
 Return average duration of key charging process in the long run. More...
 
int64_t FetchDeltaTime ()
 
int64_t FetchLastKeyChargingTimeDuration ()
 Return time value about the time duration of last key charging process. More...
 
uint32_t FetchMaxNumberOfRecordedKeyChargingTimePeriods ()
 Return the maximal number of values which are used for stored for calculation of average key charging time period. More...
 
uint32_t FetchPreviousState (void)
 Fetch the previous state of the QKD buffer. More...
 
uint32_t FetchState (void)
 Fetch the current state of the QKD buffer. More...
 
uint32_t GetBufferId (void) const
 Get the QKD Storage/Buffer ID. More...
 
uint32_t GetMcurrent (void) const
 Get the current amount of key material in QKD storage. More...
 
uint32_t GetMCurrentPrevious (void) const
 Help function used for ploting graphs; Previous - before latest change. More...
 
uint32_t GetMmax (void) const
 Get the maximal amount of key material that can be stored in QKD storage. More...
 
uint32_t GetMmin (void) const
 Get the minimal amount of key material that can be stored in QKD storage. More...
 
uint32_t GetMthr (void) const
 Get the threshold value of QKD storage The threshold value Mthr (t) at the time of measurement t is used to indicate the state of QKD buffer where it holds that Mthr (t) ≤ Mmax . More...
 
void Init (void)
 Initialize a QKDBuffer. More...
 
void InitTotalGraph () const
 Help function for total graph ploting. More...
 
void KeyCalculation ()
 Help function used for ploting graphs. More...
 
bool operator== (QKDBuffer const &o) const
 Assign operator. More...
 
Ptr< QKDKeyProcessIncomingRequest (const uint32_t &keyID, const uint32_t &keySize)
 Check whether there is enough key material to decrypt the incoming package. More...
 
Ptr< QKDKeyProcessOutgoingRequest (const uint32_t &keySize)
 Check whether there is enough key material to send the package to destination. More...
 
void SetMthr (uint32_t thr)
 Set the threshold value of QKD storage. 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<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. 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)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (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 TypeId. 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...
 

Public Attributes

uint32_t m_bufferID
 unique buffer ID More...
 
uint32_t m_DstNodeId
 destination node ID More...
 
uint32_t m_SrcNodeId
 source node ID More...
 

Static Public Attributes

static uint32_t nBuffers = 0
 number of created buffers - static value More...
 
static const uint32_t QKDSTATUS_CHARGING = 2
 QKDStatus CHARGING. More...
 
static const uint32_t QKDSTATUS_EMPTY = 3
 QKDStatus EMPTY. More...
 
static const uint32_t QKDSTATUS_READY = 0
 QKDStatus READY. More...
 
static const uint32_t QKDSTATUS_WARNING = 1
 QKDStatus WARNING. More...
 

Private Member Functions

Ptr< QKDKeyFetchKeyByID (const uint32_t &keyID)
 Check whether key exists in the buffer. More...
 
Ptr< QKDKeyFetchKeyOfSize (const uint32_t &keySize)
 Find the key of required size to be used for encryption UNDER CONSTRUCTION! THIS FUNCTION NEEDS TO PERFORM MERGE, SPLIT OF KEYS AND TO PROVIDE FINAL KEY OF REQUIRED SIZE. More...
 

Private Attributes

double m_AverageKeyChargingTimePeriod
 The average duration of key charging time period. More...
 
TracedCallback< double > m_AverageKeyChargingTimePeriodTrace
 
uint32_t m_bitsChargedInTimePeriod
 Help value used for graph ploting and calculation of average post-processing duration. More...
 
uint32_t m_bitsUsedInTimePeriod
 Help value used for detection of average key usage. More...
 
double m_c
 average amount of key in the buffer during the recalculate time period More...
 
EventId m_calculateRoutingMetric
 
std::vector< int64_t > m_chargingTimePeriods
 Vector of durations of several last charging time periods. More...
 
TracedCallback< double > m_CMetricChangeTrace
 
bool m_isRisingCurve
 whether curve on graph is rising or not More...
 
std::map< uint32_t, Ptr< QKDKey > > m_keys
 map of ID-Ptr<QKDKey> More...
 
int64_t m_lastKeyChargingTimeDuration
 The timestamp of last key usage. More...
 
int64_t m_lastKeyChargingTimeStamp
 The timestamp of last key charging (when the new key material was added) More...
 
uint32_t m_maxNumberOfRecordedKeyChargingTimePeriods
 The maximal number of values which are used for stored for calculation of average key charging time period. More...
 
uint32_t m_Mcurrent
 The current amount of key material in QKD key storage. More...
 
TracedCallback< uint32_t > m_McurrentChangeTrace
 
TracedCallback< uint32_t > m_McurrentDecreaseTrace
 
TracedCallback< uint32_t > m_McurrentIncreaseTrace
 
uint32_t m_McurrentPrevious
 The previous value of current amount of key material in QKD key storage. More...
 
uint32_t m_Mmax
 The maximal amount of key material in QKD key storage. More...
 
uint32_t m_Mmin
 The minimal amount of key material in QKD key storage. More...
 
uint32_t m_Mthr
 The threshold amount of key material in QKD key storage. More...
 
TracedCallback< uint32_t > m_MthrChangeTrace
 
TracedCallback< uint32_t > m_MthrDecreaseTrace
 
TracedCallback< uint32_t > m_MthrIncreaseTrace
 
uint32_t m_nextKeyID
 ID of the next key to be generated. More...
 
uint32_t m_noAddNewValue
 Help value used for graph ploting. More...
 
uint32_t m_noEntry
 Help value used for graph ploting. More...
 
uint32_t m_period
 Help value used for graph ploting. More...
 
uint32_t m_previousStatus
 Holds previous status; important for deciding about further status that can be selected. More...
 
std::vector< struct QKDBuffer::datam_previousValues
 Help vector used for graph ploting. More...
 
uint32_t m_recalculateTimePeriod
 The period of time (in seconds) to calculate average amount of the key in the buffer Default value 5 - used in routing protocols for detection of information freshness. More...
 
uint32_t m_Status
 The state of the Net Device transmit state machine. More...
 
TracedCallback< uint32_t > m_StatusChangeTrace
 
bool m_useRealStorages
 Whether to use real storages or virtual buffers UNDER CONSTRUCTION! Currently only virtual buffers supported. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. 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...
 

Detailed Description

Introspection did not find any typical Config paths.

QKD buffer (storage) that keeps QKD keys.


Attributes

  • Minimal: The minimal amount of key material in QKD storage
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 1000000
    • Flags: construct write read
  • Maximal: The maximal amount of key material in QKD storage
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 1000000000
    • Flags: construct write read
  • Threshold: The threshold amount of key material in QKD storage
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 2000000
    • Flags: construct write read
  • Current: The current amount of key material in QKD storage
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 5000000
    • Flags: construct write read
  • CalculationTimePeriod: The period of time (in seconds) to calculate average amount of the key in the buffer
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 5
    • Flags: construct write read
  • MaxNumberOfRecordedKeyCharingTimePeriods: The maximal number of values which are used for stored for calculation of average key charging time period
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 5
    • Flags: construct write read

TraceSources

  • ThresholdChange: The change trace for threshold amount of key material in QKD storage
    Callback signature: ns3::QKDBuffer::ThresholdChange
  • ThresholdIncrease: The increase trace for threshold amount of key material in QKD storage
    Callback signature: ns3::QKDBuffer::ThresholdIncrease
  • ThresholdDecrease: The decrease trace for threshold amount of key material in QKD storage
    Callback signature: ns3::QKDBuffer::ThresholdDecrease
  • CurrentChange: The change trace for current amount of key material in QKD storage
    Callback signature: ns3::QKDBuffer::CurrentChange
  • CurrentIncrease: The increase trace for current amount of key material in QKD storage
    Callback signature: ns3::QKDBuffer::CurrentIncrease
  • CurrentDecrease: The decrease trace for current amount of key material in QKD storage
    Callback signature: ns3::QKDBuffer::CurrentDecrease
  • StatusChange: The change trace for current status of QKD storage
    Callback signature: ns3::QKDBuffer::StatusChange
  • CMetricChange: The change trace for current status of QKD storage
    Callback signature: ns3::QKDBuffer::CMetricChange
  • AverageKeyChargingTimePeriod: The change trace for current status of QKD storage
    Callback signature: ns3::QKDBuffer::AverageKeyChargingTimePeriod

Size of this type is 488 bytes (on a 64-bit architecture).

QKDBuffer is assigned for each link using QKDManager on each side of the link (each node). That is, two QKDBuffers for one link.

Note
Due to the limited key rate, the links are organized in the following way: both endpoints of the corresponding link have key storages (QKD buffers) with limited capacity which are gradually filled with the new key material, which is subsequently used for the encryption/decryption of the data flow. The QKD devices constantly generate keys at their maximum key rate until the key storages are filled. The type of the used encryption algorithm and the amount of network traffic to be encrypted determines the speed of emptying the key storage, often referred as the key consumption rate, while the key rate of the link determines the key charging rate. If there is no enough of the stored key material, the encryption of the data flow cannot be performed and the link can be characterized as “currently unavailable”. QKD buffer can be in one of the following states: READY, WARNING, CHARGING, EMTPY. The states of QKD buffer do not directly affect the communication, but it can be used for easier prioritization of traffic depending on the state of the buffer. For example, in EMPTY state, QKD post-processing application used to establish a new key material should have the highest priority in traffic processing.

Definition at line 67 of file qkd-buffer.h.

Constructor & Destructor Documentation

ns3::QKDBuffer::QKDBuffer ( uint32_t  srcNodeId,
uint32_t  dstNodeId,
bool  useRealStorages 
)

Create a QKDBuffer.

By default, you get an empty QKD storage

Definition at line 122 of file qkd-buffer.cc.

References Init(), m_DstNodeId, m_nextKeyID, m_SrcNodeId, m_useRealStorages, nBuffers, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

ns3::QKDBuffer::~QKDBuffer ( )
virtual

Destroy a QKDBuffer.

This is the destructor for the QKDBuffer.

Definition at line 154 of file qkd-buffer.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

bool ns3::QKDBuffer::AddNewContent ( const uint32_t &  keySize)

Add new key material to the storage after post-processing is completed.

Add new content to buffer.

Parameters
keySizeuint32_t size of the new key material
Returns
True if the key material can be added to the storage; False otherwise
Parameters
uint32_tkeySize in bits Used when node receives information that new key material was establieshed

Second, add new value to vector of previous values

Definition at line 233 of file qkd-buffer.cc.

References ns3::Time::GetMilliSeconds(), KeyCalculation(), m_AverageKeyChargingTimePeriod, m_AverageKeyChargingTimePeriodTrace, m_bitsChargedInTimePeriod, m_chargingTimePeriods, m_keys, m_lastKeyChargingTimeDuration, m_lastKeyChargingTimeStamp, m_maxNumberOfRecordedKeyChargingTimePeriods, m_Mcurrent, m_McurrentChangeTrace, m_McurrentIncreaseTrace, m_Mmax, m_nextKeyID, m_noAddNewValue, m_noEntry, m_period, m_useRealStorages, ns3::Simulator::Now(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::QKDBuffer::CalculateAverageAmountOfTheKeyInTheBuffer ( )

Help function used for ploting graphs.

Definition at line 167 of file qkd-buffer.cc.

References m_bitsChargedInTimePeriod, m_bitsUsedInTimePeriod, m_c, m_calculateRoutingMetric, m_CMetricChangeTrace, m_Mcurrent, m_Mthr, m_recalculateTimePeriod, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and ns3::Seconds().

Referenced by Init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::QKDBuffer::CheckState ( void  )

Update the state after some changes on the buffer.

Definition at line 414 of file qkd-buffer.cc.

References m_isRisingCurve, m_Mcurrent, m_McurrentPrevious, m_Mmax, m_Mmin, m_Mthr, m_previousStatus, m_Status, m_StatusChangeTrace, NS_LOG_FUNCTION, QKDSTATUS_CHARGING, QKDSTATUS_EMPTY, QKDSTATUS_READY, and QKDSTATUS_WARNING.

Referenced by KeyCalculation().

+ Here is the caller graph for this function:

void ns3::QKDBuffer::Dispose ( void  )

Destroy a QKDBuffer.

This is the pre-destructor function of the QKDBuffer.

Definition at line 160 of file qkd-buffer.cc.

References ns3::Simulator::Cancel(), m_calculateRoutingMetric, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

double ns3::QKDBuffer::FetchAverageKeyChargingTimePeriod ( )

Return average duration of key charging process in the long run.

Returns
double average duration of key charging period

Definition at line 496 of file qkd-buffer.cc.

References m_AverageKeyChargingTimePeriod, and NS_LOG_FUNCTION.

int64_t ns3::QKDBuffer::FetchDeltaTime ( )

Definition at line 488 of file qkd-buffer.cc.

References ns3::Time::GetMilliSeconds(), m_lastKeyChargingTimeStamp, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Ptr< QKDKey > ns3::QKDBuffer::FetchKeyByID ( const uint32_t &  keyID)
private

Check whether key exists in the buffer.

Parameters
uint32_tkeyID
Returns
Ptr to the key

Definition at line 397 of file qkd-buffer.cc.

References m_keys, and NS_LOG_FUNCTION.

Referenced by ProcessIncomingRequest().

+ Here is the caller graph for this function:

Ptr< QKDKey > ns3::QKDBuffer::FetchKeyOfSize ( const uint32_t &  keySize)
private

Find the key of required size to be used for encryption UNDER CONSTRUCTION! THIS FUNCTION NEEDS TO PERFORM MERGE, SPLIT OF KEYS AND TO PROVIDE FINAL KEY OF REQUIRED SIZE.

Parameters
uint32_tkeySize in bits!
Returns
Ptr to the key
Parameters
keySizein bits!

Definition at line 385 of file qkd-buffer.cc.

References m_keys, m_nextKeyID, and NS_LOG_FUNCTION.

Referenced by ProcessIncomingRequest(), and ProcessOutgoingRequest().

+ Here is the caller graph for this function:

int64_t ns3::QKDBuffer::FetchLastKeyChargingTimeDuration ( )

Return time value about the time duration of last key charging process.

Returns
int64_t lastKeyChargingTimeDuration

Definition at line 477 of file qkd-buffer.cc.

References m_lastKeyChargingTimeDuration, and NS_LOG_FUNCTION.

uint32_t ns3::QKDBuffer::FetchMaxNumberOfRecordedKeyChargingTimePeriods ( )

Return the maximal number of values which are used for stored for calculation of average key charging time period.

Returns
int32_t maximal number of recorded key charging time periods; default value 5

Definition at line 306 of file qkd-buffer.cc.

References m_maxNumberOfRecordedKeyChargingTimePeriods.

uint32_t ns3::QKDBuffer::FetchPreviousState ( void  )

Fetch the previous state of the QKD buffer.

Help function used for ploting graphs

Returns
int32_t integer representation of QKD Storage state

Definition at line 509 of file qkd-buffer.cc.

References m_previousStatus, and NS_LOG_FUNCTION.

uint32_t ns3::QKDBuffer::FetchState ( void  )

Fetch the current state of the QKD buffer.

QKD buffer can be in one of the following states: – READY—when Mcur (t) ≥ Mthr , – WARNING—when Mthr > Mcur (t) > Mmin and the previous state was READY, – CHARGING—when Mthr > Mcur (t) and the previous state was EMPTY, – EMTPY—when Mmin ≥ Mcur (t) and the previous state was WARNING or CHARGING

Definition at line 502 of file qkd-buffer.cc.

References m_Status, and NS_LOG_FUNCTION.

uint32_t ns3::QKDBuffer::GetBufferId ( void  ) const

Get the QKD Storage/Buffer ID.

Returns
int32_t buffer unique ID

Definition at line 458 of file qkd-buffer.cc.

References m_bufferID, and NS_LOG_FUNCTION.

uint32_t ns3::QKDBuffer::GetMcurrent ( void  ) const

Get the current amount of key material in QKD storage.

Returns
int32_t integer representation of the current QKD storage key material

Definition at line 517 of file qkd-buffer.cc.

References m_Mcurrent, and NS_LOG_FUNCTION.

uint32_t ns3::QKDBuffer::GetMCurrentPrevious ( void  ) const

Help function used for ploting graphs; Previous - before latest change.

Returns
int32_t integer representation of the previous QKD storage key material;

Definition at line 524 of file qkd-buffer.cc.

References m_McurrentPrevious, and NS_LOG_FUNCTION.

uint32_t ns3::QKDBuffer::GetMmax ( void  ) const

Get the maximal amount of key material that can be stored in QKD storage.

Returns
int32_t integer representation of the QKD storage capacity

Definition at line 552 of file qkd-buffer.cc.

References m_Mmax, and NS_LOG_FUNCTION.

uint32_t ns3::QKDBuffer::GetMmin ( void  ) const

Get the minimal amount of key material that can be stored in QKD storage.

Returns
int32_t integer representation of the min value of QKD storage

Definition at line 559 of file qkd-buffer.cc.

References m_Mmin, and NS_LOG_FUNCTION.

uint32_t ns3::QKDBuffer::GetMthr ( void  ) const

Get the threshold value of QKD storage The threshold value Mthr (t) at the time of measurement t is used to indicate the state of QKD buffer where it holds that Mthr (t) ≤ Mmax .

Returns
int32_t integer representation of the threshold value of the QKD storage

Definition at line 531 of file qkd-buffer.cc.

References m_Mthr, and NS_LOG_FUNCTION.

void ns3::QKDBuffer::Init ( void  )

Initialize a QKDBuffer.

This is the initialize function of the new QKDBuffer.

Definition at line 135 of file qkd-buffer.cc.

References CalculateAverageAmountOfTheKeyInTheBuffer(), m_bitsChargedInTimePeriod, m_bitsUsedInTimePeriod, m_bufferID, m_c, m_lastKeyChargingTimeDuration, m_lastKeyChargingTimeStamp, m_McurrentPrevious, m_noAddNewValue, m_noEntry, m_period, nBuffers, and NS_LOG_FUNCTION.

Referenced by QKDBuffer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::QKDBuffer::InitTotalGraph ( ) const

Help function for total graph ploting.

Definition at line 464 of file qkd-buffer.cc.

References m_Mcurrent, m_McurrentIncreaseTrace, m_Mthr, m_MthrIncreaseTrace, and NS_LOG_FUNCTION.

void ns3::QKDBuffer::KeyCalculation ( )

Help function used for ploting graphs.

Definition at line 191 of file qkd-buffer.cc.

References CheckState(), ns3::compareByData(), m_isRisingCurve, m_Mcurrent, m_McurrentPrevious, m_noEntry, m_period, m_previousValues, NS_LOG_FUNCTION, ns3::QKDBuffer::data::position, and ns3::QKDBuffer::data::value.

Referenced by AddNewContent(), ProcessIncomingRequest(), and ProcessOutgoingRequest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::QKDBuffer::operator== ( QKDBuffer const &  o) const

Assign operator.

Parameters
oOther QKDBuffer
Returns
True if buffers are identical; False otherwise

Definition at line 452 of file qkd-buffer.cc.

References m_bufferID.

Ptr< QKDKey > ns3::QKDBuffer::ProcessIncomingRequest ( const uint32_t &  akeyID,
const uint32_t &  akeySize 
)

Check whether there is enough key material to decrypt the incoming package.

Process Incoming Request Used when node receives encrypted packet from other node so he needs to use key to decrypt it.

Parameters
keyIDuint32_t ID of incoming key request
keySizeuint32_t size of the requested key
Returns
Ptr<QKDKey> if there is enough key material; 0 otherwise
Todo:
Perform decryption of the packet and analyze encryption metadata (keyID and authID)

Definition at line 342 of file qkd-buffer.cc.

References FetchKeyByID(), FetchKeyOfSize(), KeyCalculation(), m_bitsUsedInTimePeriod, m_Mcurrent, m_McurrentChangeTrace, m_McurrentDecreaseTrace, m_useRealStorages, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Ptr< QKDKey > ns3::QKDBuffer::ProcessOutgoingRequest ( const uint32_t &  keySize)

Check whether there is enough key material to send the package to destination.

Process Outgoing Request Used when node wants to send encrypted packet to other node.

Parameters
keySizeuint32_t size of the requested key
Returns
Ptr<QKDKey> if there is enough key material; 0 otherwise
Parameters
keySizein bits!

Definition at line 316 of file qkd-buffer.cc.

References FetchKeyOfSize(), KeyCalculation(), m_bitsUsedInTimePeriod, m_Mcurrent, m_McurrentChangeTrace, m_McurrentDecreaseTrace, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::QKDBuffer::SetMthr ( uint32_t  thr)

Set the threshold value of QKD storage.

Parameters
int32_tinteger set the threshold value of the QKD storage

Definition at line 537 of file qkd-buffer.cc.

References m_Mthr, m_MthrChangeTrace, m_MthrDecreaseTrace, m_MthrIncreaseTrace, and NS_LOG_FUNCTION.

Member Data Documentation

double ns3::QKDBuffer::m_AverageKeyChargingTimePeriod
private

The average duration of key charging time period.

Definition at line 416 of file qkd-buffer.h.

Referenced by AddNewContent(), and FetchAverageKeyChargingTimePeriod().

TracedCallback<double > ns3::QKDBuffer::m_AverageKeyChargingTimePeriodTrace
private

Definition at line 425 of file qkd-buffer.h.

Referenced by AddNewContent(), and GetTypeId().

uint32_t ns3::QKDBuffer::m_bitsChargedInTimePeriod
private

Help value used for graph ploting and calculation of average post-processing duration.

Definition at line 331 of file qkd-buffer.h.

Referenced by AddNewContent(), CalculateAverageAmountOfTheKeyInTheBuffer(), and Init().

uint32_t ns3::QKDBuffer::m_bitsUsedInTimePeriod
private

Help value used for detection of average key usage.

Definition at line 336 of file qkd-buffer.h.

Referenced by CalculateAverageAmountOfTheKeyInTheBuffer(), Init(), ProcessIncomingRequest(), and ProcessOutgoingRequest().

uint32_t ns3::QKDBuffer::m_bufferID

unique buffer ID

Definition at line 272 of file qkd-buffer.h.

Referenced by GetBufferId(), Init(), and operator==().

double ns3::QKDBuffer::m_c
private

average amount of key in the buffer during the recalculate time period

Definition at line 349 of file qkd-buffer.h.

Referenced by CalculateAverageAmountOfTheKeyInTheBuffer(), and Init().

EventId ns3::QKDBuffer::m_calculateRoutingMetric
private

Definition at line 418 of file qkd-buffer.h.

Referenced by CalculateAverageAmountOfTheKeyInTheBuffer(), and Dispose().

std::vector<int64_t > ns3::QKDBuffer::m_chargingTimePeriods
private

Vector of durations of several last charging time periods.

Definition at line 406 of file qkd-buffer.h.

Referenced by AddNewContent().

TracedCallback<double > ns3::QKDBuffer::m_CMetricChangeTrace
private

Definition at line 424 of file qkd-buffer.h.

Referenced by CalculateAverageAmountOfTheKeyInTheBuffer(), and GetTypeId().

uint32_t ns3::QKDBuffer::m_DstNodeId

destination node ID

Definition at line 270 of file qkd-buffer.h.

Referenced by QKDBuffer().

bool ns3::QKDBuffer::m_isRisingCurve
private

whether curve on graph is rising or not

Definition at line 351 of file qkd-buffer.h.

Referenced by CheckState(), and KeyCalculation().

std::map<uint32_t, Ptr<QKDKey> > ns3::QKDBuffer::m_keys
private

map of ID-Ptr<QKDKey>

Definition at line 310 of file qkd-buffer.h.

Referenced by AddNewContent(), FetchKeyByID(), and FetchKeyOfSize().

int64_t ns3::QKDBuffer::m_lastKeyChargingTimeDuration
private

The timestamp of last key usage.

Definition at line 395 of file qkd-buffer.h.

Referenced by AddNewContent(), FetchLastKeyChargingTimeDuration(), and Init().

int64_t ns3::QKDBuffer::m_lastKeyChargingTimeStamp
private

The timestamp of last key charging (when the new key material was added)

Definition at line 390 of file qkd-buffer.h.

Referenced by AddNewContent(), FetchDeltaTime(), and Init().

uint32_t ns3::QKDBuffer::m_maxNumberOfRecordedKeyChargingTimePeriods
private

The maximal number of values which are used for stored for calculation of average key charging time period.

Definition at line 401 of file qkd-buffer.h.

Referenced by AddNewContent(), FetchMaxNumberOfRecordedKeyChargingTimePeriods(), and GetTypeId().

uint32_t ns3::QKDBuffer::m_Mcurrent
private
TracedCallback<uint32_t > ns3::QKDBuffer::m_McurrentChangeTrace
private
TracedCallback<uint32_t > ns3::QKDBuffer::m_McurrentDecreaseTrace
private

Definition at line 422 of file qkd-buffer.h.

Referenced by GetTypeId(), ProcessIncomingRequest(), and ProcessOutgoingRequest().

TracedCallback<uint32_t > ns3::QKDBuffer::m_McurrentIncreaseTrace
private

Definition at line 421 of file qkd-buffer.h.

Referenced by AddNewContent(), GetTypeId(), and InitTotalGraph().

uint32_t ns3::QKDBuffer::m_McurrentPrevious
private

The previous value of current amount of key material in QKD key storage.

Definition at line 385 of file qkd-buffer.h.

Referenced by CheckState(), GetMCurrentPrevious(), Init(), and KeyCalculation().

uint32_t ns3::QKDBuffer::m_Mmax
private

The maximal amount of key material in QKD key storage.

Definition at line 366 of file qkd-buffer.h.

Referenced by AddNewContent(), CheckState(), GetMmax(), and GetTypeId().

uint32_t ns3::QKDBuffer::m_Mmin
private

The minimal amount of key material in QKD key storage.

Definition at line 361 of file qkd-buffer.h.

Referenced by CheckState(), GetMmin(), and GetTypeId().

uint32_t ns3::QKDBuffer::m_Mthr
private

The threshold amount of key material in QKD key storage.

Definition at line 371 of file qkd-buffer.h.

Referenced by CalculateAverageAmountOfTheKeyInTheBuffer(), CheckState(), GetMthr(), GetTypeId(), InitTotalGraph(), and SetMthr().

TracedCallback<uint32_t > ns3::QKDBuffer::m_MthrChangeTrace
private

Definition at line 373 of file qkd-buffer.h.

Referenced by GetTypeId(), and SetMthr().

TracedCallback<uint32_t > ns3::QKDBuffer::m_MthrDecreaseTrace
private

Definition at line 375 of file qkd-buffer.h.

Referenced by GetTypeId(), and SetMthr().

TracedCallback<uint32_t > ns3::QKDBuffer::m_MthrIncreaseTrace
private

Definition at line 374 of file qkd-buffer.h.

Referenced by GetTypeId(), InitTotalGraph(), and SetMthr().

uint32_t ns3::QKDBuffer::m_nextKeyID
private

ID of the next key to be generated.

Definition at line 305 of file qkd-buffer.h.

Referenced by AddNewContent(), FetchKeyOfSize(), and QKDBuffer().

uint32_t ns3::QKDBuffer::m_noAddNewValue
private

Help value used for graph ploting.

Definition at line 325 of file qkd-buffer.h.

Referenced by AddNewContent(), and Init().

uint32_t ns3::QKDBuffer::m_noEntry
private

Help value used for graph ploting.

Definition at line 315 of file qkd-buffer.h.

Referenced by AddNewContent(), Init(), and KeyCalculation().

uint32_t ns3::QKDBuffer::m_period
private

Help value used for graph ploting.

Definition at line 320 of file qkd-buffer.h.

Referenced by AddNewContent(), Init(), and KeyCalculation().

uint32_t ns3::QKDBuffer::m_previousStatus
private

Holds previous status; important for deciding about further status that can be selected.

Definition at line 356 of file qkd-buffer.h.

Referenced by CheckState(), and FetchPreviousState().

std::vector<struct QKDBuffer::data> ns3::QKDBuffer::m_previousValues
private

Help vector used for graph ploting.

Definition at line 347 of file qkd-buffer.h.

Referenced by KeyCalculation().

uint32_t ns3::QKDBuffer::m_recalculateTimePeriod
private

The period of time (in seconds) to calculate average amount of the key in the buffer Default value 5 - used in routing protocols for detection of information freshness.

Definition at line 342 of file qkd-buffer.h.

Referenced by CalculateAverageAmountOfTheKeyInTheBuffer(), and GetTypeId().

uint32_t ns3::QKDBuffer::m_SrcNodeId

source node ID

Definition at line 268 of file qkd-buffer.h.

Referenced by QKDBuffer().

uint32_t ns3::QKDBuffer::m_Status
private

The state of the Net Device transmit state machine.

Definition at line 411 of file qkd-buffer.h.

Referenced by CheckState(), and FetchState().

TracedCallback<uint32_t > ns3::QKDBuffer::m_StatusChangeTrace
private

Definition at line 423 of file qkd-buffer.h.

Referenced by CheckState(), and GetTypeId().

bool ns3::QKDBuffer::m_useRealStorages
private

Whether to use real storages or virtual buffers UNDER CONSTRUCTION! Currently only virtual buffers supported.

Definition at line 300 of file qkd-buffer.h.

Referenced by AddNewContent(), ProcessIncomingRequest(), and QKDBuffer().

uint32_t ns3::QKDBuffer::nBuffers = 0
static

number of created buffers - static value

Definition at line 274 of file qkd-buffer.h.

Referenced by Init(), and QKDBuffer().

const uint32_t ns3::QKDBuffer::QKDSTATUS_CHARGING = 2
static

QKDStatus CHARGING.

Definition at line 73 of file qkd-buffer.h.

Referenced by CheckState().

const uint32_t ns3::QKDBuffer::QKDSTATUS_EMPTY = 3
static
const uint32_t ns3::QKDBuffer::QKDSTATUS_READY = 0
static

QKDStatus READY.

Definition at line 71 of file qkd-buffer.h.

Referenced by CheckState().

const uint32_t ns3::QKDBuffer::QKDSTATUS_WARNING = 1
static

QKDStatus WARNING.

Definition at line 72 of file qkd-buffer.h.

Referenced by CheckState().


The documentation for this class was generated from the following files: