You will build a software-defined network where a Ryu controller programs forwarding across an emulated Mininet topology. By the end forwarding decisions live in code, not in each switch.

Learning Objectives

  • Build a multi-switch topology in Mininet.
  • Program flows centrally with a Ryu app.
  • Validate forwarding and policy from the controller.
  • Time: ~14 hours · Difficulty: Advanced · Prereqs: the SDN concepts, OpenFlow, and controller labs.

Architecture Overview

Environment Setup

  • Mininet with Open vSwitch and Ryu installed.
  • Python 3 for the controller app.
  • Root privileges for Mininet.

Step-by-Step Execution

01
Start the controller app
ryu-manager controller.py --ofp-tcp-listen-port 6653
02
Launch the topology against it
sudo mn --topo tree,2 --controller remote,ip=127.0.0.1 --switch ovsk,protocols=OpenFlow13
03
Validate flows installed by the controller
mininet> pingall
*** Results: 0% dropped (12/12 received)

Progress So Far

Testing & Validation

sudo ovs-ofctl -O OpenFlow13 dump-flows s1

You should see controller-installed flow entries and 0% packet loss on pingall. Stop the controller and confirm forwarding depends on it.

Troubleshooting
  • Switches not connecting: match the OpenFlow version and controller port (6653).
  • No flows installed: confirm the Ryu app is running and handling packet-in events.
  • Stale Mininet state: run sudo mn -c before relaunching.

Extension Ideas

  • Add policy (firewall) logic to the controller app.
  • Compare controllers with the SDN Controllers lab.
  • Integrate with NFV service chaining.

Key Results

  • Centralized forwarding for a multi-switch topology.
  • Achieved 0% packet loss via controller-installed flows.
  • Demonstrated control/data plane separation in practice.
  • Programmed network behavior entirely in code.