First we need to install Ryu:
$ sudo pip install ryu
It is very simple as it can be installed with pip.
Confirm Ryu has been installed correctly by using the following command:
$ sudo mn --controller=ryu,ip=127.0.0.1 --topo linear,2 *** Creating network *** Adding controller warning: no Ryu modules specified; running simple_switch only *** Adding hosts and stations: h1 h2 *** Adding switches and access point(s): s1 s2 *** Adding link(s): (h1, s1) (h2, s2) (s2, s1) *** Configuring hosts *** Starting controller(s) c0 *** Starting switches and/or access points s1 s2 ... *** Starting CLI: mininet-wifi>
The preceding command uses ryu as the controller in the network emulated by Mininet. It uses a simple switch in this process.
Now we will write a simple SDN application to get notified when a topology changes. We will use wscat for this recipe. You may install it using:
$ sudo apt install node-ws