Deployment Guide

67
5.5.1 Verifying Topology with Ryu Controller
For the Ryu controller, in order to verify that the controller sees the switch and to obtain the unique datapath
ID, you can use the controller’s REST API. To start Ryu with the REST API enabled, use the Ryu ofctl_rest.py
script included with the controller package. From the Ryu server command line:
> ryu-manager verbose ofctl_rest.py
You can then use the Ryu REST API’s to communicate with the switch via OpenFlow. The first API shown here
allows you to test the controller connection and the controllers visibility into the switch node:
/stats/switches
Accessing this URL on the controllers IP address through a web server will allow you to see the Datapath ID
(DPID) of the switches known to that controller:
The datapath ID of the switch is shown above as 160088049758712. This datapath ID uniquely identifies this
switch node within the OpenFlow network and is used for all other OpenFlow communications with the
switch. Any REST capable interface will be able to access this, but for the following examples we use the
Postman REST application.
An example of accessing the switch stats and datapath ID using the Postman REST API application is also show
below. First set the REST command type to GET, and use the URL for accessing the stats/switches command
call, using your controller IP address for the address, i.e.:
http://<my controller IP address>:8080/stats/switches
Next set up basic authentication using username/password set up for the Ryu controller when it was installed: