From 47323ec9327526d402a377113a868c9d9dcd88dc Mon Sep 17 00:00:00 2001 From: Paolo Fittipaldi Date: Thu, 20 Jun 2024 15:47:35 +0000 Subject: [PATCH] Introduced SatelliteQNode, related ModuleType, MM topology and .ini file --- quisp/modules/Common/Router.cc | 2 +- quisp/modules/SatelliteQNode.ned | 30 ++++++++ .../topology_simple_satellite_network.ned | 35 +++++++++ .../simulations/satellite_simulation_test.ini | 72 +++++++++++++++++++ .../utils/DefaultComponentProviderStrategy.cc | 8 ++- .../utils/DefaultComponentProviderStrategy.h | 1 + 6 files changed, 144 insertions(+), 4 deletions(-) create mode 100644 quisp/modules/SatelliteQNode.ned create mode 100644 quisp/networks/topology_simple_satellite_network.ned create mode 100644 quisp/simulations/satellite_simulation_test.ini diff --git a/quisp/modules/Common/Router.cc b/quisp/modules/Common/Router.cc index 986b0cc44..412af8274 100644 --- a/quisp/modules/Common/Router.cc +++ b/quisp/modules/Common/Router.cc @@ -178,7 +178,7 @@ void Router::handleOspfHelloPacket(cMessage *msg) { } } -bool Router::parentModuleIsQNode() { return provider.getNode()->getModuleType() == cModuleType::get("modules.QNode"); } +bool Router::parentModuleIsQNode() {auto *type = provider.getNode()->getModuleType(); return (type == cModuleType::get("modules.QNode") or type == cModuleType::get("modules.SatelliteQNode")); } /** * @details Unlike QNodes, BSA nodes are connected to only two nodes (at least that is the assumption) diff --git a/quisp/modules/SatelliteQNode.ned b/quisp/modules/SatelliteQNode.ned new file mode 100644 index 000000000..59563bc5e --- /dev/null +++ b/quisp/modules/SatelliteQNode.ned @@ -0,0 +1,30 @@ +package modules; +@namespace(quisp::modules); + +import modules.Satellite.*; +import modules.Common.GatedQueue; + +module SatelliteQNode extends QNode +{ + parameters: + bool is_satellite = default(false); + + gates: + + submodules: + ps[sizeof(port)]: PointingSystem; + Gqueue[sizeof(port)]: GatedQueue { + parameters: + address = index; + @display("p=338,234"); + } + connections: + for i=0..sizeof(port)-1 { + router.toQueue[i] --> { @reconnect; } --> Gqueue[i].in; // Each routing port is connected to its own queue + router.fromQueue[i] <-- { @reconnect; } <-- Gqueue[i].out; + Gqueue[i].line <--> { @reconnect; } <--> port[i]; + Gqueue[i].to_ps --> ps[i].req; + Gqueue[i].from_ps <-- ps[i].ans; + } + +} diff --git a/quisp/networks/topology_simple_satellite_network.ned b/quisp/networks/topology_simple_satellite_network.ned new file mode 100644 index 000000000..dc70c16d8 --- /dev/null +++ b/quisp/networks/topology_simple_satellite_network.ned @@ -0,0 +1,35 @@ +package networks; + +import ned.DatarateChannel; +import ned.IdealChannel; + +import modules.*; +import modules.Backend.Backend; +import modules.Logger.Logger; +import modules.SharedResource.SharedResource; +import channels.*; + + + +network Simple_Satellite_MM +{ + submodules: + backend: Backend; + logger: Logger; + sharedResource: SharedResource; + EndNode1: SatelliteQNode { + address = 1; + is_satellite=true; + node_type = "EndNode"; + @display("i=COMP;p=104,48,m,5,60,60"); + } + EndNode2: SatelliteQNode { + address = 2; + node_type = "EndNode"; + @display("i=COMP;p=253,248,m,5,60,60"); + } + + connections: + EndNode1.port++ <--> FreeSpaceChannel { distance = 1000km; } <--> EndNode2.port++; + EndNode1.quantum_port++ <--> FreeSpaceQuantumChannel { distance = 1000km; } <--> EndNode2.quantum_port_receiver++; +} \ No newline at end of file diff --git a/quisp/simulations/satellite_simulation_test.ini b/quisp/simulations/satellite_simulation_test.ini new file mode 100644 index 000000000..5f8e0151e --- /dev/null +++ b/quisp/simulations/satellite_simulation_test.ini @@ -0,0 +1,72 @@ +[General] +seed-set = 1 +sim-time-limit = 1d +**.initial_notification_timing_buffer = 10s # when to start the BSA timing notification. +**.app.request_generation_interval = 2s +**.logger.enabled_log = false +**.logger.log_filename = "networks/${resultdir}/${configname}-${runnumber}.jsonl" +**.tomography_output_filename = "${resultdir}/${configname}.output" +**.statistic-recording = false +**.scalar-recording = false +**.vector-recording = false +**.speed_of_light_in_fiber = 208189.206944km +**.speed_of_light_in_freespace = 299792.458km + +**.channel_loss_rate = 0 +**.channel_x_error_rate = 0 +**.channel_z_error_rate = 0 +**.channel_y_error_rate = 0 + +**.collection_efficiency = 1 +**.darkcount_probability = 0 +**.detection_efficiency = 1 +**.indistinguishable_time_window = 1.5ns +**.photon_detection_per_second = 1000000 + +**.x_gate_error_rate = 0 +**.x_gate_x_error_ratio = 0 +**.x_gate_y_error_ratio = 0 +**.x_gate_z_error_ratio = 0 + +**.z_gate_error_rate = 0 +**.z_gate_x_error_ratio = 0 +**.z_gate_y_error_ratio = 0 +**.z_gate_z_error_ratio = 0 + +**.cnot_gate_error_rate = 0 +**.cnot_gate_iz_error_ratio = 0 +**.cnot_gate_zi_error_ratio = 0 +**.cnot_gate_zz_error_ratio = 0 +**.cnot_gate_ix_error_ratio = 0 +**.cnot_gate_xi_error_ratio = 0 +**.cnot_gate_xx_error_ratio = 0 +**.cnot_gate_iy_error_ratio = 0 +**.cnot_gate_yi_error_ratio = 0 +**.cnot_gate_yy_error_ratio = 0 + +**.memory_x_error_rate = 0 +**.memory_y_error_rate = 0 +**.memory_z_error_rate = 0 +**.memory_energy_excitation_rate = 0 +**.memory_energy_relaxation_rate = 0 +**.memory_completely_mixed_rate = 0 + +**.x_measurement_error_rate = 0 +**.z_measurement_error_rate = 0 +**.y_measurement_error_rate = 0 + +**.app.number_of_bellpair = 10000 +**.buffers = 100 +**.qrsa.hm.num_measure = 10000 + +########################### +# Link Generations Tests +########################### + +[Config NoErrorSatelliteMM] +network = networks.Simple_Satellite_MM +**.qrsa.hm.link_tomography = true +**.qrsa.hm.initial_purification = 0 +**.qrsa.hm.purification_type = 0 +**.distance_csv = "../../satellite_test_csvs/S-C1_distance.csv" +**.Aatm_CSV = "../../satellite_test_csvs/S-C1_tatm_1550.csv" diff --git a/quisp/utils/DefaultComponentProviderStrategy.cc b/quisp/utils/DefaultComponentProviderStrategy.cc index c39844010..609f88153 100644 --- a/quisp/utils/DefaultComponentProviderStrategy.cc +++ b/quisp/utils/DefaultComponentProviderStrategy.cc @@ -8,8 +8,10 @@ DefaultComponentProviderStrategy::DefaultComponentProviderStrategy(cModule *_sel cModule *DefaultComponentProviderStrategy::getQNode() { cModule *currentModule = self->getParentModule(); - while (currentModule->getModuleType() != QNodeType) { + auto *mod_type = currentModule->getModuleType(); + while (!isQNodeType(mod_type)) { currentModule = currentModule->getParentModule(); + mod_type = currentModule->getModuleType(); if (currentModule == nullptr) { throw cRuntimeError("QNode module not found. Have you changed the type name in ned file?"); } @@ -20,7 +22,7 @@ cModule *DefaultComponentProviderStrategy::getQNode() { cModule *DefaultComponentProviderStrategy::getNode() { cModule *currentModule = self->getParentModule(); auto *mod_type = currentModule->getModuleType(); - while (mod_type != QNodeType && mod_type != BSAType && mod_type != EPPSType) { + while (mod_type != QNodeType && mod_type != SatelliteQNodeType && mod_type != BSAType && mod_type != EPPSType) { currentModule = currentModule->getParentModule(); mod_type = currentModule->getModuleType(); if (currentModule == nullptr) { @@ -118,6 +120,6 @@ cModule *DefaultComponentProviderStrategy::getQRSA() { } bool DefaultComponentProviderStrategy::isBSANodeType(const cModuleType *const type) { return type == BSAType; } -bool DefaultComponentProviderStrategy::isQNodeType(const cModuleType *const type) { return type == QNodeType; } +bool DefaultComponentProviderStrategy::isQNodeType(const cModuleType *const type) { return (type == QNodeType or type == SatelliteQNodeType); } bool DefaultComponentProviderStrategy::isEPPSNodeType(const cModuleType *const type) { return type == EPPSType; } } // namespace quisp::utils diff --git a/quisp/utils/DefaultComponentProviderStrategy.h b/quisp/utils/DefaultComponentProviderStrategy.h index c6be34ed3..4990bd0f5 100644 --- a/quisp/utils/DefaultComponentProviderStrategy.h +++ b/quisp/utils/DefaultComponentProviderStrategy.h @@ -26,6 +26,7 @@ class DefaultComponentProviderStrategy : public IComponentProviderStrategy { private: const cModuleType *const QNodeType = cModuleType::get("modules.QNode"); + const cModuleType *const SatelliteQNodeType = cModuleType::get("modules.SatelliteQNode"); const cModuleType *const EPPSType = cModuleType::get("modules.EPPSNode"); const cModuleType *const BSAType = cModuleType::get("modules.BSANode"); cModule *self;