# Service for Deploying Digital Twins of QKD Networks
## 4 Implementation
### QKD Network Digital Twin Orchestrator Application  
The QKD network digital twin orchestrator application allows the user to deploy, configure, and start a QKD network digital twin with any desired topology. The input of the application is two documents. The first, referred to as the configuration document, describes the desired QKD network in terms of its comprising nodes. Specifically, the document includes the names that identify each node and indicates how the nodes are connected (i.e., it includes the list of nodes, or neighbors, to which each node is connected). In addition, the configuration document includes information about the standardized QKD API to be used (in the case of the first version it should be ETSI GS QKD 004 [27]), and the QKD protocol to form the quantum keys. The current implementation of the service supports a variant of the E91 protocol, as it represents a complex example of QKD protocol with quantum capabilities, such as entanglement management. The second document is the inventory document, and it serves to set relevant parameters to enable the configuration of the nodes from the orchestrator. These parameters include the IP addresses of the nodes, the runtime environment for the software on which the configuration of the nodes is based (i.e., Python 3 and pip, the package manager for Python), and the login credentials of the nodes to access them. Both documents are based on the YAML format, which is a type of file very common when using management and orchestration (MANO) solutions such as OSM or Kubernetes. When deploying a digital twin of a QKD network using our service, two scenarios arise, where the user has or does not have the necessary machines pre-deployed. On the one hand, we consider a scenario where the user has a pool of running machines on which to emulate the implementation of a QKD network. In this case, those machines must be accessible to the orchestrator of our service, and be compliant with the service requirements. In addition, the user must include the IP addresses and the credentials of the machines in the inventory file so that the orchestrator can connect to them. Then,the orchestrator will configure the QKD network digital twin, downloading the required software in the machines, and connecting through emulated quantum and classical channels the QKD nodes that the user had described as neighbors in the configuration documents. On the other hand, if the user does not have a pre-deployed accessible machines pool, the orchestrator can deal with the deployment of the machines that will play the role of the nodes of the emulated QKD network. In this case, the orchestrator still needs an inventory file, although the IP address parameter will be completed by the orchestrator once the machines are deployed. When executing the orchestrator, along with the two YAML files, the user will need to include the \"_osm_\" execution parameter. This parameter allows the orchestrator to identify that it is necessary to carry out the deployment of the QKD network machines and that their deployment is intended to be done by using the ETSI NFV MANO solution (i.e., OSM). As commented in previous sections, our orchestrator is designed to be able to use compliant ETSI NFV infrastructures to instantiate the required virtual machines to build the desired QKD network digital twin. In this context, any Virtual Infrastructure Manager (VIM) supported by OSM (e.g., the widely used tool OpenStack) can be utilized. Although in this first version the QKD nodes are packed in virtual machines, since OSM also support solutions such as Kubernetes, future versions of the service will be able to make use of containers. To specify the intended VIM where we carry out the deployment, the orchestrator provides an additional execution parameter defined as \"_vim_account_\". As well as in the case where the user has a pre-deployed machine pool, once the virtual machines are deployed, the orchestrator connects to them to configure and install the required software.