Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

click to hide/show revision 1
initial version
import pdb
from mininet.topo import Topo

class MyTopo( Topo ):

     def __init__( self ):
        Topo.__init__( self )

        A1  = self.addSwitch( 'A1' )
        B2 = self.addSwitch( 'B2' )
        C3 = self.addSwitch( 'C3' )
        D4 = self.addSwitch( 'D4' )
        E5 = self.addSwitch( 'E5' )
        F6 = self.addSwitch( 'F6' )
        G7 = self.addSwitch( 'G7' )
        H8 = self.addSwitch( 'H8' )

        h1 = self.addHost( 'h1' )
        h2 = self.addHost( 'h2' )
        h3 = self.addHost( 'h3' )
        h4 = self.addHost( 'h4' )
        h5 = self.addHost( 'h5' )
        h6 = self.addHost( 'h6' )
        h7 = self.addHost( 'h7' )
        h8 = self.addHost( 'h8' )


        SwitchList = (A1,B2,C3,D4,E5,F6,G7,H8)


   #host
        self.addLink(A1, h1)
        self.addLink(B2, h2)
        self.addLink(C3, h3)
        self.addLink(D4, h4)
        self.addLink(E5, h5)
        self.addLink(F6, h6)
        self.addLink(G7, h7)
        self.addLink(H8, h8)

     #switch
        self.addLink(A1, E5)
        self.addLink(A1, G7)

        self.addLink(E5, F6)
        self.addLink(E5, H8)

        self.addLink(F6, H8)
        self.addLink(F6, D4)

        self.addLink(D4, H8)

        self.addLink(B2, G7)

        self.addLink(G7, H8)

        self.addLink(H8, C3)



topos = { 'mytopo': ( lambda: MyTopo() ) }