Praseed Balakrishnan

Fixed mininet script for large topo

Change-Id: I4b3ea9959b7792956f7f2798f8540eec1d80df52
...@@ -39,12 +39,12 @@ class OpticalTopo(Topo): ...@@ -39,12 +39,12 @@ class OpticalTopo(Topo):
39 h5 = self.addHost('h5') 39 h5 = self.addHost('h5')
40 h6 = self.addHost('h6') 40 h6 = self.addHost('h6')
41 41
42 - s1 = self.addSwitch('s1',dpid="0000ffffffff0001") 42 + s1 = self.addSwitch('s1', dpid="0000ffffffff0001")
43 - s2 = self.addSwitch('s2',dpid="0000ffffffff0002") 43 + s2 = self.addSwitch('s2', dpid="0000ffffffff0002")
44 - s3 = self.addSwitch('s3',dpid="0000ffffffff0003") 44 + s3 = self.addSwitch('s3', dpid="0000ffffffff0003")
45 - s4 = self.addSwitch('s4',dpid="0000ffffffff0004") 45 + s4 = self.addSwitch('s4', dpid="0000ffffffff0004")
46 - s5 = self.addSwitch('s5',dpid="0000ffffffff0005") 46 + s5 = self.addSwitch('s5', dpid="0000ffffffff0005")
47 - s6 = self.addSwitch('s6',dpid="0000ffffffff0006") 47 + s6 = self.addSwitch('s6', dpid="0000ffffffff0006")
48 48
49 49
50 # Add links from hosts to OVS 50 # Add links from hosts to OVS
...@@ -55,45 +55,25 @@ class OpticalTopo(Topo): ...@@ -55,45 +55,25 @@ class OpticalTopo(Topo):
55 self.addLink(s5, h5) 55 self.addLink(s5, h5)
56 self.addLink(s6, h6) 56 self.addLink(s6, h6)
57 57
58 - # temporary packet link from s1 to s2 for testing
59 - # self.addLink( s1, s2 )
60 -
61 # add links from ovs to linc-oe 58 # add links from ovs to linc-oe
62 # sorry about the syntax :( 59 # sorry about the syntax :(
63 - self.addLink(s1, s1, intfName1='s1-eth0', intfName2='tap29') 60 + self.addIntf(s1,'tap29')
64 - self.addLink(s2, s2, intfName1='s2-eth0', intfName2='tap30') 61 + self.addIntf(s2,'tap30')
65 - self.addLink(s3, s3, intfName1='s3-eth0', intfName2='tap31') 62 + self.addIntf(s3,'tap31')
66 - self.addLink(s4, s4, intfName1='s4-eth0', intfName2='tap32') 63 + self.addIntf(s4,'tap32')
67 - self.addLink(s5, s5, intfName1='s5-eth0', intfName2='tap33') 64 + self.addIntf(s5,'tap33')
68 - self.addLink(s6, s6, intfName1='s6-eth0', intfName2='tap34') 65 + self.addIntf(s6,'tap34')
69 -
70 - #self.addLink(s1, s2, s3, s4, s5, s6)
71 - #intfName1 = 'tap3', intfName\2 = 'tap4', intfName2 = 'tap5',
72 - # intfName2 = 'tap6', intfName2 = 'tap7', intfName2 = 'tap8'
73 66
74 # if you use, sudo mn --custom custom/optical.py, then register the topo: 67 # if you use, sudo mn --custom custom/optical.py, then register the topo:
75 topos = {'optical': ( lambda: OpticalTopo() )} 68 topos = {'optical': ( lambda: OpticalTopo() )}
76 69
77 -def installStaticFlows(net):
78 - for swName in ['s1', 's2', 's3', 's4', 's5', 's6']:
79 - info('Adding flows to %s...' % swName)
80 - sw = net[swName]
81 - sw.dpctl('add-flow', 'in_port=1,actions=output=2')
82 - sw.dpctl('add-flow', 'in_port=2,actions=output=1')
83 - info(sw.dpctl('dump-flows'))
84 -
85 70
86 def run(): 71 def run():
87 - c = RemoteController('c','10.1.8.147',6633) 72 + c = RemoteController('c','127.0.0.1',6633)
88 - net = Mininet( topo=OpticalTopo(),controller=None) 73 + net = Mininet( topo=OpticalTopo(),controller=None,autoSetMacs=True)
89 net.addController(c) 74 net.addController(c)
90 net.start() 75 net.start()
91 76
92 - # intf1 = Intf( 'tap3', node=net.nameToNode['s1'] )
93 - # intf2 = Intf( 'tap4', node=net.nameToNode['s2'] )
94 - # net.nameToNode['s1'].attach( intf1 )
95 - # net.nameToNode['s2'].attach( intf2 )
96 -
97 #installStaticFlows( net ) 77 #installStaticFlows( net )
98 CLI( net ) 78 CLI( net )
99 net.stop() 79 net.stop()
......