Skip to content

MAC Learning Tutorial

Carmelo Cascone edited this page Jun 20, 2014 · 8 revisions

In this tutorial we'll execute the MAC Learning application leveraging OpenState features.

You first need to configure OpenState in Mininet as explained here http://openstate-sdn.github.io/

  1. Launch maclearning app in Ryu. Inside Mininet type the following command:

    $ ryu-manager ryu/ryu/app/openstate/maclearning.py

As you can see from the output this app support switches with a maximum of 4 ports:

loading app ryu/ryu/app/openstate/maclearning.py
loading app ryu.controller.ofp_handler
instantiating app ryu/ryu/app/openstate/maclearning.py of OSMacLearning
OpenState MAC Learning sample app initialized
Supporting MAX 4 ports per switch
...

To edit the number of ports you can simply edit the value SWITCH_PORTS inside maclearning.py

  1. Start Mininet with a single topology with 4 hosts:

    $ sudo mn --topo single,4 --mac --switch user --controller remote

  2. Test correct working... inside Mininet

    mininet> pingall

As you can see from the output the switch is correctly working as supposed:

*** Ping: testing ping reachability
h1 -> h2 h3 h4 
h2 -> h1 h3 h4 
h3 -> h1 h2 h4 
h4 -> h1 h2 h3 
*** Results: 0% dropped (12/12 received)
  1. To debug the flow table we need first to open a terminal window for switch s1, inside mininet:

    mininet> xterm s1

Clone this wiki locally