Skip to content

“SDN simulations with Mininet & Ryu: hub/learning switch, spanning tree, shortest path, and congestion-aware routing in Python.”

Notifications You must be signed in to change notification settings

RohitPatidar123-hub/sdn-network-controllers

Repository files navigation

SDN Mininet Ryu Controllers

This repository contains implementations of multiple Software-Defined Networking (SDN) controllers using Ryu and Mininet, as part of COL334/672 coursework (IIT Delhi, Diwali 2024).
The focus is on understanding OpenFlow-based flow rules, network efficiency, and routing algorithms.


🚀 Features

1. Hub Controller

  • Floods packets to all ports except incoming one.
  • Installs only a table-miss rule.
  • Inefficient due to high broadcast traffic.

2. Learning Switch

  • Dynamically learns MAC-to-Port mappings.
  • Installs flow rules to reduce broadcast traffic.
  • Efficient packet forwarding.

3. Spanning Tree Controller

  • Implements Minimum Spanning Tree (MST) using Kruskal’s Algorithm.
  • Prevents broadcast loops in cyclic topologies.
  • Maintains optimized forwarding rules.

4. Shortest Path Routing (SPR)

  • Uses LLDP (Link Layer Discovery Protocol) to measure link delays.
  • Computes optimal paths using Dijkstra’s Algorithm.
  • Ensures minimum-delay routing and loop prevention.

🛠️ Tech Stack

  • Python 3
  • Ryu Controller
  • Mininet
  • OpenFlow
  • Algorithms: Learning Switch, Kruskal’s MST, Dijkstra’s Shortest Path

📂 Repository Structure

├── p1_hub.py # Hub controller ├── p1_learning.py # Learning switch controller ├── p2_spanning_tree.py # MST spanning tree controller ├── p3_spr.py # Shortest Path Routing controller ├── Assignment_3_Mininet_SDN.pdf # Assignment description ├── Assignment3_Report.pdf # Detailed implementation report


⚙️ How to Run

  1. Start Mininet with the desired topology:
    sudo mn --custom p1_topo.py --topo mytopo --controller remote --switch ovsk --mac
    
    

Run Ryu controller (example for Learning Switch):

ryu-manager p1_learning.py

Test connectivity:

mininet> pingall mininet> iperf h1 h2

📊 Observations

Controller Flow Rules Installed Traffic Handling Broadcast Traffic Efficiency
Hub Controller Only table-miss Floods all packets High Low
Learning Switch Table-miss + MAC-to-Port Direct forwarding Low High
Spanning Tree MST-based flow rules Loop-free broadcast forwarding Medium High
Shortest Path Delay-weighted Dijkstra’s routing Optimized unicast + loop-free broadcast Low Very High

📌 Key Takeaways

Demonstrates SDN concepts: Hub, Learning, Spanning Tree, and Shortest Path controllers.

Uses Ryu framework to implement OpenFlow rules dynamically.

Hands-on with network topology discovery, LLDP delay measurement, and routing algorithms.

Builds strong foundations for Network Security, Distributed Systems, and Cloud Infrastructure roles.

👨‍💻 Authors

Rohit Patidar (2024JCS2042)

Jitesh. (2024JCS2043)

About

“SDN simulations with Mininet & Ryu: hub/learning switch, spanning tree, shortest path, and congestion-aware routing in Python.”

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages