This page isn't so much about configuring the software switches – these switches don't need any configuration – it's more about setting up a Mininet network that reflects the network configuration loaded on the controller.
First, create a network topology file the usual way using the Mininet Topology API. See an example here: srTopo8.py
Add hosts and switches
Add links between switches, and connect hosts to switches
Then create another file that loads the Topology file you created above. This file will create the network and connect the switches to the controller.
See an example of such a file here: sr_cpqd_full.py
Load the topo file
Make sure you use the CPqD switch (UserSwitch) and not the default OVS switch, and point the switches to the remote controller (or local controller if you use localhost)
The Mininet Topology API does not currently allow us to create multiple links between the same pair of switches. Thus we need to use a different API (the Net API) to create extra links.
We do so by loading the switches from the 'net' and adding more links
This example shows all the extra links created in the prototype used in the demo prototype videos.
Next we need to configure the hosts with the correct IP and Gateway information
The example above, shows that host h1's IP and MAC addresses are set using the setIP and setMAC api calls. It also shows that the default gateway for host h1 is 10.200.1.1. Note that this default gateway has to be configured in the configuration file loaded on the controller - specifically in the 'subnet' field of the switch configuration.
Finally note that the configuration at the controller currently requires the configuration of the links in the network. This can be useful in scenarios where the network operator wishes to consider the configuration as the 'golden rule' - in such cases, if a network link is wired incorrectly, the the controller will figure out that the discovered link does not match the configuration, and will disallow the link from being used in the network - i.e. no traffic will use the link. On the other hand, it can be cumbersome at times to configure all the network links in the controller config file. It can especially be tricky when using a Mininet based network, because the Mininet APIs used above do not allow the user to specify the ports when adding a link using addLink. Thus in order to get the controller configuration right, we need to create the network, connect it to the controller, figure out which port-numbers Mininet used to create the links, use those port numbers in the controller config file, and finally reload the controller.
Once the python files are created in mininet/custom directory, use the following command to launch Mininet
See Using the CLI section to verify that the correct switches and links have been discovered by the controller.