Bachelor's thesis, Faculty of informatics and information technologies
Digital Twin (Core + UERANSIM + Grafana, Loki and custom metrics + LSTM real-time classification with online fine-tunning)
This project was tested on:
- macOS Sequoya Version 15.4 with Docker Desktop v4.40.0
- Ubuntu 22.04.3 LTS (Jammy Jellyfish) with Docker v28.0.1
- Windows 11 Home with WSL2 (Ubuntu 22.04.3 LTS) with Docker Desktop v4.40.0
- git (version 2.39.5)
- docker (version 28.0.1)
git clone https://github.com/xtruhlar/5GDigitalTwin.git
cd 5GDigitalTwin/Implementation cd ./open5gs/base
docker build -t docker_open5gs .
cd ../../ueransim
docker build -t docker_ueransim .
cd ..cp .env.example .env
set -a
source .env
set +adocker compose -f deploy-all.yaml up --build -ddocker exec -it mongo mkdir -p /data/backup
docker cp ./open5gs/mongodb_backup/open5gs mongo:/data/backup/open5gs
docker exec -it mongo mongorestore --uri="mongodb://localhost:27017" --db open5gs /data/backup/open5gsTo ensure everything work properly open http://localhost:9999/ in your browser and login using credentials:
Login: admin
Password: 1423
docker compose -f nr-gnb.yaml -p gnodeb up -d && docker container attach nr_gnbdocker compose -f nr-UEs/nr-ue1.yaml -p ues up --build -dThen go to Grafana, open http://localhost:3000/ in your browser and login using credentials:
Login: open5gs
Password: open5gs
Open menu on the left, click on Dashboards. Select Current state Dash and you can see the current state of your 5G network.
python network_watcher.py. ├── Implementation │ ├── data/ │ │ ├── main.ipynb # Main script for data collection and preprocessing │ │ ├── datasets/ # Real and simulated CSV datasets │ │ ├── logs_real_5G/ # Log files from Open5GS components │ │ ├── Jupyter_Output/ # Jupyter Notebook outputs in HTML format │ │ ├── current_uc.txt # Current UC state (UC1-UC6) │ │ └── running_data.csv # Exported Prometheus metrics (live) │ ├── Model/ │ │ ├── *.ipynb # Notebooks for model training and evaluation │ │ ├── trained_models/ # Final .h5 and .keras models │ │ ├── json/ # JSON files for model architecture │ │ ├── scaler/ │ │ │ └── scaler.joblib # Scaler for data preprocessing │ │ └── preprocessed_data/ # Numpy arrays for training/testing (X/y) │ ├── uc1.py ... uc6.py # Scripts simulating UC1–UC6 behavior │ ├── network_watcher.py # Real-time log watcher and classifier │ ├── open5gs/ # Configurations for AMF, SMF, UPF, etc. │ ├── ueransim/ # Init scripts and YAML configs for UEs and gNB │ ├── promtail/ │ │ └── promtail-config.yaml # Promtail configuration for log shipping │ ├── loki/ │ │ └── loki-config.yaml # Loki configuration for log storage │ └── deploy-all.yaml # Docker Compose orchestration script ├── docs/ # Auto-generated Sphinx documentation (HTML) │ └── index.html, ucX.html, etc. ├── images/ │ └── dashboard.png, model architecture.png └── README.md
Derived from Herle Supreeth's repository, therefore BSD 2-Clause.
Special thanks to Ing. Matej Petrík for continuous support and guidance on Digital Twin technology. Ing. Matej Janeba for insights on 5G networks and assistance with collecting real-world traffic data. Herle Supreeth for providing the initial implementation of the dockerized 5G Core.
