Ejemplo n.º 1
0
    def build(self, **_opts):

        # Setup Routers
        router = {}
        #
        # Setup Main Router
        router[1] = topotest.addRouter(self, 'r1')
        #
        # Setup RIPng Routers
        for i in range(2, 4):
            router[i] = topotest.addRouter(self, 'r%s' % i)

        # Setup Switches
        switch = {}
        #
        # On main router
        # First switch is for a dummy interface (for local network)
        switch[1] = self.addSwitch('sw1', cls=topotest.LegacySwitch)
        self.addLink(switch[1], router[1], intfName2='r1-eth0')
        #
        # Switches for RIPng
        # switch 2 switch is for connection to RIP router
        switch[2] = self.addSwitch('sw2', cls=topotest.LegacySwitch)
        self.addLink(switch[2], router[1], intfName2='r1-eth1')
        self.addLink(switch[2], router[2], intfName2='r2-eth0')
        # switch 3 is between RIP routers
        switch[3] = self.addSwitch('sw3', cls=topotest.LegacySwitch)
        self.addLink(switch[3], router[2], intfName2='r2-eth1')
        self.addLink(switch[3], router[3], intfName2='r3-eth1')
        # switch 4 is stub on remote RIP router
        switch[4] = self.addSwitch('sw4', cls=topotest.LegacySwitch)
        self.addLink(switch[4], router[3], intfName2='r3-eth0')
Ejemplo n.º 2
0
    def build(self, **_opts):

        # Setup Routers
        router = {}
        #
        # Setup Main Router
        router[1] = topotest.addRouter(self, 'r1')
        #
        # Setup RIP Routers
        for i in range(2, 4):
            router[i] = topotest.addRouter(self, 'r%s' % i)
        #
        # Setup Switches
        switch = {}
        #
        # On main router
        # First switch is for a dummy interface (for local network)
        switch[1] = self.addSwitch('sw1', cls=topotest.LegacySwitch)
        self.addLink(switch[1], router[1], intfName2='r1-eth0')
        #
        # Switches for RIP
        # switch 2 switch is for connection to RIP router
        switch[2] = self.addSwitch('sw2', cls=topotest.LegacySwitch)
        self.addLink(switch[2], router[1], intfName2='r1-eth1')
        self.addLink(switch[2], router[2], intfName2='r2-eth0')
        # switch 3 is between RIP routers
        switch[3] = self.addSwitch('sw3', cls=topotest.LegacySwitch)
        self.addLink(switch[3], router[2], intfName2='r2-eth1')
        self.addLink(switch[3], router[3], intfName2='r3-eth1')
        # switch 4 is stub on remote RIP router
        switch[4] = self.addSwitch('sw4', cls=topotest.LegacySwitch)
        self.addLink(switch[4], router[3], intfName2='r3-eth0')
Ejemplo n.º 3
0
    def build(self, **_opts):

        exabgpPrivateDirs = ["/etc/exabgp", "/var/run/exabgp", "/var/log"]

        # Setup Routers
        router = {}
        for i in range(1, 2):
            router[i] = topotest.addRouter(self, "r%s" % i)

        # Setup Provider BGP peers
        peer = {}
        for i in range(1, 9):
            peer[i] = self.addHost(
                "peer%s" % i,
                ip="172.16.1.%s/24" % i,
                defaultRoute="via 172.16.1.254",
                privateDirs=exabgpPrivateDirs,
            )

        # Setup Switches
        switch = {}
        # First switch is for a dummy interface (for local network)
        switch[0] = self.addSwitch("sw0", cls=topotest.LegacySwitch)
        self.addLink(switch[0], router[1], intfName2="r1-stub")
        # Second switch is for connection to all peering routers
        switch[1] = self.addSwitch("sw1", cls=topotest.LegacySwitch)
        self.addLink(switch[1], router[1], intfName2="r1-eth0")
        for j in range(1, 9):
            self.addLink(switch[1], peer[j], intfName2="peer%s-eth0" % j)
Ejemplo n.º 4
0
    def build(self, **_opts):
        #
        # Define Switches first
        #
        switch = {}
        for i in range(1, 7):
            switch[i] = self.addSwitch('SW%s' % i,
                                       dpid=topotest.int2dpid(i),
                                       cls=topotest.LegacySwitch)
        #
        # Define FRR/Quagga Routers
        #
        router = {}
        for i in range(1, 5):
            router[i] = topotest.addRouter(self, 'r%s' % i)

        #
        # Wire up the switches and routers
        #
        # Stub nets
        for i in range(1, 5):
            self.addLink(switch[i], router[i], intfName2='r%s-stubnet' % i)
        # Switch 5
        self.addLink(switch[5], router[1], intfName2='r1-sw5')
        self.addLink(switch[5], router[2], intfName2='r2-sw5')
        self.addLink(switch[5], router[3], intfName2='r3-sw5')
        # Switch 6
        self.addLink(switch[6], router[3], intfName2='r3-sw6')
        self.addLink(switch[6], router[4], intfName2='r4-sw6')
    def build(self, **_opts):

        exabgpPrivateDirs = ['/etc/exabgp', '/var/run/exabgp', '/var/log']

        # Setup Routers
        router = {}
        for i in range(1, 2):
            router[i] = topotest.addRouter(self, 'r%s' % i)

        # Setup Provider BGP peers
        peer = {}
        for i in range(1, 9):
            peer[i] = self.addHost('peer%s' % i,
                                   ip='172.16.1.%s/24' % i,
                                   defaultRoute='via 172.16.1.254',
                                   privateDirs=exabgpPrivateDirs)

        # Setup Switches
        switch = {}
        # First switch is for a dummy interface (for local network)
        switch[0] = self.addSwitch('sw0', cls=topotest.LegacySwitch)
        self.addLink(switch[0], router[1], intfName2='r1-stub')
        # Second switch is for connection to all peering routers
        switch[1] = self.addSwitch('sw1', cls=topotest.LegacySwitch)
        self.addLink(switch[1], router[1], intfName2='r1-eth0')
        for j in range(1, 9):
            self.addLink(switch[1], peer[j], intfName2='peer%s-eth0' % j)
Ejemplo n.º 6
0
    def build(self, **_opts):
        #
        # Define Switches first
        #
        switch = {}
        for i in range(1, 7):
            switch[i] = self.addSwitch('SW%s' % i, 
                                       dpid=topotest.int2dpid(i),
                                       cls=topotest.LegacySwitch)
        #
        # Define FRR/Quagga Routers
        #
        router = {}
        for i in range(1, 5):
            router[i] = topotest.addRouter(self, 'r%s' % i)

        #
        # Wire up the switches and routers
        #
        # Stub nets
        for i in range(1, 5):
            self.addLink(switch[i], router[i], intfName2='r%s-stubnet' % i)
        # Switch 5
        self.addLink(switch[5], router[1], intfName2='r1-sw5')
        self.addLink(switch[5], router[2], intfName2='r2-sw5')
        self.addLink(switch[5], router[3], intfName2='r3-sw5')
        # Switch 6
        self.addLink(switch[6], router[3], intfName2='r3-sw6')
        self.addLink(switch[6], router[4], intfName2='r4-sw6')
Ejemplo n.º 7
0
    def build(self, **_opts):

        exabgpPrivateDirs = ['/etc/exabgp',
                             '/var/run/exabgp',
                             '/var/log']

        # Setup Routers
        router = {}
        for i in range(1, 2):
            router[i] = topotest.addRouter(self, 'r%s' % i)

        # Setup Provider BGP peers
        peer = {}
        for i in range(1, 9):
            peer[i] = self.addHost('peer%s' % i, ip='172.16.1.%s/24' % i,
                                    defaultRoute='via 172.16.1.254',
                                    privateDirs=exabgpPrivateDirs)

        # Setup Switches
        switch = {}
        # First switch is for a dummy interface (for local network)
        switch[0] = self.addSwitch('sw0', cls=topotest.LegacySwitch)
        self.addLink(switch[0], router[1], intfName2='r1-stub')
        # Second switch is for connection to all peering routers
        switch[1] = self.addSwitch('sw1', cls=topotest.LegacySwitch)
        self.addLink(switch[1], router[1], intfName2='r1-eth0')
        for j in range(1, 9):
            self.addLink(switch[1], peer[j], intfName2='peer%s-eth0' % j)
Ejemplo n.º 8
0
    def build(self, **_opts):

        # Setup Routers
        router = {}
        #
        # Setup Main Router
        router[1] = topotest.addRouter(self, "r1")
        #
        # Setup RIP Routers
        for i in range(2, 4):
            router[i] = topotest.addRouter(self, "r%s" % i)
        #
        # Setup Switches
        switch = {}
        #
        # On main router
        # First switch is for a dummy interface (for local network)
        switch[1] = self.addSwitch("sw1", cls=topotest.LegacySwitch)
        self.addLink(switch[1], router[1], intfName2="r1-eth0")
        #
        # Switches for RIP
        # switch 2 switch is for connection to RIP router
        switch[2] = self.addSwitch("sw2", cls=topotest.LegacySwitch)
        self.addLink(switch[2], router[1], intfName2="r1-eth1")
        self.addLink(switch[2], router[2], intfName2="r2-eth0")
        # switch 3 is between RIP routers
        switch[3] = self.addSwitch("sw3", cls=topotest.LegacySwitch)
        self.addLink(switch[3], router[2], intfName2="r2-eth1")
        self.addLink(switch[3], router[3], intfName2="r3-eth1")
        # switch 4 is stub on remote RIP router
        switch[4] = self.addSwitch("sw4", cls=topotest.LegacySwitch)
        self.addLink(switch[4], router[3], intfName2="r3-eth0")

        switch[5] = self.addSwitch("sw5", cls=topotest.LegacySwitch)
        self.addLink(switch[5], router[1], intfName2="r1-eth2")

        switch[6] = self.addSwitch("sw6", cls=topotest.LegacySwitch)
        self.addLink(switch[6], router[1], intfName2="r1-eth3")
Ejemplo n.º 9
0
    def build(self, **_opts):

        # Setup Routers
        router = {}
        for i in range(1, 5):
            router[i] = topotest.addRouter(self, 'r%s' % i)

        # Setup Switches, add Interfaces and Connections
        switch = {}
        # First switch
        switch[0] = self.addSwitch('sw0', cls=topotest.LegacySwitch)
        self.addLink(switch[0],
                     router[1],
                     intfName2='r1-eth0',
                     addr1='80:AA:00:00:00:00',
                     addr2='00:11:00:01:00:00')
        self.addLink(switch[0],
                     router[2],
                     intfName2='r2-eth0',
                     addr1='80:AA:00:00:00:01',
                     addr2='00:11:00:02:00:00')
        # Second switch
        switch[1] = self.addSwitch('sw1', cls=topotest.LegacySwitch)
        self.addLink(switch[1],
                     router[2],
                     intfName2='r2-eth1',
                     addr1='80:AA:00:01:00:00',
                     addr2='00:11:00:02:00:01')
        self.addLink(switch[1],
                     router[3],
                     intfName2='r3-eth0',
                     addr1='80:AA:00:01:00:01',
                     addr2='00:11:00:03:00:00')
        self.addLink(switch[1],
                     router[4],
                     intfName2='r4-eth0',
                     addr1='80:AA:00:01:00:02',
                     addr2='00:11:00:04:00:00')
        # Third switch
        switch[2] = self.addSwitch('sw2', cls=topotest.LegacySwitch)
        self.addLink(switch[2],
                     router[2],
                     intfName2='r2-eth2',
                     addr1='80:AA:00:02:00:00',
                     addr2='00:11:00:02:00:02')
        self.addLink(switch[2],
                     router[3],
                     intfName2='r3-eth1',
                     addr1='80:AA:00:02:00:01',
                     addr2='00:11:00:03:00:01')
    def build(self, **_opts):

        # Setup Routers
        router = {}
        #
        # Setup Main Router
        router[1] = topotest.addRouter(self, 'r1')
        #

        # Setup Switches
        switch = {}
        #
        for i in range(0, 10):
            switch[i] = self.addSwitch('sw%s' % i, cls=topotest.LegacySwitch)
            self.addLink(switch[i], router[1], intfName2='r1-eth%s' % i)
Ejemplo n.º 11
0
    def build(self, **_opts):

        # Setup Routers
        router = {}
        #
        # Setup Main Router
        router[1] = topotest.addRouter(self, 'r1')
        #

        # Setup Switches
        switch = {}
        #
        for i in range(0, 10):
            switch[i] = self.addSwitch('sw%s' % i, cls=topotest.LegacySwitch)
            self.addLink(switch[i], router[1], intfName2='r1-eth%s' % i )
Ejemplo n.º 12
0
    def build(self, **_opts):

        # Setup Routers
        router = {}
        for i in range(1, 5):
            router[i] = topotest.addRouter(self, 'r%s' % i)

        # Setup Switches, add Interfaces and Connections
        switch = {}
        # First switch
        switch[0] = self.addSwitch('sw0', cls=topotest.LegacySwitch)
        self.addLink(switch[0], router[1], intfName2='r1-eth0', addr1='80:AA:00:00:00:00', addr2='00:11:00:01:00:00')
        self.addLink(switch[0], router[2], intfName2='r2-eth0', addr1='80:AA:00:00:00:01', addr2='00:11:00:02:00:00')
        # Second switch
        switch[1] = self.addSwitch('sw1', cls=topotest.LegacySwitch)
        self.addLink(switch[1], router[2], intfName2='r2-eth1', addr1='80:AA:00:01:00:00', addr2='00:11:00:02:00:01')
        self.addLink(switch[1], router[3], intfName2='r3-eth0', addr1='80:AA:00:01:00:01', addr2='00:11:00:03:00:00')
        self.addLink(switch[1], router[4], intfName2='r4-eth0', addr1='80:AA:00:01:00:02', addr2='00:11:00:04:00:00')
        # Third switch
        switch[2] = self.addSwitch('sw2', cls=topotest.LegacySwitch)
        self.addLink(switch[2], router[2], intfName2='r2-eth2', addr1='80:AA:00:02:00:00', addr2='00:11:00:02:00:02')
        self.addLink(switch[2], router[3], intfName2='r3-eth1', addr1='80:AA:00:02:00:01', addr2='00:11:00:03:00:01')
Ejemplo n.º 13
0
    def build(self, **_opts):

        # Setup Routers
        router = {}
        for i in range(1, 5):
            router[i] = topotest.addRouter(self, "r%s" % i)

        # Setup Switches, add Interfaces and Connections
        switch = {}
        # First switch
        switch[0] = self.addSwitch("sw0", cls=topotest.LegacySwitch)
        self.addLink(
            switch[0],
            router[1],
            intfName2="r1-eth0",
            addr1="80:AA:00:00:00:00",
            addr2="00:11:00:01:00:00",
        )
        self.addLink(
            switch[0],
            router[2],
            intfName2="r2-eth0",
            addr1="80:AA:00:00:00:01",
            addr2="00:11:00:02:00:00",
        )
        # Second switch
        switch[1] = self.addSwitch("sw1", cls=topotest.LegacySwitch)
        self.addLink(
            switch[1],
            router[2],
            intfName2="r2-eth1",
            addr1="80:AA:00:01:00:00",
            addr2="00:11:00:02:00:01",
        )
        self.addLink(
            switch[1],
            router[3],
            intfName2="r3-eth0",
            addr1="80:AA:00:01:00:01",
            addr2="00:11:00:03:00:00",
        )
        self.addLink(
            switch[1],
            router[4],
            intfName2="r4-eth0",
            addr1="80:AA:00:01:00:02",
            addr2="00:11:00:04:00:00",
        )
        # Third switch
        switch[2] = self.addSwitch("sw2", cls=topotest.LegacySwitch)
        self.addLink(
            switch[2],
            router[2],
            intfName2="r2-eth2",
            addr1="80:AA:00:02:00:00",
            addr2="00:11:00:02:00:02",
        )
        self.addLink(
            switch[2],
            router[3],
            intfName2="r3-eth1",
            addr1="80:AA:00:02:00:01",
            addr2="00:11:00:03:00:01",
        )