A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
examples_qkd_etsi_combined_input.cc File Reference
#include <stdio.h>
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/applications-module.h"
#include "ns3/internet-module.h"
#include "ns3/flow-monitor-module.h"
#include "ns3/mobility-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/internet-apps-module.h"
#include "ns3/gnuplot.h"
#include "ns3/qkd-link-helper.h"
#include "ns3/qkd-app-helper.h"
#include "ns3/qkd-app-004.h"
#include "ns3/network-module.h"
#include "ns3/netanim-module.h"
#include "ns3/mpi-module.h"
+ Include dependency graph for examples_qkd_etsi_combined_input.cc:

Go to the source code of this file.

Classes

struct  LinkDetails
 

Functions

std::string CalculateAverageDelayBasedOnDistance (uint32_t distanceInMeters)
 
void CreateOutputForCPU (std::string outputStatsName)
 
bool DoesLinkExist (std::string linkName, Ipv4InterfaceContainer &interfacesToApp)
 
void KeyConsumedLink (std::string context, const uint32_t &srcNodeId, const uint32_t &dstNodeId, const uint32_t &amountInBits)
 Keys fetched from qkdBuffers for transformation before delivery to end-user application.
 
void KeyGenerated (std::string context, const std::string &appId, const std::string &keyId, const uint32_t &amountInBits)
 
void KeyServed (std::string context, const std::string &appId, const std::string &keyId, const uint32_t &amountInBits)
 Keys served from KMS to end-user application.
 
void MissedSendPacketCall (std::string context, const std::string &appId, Ptr< const Packet > p)
 
std::string outputFileType ("json")
 
void Ratio (std::string outputStatsName, uint32_t cpuCounter)
 
std::vector< std::pair< std::string, std::vector< uint32_t > > > read_csv (std::string filename)
 
void ReceivedPacket (std::string context, const std::string &appId, Ptr< const Packet > p)
 
void ReceivedPacketFromKMS (std::string context, const std::string &appId, Ptr< const Packet > p)
 
void ReceivedPacketSig (std::string context, const std::string &appId, Ptr< const Packet > p)
 
void RelayKeyTrace (std::string context, const uint32_t &nodeId, const uint32_t &srcNodeId, const uint32_t &dstNodeId, const uint32_t &amountInBits)
 
void SentPacket (std::string context, const std::string &appId, Ptr< const Packet > p)
 
void SentPacketSig (std::string context, const std::string &appId, Ptr< const Packet > p)
 
void SentPacketToKMS (std::string context, const std::string &appId, Ptr< const Packet > p)
 
void write_csv (std::string filename, std::vector< std::pair< std::string, std::vector< uint32_t > > > dataset)
 

Variables

std::ofstream logFile
 
std::map< std::string, Ipv4InterfaceContainerm_interfaces
 
std::map< std::string, LinkDetails * > m_nodePairs
 
nlohmann::json outputLogFile
 
uint32_t showKeyAdded = 1
 
uint32_t showKeyServed = 1
 

Function Documentation

◆ CalculateAverageDelayBasedOnDistance()

std::string CalculateAverageDelayBasedOnDistance ( uint32_t  distanceInMeters)

Definition at line 887 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create().

+ Here is the call graph for this function:

◆ CreateOutputForCPU()

void CreateOutputForCPU ( std::string  outputStatsName)

Definition at line 531 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), m_nodePairs, and write_csv().

+ Here is the call graph for this function:

◆ DoesLinkExist()

bool DoesLinkExist ( std::string  linkName,
Ipv4InterfaceContainer interfacesToApp 
)

Definition at line 409 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), and m_interfaces.

+ Here is the call graph for this function:

◆ KeyConsumedLink()

void KeyConsumedLink ( std::string  context,
const uint32_t srcNodeId,
const uint32_t dstNodeId,
const uint32_t amountInBits 
)

Keys fetched from qkdBuffers for transformation before delivery to end-user application.

Definition at line 259 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), ns3::Time::GetSeconds(), logFile, m_nodePairs, ns3::Simulator::Now(), outputFileType(), outputLogFile, and showKeyAdded.

+ Here is the call graph for this function:

◆ KeyGenerated()

void KeyGenerated ( std::string  context,
const std::string &  appId,
const std::string &  keyId,
const uint32_t amountInBits 
)

Definition at line 221 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), ns3::Time::GetSeconds(), logFile, m_nodePairs, ns3::Simulator::Now(), outputFileType(), outputLogFile, and showKeyAdded.

+ Here is the call graph for this function:

◆ KeyServed()

void KeyServed ( std::string  context,
const std::string &  appId,
const std::string &  keyId,
const uint32_t amountInBits 
)

Keys served from KMS to end-user application.

Definition at line 300 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), ns3::Time::GetSeconds(), logFile, m_nodePairs, ns3::Simulator::Now(), outputFileType(), outputLogFile, and showKeyServed.

+ Here is the call graph for this function:

◆ MissedSendPacketCall()

void MissedSendPacketCall ( std::string  context,
const std::string &  appId,
Ptr< const Packet p 
)

Definition at line 426 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), and m_nodePairs.

+ Here is the call graph for this function:

◆ outputFileType()

std::string outputFileType ( "json"  )

◆ Ratio()

void Ratio ( std::string  outputStatsName,
uint32_t  cpuCounter 
)

Definition at line 628 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), m_nodePairs, nodes, and read_csv().

+ Here is the call graph for this function:

◆ read_csv()

std::vector< std::pair< std::string, std::vector< uint32_t > > > read_csv ( std::string  filename)

Definition at line 156 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create().

Referenced by Ratio().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReceivedPacket()

void ReceivedPacket ( std::string  context,
const std::string &  appId,
Ptr< const Packet p 
)

Definition at line 433 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), and m_nodePairs.

+ Here is the call graph for this function:

◆ ReceivedPacketFromKMS()

void ReceivedPacketFromKMS ( std::string  context,
const std::string &  appId,
Ptr< const Packet p 
)

Definition at line 503 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), ns3::Time::GetSeconds(), logFile, m_nodePairs, ns3::Simulator::Now(), outputFileType(), outputLogFile, and showKeyServed.

+ Here is the call graph for this function:

◆ ReceivedPacketSig()

void ReceivedPacketSig ( std::string  context,
const std::string &  appId,
Ptr< const Packet p 
)

Definition at line 467 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), and m_nodePairs.

+ Here is the call graph for this function:

◆ RelayKeyTrace()

void RelayKeyTrace ( std::string  context,
const uint32_t nodeId,
const uint32_t srcNodeId,
const uint32_t dstNodeId,
const uint32_t amountInBits 
)

Definition at line 341 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), ns3::Time::GetSeconds(), logFile, m_nodePairs, ns3::Simulator::Now(), outputFileType(), outputLogFile, and showKeyAdded.

+ Here is the call graph for this function:

◆ SentPacket()

void SentPacket ( std::string  context,
const std::string &  appId,
Ptr< const Packet p 
)

Definition at line 383 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), ns3::Time::GetSeconds(), logFile, m_nodePairs, ns3::Simulator::Now(), outputFileType(), and outputLogFile.

+ Here is the call graph for this function:

◆ SentPacketSig()

void SentPacketSig ( std::string  context,
const std::string &  appId,
Ptr< const Packet p 
)

Definition at line 441 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), ns3::Time::GetSeconds(), logFile, m_nodePairs, ns3::Simulator::Now(), outputFileType(), and outputLogFile.

+ Here is the call graph for this function:

◆ SentPacketToKMS()

void SentPacketToKMS ( std::string  context,
const std::string &  appId,
Ptr< const Packet p 
)

Definition at line 475 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create(), ns3::Time::GetSeconds(), logFile, m_nodePairs, ns3::Simulator::Now(), outputFileType(), outputLogFile, and showKeyAdded.

+ Here is the call graph for this function:

◆ write_csv()

void write_csv ( std::string  filename,
std::vector< std::pair< std::string, std::vector< uint32_t > > >  dataset 
)

Definition at line 120 of file examples_qkd_etsi_combined_input.cc.

References ns3::Create().

Referenced by CreateOutputForCPU().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ logFile

◆ m_interfaces

◆ m_nodePairs

◆ outputLogFile

◆ showKeyAdded

uint32_t showKeyAdded = 1

◆ showKeyServed

uint32_t showKeyServed = 1

Definition at line 48 of file examples_qkd_etsi_combined_input.cc.

Referenced by KeyServed(), and ReceivedPacketFromKMS().