1 """Custom topology example
3 Two directly connected switches plus a host for each switch:
5 host --- switch --- switch --- host
7 Adding the 'topos' dict with a key/value pair to generate our newly defined
8 topology enables one to pass in '--topo=mytopo' from the command line.
11 from mininet.topo import Topo
14 "Simple topology example."
19 # Add hosts and switches
20 leftHost = self.addHost( 'h1' )
21 rightHost = self.addHost( 'h2' )
22 leftSwitch = self.addSwitch( 's3' )
23 rightSwitch = self.addSwitch( 's4' )
26 self.addLink( leftHost, leftSwitch )
27 self.addLink( leftSwitch, rightSwitch )
28 self.addLink( rightSwitch, rightHost )
31 topos = { 'mytopo': ( lambda: MyTopo() ) }