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.
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.
State
NetSim passes the state: UE measurements, network measurements and UE context.
Action
The RL algorithm returns an action, such as a handover or a power-control decision.
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.
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
▶
21:27
ML-Based Attack Detection in RPL IoT
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
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.
Research publications featuring AI/ML with NetSim
This selection of peer-reviewed work built and validated AI/ML methods in NetSim.
Useful links
Read the guides, the AI/ML brochure and the worked network-slicing example, or contact us to take a project further.