from mininet.topo import Topo

class MyFirstTopo(Topo):
	"Simple topolopy example."
	def __init__(self):
		"Create custom topo."
		#Init topo
		Topo.__init__(self)
		#Add hosts and switches
		h1 = self.addHost('h1')
		h2 = self.addHost('h2')
		h3 = self.addHost('h3')
		h4 = self.addHost('h4')
		leftSwitch = self.addSwitch('s1')
		rightSwitch = self.addSwitch('s2')
		#Add links
		self.addLink(h1, leftSwitch)
		self.addLink(h2, leftSwitch)
		self.addLink(leftSwitch, rightSwitch)
		self.addLink(rightSwitch, h3)
		self.addLink(rightSwitch, h4)

topos = {'myfirsttopo': (lambda: MyFirstTopo())}
