Network Topology Project with Python Ryu and Mininet
- WSL2 with Ubuntu 22.04 LTS
- Python 3.8.x
-
[Only if you are using windows] Set up WSL2 with Ubuntu 22.04 LTS: Follow the official Microsoft documentation to install WSL2 and set up Ubuntu 22.04 LTS. Install WSL2
-
Install Mininet: Open your WSL2 terminal or Ubuntu terminal and run the following commands:
sudo apt update sudo apt install mininet openvswitch-switch -y
Test it (remember: Mininet only works as root):
sudo mn --test pingall
-
Install Python 3.8.x: Open your WSL2 terminal or Ubuntu terminal and run the following commands:
sudo apt update sudo apt install python3.8 python3.8-venv python3.8-dev -y
Maybe you'll have to run this before:
sudo add-apt-repository ppa:deadsnakes/ppa -y
-
Clone this repository, enter the folder where it is located at and set up a virtual environment:
git clone <repo> cd sdn-project python3.8 -m venv .venv source .venv/bin/activate
Only the Ryu controller and not Mininet will use the venv.
-
Inside the virtual environment, install the Requirements:
pip install -r requirements.txt
-
Run the Ryu Controller: Open a terminal where the folder sdn-project is located, activate the venv and run the controller
source .venv/bin/activate ryu-manager ./controller/sdn_controller.py -
Run Mininet with your Topology: You have to run the Ryu controller in a terminal with the venv activated, and Mininet in another one, outside the venv. So open a new terminal and run:
sudo python3 ./topology/geant_topology.py
-
Plot the Graphs: After stopping Mininet and the Ryu controller, you can plot the graphs by running:
source .venv/bin/activate python3 ./plot_graphs.py
- Ensure that you have administrative privileges to run Mininet.
- If you encounter any issues, refer to the official documentation of Mininet and Ryu for troubleshooting tips.
- If the
eventleterror on ryu occurs, try uninstalling and reinstalling a specific version:pip uninstall eventlet pip install eventlet==0.30.1