fahad

Cleanning up test/topos

=======================
We don't need these files anymore.

Change-Id: I6c4c1db1d67bd03874fbaa03bb47d4fc09e9f41d
{
"devices" : [
{
"uri": "of:0000ffffffffff01", "mac": "ffffffffffff01", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "ROADM1", "latitude": 37.6, "longitude": -122.3, "optical.regens": 0 },
"ports": [ { "port": 10, "speed": 100000, "type": "FIBER" }, { "port": 20, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffffff02", "mac": "ffffffffffff02", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "ROADM2", "latitude": 37.3, "longitude": -121.9, "optical.regens": 0 },
"ports": [ { "port": 11, "speed": 100000, "type": "FIBER" }, { "port": 21, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffffff03", "mac": "ffffffffffff03", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "ROADM3", "latitude": 33.9, "longitude": -118.4, "optical.regens": 2 },
"ports": [ { "port": 30, "speed": 0, "type": "FIBER" }, { "port": 31, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0001", "mac": "ffffffffff0001", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "ROUTER1", "latitude": 37.6, "longitude": -122.3 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0002", "mac": "ffffffffff0002", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "ROUTER2", "latitude": 37.3, "longitude": -121.9 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
}
],
"links" : [
{ "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff03/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
{ "src": "of:0000ffffffffff02/21", "dst": "of:0000ffffffffff03/31", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
{ "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
{ "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff02/11", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } }
],
"hosts" : [
{ "mac": "00:00:00:00:00:01", "vlan": -1, "location": "of:0000ffffffff0001/1", "ip": "10.0.0.1" },
{ "mac": "00:00:00:00:00:02", "vlan": -1, "location": "of:0000ffffffff0002/1", "ip": "10.0.0.2" }
]
}
\ No newline at end of file
{
"devices" : [
{
"uri": "of:0000ffffffffff01", "mac": "ffffffffffff01", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "SFO-W10", "latitude": 37.6, "longitude": -122.3, "optical.regens": 0 },
"ports": [ { "port": 10, "speed": 100000, "type": "FIBER" },
{ "port": 20, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed":100000, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffffff02", "mac": "ffffffffffff02", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "SJC-W10", "latitude": 37.3, "longitude": -121.9, "optical.regens": 0 },
"ports": [ { "port": 20, "speed": 100000, "type": "FIBER" },
{ "port": 30, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffffff03", "mac": "ffffffffffff03", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "LAX-W10", "latitude": 33.9, "longitude": -118.4, "optical.regens": 0 },
"ports": [ { "port": 30, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed": 0, "type": "FIBER" },
{ "port": 20, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffffff04", "mac": "ffffffffffff04", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "SDG-W10", "latitude": 32.8, "longitude": -117.1, "optical.regens": 3 },
"ports": [ { "port": 30, "speed": 0, "type": "FIBER" },
{ "port":50, "speed": 0, "type": "FIBER" },
{ "port":20, "speed": 0, "type": "FIBER" }]
},
{
"uri": "of:0000ffffffffff05", "mac": "ffffffffffff05", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "MSP-M10", "latitude": 44.8, "longitude": -93.1, "optical.regens": 3 },
"ports": [ { "port": 20, "speed": 0, "type": "FIBER" },
{ "port": 30, "speed": 0, "type": "FIBER" },
{ "port": 40, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed": 0, "type": "FIBER" }]
},
{
"uri": "of:0000ffffffffff06", "mac": "ffffffffffff06", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "DFW-M10", "latitude": 32.8, "longitude": -97.1, "optical.regens": 3 },
"ports": [ { "port": 10, "speed": 0, "type": "FIBER" },
{ "port": 20, "speed": 0, "type": "FIBER" },
{ "port": 30, "speed": 0, "type": "FIBER" },
{ "port": 40, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed": 0, "type": "FIBER" }]
},
{
"uri": "of:0000ffffffffff07", "mac": "ffffffffffff07", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "CHG-N10", "latitude": 41.8, "longitude": -87.6, "optical.regens": 3 },
"ports": [ { "port": 10, "speed": 0, "type": "FIBER" },
{ "port": 20, "speed": 0, "type": "FIBER" },
{ "port": 30, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed": 0, "type": "FIBER" }]
},
{
"uri": "of:0000ffffffffff08", "mac": "ffffffffffff08", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "IAD-M10", "latitude": 38.8, "longitude": -77.1, "optical.regens": 3 },
"ports": [ { "port": 20, "speed": 0, "type": "FIBER" },
{ "port": 30, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed": 0, "type": "FIBER" }]
},
{
"uri": "of:0000ffffffffff09", "mac": "ffffffffffff09", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "JFK-M10", "latitude": 40.8, "longitude": -73.1, "optical.regens": 0 },
"ports": [ { "port": 10, "speed": 0, "type": "FIBER" },
{ "port": 20, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed": 0, "type": "FIBER" }]
},
{
"uri": "of:0000ffffffffff0A", "mac": "ffffffffffff0A", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "ATL-S10", "latitude": 33.8, "longitude": -84.1, "optical.regens": 0 },
"ports": [ { "port": 10, "speed": 0, "type": "FIBER" },
{ "port": 20, "speed": 0, "type": "FIBER" },
{ "port": 50, "speed": 0, "type": "FIBER" }]
},
{
"uri": "of:0000ffffffff0001", "mac": "ffffffffff0001", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "SFO-R10", "latitude": 37.6, "longitude": -122.3 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0002", "mac": "ffffffffff0003", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "LAX-R10", "latitude": 33.9, "longitude": -118.4 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0003", "mac": "ffffffffff0004", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "SDG-R10", "latitude": 32.8, "longitude": -117.1 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0004", "mac": "ffffffffff0007", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "CHG-R10", "latitude": 41.8, "longitude": -87.6 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0005", "mac": "ffffffffff0009", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "JFK-R10", "latitude": 40.8, "longitude": -73.1 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0006", "mac": "ffffffffff000A", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "ATL-R10", "latitude": 33.8, "longitude": -84.1 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
}
],
"links" : [
{ "src": "of:0000ffffffffff01/50", "dst": "of:0000ffffffffff02/30","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 48, "durable": "true" } },
{ "src": "of:0000ffffffffff02/50", "dst": "of:0000ffffffffff03/30","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 493, "durable": "true" } },
{ "src": "of:0000ffffffffff03/50", "dst": "of:0000ffffffffff04/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 171, "durable": "true" } },
{ "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff05/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2555, "durable": "true" } },
{ "src": "of:0000ffffffffff02/20", "dst": "of:0000ffffffffff05/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2539, "durable": "true" } },
{ "src": "of:0000ffffffffff03/20", "dst": "of:0000ffffffffff06/50","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1979, "durable": "true" } },
{ "src": "of:0000ffffffffff04/20", "dst": "of:0000ffffffffff06/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1867, "durable": "true" } },
{ "src": "of:0000ffffffffff05/30", "dst": "of:0000ffffffffff06/40","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1378, "durable": "true" } },
{ "src": "of:0000ffffffffff05/40", "dst": "of:0000ffffffffff07/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 2200, "durable": "true" } },
{ "src": "of:0000ffffffffff06/30", "dst": "of:0000ffffffffff08/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1918, "durable": "true" } },
{ "src": "of:0000ffffffffff07/20", "dst": "of:0000ffffffffff08/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 3625, "durable": "true" } },
{ "src": "of:0000ffffffffff07/30", "dst": "of:0000ffffffffff09/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 3880, "durable": "true" } },
{ "src": "of:0000ffffffffff08/20", "dst": "of:0000ffffffffff0A/50", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 838, "durable": "true" } },
{ "src": "of:0000ffffffffff09/20", "dst": "of:0000ffffffffff0A/20","type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1245, "durable": "true" } },
{ "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } },
{ "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff04/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } },
{ "src": "of:0000ffffffff0003/2", "dst": "of:0000ffffffffff06/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } },
{ "src": "of:0000ffffffff0004/2", "dst": "of:0000ffffffffff07/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } },
{ "src": "of:0000ffffffff0005/2", "dst": "of:0000ffffffffff09/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } },
{ "src": "of:0000ffffffff0006/2", "dst": "of:0000ffffffffff0A/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" } }
]
}
{
"devices" : [
{
"uri": "of:0000ffffffffff01", "mac": "ffffffffffff01", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "ROADM1", "latitude": 37.6, "longitude": -122.3, "optical.regens": 0 },
"ports": [ { "port": 10, "speed": 100000, "type": "FIBER" }, { "port": 20, "speed": 0, "type": "FIBER" }, { "port": 22, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffffff02", "mac": "ffffffffffff02", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "ROADM2", "latitude": 37.3, "longitude": -121.9, "optical.regens": 0 },
"ports": [ { "port": 11, "speed": 100000, "type": "FIBER" }, { "port": 21, "speed": 0, "type": "FIBER" }, { "port": 22, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffffff03", "mac": "ffffffffffff03", "type": "ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "ROADM3", "latitude": 33.9, "longitude": -118.4, "optical.regens": 2 },
"ports": [ { "port": 30, "speed": 0, "type": "FIBER" }, { "port": 31, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffffff04", "mac": "ffffffffffff04", "type":"ROADM",
"mfr": "Linc", "hw": "OE", "sw": "?", "serial": "?",
"annotations": { "name": "ROADM4", "latitude": 39.9, "longitude": -119.4, "optical.regens": 2 },
"ports": [ { "port": 30, "speed": 0, "type": "FIBER" }, { "port": 31, "speed": 0, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0001", "mac": "ffffffffff0001", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "ROUTER1", "latitude": 37.6, "longitude": -122.3 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
},
{
"uri": "of:0000ffffffff0002", "mac": "ffffffffff0002", "type": "SWITCH",
"mfr": "Linc", "hw": "PK", "sw": "?", "serial": "?",
"annotations": { "name": "ROUTER2", "latitude": 37.3, "longitude": -121.9 },
"ports": [ { "port": 1, "speed": 10000, "type": "COPPER" }, { "port": 2, "speed": 100000, "type": "FIBER" } ]
}
],
"links" : [
{ "src": "of:0000ffffffffff01/20", "dst": "of:0000ffffffffff03/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
{ "src": "of:0000ffffffffff02/21", "dst": "of:0000ffffffffff03/31", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
{ "src": "of:0000ffffffffff01/22", "dst": "of:0000ffffffffff04/30", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
{ "src": "of:0000ffffffffff04/31", "dst": "of:0000ffffffffff02/22", "type": "OPTICAL", "annotations": { "optical.waves": 80, "optical.type": "WDM", "durable": "true", "inactive": "true" } },
{ "src": "of:0000ffffffff0001/2", "dst": "of:0000ffffffffff01/10", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } },
{ "src": "of:0000ffffffff0002/2", "dst": "of:0000ffffffffff02/11", "type": "OPTICAL", "annotations": { "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true", "inactive": "true" } }
]
}
#!/usr/bin/env python
''' file: optical.py '''
from mininet.topo import Topo
from mininet.node import RemoteController
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.link import Intf, Link
from mininet.util import irange
class NullIntf( Intf ):
"A dummy interface with a blank name that doesn't do any configuration"
def __init__( self, name, **params ):
self.name = ''
class NullLink( Link ):
"A dummy link that doesn't touch either interface"
def makeIntfPair( cls, intf1, intf2, addr1=None, addr2=None ):
pass
def delete( self ):
pass
class OpticalTopo( Topo ):
def addIntf( self, switch, intfName ):
"Add intf intfName to switch"
self.addLink( switch, switch, cls=NullLink,
intfName1=intfName, cls2=NullIntf, intfName2=intfName )
def build( self, n=2, tapStart=3 ):
# Add hosts and switches
hosts = []
switches = []
for i in irange( 1, n ):
h = self.addHost( 'h%d' % i )
s = self.addSwitch( 's%d' % i, dpid="0000ffffffff%04d" % i )
self.addLink( h, s )
hosts.append( h )
switches.append( s )
# Add optical tap interfaces
tapNum = tapStart
for sw in switches:
self.addIntf( sw, 'tap%d' % tapNum )
tapNum += 1
# if you use, sudo mn --custom custom/optical.py, then register the topo:
#sudo mn --custom optical.py --topo optical,5
topos = { 'optical': OpticalTopo }
def installStaticFlows( net ):
for sw in net.switches:
info( 'Adding flows to %s...' % sw.name )
sw.dpctl( 'add-flow', 'in_port=1,actions=output=2' )
sw.dpctl( 'add-flow', 'in_port=2,actions=output=1' )
info( sw.dpctl( 'dump-flows' ) )
def run( n ):
topo = OpticalTopo( n )
net = Mininet( topo=topo, controller=RemoteController, autoSetMacs=True )
net.start()
#installStaticFlows( net )
CLI( net )
net.stop()
# if the script is run directly (sudo custom/optical.py):
if __name__ == '__main__':
import sys
try:
n = int( sys.argv[1] )
except:
print ( 'Usage: ./optical.py n # n is number of switches\n'
'Starting with default of 2 switches...\n' )
n = 2
setLogLevel( 'info' )
run( n )
#!/usr/bin/env python
''' file: custom/optical.py '''
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.link import Intf, Link
from mininet.node import RemoteController
class NullIntf( Intf ):
"A dummy interface with a blank name that doesn't do any configuration"
def __init__( self, name, **params ):
self.name = ''
class NullLink( Link ):
"A dummy link that doesn't touch either interface"
def makeIntfPair( cls, intf1, intf2, *args, **kwargs ):
pass
def delete( self ):
pass
class OpticalTopo(Topo):
def addIntf( self, switch, intfName ):
"Add intf intfName to switch"
self.addLink( switch, switch, cls=NullLink,
intfName1=intfName, cls2=NullIntf )
def __init__(self):
# Initialize topology
Topo.__init__(self)
# Add hosts and switches
h1 = self.addHost('h1')
h2 = self.addHost('h2')
h3 = self.addHost('h3')
h4 = self.addHost('h4')
h5 = self.addHost('h5')
h6 = self.addHost('h6')
s1 = self.addSwitch('s1', dpid="0000ffffffff0001")
s2 = self.addSwitch('s2', dpid="0000ffffffff0002")
s3 = self.addSwitch('s3', dpid="0000ffffffff0003")
s4 = self.addSwitch('s4', dpid="0000ffffffff0004")
s5 = self.addSwitch('s5', dpid="0000ffffffff0005")
s6 = self.addSwitch('s6', dpid="0000ffffffff0006")
# Add links from hosts to OVS
self.addLink(s1, h1)
self.addLink(s2, h2)
self.addLink(s3, h3)
self.addLink(s4, h4)
self.addLink(s5, h5)
self.addLink(s6, h6)
# add links from ovs to linc-oe
# sorry about the syntax :(
self.addIntf(s1,'tap29')
self.addIntf(s2,'tap30')
self.addIntf(s3,'tap31')
self.addIntf(s4,'tap32')
self.addIntf(s5,'tap33')
self.addIntf(s6,'tap34')
# if you use, sudo mn --custom custom/optical.py, then register the topo:
topos = {'optical': ( lambda: OpticalTopo() )}
def run():
c = RemoteController('c','127.0.0.1',6633)
net = Mininet( topo=OpticalTopo(),controller=None,autoSetMacs=True)
net.addController(c)
net.start()
#installStaticFlows( net )
CLI( net )
net.stop()
# if the script is run directly (sudo custom/optical.py):
if __name__ == '__main__':
setLogLevel('info')
run()
[{linc,
[{of_config,disabled},
{software_desc,<<"LINC-OE OpenFlow Software Switch 1.1">>},
{capable_switch_ports,
[{port,1,[{interface,"dummy"},{type,optical}]},
{port,2,[{interface,"dummy"},{type,optical}]},
{port,3,[{interface,"dummy"},{type,optical}]},
{port,4,[{interface,"dummy"},{type,optical}]},
{port,5,[{interface,"dummy"},{type,optical}]},
{port,6,[{interface,"dummy"},{type,optical}]},
{port,7,[{interface,"dummy"},{type,optical}]},
{port,8,[{interface,"dummy"},{type,optical}]},
{port,9,[{interface,"dummy"},{type,optical}]},
{port,10,[{interface,"dummy"},{type,optical}]},
{port,11,[{interface,"dummy"},{type,optical}]},
{port,12,[{interface,"dummy"},{type,optical}]},
{port,13,[{interface,"dummy"},{type,optical}]},
{port,14,[{interface,"dummy"},{type,optical}]},
{port,15,[{interface,"dummy"},{type,optical}]},
{port,16,[{interface,"dummy"},{type,optical}]},
{port,17,[{interface,"dummy"},{type,optical}]},
{port,18,[{interface,"dummy"},{type,optical}]},
{port,19,[{interface,"dummy"},{type,optical}]},
{port,20,[{interface,"dummy"},{type,optical}]},
{port,21,[{interface,"dummy"},{type,optical}]},
{port,22,[{interface,"dummy"},{type,optical}]},
{port,23,[{interface,"dummy"},{type,optical}]},
{port,24,[{interface,"dummy"},{type,optical}]},
{port,25,[{interface,"dummy"},{type,optical}]},
{port,26,[{interface,"dummy"},{type,optical}]},
{port,27,[{interface,"dummy"},{type,optical}]},
{port,28,[{interface,"dummy"},{type,optical}]},
{port,29,[{interface,"tap29"}]},
{port,30,[{interface,"tap30"}]},
{port,31,[{interface,"tap31"}]},
{port,32,[{interface,"tap32"}]},
{port,33,[{interface,"tap33"}]},
{port,34,[{interface,"tap34"}]}]},
{capable_switch_queues,[]},
{optical_links,
[{{1,50},{2,30}},
{{2,50},{3,30}},
{{3,50},{4,50}},
{{1,20},{5,50}},
{{2,20},{5,20}},
{{3,20},{6,50}},
{{4,20},{6,20}},
{{5,30},{6,40}},
{{5,40},{7,50}},
{{6,30},{8,50}},
{{7,20},{8,30}},
{{7,30},{9,50}},
{{8,20},{10,50}},
{{9,20},{10,20}}]},
{logical_switches,
[{switch,1,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:01"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,1,[{queues,[]},{port_no,50}]},
{port,7,[{queues,[]},{port_no,20}]},
{port,29,[{queues,[]},{port_no,10}]}]}]},
{switch,2,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:02"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,2,[{queues,[]},{port_no,30}]},
{port,3,[{queues,[]},{port_no,50}]},
{port,9,[{queues,[]},{port_no,20}]}]}]},
{switch,3,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:03"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,4,[{queues,[]},{port_no,30}]},
{port,5,[{queues,[]},{port_no,50}]},
{port,11,[{queues,[]},{port_no,20}]}]}]},
{switch,4,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:04"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,6,[{queues,[]},{port_no,50}]},
{port,13,[{queues,[]},{port_no,20}]},
{port,30,[{queues,[]},{port_no,10}]}]}]},
{switch,5,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:05"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,8,[{queues,[]},{port_no,50}]},
{port,10,[{queues,[]},{port_no,20}]},
{port,15,[{queues,[]},{port_no,30}]},
{port,17,[{queues,[]},{port_no,40}]}]}]},
{switch,7,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:07"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,18,[{queues,[]},{port_no,50}]},
{port,21,[{queues,[]},{port_no,20}]},
{port,23,[{queues,[]},{port_no,30}]},
{port,32,[{queues,[]},{port_no,10}]}]}]},
{switch,8,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:08"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,20,[{queues,[]},{port_no,50}]},
{port,22,[{queues,[]},{port_no,30}]},
{port,25,[{queues,[]},{port_no,20}]}]}]},
{switch,9,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:09"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,24,[{queues,[]},{port_no,50}]},
{port,27,[{queues,[]},{port_no,20}]},
{port,33,[{queues,[]},{port_no,10}]}]}]},
{switch,10,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:0A"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,26,[{queues,[]},{port_no,50}]},
{port,28,[{queues,[]},{port_no,20}]},
{port,34,[{queues,[]},{port_no,10}]}]}]},
{switch,6,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:06"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,12,[{queues,[]},{port_no,50}]},
{port,14,[{queues,[]},{port_no,20}]},
{port,16,[{queues,[]},{port_no,40}]},
{port,19,[{queues,[]},{port_no,30}]},
{port,31,[{queues,[]},{port_no,10}]}]}]}]}]},
{epcap,[{verbose,false},{stats_interval,10}]},
{enetconf,
[{capabilities,
[{base,{1,0}},
{base,{1,1}},
{startup,{1,0}},
{'writable-running',{1,0}}]},
{callback_module,linc_ofconfig},
{sshd_ip,any},
{sshd_port,1830},
{sshd_user_passwords,[{"linc","linc"}]}]},
{lager,
[{handlers,
[{lager_console_backend,info},
{lager_file_backend,
[{"log/error.log",error,10485760,"$D0",5},
{"log/console.log",info,10485760,"$D0",5}]}]}]},
{sasl,
[{sasl_error_logger,{file,"log/sasl-error.log"}},
{errlog_type,error},
{error_logger_mf_dir,"log/sasl"},
{error_logger_mf_maxbytes,10485760},
{error_logger_mf_maxfiles,5}]},
{sync,[{excluded_modules,[procket]}]}].
[{linc,
[{of_config,disabled},
{software_desc,<<"LINC-OE OpenFlow Software Switch 1.1">>},
{capable_switch_ports,
[{port,1,[{interface,"dummy"},{type,optical}]},
{port,2,[{interface,"dummy"},{type,optical}]},
{port,5,[{interface,"dummy"},{type,optical}]},
{port,6,[{interface,"dummy"},{type,optical}]},
{port,7,[{interface,"dummy"},{type,optical}]},
{port,8,[{interface,"dummy"},{type,optical}]},
{port,9,[{interface,"dummy"},{type,optical}]},
{port,10,[{interface,"dummy"},{type,optical}]},
{port,3,[{interface,"tap3"}]},
{port,4,[{interface,"tap4"}]}]},
{capable_switch_queues,[]},
{optical_links,[{{1,20},{3,30}},{{3,31},{2,21}},{{1,22},{4,30}},{{4,31},{2,22}}]},
{logical_switches,
[{switch,1,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:01"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,1,[{queues,[]},{port_no,20}]},
{port,7,[{queues,[]},{port_no,22}]},
{port,3,[{queues,[]},{port_no,10}]}]}]},
{switch,3,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:03"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,5,[{queues,[]},{port_no,30}]},
{port,6,[{queues,[]},{port_no,31}]}]}]},
{switch,2,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:02"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,2,[{queues,[]},{port_no,21}]},
{port,8,[{queues,[]},{port_no,22}]},
{port,4,[{queues,[]},{port_no,11}]}]}]},
{switch,4,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:04"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,9,[{queues,[]},{port_no,30}]},
{port,10,[{queues,[]},{port_no,31}]}]}]}]}]},
{epcap,[{verbose,false},{stats_interval,10}]},
{enetconf,
[{capabilities,
[{base,{1,0}},
{base,{1,1}},
{startup,{1,0}},
{'writable-running',{1,0}}]},
{callback_module,linc_ofconfig},
{sshd_ip,any},
{sshd_port,1830},
{sshd_user_passwords,[{"linc","linc"}]}]},
{lager,
[{handlers,
[{lager_console_backend,debug},
{lager_file_backend,
[{"log/error.log",error,10485760,"$D0",5},
{"log/console.log",info,10485760,"$D0",5}]}]}]},
{sasl,
[{sasl_error_logger,{file,"log/sasl-error.log"}},
{errlog_type,error},
{error_logger_mf_dir,"log/sasl"},
{error_logger_mf_maxbytes,10485760},
{error_logger_mf_maxfiles,5}]},
{sync,[{excluded_modules,[procket]}]}].
[{linc,
[{of_config,disabled},
{software_desc,<<"LINC-OE OpenFlow Software Switch 1.1">>},
{capable_switch_ports,
[{port,1,[{interface,"dummy"},{type,optical}]},
{port,2,[{interface,"dummy"},{type,optical}]},
{port,3,[{interface,"dummy"},{type,optical}]},
{port,4,[{interface,"dummy"},{type,optical}]},
{port,5,[{interface,"dummy"},{type,optical}]},
{port,6,[{interface,"dummy"},{type,optical}]},
{port,7,[{interface,"dummy"},{type,optical}]},
{port,8,[{interface,"dummy"},{type,optical}]},
{port,9,[{interface,"dummy"},{type,optical}]},
{port,10,[{interface,"dummy"},{type,optical}]},
{port,11,[{interface,"dummy"},{type,optical}]},
{port,12,[{interface,"dummy"},{type,optical}]},
{port,13,[{interface,"dummy"},{type,optical}]},
{port,14,[{interface,"dummy"},{type,optical}]},
{port,15,[{interface,"dummy"},{type,optical}]},
{port,16,[{interface,"dummy"},{type,optical}]},
{port,17,[{interface,"dummy"},{type,optical}]},
{port,18,[{interface,"dummy"},{type,optical}]},
{port,19,[{interface,"dummy"},{type,optical}]},
{port,20,[{interface,"dummy"},{type,optical}]},
{port,21,[{interface,"dummy"},{type,optical}]},
{port,22,[{interface,"dummy"},{type,optical}]},
{port,23,[{interface,"dummy"},{type,optical}]},
{port,24,[{interface,"dummy"},{type,optical}]},
{port,25,[{interface,"dummy"},{type,optical}]},
{port,26,[{interface,"dummy"},{type,optical}]},
{port,27,[{interface,"dummy"},{type,optical}]},
{port,28,[{interface,"dummy"},{type,optical}]},
{port,29,[{interface,"tap29"}]},
{port,30,[{interface,"tap30"}]},
{port,31,[{interface,"tap31"}]},
{port,32,[{interface,"tap32"}]},
{port,33,[{interface,"tap33"}]},
{port,34,[{interface,"tap34"}]}]},
{capable_switch_queues,[]},
{optical_links,
[{{1,50},{2,30}},
{{2,50},{3,30}},
{{3,50},{4,50}},
{{1,20},{5,50}},
{{2,20},{5,20}},
{{3,20},{6,50}},
{{4,20},{6,20}},
{{5,30},{6,40}},
{{5,40},{7,50}},
{{6,30},{8,50}},
{{7,20},{8,30}},
{{7,30},{9,50}},
{{8,20},{10,50}},
{{9,20},{10,20}}]},
{logical_switches,
[{switch,1,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:01"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,1,[{queues,[]},{port_no,50}]},
{port,7,[{queues,[]},{port_no,20}]},
{port,29,[{queues,[]},{port_no,10}]}]}]},
{switch,2,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:02"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,2,[{queues,[]},{port_no,30}]},
{port,3,[{queues,[]},{port_no,50}]},
{port,9,[{queues,[]},{port_no,20}]}]}]},
{switch,3,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:03"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,4,[{queues,[]},{port_no,30}]},
{port,5,[{queues,[]},{port_no,50}]},
{port,11,[{queues,[]},{port_no,20}]}]}]},
{switch,4,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:04"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,6,[{queues,[]},{port_no,50}]},
{port,13,[{queues,[]},{port_no,20}]},
{port,30,[{queues,[]},{port_no,10}]}]}]},
{switch,5,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:05"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,8,[{queues,[]},{port_no,50}]},
{port,10,[{queues,[]},{port_no,20}]},
{port,15,[{queues,[]},{port_no,30}]},
{port,17,[{queues,[]},{port_no,40}]}]}]},
{switch,7,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:07"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,18,[{queues,[]},{port_no,50}]},
{port,21,[{queues,[]},{port_no,20}]},
{port,23,[{queues,[]},{port_no,30}]},
{port,32,[{queues,[]},{port_no,10}]}]}]},
{switch,8,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:08"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,20,[{queues,[]},{port_no,50}]},
{port,22,[{queues,[]},{port_no,30}]},
{port,25,[{queues,[]},{port_no,20}]}]}]},
{switch,9,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:09"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,24,[{queues,[]},{port_no,50}]},
{port,27,[{queues,[]},{port_no,20}]},
{port,33,[{queues,[]},{port_no,10}]}]}]},
{switch,10,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:0A"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,26,[{queues,[]},{port_no,50}]},
{port,28,[{queues,[]},{port_no,20}]},
{port,34,[{queues,[]},{port_no,10}]}]}]},
{switch,6,
[{backend,linc_us4_oe},
{datapath_id,"00:00:ff:ff:ff:ff:ff:06"},
{controllers,[{"Switch0-Controller","10.1.8.147",6633,tcp}]},
{controllers_listener,disabled},
{queues_status,disabled},
{ports,
[{port,12,[{queues,[]},{port_no,50}]},
{port,14,[{queues,[]},{port_no,20}]},
{port,16,[{queues,[]},{port_no,40}]},
{port,19,[{queues,[]},{port_no,30}]},
{port,31,[{queues,[]},{port_no,10}]}]}]}]}]},
{epcap,[{verbose,false},{stats_interval,10}]},
{enetconf,
[{capabilities,
[{base,{1,0}},
{base,{1,1}},
{startup,{1,0}},
{'writable-running',{1,0}}]},
{callback_module,linc_ofconfig},
{sshd_ip,any},
{sshd_port,1830},
{sshd_user_passwords,[{"linc","linc"}]}]},
{lager,
[{handlers,
[{lager_console_backend,info},
{lager_file_backend,
[{"log/error.log",error,10485760,"$D0",5},
{"log/console.log",info,10485760,"$D0",5}]}]}]},
{sasl,
[{sasl_error_logger,{file,"log/sasl-error.log"}},
{errlog_type,error},
{error_logger_mf_dir,"log/sasl"},
{error_logger_mf_maxbytes,10485760},
{error_logger_mf_maxfiles,5}]},
{sync,[{excluded_modules,[procket]}]}].