"""Custom topology: single

One switch and 32 hosts:

   {h1,h2,h3...h32} --- switch
"""

from mininet.topo import Topo

class SingleTopo(Topo):
    "Simple topology example with one switch and 32 hosts."

    def __init__(self):
        "Create custom topo."

        # Initialize topology
        Topo.__init__(self)

        # Add hosts and switches
        switch = self.addSwitch('s1')
        for i in range(1,33):
            host = self.addHost('h%d' % i)
            self.addLink(host, switch)

topos = { 'single': (lambda: SingleTopo()) }
