NRP Backend Architecture

Purpose

The NRP Backend is responsible for providing a REST API to launch and control simulated experiments. Such experiments leverage the NRP Core framework for orchestrating and synchronize different simulators.

Experiments are run by executing user-defined python scripts (usually named main_script.py) using nrp-core python client to advance the simulation.

Using the REST API provided by NRP Backend, the user can request an experiment to be:

  • launched

  • paused

  • resumed

  • stopped

Architecture of the NRP

../../_images/architecture_components_backend.png

Fig. 1 Architecture of NRP Backend with NRP Frontend and nrp-core.

The component diagram in Fig. 1 depicts the architecture of the NRP, showing NRP Backend alongside NRP Frontend and nrp-core and the Simulation Server. The REST API server takes requests, coming from NRP Frontend, and fulfils them interacting with the Storage Client to fetch the experiment data, and the Simulation Server to run it.

The Storage Client access the storage, where the experiment’s data are kept, via the Storage Proxy’s REST interface.

The Simulation Server manages the execution of the experiment’s main_script.py that drives nrp-core’s simulation via its python client.

A MQTT broker is used to send runtime information (e.g. status of the simulation, errors) to the Frontend and to exchange messages between backend’s internal components (i.e. REST Server and Simulation Server).

Details on the REST API can be found here: REST API.

Architecture of NRP Backend

../../_images/components_backend.png

Fig. 2 Architecture of NRP Backend

The component diagram in Fig. 2 details the structure of NRP Backend and its packages hbp_nrp_backend and hbp_nrp_simserver. The first implements the REST Server and the second the Simulation Server that runs nrp-core simulation scripts.