Machine Learning for Communication Networks

5G RAN · O-RAN RIC · Attack detection · Synthetic data

NetSim is a system-level simulator that generates data and trains AI/ML algorithms. It also closes the loop between a learning agent and a live network model. Interface your Python or RIC algorithm, run the simulation, and measure how it changes network performance.

5G RAN optimisation Reinforcement learning Network security Digital twin
NetSim · AI/ML techniques
Machine learning techniques applied across the NetSim network simulation workflow

How NetSim fits an ML workflow

Use the simulator as a data source, as a training environment, or as a test bench for control algorithms.

Generate synthetic data

Produce labelled training data at low cost and at large scale. NetSim writes it to CSV, ready for your pipeline.

Close the loop with RL

Exchange state, action and reward with a Python agent at each step, so the network responds to the algorithm in real time.

Verify RIC algorithms

Test Non-Real-Time, Near-Real-Time and Real-Time control loops against a RAN model, through an equivalent of the O-RAN E2 interface.

Own the source

The protocol algorithms are in C, and RL is in Python through Gymnasium. Modify the source to test your own ideas.

AI/ML in the 5G RAN

NetSim generates data and trains AI/ML algorithms for many RAN problems.

RAN use cases

Traffic steering, load balancing, throughput scaling, MAC scheduling, link adaptation, power control, beamforming and interference mitigation.

Digital twin and RIC

Build a 5G network digital twin and verify RAN Intelligent Controller algorithms. NetSim simulates the RAN from your r-app or x-app control inputs, as an O-RAN E2 equivalent.

Network slicing

In-built online learning shares PRBs dynamically, with constrained optimisation and Lagrange multipliers. Check whether the network meets UE-level and slice-level SLAs.

Reinforcement learning

Connect NetSim to a Python RL algorithm through Gymnasium, with Q-learning, DQN, A2C, PPO and other methods.

The reinforcement-learning loop

NetSim and your algorithm exchange information at each step, so you can see how the policy improves network performance.

NetSim → Agent

State

NetSim passes the state: UE measurements, network measurements and UE context.

Agent → NetSim

Action

The RL algorithm returns an action, such as a handover or a power-control decision.

NetSim → Agent

Reward + next state

NetSim simulates the action and returns the reward (throughput, latency, and other KPIs) and the next state.

Worked RAN examples

These reference projects, with documentation, apply learning to specific RAN control problems.

Downlink power control

Reinforcement learning controls multi-gNB downlink power to maximise the sum throughput.

Detailed PDF →

Load balancing

This framework supports algorithm development for the 3GPP Release 17 AI/ML for NG-RAN load balancing use case.

Detailed article →

Delay-constrained scheduling

Reinforcement learning schedules traffic to maximise delay-constrained throughput in 5G NR.

Detailed PDF →

AI/ML for attack detection

Generate attack and normal traffic in NetSim, extract features, and train classifiers to tell them apart.

IoT · RPL

Rank attacks in an RPL-based IoT network

  • RPL to RFC 6550, with DODAG formation and rank calculations
  • Attack scenarios with 2 to 15 malicious nodes across networks of 6 to 42 nodes
  • Features from packet traces: DAO and DIO sent/received, and data packets received
  • Classifiers: KNN, Naive Bayes, SVM and Logistic Regression
  • Result: above 95% accuracy, precision and recall
Detailed PDF →
Video Thumbnail ▶ 21:27

ML-Based Attack Detection in RPL IoT

VANET · IEEE 802.11p / 1609

Sybil attacks in VANETs

  • VANET scenarios based on IEEE 802.11p and IEEE 1609
  • Attack scenarios with 1 to 3 Sybil nodes across networks of 5 to 14 nodes
  • RSSI-based features: power, difference and similarity
  • Classifiers: Random Forest, KNN, XGBoost and Decision Tree
  • Result: 95 to 97% accuracy across classifiers
Detailed PDF →

Generate synthetic data for ML

Machine learning needs larger and larger amounts of data. A simulator produces this data at low cost, with exact labels and no sensitive information.

The trouble with real data

  • Difficult and expensive to collect, especially for complex or specialised cases
  • Slow to label, and labels need costly expert knowledge
  • May contain sensitive or confidential information
  • Often unbalanced, lacking examples of certain classes or phenomena

Synthetic data from a simulator

  • Generated at very low cost and in large quantities
  • Labelled exactly, so it can train neural nets directly
  • Covers many scenarios and edge cases
  • Free of sensitive or confidential information

Automated utilities drive scenario generation and execution. NetSim writes large amounts of labelled data to CSV, including:

Performance metrics

Instantaneous and average throughput per link and application, buffer occupancy over time and TCP congestion window over time.

Packet trace

More than 30 parameters per packet: arrival, queuing and departure times, payload, overhead, errors and collisions.

Radio measurements

SINR, path loss, shadowing, fast fading, LOS/NLOS state, O2I loss, MCS, CQI, BS-UE distances and UE-gNB association.

Radio resource allocation

Buffer fill (queue size), scheduling weights and PRBs allocated per scheduling interval.

Independent validation

Research publications featuring AI/ML with NetSim

This selection of peer-reviewed work built and validated AI/ML methods in NetSim.

IEEE Xplore NetSimGym: the Gymnasium for Reinforcement Learning in Networking Research View paper → IEEE Xplore DETONAR: Detection of Routing Attacks in RPL-Based IoT View paper → IEEE Xplore Reinforcement-Learning-based IDS for 6LoWPAN View paper → IEEE Xplore ELNIDS: Ensemble Learning based Network Intrusion Detection System for RPL based Internet of Things View paper → Elsevier Q-Learning Relay Placement for Alert Message Dissemination in Vehicular Networks View paper → arXiv Adaptive Hybrid Heterogeneous IDS for 6LoWPAN View paper → IET Exploring cybersecurity issues in 5G enabled electric vehicle charging station with deep learning View paper → IEEE Xplore Adversarial RL-Based IDS for Evolving Data Environment in 6LoWPAN View paper → IEEE Xplore Advancing 6G Network Performance: AI/ML Framework for Proactive Management and Dynamic Optimal Routing View paper → IEEE Xplore An Intelligence-Based Framework for Managing WLANs: The Potential of Non-Contiguous Channel Bonding View paper → JCOMSS Learning-Based Road Link Quality Estimation for Intelligent Alert-Message Dissemination View paper → IEEE Xplore Malicious Node Detection in VANETs via Enhanced DSR and ML View paper → Thesis Performance Analysis of 5G DDoS Attack using Machine Learning View paper → IEEE Xplore SIGMAML: SNR-Guided 5G Mobility Management using Machine Learning Algorithms View paper → IEEE Xplore Intelligent QoS Agent Design for QoS Monitoring and Provisioning in 6G Network View paper → IEEE Xplore A Novel Two-Step Bayesian Hyperparameter Optimization Strategy for DoS Attack Detection in IoT View paper → IEEE Xplore Flexibly Controlled 5G Network Slicing View paper →

Read the guides, the AI/ML brochure and the worked network-slicing example, or contact us to take a project further.