#!/usr/bin/env python

from mininet.cli import CLI
from mininet.link import Link
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.term import makeTerm

if '__main__' == __name__:
    net = Mininet(controller=RemoteController)

    c0 = net.addController('c0')

    s1 = net.addSwitch('s1')
    s2 = net.addSwitch('s2')

    Link(s1, s2)
    Link(s1, s2)

    net.build()
    c0.start()
    s1.start([c0])
    s2.start([c0])

    s1.cmd('ovs-vsctl set Bridge s1 protocols=OpenFlow13')
    s2.cmd('ovs-vsctl set Bridge s2 protocols=OpenFlow13')

    CLI(net)

    net.stop()

@@ -16,16 +16,28 @@
 python%0A%0A
+import sys%0A%0A
 from min
@@ -177,56 +177,612 @@
 net.
-term import makeTerm%0A%0Aif '__main__' == __name__:
+node import OVSSwitch%0Afrom mininet.node import UserSwitch%0Afrom mininet.term import makeTerm%0A%0Afrom oslo.config import cfg%0Afrom ryu import version%0A%0Aif '__main__' == __name__:%0A%0A    opts = %5B%0A        cfg.StrOpt('switch', default='ovs', help='test switch (ovs%7Ccpqd)')%0A    %5D%0A    conf = cfg.ConfigOpts()%0A    conf.register_cli_opts(opts)%0A    conf(project='ryu', version='run_mininet.py %25s' %25 version)%0A    conf(sys.argv%5B1:%5D)%0A    switch_type = %7B'ovs': OVSSwitch, 'cpqd': UserSwitch%7D%0A    switch = switch_type.get(conf.switch)%0A    if switch is None:%0A        raise ValueError('Invalid switch type. %5B%25s%5D', conf.switch)%0A
 %0A   
@@ -796,16 +796,31 @@
 Mininet(
+switch=switch, 
 controll
@@ -1039,16 +1039,49 @@
 (%5Bc0%5D)%0A%0A
+    if conf.switch == 'ovs':%0A    
     s1.c
@@ -1131,16 +1131,20 @@
 low13')%0A
+    
     s2.c

test tool: run_mininet: support CPqD Software Switch