mininet/mininet — pull request #305 by ggee (2014-05-03 20:40:06+00:00)
Title: OVS switch connect to controllers using protocols other than TCP like SSL.

Add ability for for OVS switch start connect to controllers using protocols other than TCP.

net.addController( 'c0', protocol='ssl' )

This now allows OVS to connect to a controller using SSL. The default of protocol is 'tcp'
as it currently is. When adding a controller, you specify the protocol and then that value is used during switch.start(). Example and test python script used shown below.

#!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.cli import CLI
from mininet.log import setLogLevel, info

def emptyNet():
net = Mininet( controller=OVSController )
net.addController( 'c0',
cargs='-v pssl:%d -p /etc/openvswitch/ctl-privkey.pem \
-c /etc/openvswitch/ctl-cert.pem \
-C /var/lib/openvswitch/pki/switchca/cacert.pem',
protocol='ssl' )
h1 = net.addHost( 'h1' )
h2 = net.addHost( 'h2' )
s1 = net.addSwitch( 's1' )
net.addLink( h1, s1 )
net.addLink( h2, s1 )

net.start()
net.pingAll()
CLI( net )
net.stop()

if __name__ == '__main__':
setLogLevel( 'info' )
emptyNet()

Shows OVS listening on SSL.

root@mininet21:~/SVN/mininet# sudo ovs-vsctl show
ec21cc9e-4dc3-44d1-8c18-f23409d4615c
Bridge "s1"
Controller "ssl:127.0.0.1:6633"
is_connected: true
fail_mode: secure
Port "s1"
Interface "s1"
type: internal
Port "s1-eth2"
Interface "s1-eth2"
Port "s1-eth1"
Interface "s1-eth1"
ovs_version: "1.4.6"

Output of script.

mininet@mininet21:~$ sudo ./ssl2.py
*** Configuring hosts
h1 h2
*** Starting controller
*** Starting 1 switches
s1
*** Ping: testing ping reachability
h1 -> h2
h2 -> h1
*** Results: 0% dropped (2/2 received)
*** Starting CLI:

All this assumes that the user setup the SSL keys as described in the FAQ/wiki.