2 Custom Topology to test extended Vxlan Tunnel Functionality created via OVSDB SouthBound plugin.
3 usage: mn --controller=remote,ip=<> --switch=ovsk,protocols=OpenFlow13 --custom <> --topo host1
7 from mininet.topo import Topo
10 def add_hosts(self, switch, hosts, start_host_suffix):
11 """Add and connect specified number of hosts to the the switch
14 :param switch: A string that describes the switch name to which the hosts are to be connected
15 example 's1 s2 s3 ...'
17 :param hosts: A integer that describes the number of hosts to be added to the switch
19 :param start_host_suffix: A integer that describes the starting suffix of the host from which
24 host_suffix = start_host_suffix
25 for _ in range(hosts):
26 host = self.addHost("h%s" % host_suffix, ip="10.0.0.%s" % host_suffix)
27 self.addLink(switch, host)
32 """Class to create a switch and host with suffix
35 :param host_suffix: specified else default is 1. For example: if equals to 3 (s3,h3)
36 :param hosts_per_switch: Number of hosts be connected to the switch. Default is 1.
39 def __init__(self, host_suffix=1, hosts_per_switch=1, **opts):
40 Topo.__init__(self, **opts)
41 switch = self.addSwitch('s%s' % host_suffix)
42 add_hosts(self, switch, hosts_per_switch, host_suffix)
45 topos = {'host': HostTopo}