Created
June 29, 2017 09:45
-
-
Save imirzadeh/27b4fbfdde857b5d7ee522fe4bc48371 to your computer and use it in GitHub Desktop.
topo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mininet.topo import Topo | |
class MyTopo( Topo ): | |
"Simple topology example." | |
def __init__( self ): | |
"Create custom topo." | |
# Initialize topology | |
Topo.__init__( self ) | |
# Add hosts and switches | |
h1= self.addHost( 'h1' ) | |
h2 = self.addHost( 'h2' ) | |
h3 = self.addHost( 'h3' ) | |
s1 = self.addSwitch( 's1' ) | |
# Add links | |
self.addLink(h1, s1) | |
self.addLink(h2, s1) | |
self.addLink(h3, s1) | |
topos = { 'mytopo': ( lambda: MyTopo() ) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment