from mininet.cli import CLI from mininet.net import Mininet from mininet.link import TCLink from mininet.topo import Topo from mininet.log import setLogLevel class CustomTopo(Topo): def __init__(self, **opts): Topo.__init__(self, **opts) # Agrega Hosts h1 = self.addHost('h1') h2 = self.addHost('h2') # Agrega Switches s1 = self.addSwitch('s1') s2 = self.addSwitch('s2') # Agrega Links self.addLink(h1, s1) self.addLink(h2, s2) self.addLink(s2, s3, bw=20, delay='200ms',loss=1) if __name__ == '__main__': setLogLevel( 'info' ) # Create data network topo = CustomTopo() net = Mininet(topo=topo, link=TCLink, autoSetMacs=True, autoStaticArp=True) # Run network net.start() CLI( net ) net.stop()