Skip to content

Telefonica-Scientific-Research/DDRD

Repository files navigation

Data-Driven Deployment of Reconfigurable Intelligent Surfaces in Cellular Networks

Authors: Sina Beyraghi, Javad Shabanpour, Giovanni Geraci, Paul Almasan, Angel Lozano

Contact: Sina Beyraghi (mohammadsina.beyraghi@telefonica.com)

Abstract

This paper presents a fully automated, data-driven framework for the large-scale deployment of reconfigurable intelligent surfaces (RISs) in cellular networks. Leveraging physically consistent ray tracing and empirical data from a commercial deployment in the UK, the proposed method jointly optimizes RIS placement, orientation, configuration, and base station beamforming in dense urban environments across frequency bands (corresponding to 4G, 5G, and a hypothetical 6G system). Candidate RIS locations are identified via reflection- and scattering-based heuristics using calibrated electromagnetic models within the Sionna Ray Tracing (RT) engine. Outage users are clustered to reduce deployment complexity, and the tradeoff between coverage gains and infrastructure cost is systematically evaluated. It is shown that achieving meaningful coverage improvement in urban areas requires a dense deployment of large-aperture RIS units, raising questions about cost-effectiveness. To facilitate reproducibility and future research, the complete simulation framework and RIS deployment algorithms are provided as open-source software.

Description

This open-source repository includes two core methodologies: a reflection-based algorithm and a scattering-based algorithm, both designed to determine optimal RIS placement, phase configuration, and base station (BS) beam selection using site-specific simulations via Sionna RT.

Files description

  • main.py: Serves as the central script for configuring system and network parameters. It sequentially coordinates the simulation by invoking functions from various modular classes, enabling a structured and section-by-section execution of the complete pipeline.
  • coverage_map.py: Interfaces with the Sionna RT engine to compute the coverage map based on initialized ray tracing parameters. It evaluates coverage performance across the network area by processing all deployed base stations.
  • outdoor_disc.py: Provides functionality to differentiate between indoor and outdoor users. It identifies and extracts the locations of outdoor users based on geometric and spatial analysis.
  • utils.py: Contains utility functions for constructing and organizing base station and user data structures, facilitating efficient post-processing and analysis.
  • clustering.py: Implements functions for applying the BIRCH clustering algorithm to group outage users based on their spatial distribution.
  • post_processing: Provides a set of functions for organizing, filtering, and sorting simulation data across various stages of the pipeline to support analysis and visualization.
  • RayInfo: Interfaces with Sionna RT to generate rays between specific base stations and target points. It extracts detailed ray-level information, including path types, reflection points, and interactions with surrounding buildings.
  • reflection_alg_data: Prepares and organizes input data required for reflection-based algorithms (e.g., Strongest Ray Selection, All Ray). It outputs potential RIS deployment locations, RIS orientations, incident and desired reradiation angles, beam selection indices, and related parameters.
  • RIS_orientation: Computes the orientation of the RIS based on the angles of the incoming and outgoing waves. It aligns the RIS surface to be practically parallel to the desired building wall, ensuring effective reflection toward the target direction.
  • strongest_ray_alg: Implements the Strongest Ray Selection algorithm from the reflection-based approach for RIS deployment. It provides functions to jointly optimize the RIS location, base station beamforming, and RIS phase configuration for enhanced signal reflection.
  • All_ray_alg: Implements the All Ray algorithm from the reflection-based approach for RIS deployment. It provides functions to jointly optimize the RIS location, base station beamforming, and RIS phase configuration for enhanced signal reflection.
  • RIS_Re_Assocciation: Provides functions to re-associate remaining outage users with already deployed RIS units by establishing new line-of-sight (LoS) links, aiming to extend coverage and improve connectivity.
  • scattering_alg_data: Prepares and organizes input data required for scattering-based algorithm. It outputs potential RIS deployment locations, RIS orientations, incident and desired reradiation angles, beam selection indices, and related parameters.
  • scattering_alg: It provides functions to jointly optimize the RIS location, base station beamforming, and RIS phase configuration for enhanced signal reflection. It is designed to ensure a direct line-of-sight (LoS) link between the BS, RIS, and UE.
  • plotting: Offers various plotting functions—including CDF, bar, and scatter plots—to visualize results across different simulation scenarios.

Features

  • Supports large-scale, multi-cell networks and multiple radio deployments (4G/5G/6G).
  • Uses NVIDIA's Sionna RT (v0.19.2) for high-fidelity ray tracing.
  • Joint optimization of RIS location, phase-shift configuration, and BS beamforming.
  • Clustering-based user grouping for scalable RIS placement.
  • Modular support for reflection-based and scattering-based RIS deployment strategies.

How to use the code

Cloning

Open a terminal and execute the following commands to download the github repository.

git clone https://github.com/Telefonica-Scientific-Research/DDRD 
cd DDRD 

Installation

This project requires Python 3.8+ and a complete list of dependencies is included in requirements.txt.

First, create the virtual environment and activate the environment. Make sure the python version is 3.8 or higher.

virtualenv -p python3 myenv
source myenv/bin/activate

Then, install the required dependencies with the following command:

pip install -r requirements.txt

Finally, install torch==2.5.1 using a command similar to the one below. Depending on the CUDA version installed in your system, the command can change. Check the official documentation and use the command that suits the best for your system setup.

# CUDA 12.1
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu121

Instructions to execute

The key functions of the simulation pipeline are in main.py. Due to the high computational complexity of the simulation, each step below must be executed sequentially rather than simultaneously. Running all components at once exceeds system memory limits. For example, the coverage map must first be simulated and its results saved (Step 2 below). Once completed, the coverage map module should be deactivated, and the outdoor_UE_disc_phase1 should be set to True and executed. After saving the results of phase 1, it should also be deactivated before running phase 2 with outdoor_UE_disc_phase2 set to True. This step-by-step workflow is essential to ensure the simulation remains executable within hardware constraints.

Step-by-step:

  1. Deploy BS locations and area of interest
    • You can configure deployment parameters (e.g., BS/UE location, tilt, orientation) either by reading from a .csv file or by manually specifying them in main.py. Control this behavior by setting the following line to True or False:

      DDRD/main.py

      Line 82 in 76ba71a

      use_real_dataset = True # Set to False to use manual BS lists
  2. Outdoor/Indoor User Detection
    • Use Sionna RT to compute and save the coverage map by setting Sionna_run_maps==True and executing the main.py script. Then, set Sionna_run_maps==False and outdoor_UE_disc_phase1==True, run the main.py script again. Finally, set outdoor_UE_disc_phase1 to False and set outdoor_UE_disc_phase2==True to extract outdoor users.

      Important: Execute each step separately. Before running the next phase, ensure the previous one is deactivated.

      DDRD/main.py

      Lines 84 to 91 in 76ba71a

      # ------- Indoor Outdoor UE discrimination -----
      Sionna_run_maps = False # if False, we do not compute coverage map for all BS
      # and we use the results that we generated before. Therfore
      # in the first time we must compute it.
      outdoor_UE_disc_phase1 = False # This approach is based on RSRP (If an user
      # get -inf from all BS, it is indoor)
      outdoor_UE_disc_phase2 = False #This approach serves as a complement to Approach 1,
      #which relies on building data to extract outdoor users.

  3. Clustering Outdoor Users
    • Apply BIRCH-based clustering to group outage-prone users. Set the flag to True and run the main.py script.

      DDRD/main.py

      Lines 97 to 98 in 76ba71a

      # ------- Clustering outage UEs -------
      clustring_UE = False # Using BIRCH algorithm clustering to group nearby outage UEs
  4. Reflection-Based RIS Deployment
    • Find optimal RIS placement based on ray reflection paths (Jointly optimizing BS precoder and RIS phase shift configuration). Similarly to Step 2, activate the flags accordingly and execute the main.py script again.

      Important: Execute each step separately. Before running the next phase, ensure the previous one is deactivated.

      DDRD/main.py

      Lines 100 to 109 in 76ba71a

      # ------- Applying Reflection-Based Algorithms for RIS location deployment --------
      sionna_path_generation = False #This is for generating the rays for centroids
      Strongest_ray_RIS_location = False # Deploying RIS on reflection location of
      # Strongest rays (Evaluating RIS locations based on centroids)
      precoder_optimization_strongest_ray = False # After deploying RISs, we need to select the best beam from serving BS
      RSRP_RIS_UEs_Computation_Strongest_Ray = False # Computing RSRP for each UE of each cluster with RIS
      All_ray_RIS_location = False # Deploying RIS on reflection location of
      # All rays (Evaluating RIS locations based on centroids)
      precoder_optimization_all_ray = False # After deploying RISs, we need to select the best beam from serving BS
      RSRP_RIS_UEs_Computation_All_Ray = False # Computing RSRP for each UE of each cluster with RIS

  5. Re-Clustering and Re-Deployment
    • Re-evaluate uncovered users and repeat clustering and deployment (Jointly optimizing BS precoder and RIS phase shift configuration).

      Important: Execute each step separately. Before running the next phase, ensure the previous one is deactivated.

      DDRD/main.py

      Lines 111 to 117 in 76ba71a

      sionna_path_generation_recluster = False
      RE_Cluster_Strongest_ray_RIS_location = False
      precoder_optimization_strongest_ray_Re_Cluster = False
      RSRP_RIS_UEs_Computation_Strongest_Ray_Re_Cluster = False
      Re_Cluster_All_ray_RIS_location = False
      precoder_optimization_all_ray_Re_cluster = False
      RSRP_RIS_UEs_Computation_All_Ray_Re_Cluster = False

  6. RIS Re-Association
    • Re-assocciating remained outage users to nearby deployed RIS in the network (Jointly optimizing BS precoder and RIS phase shift configuration).

      Important: Execute each step separately. Before running the next phase, ensure the previous one is deactivated.

      DDRD/main.py

      Lines 119 to 122 in 76ba71a

      LoS_link_UE_RIS = False
      LoS_link_RIS_Tx = False
      Re_Assocciation_RIS_precoder_update = False
      re_assocciation_RSRP_RIS = False

  7. Optional: Scattering-Based Algorithm
    • Repeat steps 4-6 using scattering-based logic.

      Important: Execute each step separately. Before running the next phase, ensure the previous one is deactivated.

      DDRD/main.py

      Lines 128 to 142 in 76ba71a

      # ------- Applying Scattering-Based Algorithm for RIS location deployment --------
      sionna_path_generation_scattering = False
      scattering_RIS_location = False
      precoder_optimization_scattering = False # After deploying RISs, we need to select the best beam from serving BS
      RSRP_RIS_UEs_Computation_scattering = False # Computing RSRP for each UE of each cluster with RIS
      sionna_path_generation_recluster_scattering = False
      scattering_RIS_location_recluster = False
      precoder_optimization_scattering_recluster = False # After deploying RISs, we need to select the best beam from serving BS
      RSRP_RIS_UEs_Computation_scattering_recluster = False # Computing RSRP for each UE of each cluster with RIS
      LoS_link_UE_RIS_scatter = False
      LoS_link_RIS_Tx_scatter = False
      Re_Assocciation_RIS_precoder_update_scatter = False
      re_assocciation_RSRP_RIS_scatter = False

Citation

If you find this work useful for your research, please cite our paper:

@article{beyraghi2025datadriven,
  title={Data-Driven Deployment of Reconfigurable Intelligent Surfaces in Cellular Networks},
  author={Beyraghi, Mohammadsina and Shabanpour, Javad and Geraci, Giovanni and Almasan, Paul and Lozano, Angel},
  journal={arXiv preprint arXiv:2510.10190},
  year={2025}
}

About

Code corresponding to the Data-Driven Deployment of Reconfigurable Intelligent Surfaces in Cellular Networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages