- Overview
- Real-World Application
- Full Thesis Report
- Objectives
- Implementation
- Repository Structure
- Getting Started
- Usage
- Results
- AMPL Usage
- Quick Code Preview
- Authors
- Acknowledgments
- Contact
- License
This project explores dynamic resource allocation in 5G network slicing, focusing on optimizing bandwidth allocation using Integer Linear Programming (ILP).
The work was completed as part of my Bachelorβs thesis in Computer Science at the University of Ain Temouchent (2022/2023).
The thesis demonstrates this model applied to:
- eMBB slices: Video streaming (high bandwidth)
- uRLLC slices: Autonomous vehicles (low latency)
- mMTC slices: IoT sensors (massive connections)
With dynamic demands varying across 24-hour periods. See full thesis for detailed scenarios.
- Analyze 5G architecture, SDN, and NFV frameworks.
- Develop an ILP model for dynamic and fair resource allocation.
- Implement and test the model using Gurobi, Mininet, and FlowVisor.
- Demonstrate fairness and efficiency improvements in network slicing.
- Modeling Language: AMPL & Python (Gurobi)
- Simulation Tools: Mininet, FlowVisor for SDN slicing
- Optimization Techniques: Linear Programming (LP), Integer Linear Programming (ILP)
- Libraries Used: Gurobi, PuLP, NumPy
βββ code/
β βββ examples/
β β βββ simple_demo.py # PuLP implementation (basic)
β β βββ simple_demo_gurobi.py # Gurobi implementation (basic)
β β βββ smart_city.py # Smart City scenario (24 hours)
β β βββ smart_city_gurobi.py # Smart City with Gurobi (24 hours)
β βββ models/
β β βββ model.mod # AMPL model definition
β β βββ simple_data.dat # Data for simple demo
β β βββ smart_city_data.dat # Data for Smart City
β βββ notebooks/
β β βββ simple_demo.ipynb # Interactive simple demo
β β βββ smart_city.ipynb # Interactive Smart City demo
β βββ requirements.txt # Python dependencies
β βββ README.md
βββ thesis.pdf
βββ LICENSE
βββ README.md
- Python 3.8+
- pip package manager
- (Optional) Gurobi license for commercial solver
# Clone the repository
git clone https://github.com/7amzaGH/5G-Network-Slicing-Optimization.git
cd 5G-Network-Slicing-Optimization
# Install dependencies
cd code
pip install -r code/requirements.txt
# Run the model
python dynamic_lp.pyQuick 3-slice demonstration to understand the basics:
# Using PuLP (open-source)
python code/examples/simple_demo.py
# Using Gurobi (requires license)
python code/examples/simple_demo_gurobi.py
# Interactive Jupyter notebook
jupyter notebook code/notebooks/simple_demo.ipynbScenario Details:
- 3 network slices (slice1, slice2, slice3)
- 2 physical links (link1, link2)
- 2 time slots
- Total: 370 Mbps optimized allocation
Realistic 24-hour smart city deployment:
# Using PuLP
python code/examples/smart_city.py
# Using Gurobi (faster for large-scale)
python code/examples/smart_city_gurobi.py
# Interactive visualization notebook
jupyter notebook code/notebooks/smart_city.ipynbScenario Details:
- 5 network slices (eMBB, uRLLC, mMTC, PublicSafety, VideoSurveillance)
- 4 physical links (fiber, microwave, mmWave, sub-6GHz)
- 24 time slots (hourly demands)
- Dynamic traffic patterns (rush hour peaks, night-time lows)
- Total: 33.7 Gbps optimized allocation
- Total Bandwidth: 370 Mbps
- Fairness: All slices allocated in both time slots
- Efficiency: 84% average link utilization
The model successfully optimizes bandwidth allocation for a realistic smart city deployment.
Key Achievements:
- Total Bandwidth Allocated: 33,748 Mbps (33.7 Gbps)
- Fairness: All slices guaranteed allocation in every time slot
- Peak Efficiency: 92% link utilization during rush hours (7-9am, 5-6pm)
- Average Efficiency: 42% daily utilization (reflects realistic off-peak patterns)
Performance Highlights:
- eMBB: Peaks at 900 Mbps during evening commute (6pm)
- uRLLC: Scales from 30 Mbps (night) to 480 Mbps (rush hour)
- mMTC: Maintains stable ~100 Mbps (constant IoT sensor traffic)
- PublicSafety: Guaranteed 50-89 Mbps across all time periods
- VideoSurveillance: 180-270 Mbps with higher allocation during night hours
For those using AMPL modeling language:
ampl code/models/model.mod code/models/simple_data.dat
# or
ampl code/models/model.mod code/models/smart_city_data.datSimple optimization with Gurobi:
import gurobipy as gp
from gurobipy import GRB
# Define network elements
S = ['slice1', 'slice2', 'slice3'] # Network slices
L = ['link1', 'link2'] # Physical links
T = ['1', '2'] # Time slots
# Create optimization model
m = gp.Model("5G_Network_Slicing")
x = m.addVars(S, L, T, vtype=GRB.BINARY, name="allocation")
# Objective: Maximize total bandwidth allocation
m.setObjective(gp.quicksum(demand[s,l,t] * x[s,l,t]
for s in S for l in L for t in T), GRB.MAXIMIZE)
# Solve
m.optimize()
print(f"Optimal bandwidth: {m.objVal} Mbps")Collaborated with Aya Boudaoud
University of Ain Temouchent Belhadj Bouchaib
Academic Year: 2022/2023
For questions or collaboration:
- GitHub: @7amzaGH
- Email: ghitrihamza46@gmail.com
This project is licensed under the MIT License - see the LICENSE file for details.