fahad
Committed by Gerrit Code Review

Lots of improvements in opticalUtils.py

Now we can controll LINC components from mininet e.g swtich start/stop or link up/down
-Added LINCSwitch, LINCIntf and LINCLink classes
    -fixed start/stop LINC-Switch bug related to taps
    -refactored opticalUtils.py
    -fixed typo
    -Implemented LINC-CLI support in LINCSwitch class
    -Added support for link up/down from mininet
    -Added support for switch start/stop from mininet
    and many more :)

Change-Id: Ide6460081a554ea3ca9146be480ae016d7d2356d
#!/usr/bin/python
from opticalUtils import MininetOE, OpticalSwitch, OpticalLink
from opticalUtils import MininetOE, LINCSwitch, LINCLink
from mininet.topo import Topo
from mininet.log import setLogLevel
from mininet.node import RemoteController
......@@ -10,25 +10,25 @@ class SmallOpticalTopo( Topo ):
def build( self ):
o1ann = { "latitude": 37.6, "longitude": -122.3, "optical.regens": 0 }
O1 = self.addSwitch( 'SFO-W10', dpid='0000ffffffffff01', annotations=o1ann, cls=OpticalSwitch )
O1 = self.addSwitch( 'SFO-W10', dpid='0000ffffffffff01', annotations=o1ann, cls=LINCSwitch )
o2ann = { "latitude": 37.3, "longitude": -121.9, "optical.regens": 0 }
O2 = self.addSwitch( 'SJC-W10', dpid='0000ffffffffff02', annotations=o2ann, cls=OpticalSwitch )
O2 = self.addSwitch( 'SJC-W10', dpid='0000ffffffffff02', annotations=o2ann, cls=LINCSwitch )
o3ann = { "latitude": 33.9, "longitude": -118.4, "optical.regens": 0 }
O3 = self.addSwitch( 'LAX-W10', dpid='0000ffffffffff03', annotations=o3ann, cls=OpticalSwitch )
O3 = self.addSwitch( 'LAX-W10', dpid='0000ffffffffff03', annotations=o3ann, cls=LINCSwitch )
o4ann = { "latitude": 32.8, "longitude": -117.1, "optical.regens": 3 }
O4 = self.addSwitch( 'SDG-W10', dpid='0000ffffffffff04', annotations=o4ann, cls=OpticalSwitch )
O4 = self.addSwitch( 'SDG-W10', dpid='0000ffffffffff04', annotations=o4ann, cls=LINCSwitch )
o5ann = { "latitude": 44.8, "longitude": -93.1, "optical.regens": 3 }
O5 = self.addSwitch( 'MSP-M10', dpid='0000ffffffffff05', annotations=o5ann, cls=OpticalSwitch )
O5 = self.addSwitch( 'MSP-M10', dpid='0000ffffffffff05', annotations=o5ann, cls=LINCSwitch )
o6ann = { "latitude": 32.8, "longitude": -97.1, "optical.regens": 3 }
O6 = self.addSwitch( 'DFW-M10', dpid='0000ffffffffff06', annotations=o6ann, cls=OpticalSwitch )
O6 = self.addSwitch( 'DFW-M10', dpid='0000ffffffffff06', annotations=o6ann, cls=LINCSwitch )
o7ann = { "latitude": 41.8, "longitude": -87.6, "optical.regens": 3 }
O7 = self.addSwitch( 'CHG-N10', dpid='0000ffffffffff07', annotations=o7ann, cls=OpticalSwitch )
O7 = self.addSwitch( 'CHG-N10', dpid='0000ffffffffff07', annotations=o7ann, cls=LINCSwitch )
o8ann = { "latitude": 38.8, "longitude": -77.1, "optical.regens": 3 }
O8 = self.addSwitch( 'IAD-M10', dpid='0000ffffffffff08', annotations=o8ann, cls=OpticalSwitch )
O8 = self.addSwitch( 'IAD-M10', dpid='0000ffffffffff08', annotations=o8ann, cls=LINCSwitch )
o9ann = { "latitude": 40.8, "longitude": -73.1, "optical.regens": 0 }
O9 = self.addSwitch( 'JFK-M10', dpid='0000ffffffffff09', annotations=o9ann, cls=OpticalSwitch )
O9 = self.addSwitch( 'JFK-M10', dpid='0000ffffffffff09', annotations=o9ann, cls=LINCSwitch )
o10ann = { "latitude": 33.8, "longitude": -84.1, "optical.regens": 0 }
O10 = self.addSwitch( 'ATL-S10', dpid='0000ffffffffff0a', annotations=o10ann, cls=OpticalSwitch )
O10 = self.addSwitch( 'ATL-S10', dpid='0000ffffffffff0a', annotations=o10ann, cls=LINCSwitch )
SFOR10 = self.addSwitch( 'SFO-R10', dpid='0000ffffffff0001', annotations={"latitude": 37.6, "longitude": -122.3} )
......@@ -38,29 +38,29 @@ class SmallOpticalTopo( Topo ):
JFKR10 = self.addSwitch( 'JFK-R10', dpid='0000ffffffff0005', annotations={ "latitude": 40.8, "longitude": -73.1 } )
ATLR10 = self.addSwitch( 'ATL-R10', dpid='0000ffffffff0006', annotations={ "latitude": 33.8, "longitude": -84.1 } )
self.addLink( O1, O2, port1=50, port2=30, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O2, O3, port1=50, port2=30, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O3, O4, port1=50, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O1, O5, port1=20, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O2, O5, port1=20, port2=20, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O3, O6, port1=20, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O4, O6, port1=20, port2=20, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O5, O6, port1=30, port2=40, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O5, O7, port1=40, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O6, O8, port1=30, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O7, O8, port1=20, port2=30, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O7, O9, port1=30, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O8, O10, port1=20, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O9, O10, port1=20, port2=20, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=OpticalLink )
self.addLink( O1, O2, port1=50, port2=30, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O2, O3, port1=50, port2=30, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O3, O4, port1=50, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O1, O5, port1=20, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O2, O5, port1=20, port2=20, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O3, O6, port1=20, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O4, O6, port1=20, port2=20, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O5, O6, port1=30, port2=40, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O5, O7, port1=40, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O6, O8, port1=30, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O7, O8, port1=20, port2=30, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O7, O9, port1=30, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O8, O10, port1=20, port2=50, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( O9, O10, port1=20, port2=20, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1000, "durable": "true" }, cls=LINCLink )
self.addLink( SFOR10, O1, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( LAXR10, O3, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SFOR10, O1, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( LAXR10, O3, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
# added second tap
self.addLink( LAXR10, O3, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SDGR10, O4, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( CHGR10, O7, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( JFKR10, O9, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ATLR10, O10, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( LAXR10, O3, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SDGR10, O4, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( CHGR10, O7, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( JFKR10, O9, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ATLR10, O10, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
h1 = self.addHost( 'h1' )
h2 = self.addHost( 'h2' )
......@@ -81,7 +81,7 @@ if __name__ == '__main__':
if len( sys.argv ) >= 2:
controllers = sys.argv[1:]
else:
print 'Usage: ./opticalUtils.py (<Controller IP>)+'
print 'Usage:sudo -E python opticalTest.py (<Controller IP>)+'
print 'Using localhost...\n'
controllers = [ '127.0.0.1' ]
......
#!/usr/bin/python
from opticalUtils import MininetOE, OpticalSwitch, OpticalLink
from opticalUtils import MininetOE, LINCSwitch, LINCLink
from mininet.topo import Topo
from mininet.log import setLogLevel
from mininet.node import RemoteController
......@@ -11,155 +11,155 @@ class BigOpticalTopo( Topo ):
def build( self ):
# Optical layer ROADMs
o1ann = { "latitude": 32.508086, "longitude": -99.741564, "optical.regens": 0 }
O1 = self.addSwitch( 'ABLNTXRO', dpid='0000ffffffffff01', annotations=o1ann, cls=OpticalSwitch )
O1 = self.addSwitch( 'ABLNTXRO', dpid='0000ffffffffff01', annotations=o1ann, cls=LINCSwitch )
o2ann = { "latitude": 35.084446, "longitude": -106.649719, "optical.regens": 0 }
O2 = self.addSwitch( 'ALBQNMMA', dpid='0000ffffffffff02', annotations=o2ann, cls=OpticalSwitch )
O2 = self.addSwitch( 'ALBQNMMA', dpid='0000ffffffffff02', annotations=o2ann, cls=LINCSwitch )
o3ann = { "latitude": 42.652222, "longitude": -73.758333, "optical.regens": 0 }
O3 = self.addSwitch( 'ALBYNYSS', dpid='0000ffffffffff03', annotations=o3ann, cls=OpticalSwitch )
O3 = self.addSwitch( 'ALBYNYSS', dpid='0000ffffffffff03', annotations=o3ann, cls=LINCSwitch )
o4ann = { "latitude": 33.755833, "longitude": -97.743057, "optical.regens": 5 }
O4 = self.addSwitch( 'ATLNGATL', dpid='0000ffffffffff04', annotations=o4ann, cls=OpticalSwitch ) # ATLNGATL Connected to packet node
O4 = self.addSwitch( 'ATLNGATL', dpid='0000ffffffffff04', annotations=o4ann, cls=LINCSwitch ) # ATLNGATL Connected to packet node
o5ann = { "latitude": 42.882778, "longitude": -78.877778, "optical.regens": 0 }
O5 = self.addSwitch( 'BFLONYFR', dpid='0000ffffffffff05', annotations=o5ann, cls=OpticalSwitch )
O5 = self.addSwitch( 'BFLONYFR', dpid='0000ffffffffff05', annotations=o5ann, cls=LINCSwitch )
o6ann = { "latitude": 45.781667, "longitude": -108.509167, "optical.regens": 0 }
O6 = self.addSwitch( 'BLNGMTMA', dpid='0000ffffffffff06', annotations=o6ann, cls=OpticalSwitch )
O6 = self.addSwitch( 'BLNGMTMA', dpid='0000ffffffffff06', annotations=o6ann, cls=LINCSwitch )
o7ann = { "latitude": 39.293781, "longitude": -76.614127, "optical.regens": 0 }
O7 = self.addSwitch( 'BLTMMDCH', dpid='0000ffffffffff07', annotations=o7ann, cls=OpticalSwitch )
O7 = self.addSwitch( 'BLTMMDCH', dpid='0000ffffffffff07', annotations=o7ann, cls=LINCSwitch )
o8ann = { "latitude": 33.517223, "longitude": -86.812225, "optical.regens": 0 }
O8 = self.addSwitch( 'BRHMALMT', dpid='0000ffffffffff08', annotations=o8ann, cls=OpticalSwitch )
O8 = self.addSwitch( 'BRHMALMT', dpid='0000ffffffffff08', annotations=o8ann, cls=LINCSwitch )
o9ann = { "latitude": 46.836379, "longitude": -100.796917, "optical.regens": 0 }
O9 = self.addSwitch( 'BSMRNDJC', dpid='0000ffffffffff09', annotations=o9ann, cls=OpticalSwitch )
O9 = self.addSwitch( 'BSMRNDJC', dpid='0000ffffffffff09', annotations=o9ann, cls=LINCSwitch )
o10ann = { "latitude": 30.449722, "longitude": -91.184167, "optical.regens": 0 }
O10 = self.addSwitch( 'BTRGLAMA', dpid='0000ffffffffff0a', annotations=o10ann, cls=OpticalSwitch )
O10 = self.addSwitch( 'BTRGLAMA', dpid='0000ffffffffff0a', annotations=o10ann, cls=LINCSwitch )
o11ann = { "latitude": 41.881484, "longitude": -87.640432, "optical.regens": 4 }
O11 = self.addSwitch( 'CHCGILCL', dpid='0000ffffffffff0b', annotations=o11ann, cls=OpticalSwitch )
O11 = self.addSwitch( 'CHCGILCL', dpid='0000ffffffffff0b', annotations=o11ann, cls=LINCSwitch )
o12ann = { "latitude": 35.224924, "longitude": -80.837502, "optical.regens": 0 }
O12 = self.addSwitch( 'CHRLNCCA', dpid='0000ffffffffff0c', annotations=o12ann, cls=OpticalSwitch )
O12 = self.addSwitch( 'CHRLNCCA', dpid='0000ffffffffff0c', annotations=o12ann, cls=LINCSwitch )
o13ann = { "latitude": 32.785278, "longitude": -79.938056, "optical.regens": 0 }
O13 = self.addSwitch( 'CHTNSCDT', dpid='0000ffffffffff0d', annotations=o13ann, cls=OpticalSwitch )
O13 = self.addSwitch( 'CHTNSCDT', dpid='0000ffffffffff0d', annotations=o13ann, cls=LINCSwitch )
o14ann = { "latitude": 41.498333, "longitude": -81.686943, "optical.regens": 0 }
O14 = self.addSwitch( 'CLEVOH02', dpid='0000ffffffffff0e', annotations=o14ann, cls=OpticalSwitch )
O14 = self.addSwitch( 'CLEVOH02', dpid='0000ffffffffff0e', annotations=o14ann, cls=LINCSwitch )
o15ann = { "latitude": 39.965279, "longitude": -82.996666, "optical.regens": 0 }
O15 = self.addSwitch( 'CLMBOH11', dpid='0000ffffffffff0f', annotations=o15ann, cls=OpticalSwitch )
O15 = self.addSwitch( 'CLMBOH11', dpid='0000ffffffffff0f', annotations=o15ann, cls=LINCSwitch )
o16ann = { "latitude": 42.36745, "longitude": -71.084918, "optical.regens": 0 }
O16 = self.addSwitch( 'CMBRMA01', dpid='0000ffffffffff10', annotations=o16ann, cls=OpticalSwitch )
O16 = self.addSwitch( 'CMBRMA01', dpid='0000ffffffffff10', annotations=o16ann, cls=LINCSwitch )
o17ann = { "latitude": 39.102778, "longitude": -84.516944, "optical.regens": 0 }
O17 = self.addSwitch( 'CNCNOHWS', dpid='0000ffffffffff11', annotations=o17ann, cls=OpticalSwitch )
O17 = self.addSwitch( 'CNCNOHWS', dpid='0000ffffffffff11', annotations=o17ann, cls=LINCSwitch )
o18ann = { "latitude": 32.797524, "longitude": -96.780431, "optical.regens": 0 }
O18 = self.addSwitch( 'DLLSTXTL', dpid='0000ffffffffff12', annotations=o18ann, cls=OpticalSwitch ) # DLLSTXTL Connected to packet node
O18 = self.addSwitch( 'DLLSTXTL', dpid='0000ffffffffff12', annotations=o18ann, cls=LINCSwitch ) # DLLSTXTL Connected to packet node
o19ann = { "latitude": 39.744999, "longitude": -104.996391, "optical.regens": 0 }
O19 = self.addSwitch( 'DNVRCOMA', dpid='0000ffffffffff13', annotations=o19ann, cls=OpticalSwitch )
O19 = self.addSwitch( 'DNVRCOMA', dpid='0000ffffffffff13', annotations=o19ann, cls=LINCSwitch )
o20ann = { "latitude": 42.332779, "longitude": -83.054169, "optical.regens": 5 }
O20 = self.addSwitch( 'DTRTMIBA', dpid='0000ffffffffff14', annotations=o20ann, cls=OpticalSwitch )
O20 = self.addSwitch( 'DTRTMIBA', dpid='0000ffffffffff14', annotations=o20ann, cls=LINCSwitch )
o21ann = { "latitude": 31.756389, "longitude": -106.483611, "optical.regens": 0 }
O21 = self.addSwitch( 'ELPSTXMA', dpid='0000ffffffffff15', annotations=o21ann, cls=OpticalSwitch )
O21 = self.addSwitch( 'ELPSTXMA', dpid='0000ffffffffff15', annotations=o21ann, cls=LINCSwitch )
o22ann = { "latitude": 36.73923, "longitude": -119.79423, "optical.regens": 0 }
O22 = self.addSwitch( 'FRSNCA01', dpid='0000ffffffffff16', annotations=o22ann, cls=OpticalSwitch )
O22 = self.addSwitch( 'FRSNCA01', dpid='0000ffffffffff16', annotations=o22ann, cls=LINCSwitch )
o23ann = { "latitude": 36.072222, "longitude": -79.793889, "optical.regens": 0 }
O23 = self.addSwitch( 'GNBONCEU', dpid='0000ffffffffff17', annotations=o23ann, cls=OpticalSwitch )
O23 = self.addSwitch( 'GNBONCEU', dpid='0000ffffffffff17', annotations=o23ann, cls=LINCSwitch )
o24ann = { "latitude": 41.765833, "longitude": -72.676389, "optical.regens": 0 }
O24 = self.addSwitch( 'HRFRCT03', dpid='0000ffffffffff18', annotations=o24ann, cls=OpticalSwitch )
O24 = self.addSwitch( 'HRFRCT03', dpid='0000ffffffffff18', annotations=o24ann, cls=LINCSwitch )
o25ann = { "latitude": 29.748333, "longitude": -95.36528, "optical.regens": 0 }
O25 = self.addSwitch( 'HSTNTX01', dpid='0000ffffffffff19', annotations=o25ann, cls=OpticalSwitch )
O25 = self.addSwitch( 'HSTNTX01', dpid='0000ffffffffff19', annotations=o25ann, cls=LINCSwitch )
o26ann = { "latitude": 30.33071, "longitude": -81.43, "optical.regens": 0 }
O26 = self.addSwitch( 'JCVLFLCL', dpid='0000ffffffffff1a', annotations=o26ann, cls=OpticalSwitch )
O26 = self.addSwitch( 'JCVLFLCL', dpid='0000ffffffffff1a', annotations=o26ann, cls=LINCSwitch )
o27ann = { "latitude": 39.096649, "longitude": -94.578716, "optical.regens": 0 }
O27 = self.addSwitch( 'KSCYMO09', dpid='0000ffffffffff1b', annotations=o27ann, cls=OpticalSwitch )
O27 = self.addSwitch( 'KSCYMO09', dpid='0000ffffffffff1b', annotations=o27ann, cls=LINCSwitch )
o28ann = { "latitude": 40.5899999,"longitude": -73.6699993, "optical.regens": 0 }
O28 = self.addSwitch( 'LGISLAND', dpid='0000ffffffffff1c', annotations=o28ann, cls=OpticalSwitch )
O28 = self.addSwitch( 'LGISLAND', dpid='0000ffffffffff1c', annotations=o28ann, cls=LINCSwitch )
o29ann = { "latitude": 34.051227, "longitude": -118.252958, "optical.regens": 0 }
O29 = self.addSwitch( 'LSANCA03', dpid='0000ffffffffff1d', annotations=o29ann, cls=OpticalSwitch ) # LSANCA03 Connected to packet node
O29 = self.addSwitch( 'LSANCA03', dpid='0000ffffffffff1d', annotations=o29ann, cls=LINCSwitch ) # LSANCA03 Connected to packet node
o30ann = { "latitude": 36.168056, "longitude": -115.138889, "optical.regens": 0 }
O30 = self.addSwitch( 'LSVGNV02', dpid='0000ffffffffff1e', annotations=o30ann, cls=OpticalSwitch )
O30 = self.addSwitch( 'LSVGNV02', dpid='0000ffffffffff1e', annotations=o30ann, cls=LINCSwitch )
o31ann = { "latitude":38.249167, "longitude": -85.760833, "optical.regens": 0 }
O31 = self.addSwitch( 'LSVLKYCS', dpid='0000ffffffffff1f', annotations=o31ann, cls=OpticalSwitch )
O31 = self.addSwitch( 'LSVLKYCS', dpid='0000ffffffffff1f', annotations=o31ann, cls=LINCSwitch )
o32ann = { "latitude": 34.740833, "longitude": -92.271942, "optical.regens": 2 }
O32 = self.addSwitch( 'LTRKARFR', dpid='0000ffffffffff20', annotations=o32ann, cls=OpticalSwitch )
O32 = self.addSwitch( 'LTRKARFR', dpid='0000ffffffffff20', annotations=o32ann, cls=LINCSwitch )
o33ann = { "latitude": 25.779167, "longitude": -80.195, "optical.regens": 0 }
O33 = self.addSwitch( 'MIAMFLAC', dpid='0000ffffffffff21', annotations=o33ann, cls=OpticalSwitch )
O33 = self.addSwitch( 'MIAMFLAC', dpid='0000ffffffffff21', annotations=o33ann, cls=LINCSwitch )
o34ann = { "latitude": 43.037224, "longitude": -87.922501, "optical.regens": 0 }
O34 = self.addSwitch( 'MILWWIHE', dpid='0000ffffffffff22', annotations=o34ann, cls=OpticalSwitch )
O34 = self.addSwitch( 'MILWWIHE', dpid='0000ffffffffff22', annotations=o34ann, cls=LINCSwitch )
o35ann = { "latitude": 35.145158, "longitude": -90.048058, "optical.regens": 0 }
O35 = self.addSwitch( 'MMPHTNMA', dpid='0000ffffffffff23', annotations=o35ann, cls=OpticalSwitch )
O35 = self.addSwitch( 'MMPHTNMA', dpid='0000ffffffffff23', annotations=o35ann, cls=LINCSwitch )
o36ann = { "latitude": 44.977365, "longitude": -93.26718, "optical.regens": 0 }
O36 = self.addSwitch( 'MPLSMNDT', dpid='0000ffffffffff24', annotations=o36ann, cls=OpticalSwitch ) # MPLSMNDT Connected to packet node
O36 = self.addSwitch( 'MPLSMNDT', dpid='0000ffffffffff24', annotations=o36ann, cls=LINCSwitch ) # MPLSMNDT Connected to packet node
o37ann = { "latitude": 36.853333, "longitude": -76.29, "optical.regens": 0 }
O37 = self.addSwitch( 'NRFLVABS', dpid='0000ffffffffff25', annotations=o37ann, cls=OpticalSwitch )
O37 = self.addSwitch( 'NRFLVABS', dpid='0000ffffffffff25', annotations=o37ann, cls=LINCSwitch )
o38ann = { "latitude": 36.163955, "longitude": -86.775558, "optical.regens": 0 }
O38 = self.addSwitch( 'NSVLTNMT', dpid='0000ffffffffff26', annotations=o38ann, cls=OpticalSwitch )
O38 = self.addSwitch( 'NSVLTNMT', dpid='0000ffffffffff26', annotations=o38ann, cls=LINCSwitch )
o39ann = { "latitude": 29.949806, "longitude": -90.07222, "optical.regens": 0 }
O39 = self.addSwitch( 'NWORLAMA', dpid='0000ffffffffff27', annotations=o39ann, cls=OpticalSwitch )
O39 = self.addSwitch( 'NWORLAMA', dpid='0000ffffffffff27', annotations=o39ann, cls=LINCSwitch )
o40ann = { "latitude": 40.734408, "longitude": -74.177978, "optical.regens": 0 }
O40 = self.addSwitch( 'NWRKNJ02', dpid='0000ffffffffff28', annotations=o40ann, cls=OpticalSwitch ) # NWRKNJ02 Connected to packet node
O40 = self.addSwitch( 'NWRKNJ02', dpid='0000ffffffffff28', annotations=o40ann, cls=LINCSwitch ) # NWRKNJ02 Connected to packet node
o41ann = { "latitude": 40.767497, "longitude": -73.989713, "optical.regens": 0 }
O41 = self.addSwitch( 'NYCMNY54', dpid='0000ffffffffff29', annotations=o41ann, cls=OpticalSwitch )
O41 = self.addSwitch( 'NYCMNY54', dpid='0000ffffffffff29', annotations=o41ann, cls=LINCSwitch )
o42ann = { "latitude": 35.470833, "longitude": -97.515274, "optical.regens": 0 }
O42 = self.addSwitch( 'OKCYOKCE', dpid='0000ffffffffff2a', annotations=o42ann, cls=OpticalSwitch )
O42 = self.addSwitch( 'OKCYOKCE', dpid='0000ffffffffff2a', annotations=o42ann, cls=LINCSwitch )
o43ann = { "latitude": 37.805556, "longitude": -122.268889, "optical.regens": 2 }
O43 = self.addSwitch( 'OKLDCA03', dpid='0000ffffffffff2b', annotations=o43ann, cls=OpticalSwitch )
O43 = self.addSwitch( 'OKLDCA03', dpid='0000ffffffffff2b', annotations=o43ann, cls=LINCSwitch )
o44ann = { "latitude": 41.259167, "longitude":-95.940277, "optical.regens": 0 }
O44 = self.addSwitch( 'OMAHNENW', dpid='0000ffffffffff2c', annotations=o44ann, cls=OpticalSwitch )
O44 = self.addSwitch( 'OMAHNENW', dpid='0000ffffffffff2c', annotations=o44ann, cls=LINCSwitch )
o45ann = { "latitude": 28.543279, "longitude": -81.377502, "optical.regens": 0 }
O45 = self.addSwitch( 'ORLDFLMA', dpid='0000ffffffffff2d', annotations=o45ann, cls=OpticalSwitch ) # ORLDFLMA Connected to packet node
O45 = self.addSwitch( 'ORLDFLMA', dpid='0000ffffffffff2d', annotations=o45ann, cls=LINCSwitch ) # ORLDFLMA Connected to packet node
o46ann = { "latitude": 39.946446, "longitude": -75.184139, "optical.regens": 0 }
O46 = self.addSwitch( 'PHLAPASL', dpid='0000ffffffffff2e', annotations=o46ann, cls=OpticalSwitch )
O46 = self.addSwitch( 'PHLAPASL', dpid='0000ffffffffff2e', annotations=o46ann, cls=LINCSwitch )
o47ann = { "latitude": 33.450361, "longitude": -112.07709, "optical.regens": 0 }
O47 = self.addSwitch( 'PHNXAZMA', dpid='0000ffffffffff2f', annotations=o47ann, cls=OpticalSwitch ) # PHNXAZMA Connected to packet node
O47 = self.addSwitch( 'PHNXAZMA', dpid='0000ffffffffff2f', annotations=o47ann, cls=LINCSwitch ) # PHNXAZMA Connected to packet node
o48ann = { "latitude":40.441387, "longitude": -79.995552, "optical.regens": 0 }
O48 = self.addSwitch( 'PITBPADG', dpid='0000ffffffffff30', annotations=o48ann, cls=OpticalSwitch )
O48 = self.addSwitch( 'PITBPADG', dpid='0000ffffffffff30', annotations=o48ann, cls=LINCSwitch )
o49ann = { "latitude":41.818889, "longitude": -71.415278, "optical.regens": 0 }
O49 = self.addSwitch( 'PRVDRIGR', dpid='0000ffffffffff31', annotations=o49ann, cls=OpticalSwitch )
O49 = self.addSwitch( 'PRVDRIGR', dpid='0000ffffffffff31', annotations=o49ann, cls=LINCSwitch )
o50ann = { "latitude": 45.522499, "longitude": -122.678055, "optical.regens": 2 }
O50 = self.addSwitch( 'PTLDOR62', dpid='0000ffffffffff32', annotations=o50ann, cls=OpticalSwitch )
O50 = self.addSwitch( 'PTLDOR62', dpid='0000ffffffffff32', annotations=o50ann, cls=LINCSwitch )
o51ann = { "latitude": 37.540752, "longitude": -77.436096, "optical.regens": 0 }
O51 = self.addSwitch( 'RCMDVAGR', dpid='0000ffffffffff33', annotations=o51ann, cls=OpticalSwitch )
O51 = self.addSwitch( 'RCMDVAGR', dpid='0000ffffffffff33', annotations=o51ann, cls=LINCSwitch )
o52ann = { "latitude": 35.779656, "longitude": -78.640831, "optical.regens": 0 }
O52 = self.addSwitch( 'RLGHNCMO', dpid='0000ffffffffff34', annotations=o52ann, cls=OpticalSwitch )
O52 = self.addSwitch( 'RLGHNCMO', dpid='0000ffffffffff34', annotations=o52ann, cls=LINCSwitch )
o53ann = { "latitude": 43.157222, "longitude": -77.616389, "optical.regens": 0 }
O53 = self.addSwitch( 'ROCHNYXA', dpid='0000ffffffffff35', annotations=o53ann, cls=OpticalSwitch ) # ROCHNYXA Connected to packet node
O53 = self.addSwitch( 'ROCHNYXA', dpid='0000ffffffffff35', annotations=o53ann, cls=LINCSwitch ) # ROCHNYXA Connected to packet node
o54ann = { "latitude": 38.578609, "longitude": -121.487221, "optical.regens": 0 }
O54 = self.addSwitch( 'SCRMCA01', dpid='0000ffffffffff36', annotations=o54ann, cls=OpticalSwitch )
O54 = self.addSwitch( 'SCRMCA01', dpid='0000ffffffffff36', annotations=o54ann, cls=LINCSwitch )
o55ann = { "latitude": 41.415278, "longitude": -75.649167, "optical.regens": 0 }
O55 = self.addSwitch( 'SCTNPA01', dpid='0000ffffffffff37', annotations=o55ann, cls=OpticalSwitch )
O55 = self.addSwitch( 'SCTNPA01', dpid='0000ffffffffff37', annotations=o55ann, cls=LINCSwitch )
o56ann = { "latitude": 40.767776, "longitude": -111.888336, "optical.regens": 0 }
O56 = self.addSwitch( 'SLKCUTMA', dpid='0000ffffffffff38', annotations=o56ann, cls=OpticalSwitch )
O56 = self.addSwitch( 'SLKCUTMA', dpid='0000ffffffffff38', annotations=o56ann, cls=LINCSwitch )
o57ann = { "latitude": 29.429445, "longitude": -98.488892, "optical.regens": 0 }
O57 = self.addSwitch( 'SNANTXCA', dpid='0000ffffffffff39', annotations=o57ann, cls=OpticalSwitch ) # SNANTXCA Connected to packet node
O57 = self.addSwitch( 'SNANTXCA', dpid='0000ffffffffff39', annotations=o57ann, cls=LINCSwitch ) # SNANTXCA Connected to packet node
o58ann = { "latitude": 34.418889, "longitude": -119.7, "optical.regens": 0 }
O58 = self.addSwitch( 'SNBBCA01', dpid='0000ffffffffff3a', annotations=o58ann, cls=OpticalSwitch )
O58 = self.addSwitch( 'SNBBCA01', dpid='0000ffffffffff3a', annotations=o58ann, cls=LINCSwitch )
o59ann = { "latitude":32.746944, "longitude": -117.158611, "optical.regens": 0 }
O59 = self.addSwitch( 'SNDGCA02', dpid='0000ffffffffff3b', annotations=o59ann, cls=OpticalSwitch )
O59 = self.addSwitch( 'SNDGCA02', dpid='0000ffffffffff3b', annotations=o59ann, cls=LINCSwitch )
o60ann = { "latitude":37.785143, "longitude": -122.397263, "optical.regens": 0 }
O60 = self.addSwitch( 'SNFCCA21', dpid='0000ffffffffff3c', annotations=o60ann, cls=OpticalSwitch )
O60 = self.addSwitch( 'SNFCCA21', dpid='0000ffffffffff3c', annotations=o60ann, cls=LINCSwitch )
o61ann = { "latitude": 37.333333, "longitude": -121.892778, "optical.regens": 0 }
O61 = self.addSwitch( 'SNJSCA02', dpid='0000ffffffffff3d', annotations=o61ann, cls=OpticalSwitch ) # SNJSCA02 Connected to packet node
O61 = self.addSwitch( 'SNJSCA02', dpid='0000ffffffffff3d', annotations=o61ann, cls=LINCSwitch ) # SNJSCA02 Connected to packet node
o62ann = { "latitude": 39.795278, "longitude": -89.649444, "optical.regens": 0 }
O62 = self.addSwitch( 'SPFDILSD', dpid='0000ffffffffff3e', annotations=o62ann, cls=OpticalSwitch )
O62 = self.addSwitch( 'SPFDILSD', dpid='0000ffffffffff3e', annotations=o62ann, cls=LINCSwitch )
o63ann = { "latitude": 47.654724, "longitude": -117.419167, "optical.regens": 0 }
O63 = self.addSwitch( 'SPKNWA01', dpid='0000ffffffffff3f', annotations=o63ann, cls=OpticalSwitch )
O63 = self.addSwitch( 'SPKNWA01', dpid='0000ffffffffff3f', annotations=o63ann, cls=LINCSwitch )
o64ann = { "latitude": 38.633335, "longitude": -90.215279, "optical.regens": 0 }
O64 = self.addSwitch( 'STLSMO09', dpid='0000ffffffffff40', annotations=o64ann, cls=OpticalSwitch )
O64 = self.addSwitch( 'STLSMO09', dpid='0000ffffffffff40', annotations=o64ann, cls=LINCSwitch )
o65ann = { "latitude": 47.606945, "longitude": -122.333336, "optical.regens": 0 }
O65 = self.addSwitch( 'STTLWA06', dpid='0000ffffffffff41', annotations=o65ann, cls=OpticalSwitch )
O65 = self.addSwitch( 'STTLWA06', dpid='0000ffffffffff41', annotations=o65ann, cls=LINCSwitch )
o66ann = { "latitude": 43.049444, "longitude": -76.1475, "optical.regens": 3 }
O66 = self.addSwitch( 'SYRCNYSU', dpid='0000ffffffffff42', annotations=o66ann, cls=OpticalSwitch )
O66 = self.addSwitch( 'SYRCNYSU', dpid='0000ffffffffff42', annotations=o66ann, cls=LINCSwitch )
o67ann = { "latitude": 28.0225, "longitude": -82.522778, "optical.regens": 0 }
O67 = self.addSwitch( 'TAMQFLFN', dpid='0000ffffffffff43', annotations=o67ann, cls=OpticalSwitch )
O67 = self.addSwitch( 'TAMQFLFN', dpid='0000ffffffffff43', annotations=o67ann, cls=LINCSwitch )
o68ann = { "latitude": 32.224444, "longitude": -110.968333, "optical.regens": 0 }
O68 = self.addSwitch( 'TCSNAZMA', dpid='0000ffffffffff44', annotations=o68ann, cls=OpticalSwitch )
O68 = self.addSwitch( 'TCSNAZMA', dpid='0000ffffffffff44', annotations=o68ann, cls=LINCSwitch )
o69ann = { "latitude": 30.456389, "longitude": -84.290833, "optical.regens": 0 }
O69 = self.addSwitch( 'TLHSFLAT', dpid='0000ffffffffff45', annotations=o69ann, cls=OpticalSwitch )
O69 = self.addSwitch( 'TLHSFLAT', dpid='0000ffffffffff45', annotations=o69ann, cls=LINCSwitch )
o70ann = { "latitude": 41.65, "longitude": -83.538056, "optical.regens": 2 }
O70 = self.addSwitch( 'TOLDOH21', dpid='0000ffffffffff46', annotations=o70ann, cls=OpticalSwitch )
O70 = self.addSwitch( 'TOLDOH21', dpid='0000ffffffffff46', annotations=o70ann, cls=LINCSwitch )
o71ann = { "latitude": 36.151669, "longitude": -95.985832, "optical.regens": 0 }
O71 = self.addSwitch( 'TULSOKTB', dpid='0000ffffffffff47', annotations=o71ann, cls=OpticalSwitch )
O71 = self.addSwitch( 'TULSOKTB', dpid='0000ffffffffff47', annotations=o71ann, cls=LINCSwitch )
o72ann = { "latitude": 38.88306 , "longitude": -77.01028, "optical.regens": 0 }
O72 = self.addSwitch( 'WASHDCSW', dpid='0000ffffffffff48', annotations=o72ann, cls=OpticalSwitch ) # WASHDCSW Connected to packet node
O72 = self.addSwitch( 'WASHDCSW', dpid='0000ffffffffff48', annotations=o72ann, cls=LINCSwitch ) # WASHDCSW Connected to packet node
o73ann = { "latitude": 39.739167, "longitude": -75.553889, "optical.regens": 0 }
O73 = self.addSwitch( 'WLMGDE01', dpid='0000ffffffffff49', annotations=o73ann, cls=OpticalSwitch )
O73 = self.addSwitch( 'WLMGDE01', dpid='0000ffffffffff49', annotations=o73ann, cls=LINCSwitch )
o74ann = { "latitude": 26.709391, "longitude": -80.05278, "optical.regens": 0 }
O74 = self.addSwitch( 'WPBHFLAN', dpid='0000ffffffffff4a', annotations=o74ann, cls=OpticalSwitch )
O74 = self.addSwitch( 'WPBHFLAN', dpid='0000ffffffffff4a', annotations=o74ann, cls=LINCSwitch )
o75ann = { "latitude": 29.57, "longitude": -96.7, "optical.regens": 0 }
O75 = self.addSwitch( 'AUSTTXGR', dpid='0000ffffffffff4b', annotations=o75ann, cls=OpticalSwitch )
O75 = self.addSwitch( 'AUSTTXGR', dpid='0000ffffffffff4b', annotations=o75ann, cls=LINCSwitch )
#o25ann = { "latitude": 29.748333, "longitude": -95.36528, "optical.regens": 0 }
#o57ann = { "latitude": 29.429445, "longitude": -98.488892, "optical.regens": 0 }
......@@ -188,162 +188,162 @@ class BigOpticalTopo( Topo ):
# Optical Links between the ROADMs (although Distance is not used; we should keep these for future reference)
self.addLink( O1, O18, port1=100, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 334, "durable": "true" }, cls=OpticalLink ) # ABLNTXRO DLLSTXTL
self.addLink( O1, O21, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 768, "durable": "true" }, cls=OpticalLink ) # ABLNTXRO ELPSTXMA
self.addLink( O3, O16, port1=100, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 265, "durable": "true" }, cls=OpticalLink ) # ALBYNYSS CMBRMA01
self.addLink( O3, O66, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 239, "durable": "true" }, cls=OpticalLink ) # ALBYNYSS SYRCNYSU
self.addLink( O2, O18, port1=100, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1134, "durable": "true" }, cls=OpticalLink ) # ALBQNMMA DLLSTXTL
self.addLink( O2, O19, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 646, "durable": "true" }, cls=OpticalLink ) # ALBQNMMA DNVRCOMA
self.addLink( O2, O21, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 444, "durable": "true" }, cls=OpticalLink ) # ALBQNMMA ELPSTXMA
self.addLink( O2, O30, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 931, "durable": "true" }, cls=OpticalLink ) # ALBQNMMA LSVGNV02
self.addLink( O4, O8, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 271, "durable": "true" }, cls=OpticalLink ) # ATLNGATL BRHMALMT
self.addLink( O4, O12, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 436, "durable": "true" }, cls=OpticalLink ) # ATLNGATL CHRLNCCA
self.addLink( O4, O26, port1=103, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 566, "durable": "true" }, cls=OpticalLink ) # ATLNGATL JCVLFLCL
self.addLink( O75, O25, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 283, "durable": "true" }, cls=OpticalLink ) # AUSTTXGR HSTNTX01
self.addLink( O75, O57, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 141, "durable": "true" }, cls=OpticalLink ) # AUSTTXGR SNANTXCA
self.addLink( O7, O46, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 170, "durable": "true" }, cls=OpticalLink ) # BLTMMDCH PHLAPASL
self.addLink( O7, O48, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 378, "durable": "true" }, cls=OpticalLink ) # BLTMMDCH PITBPADG
self.addLink( O7, O70, port1=103, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 68, "durable": "true" }, cls=OpticalLink ) # BLTMMDCH WASHDCSW
self.addLink( O10, O25, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 491, "durable": "true" }, cls=OpticalLink ) # BTRGLAMA HSTNTX01
self.addLink( O10, O39, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 144, "durable": "true" }, cls=OpticalLink ) # BTRGLAMA NWORLAMA
self.addLink( O6, O9, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 724, "durable": "true" }, cls=OpticalLink ) # BLNGMTMA BSMRNDJC
self.addLink( O6, O19, port1=102, port2=107, annotations={ "optical.wves": 80, "optical.type": "WDM", "optical.kms": 875, "durable": "true" }, cls=OpticalLink ) # BLNGMTMA DNVRCOMA
self.addLink( O6, O63, port1=103, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 852, "durable": "true" }, cls=OpticalLink ) # BLNGMTMA SPKNWA01
self.addLink( O8, O38, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 353, "durable": "true" }, cls=OpticalLink ) # BRHMALMT NSVLTNMT
self.addLink( O8, O39, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 602, "durable": "true" }, cls=OpticalLink ) # BRHMALMT NWORLAMA
self.addLink( O9, O36, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 741, "durable": "true" }, cls=OpticalLink ) # BSMRNDJC MPLSMNDT
self.addLink( O16, O49, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 80, "durable": "true" }, cls=OpticalLink ) # CMBRMA01 PRVDRIGR
self.addLink( O5, O14, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 333, "durable": "true" }, cls=OpticalLink ) # BFLONYFR CLEVOH02
self.addLink( O5, O53, port1=104, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 128, "durable": "true" }, cls=OpticalLink ) # BFLONYFR ROCHNYXA
self.addLink( O13, O26, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 368, "durable": "true" }, cls=OpticalLink ) # CHTNSCDT JCVLFLCL
self.addLink( O13, O52, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 424, "durable": "true" }, cls=OpticalLink ) # CHTNSCDT RLGHNCMO
self.addLink( O12, O23, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 160, "durable": "true" }, cls=OpticalLink ) # CHRLNCCA GNBONCEU
self.addLink( O11, O20, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 458, "durable": "true" }, cls=OpticalLink ) # CHCGILCL DTRTMIBA
self.addLink( O11, O34, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 156, "durable": "true" }, cls=OpticalLink ) # CHCGILCL MILWWIHE
self.addLink( O11, O62, port1=103, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 344, "durable": "true" }, cls=OpticalLink ) # CHCGILCL SPFDILSD
self.addLink( O17, O15, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 194, "durable": "true" }, cls=OpticalLink ) # CNCNOHWS CLMBOH11
self.addLink( O17, O31, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 172, "durable": "true" }, cls=OpticalLink ) # CNCNOHWS LSVLKYCS
self.addLink( O17, O72, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 779, "durable": "true" }, cls=OpticalLink ) # CNCNOHWS WASHDCSW
self.addLink( O14, O15, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 243, "durable": "true" }, cls=OpticalLink ) # CLEVOH02 CLMBOH11
self.addLink( O14, O70, port1=102, port2=101, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 185, "durable": "true" }, cls=OpticalLink ) # CLEVOH02 TOLDOH21
self.addLink( O15, O48, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 312, "durable": "true" }, cls=OpticalLink ) # CLMBOH11 PITBPADG
self.addLink( O18, O25, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 437, "durable": "true" }, cls=OpticalLink ) # DLLSTXTL HSTNTX01
self.addLink( O18, O32, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 563, "durable": "true" }, cls=OpticalLink ) # DLLSTXTL LTRKARFR
self.addLink( O18, O42, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 365, "durable": "true" }, cls=OpticalLink ) # DLLSTXTL OKCYOKCE
self.addLink( O19, O44, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 940, "durable": "true" }, cls=OpticalLink ) # DNVRCOMA OMAHNENW
self.addLink( O19, O56, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 714, "durable": "true" }, cls=OpticalLink ) # DNVRCOMA SLKCUTMA
self.addLink( O20, O70, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 103, "durable": "true" }, cls=OpticalLink ) # DTRTMIBA TOLDOH21
self.addLink( O21, O57, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 969, "durable": "true" }, cls=OpticalLink ) # ELPSTXMA SNANTXCA
self.addLink( O21, O68, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 511, "durable": "true" }, cls=OpticalLink ) # ELPSTXMA TCSNAZMA
self.addLink( O22, O31, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 505, "durable": "true" }, cls=OpticalLink ) # FRSNCA01 LSVGNV02
self.addLink( O22, O29, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 396, "durable": "true" }, cls=OpticalLink ) # FRSNCA01 LSANCA03
self.addLink( O22, O42, port1=103, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 298, "durable": "true" }, cls=OpticalLink ) # FRSNCA01 OKLDCA03
self.addLink( O23, O31, port1=101, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 697, "durable": "true" }, cls=OpticalLink ) # GNBONCEU LSVLKYCS
self.addLink( O23, O52, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 130, "durable": "true" }, cls=OpticalLink ) # GNBONCEU RLGHNCMO
self.addLink( O23, O51, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 319, "durable": "true" }, cls=OpticalLink ) # GNBONCEU RCMDVAGR
self.addLink( O24, O28, port1=101, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 185, "durable": "true" }, cls=OpticalLink ) # HRFRCT03 L_Island
self.addLink( O24, O49, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 125, "durable": "true" }, cls=OpticalLink ) # HRFRCT03 PRVDRIGR
self.addLink( O26, O45, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 238, "durable": "true" }, cls=OpticalLink ) # JCVLFLCL ORLDFLMA
self.addLink( O27, O44, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 320, "durable": "true" }, cls=OpticalLink ) # KSCYMO09 OMAHNENW
self.addLink( O27, O64, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 457, "durable": "true" }, cls=OpticalLink ) # KSCYMO09 STLSMO09
self.addLink( O27, O71, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 420, "durable": "true" }, cls=OpticalLink ) # KSCYMO09 TULSOKTB
self.addLink( O30, O47, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 494, "durable": "true" }, cls=OpticalLink ) # LSVGNV02 PHNXAZMA
self.addLink( O30, O56, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 701, "durable": "true" }, cls=OpticalLink ) # LSVGNV02 SLKCUTMA
self.addLink( O32, O35, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 249, "durable": "true" }, cls=OpticalLink ) # LTRKARFR MMPHTNMA
self.addLink( O28, O41, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 40, "durable": "true" }, cls=OpticalLink ) # L_Island NYCMNY54
self.addLink( O29, O59, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 212, "durable": "true" }, cls=OpticalLink ) # LSANCA03 SNDGCA02
self.addLink( O29, O58, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 167, "durable": "true" }, cls=OpticalLink ) # LSANCA03 SNBBCA01
self.addLink( O31, O38, port1=104, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 298, "durable": "true" }, cls=OpticalLink ) # LSVLKYCS NSVLTNMT
self.addLink( O31, O64, port1=102, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 468, "durable": "true" }, cls=OpticalLink ) # LSVLKYCS STLSMO09
self.addLink( O35, O38, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 380, "durable": "true" }, cls=OpticalLink ) # MMPHTNMA NSVLTNMT
self.addLink( O33, O67, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 407, "durable": "true" }, cls=OpticalLink ) # MIAMFLAC TAMQFLFN
self.addLink( O33, O74, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 125, "durable": "true" }, cls=OpticalLink ) # MIAMFLAC WPBHFLAN
self.addLink( O34, O36, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 574, "durable": "true" }, cls=OpticalLink ) # MILWWIHE MPLSMNDT
self.addLink( O36, O44, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 560, "durable": "true" }, cls=OpticalLink ) # MPLSMNDT OMAHNENW
self.addLink( O39, O69, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 670, "durable": "true" }, cls=OpticalLink ) # NWORLAMA TLHSFLAT
self.addLink( O41, O40, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 19, "durable": "true" }, cls=OpticalLink ) # NYCMNY54 NWRKNJ02
self.addLink( O41, O55, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 187, "durable": "true" }, cls=OpticalLink ) # NYCMNY54 SCTNPA01
self.addLink( O41, O73, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 210, "durable": "true" }, cls=OpticalLink ) # NYCMNY54 WLMGDE01
self.addLink( O40, O46, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 146, "durable": "true" }, cls=OpticalLink ) # NWRKNJ02 PHLAPASL
self.addLink( O37, O52, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 290, "durable": "true" }, cls=OpticalLink ) # NRFLVABS RLGHNCMO
self.addLink( O37, O73, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 392, "durable": "true" }, cls=OpticalLink ) # NRFLVABS WLMGDE01
self.addLink( O43, O54, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 131, "durable": "true" }, cls=OpticalLink ) # OKLDCA03 SCRMCA01
self.addLink( O43, O56, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1142, "durable": "true" }, cls=OpticalLink ) # OKLDCA03 SLKCUTMA
self.addLink( O43, O60, port1=103, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 13, "durable": "true" }, cls=OpticalLink ) # OKLDCA03 SNFCCA21
self.addLink( O42, O71, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 188, "durable": "true" }, cls=OpticalLink ) # OKCYOKCE TULSOKTB
self.addLink( O45, O74, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 290, "durable": "true" }, cls=OpticalLink ) # ORLDFLMA WPBHFLAN
self.addLink( O46, O55, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 201, "durable": "true" }, cls=OpticalLink ) # PHLAPASL SCTNPA01
self.addLink( O47, O59, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 575, "durable": "true" }, cls=OpticalLink ) # PHNXAZMA SNDGCA02
self.addLink( O47, O68, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 205, "durable": "true" }, cls=OpticalLink ) # PHNXAZMA TCSNAZMA
self.addLink( O48, O55, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 457, "durable": "true" }, cls=OpticalLink ) # PITBPADG SCTNPA01
self.addLink( O50, O54, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 934, "durable": "true" }, cls=OpticalLink ) # PTLDOR62 SCRMCA01
self.addLink( O50, O56, port1=102, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1225, "durable": "true" }, cls=OpticalLink ) # PTLDOR62 SLKCUTMA
self.addLink( O50, O65, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 280, "durable": "true" }, cls=OpticalLink ) # PTLDOR62 STTLWA06
self.addLink( O51, O72, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 184, "durable": "true" }, cls=OpticalLink ) # RCMDVAGR WASHDCSW
self.addLink( O53, O66, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 143, "durable": "true" }, cls=OpticalLink ) # ROCHNYXA SYRCNYSU
self.addLink( O60, O61, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 80., "durable": "true" }, cls=OpticalLink ) # SNFCCA21 SNJSCA02
self.addLink( O61, O58, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 455, "durable": "true" }, cls=OpticalLink ) # SNJSCA02 SNBBCA01
self.addLink( O55, O66, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 223, "durable": "true" }, cls=OpticalLink ) # SCTNPA01 SYRCNYSU
self.addLink( O65, O63, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 442, "durable": "true" }, cls=OpticalLink ) # STTLWA06 SPKNWA01
self.addLink( O62, O64, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 165, "durable": "true" }, cls=OpticalLink ) # SPFDILSD STLSMO09
self.addLink( O69, O67, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 384, "durable": "true" }, cls=OpticalLink ) # TLHSFLAT TAMQFLFN
self.addLink( O1, O18, port1=100, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 334, "durable": "true" }, cls=LINCLink ) # ABLNTXRO DLLSTXTL
self.addLink( O1, O21, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 768, "durable": "true" }, cls=LINCLink ) # ABLNTXRO ELPSTXMA
self.addLink( O3, O16, port1=100, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 265, "durable": "true" }, cls=LINCLink ) # ALBYNYSS CMBRMA01
self.addLink( O3, O66, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 239, "durable": "true" }, cls=LINCLink ) # ALBYNYSS SYRCNYSU
self.addLink( O2, O18, port1=100, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1134, "durable": "true" }, cls=LINCLink ) # ALBQNMMA DLLSTXTL
self.addLink( O2, O19, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 646, "durable": "true" }, cls=LINCLink ) # ALBQNMMA DNVRCOMA
self.addLink( O2, O21, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 444, "durable": "true" }, cls=LINCLink ) # ALBQNMMA ELPSTXMA
self.addLink( O2, O30, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 931, "durable": "true" }, cls=LINCLink ) # ALBQNMMA LSVGNV02
self.addLink( O4, O8, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 271, "durable": "true" }, cls=LINCLink ) # ATLNGATL BRHMALMT
self.addLink( O4, O12, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 436, "durable": "true" }, cls=LINCLink ) # ATLNGATL CHRLNCCA
self.addLink( O4, O26, port1=103, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 566, "durable": "true" }, cls=LINCLink ) # ATLNGATL JCVLFLCL
self.addLink( O75, O25, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 283, "durable": "true" }, cls=LINCLink ) # AUSTTXGR HSTNTX01
self.addLink( O75, O57, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 141, "durable": "true" }, cls=LINCLink ) # AUSTTXGR SNANTXCA
self.addLink( O7, O46, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 170, "durable": "true" }, cls=LINCLink ) # BLTMMDCH PHLAPASL
self.addLink( O7, O48, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 378, "durable": "true" }, cls=LINCLink ) # BLTMMDCH PITBPADG
self.addLink( O7, O70, port1=103, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 68, "durable": "true" }, cls=LINCLink ) # BLTMMDCH WASHDCSW
self.addLink( O10, O25, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 491, "durable": "true" }, cls=LINCLink ) # BTRGLAMA HSTNTX01
self.addLink( O10, O39, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 144, "durable": "true" }, cls=LINCLink ) # BTRGLAMA NWORLAMA
self.addLink( O6, O9, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 724, "durable": "true" }, cls=LINCLink ) # BLNGMTMA BSMRNDJC
self.addLink( O6, O19, port1=102, port2=107, annotations={ "optical.wves": 80, "optical.type": "WDM", "optical.kms": 875, "durable": "true" }, cls=LINCLink ) # BLNGMTMA DNVRCOMA
self.addLink( O6, O63, port1=103, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 852, "durable": "true" }, cls=LINCLink ) # BLNGMTMA SPKNWA01
self.addLink( O8, O38, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 353, "durable": "true" }, cls=LINCLink ) # BRHMALMT NSVLTNMT
self.addLink( O8, O39, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 602, "durable": "true" }, cls=LINCLink ) # BRHMALMT NWORLAMA
self.addLink( O9, O36, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 741, "durable": "true" }, cls=LINCLink ) # BSMRNDJC MPLSMNDT
self.addLink( O16, O49, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 80, "durable": "true" }, cls=LINCLink ) # CMBRMA01 PRVDRIGR
self.addLink( O5, O14, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 333, "durable": "true" }, cls=LINCLink ) # BFLONYFR CLEVOH02
self.addLink( O5, O53, port1=104, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 128, "durable": "true" }, cls=LINCLink ) # BFLONYFR ROCHNYXA
self.addLink( O13, O26, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 368, "durable": "true" }, cls=LINCLink ) # CHTNSCDT JCVLFLCL
self.addLink( O13, O52, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 424, "durable": "true" }, cls=LINCLink ) # CHTNSCDT RLGHNCMO
self.addLink( O12, O23, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 160, "durable": "true" }, cls=LINCLink ) # CHRLNCCA GNBONCEU
self.addLink( O11, O20, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 458, "durable": "true" }, cls=LINCLink ) # CHCGILCL DTRTMIBA
self.addLink( O11, O34, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 156, "durable": "true" }, cls=LINCLink ) # CHCGILCL MILWWIHE
self.addLink( O11, O62, port1=103, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 344, "durable": "true" }, cls=LINCLink ) # CHCGILCL SPFDILSD
self.addLink( O17, O15, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 194, "durable": "true" }, cls=LINCLink ) # CNCNOHWS CLMBOH11
self.addLink( O17, O31, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 172, "durable": "true" }, cls=LINCLink ) # CNCNOHWS LSVLKYCS
self.addLink( O17, O72, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 779, "durable": "true" }, cls=LINCLink ) # CNCNOHWS WASHDCSW
self.addLink( O14, O15, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 243, "durable": "true" }, cls=LINCLink ) # CLEVOH02 CLMBOH11
self.addLink( O14, O70, port1=102, port2=101, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 185, "durable": "true" }, cls=LINCLink ) # CLEVOH02 TOLDOH21
self.addLink( O15, O48, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 312, "durable": "true" }, cls=LINCLink ) # CLMBOH11 PITBPADG
self.addLink( O18, O25, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 437, "durable": "true" }, cls=LINCLink ) # DLLSTXTL HSTNTX01
self.addLink( O18, O32, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 563, "durable": "true" }, cls=LINCLink ) # DLLSTXTL LTRKARFR
self.addLink( O18, O42, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 365, "durable": "true" }, cls=LINCLink ) # DLLSTXTL OKCYOKCE
self.addLink( O19, O44, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 940, "durable": "true" }, cls=LINCLink ) # DNVRCOMA OMAHNENW
self.addLink( O19, O56, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 714, "durable": "true" }, cls=LINCLink ) # DNVRCOMA SLKCUTMA
self.addLink( O20, O70, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 103, "durable": "true" }, cls=LINCLink ) # DTRTMIBA TOLDOH21
self.addLink( O21, O57, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 969, "durable": "true" }, cls=LINCLink ) # ELPSTXMA SNANTXCA
self.addLink( O21, O68, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 511, "durable": "true" }, cls=LINCLink ) # ELPSTXMA TCSNAZMA
self.addLink( O22, O31, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 505, "durable": "true" }, cls=LINCLink ) # FRSNCA01 LSVGNV02
self.addLink( O22, O29, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 396, "durable": "true" }, cls=LINCLink ) # FRSNCA01 LSANCA03
self.addLink( O22, O42, port1=103, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 298, "durable": "true" }, cls=LINCLink ) # FRSNCA01 OKLDCA03
self.addLink( O23, O31, port1=101, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 697, "durable": "true" }, cls=LINCLink ) # GNBONCEU LSVLKYCS
self.addLink( O23, O52, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 130, "durable": "true" }, cls=LINCLink ) # GNBONCEU RLGHNCMO
self.addLink( O23, O51, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 319, "durable": "true" }, cls=LINCLink ) # GNBONCEU RCMDVAGR
self.addLink( O24, O28, port1=101, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 185, "durable": "true" }, cls=LINCLink ) # HRFRCT03 L_Island
self.addLink( O24, O49, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 125, "durable": "true" }, cls=LINCLink ) # HRFRCT03 PRVDRIGR
self.addLink( O26, O45, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 238, "durable": "true" }, cls=LINCLink ) # JCVLFLCL ORLDFLMA
self.addLink( O27, O44, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 320, "durable": "true" }, cls=LINCLink ) # KSCYMO09 OMAHNENW
self.addLink( O27, O64, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 457, "durable": "true" }, cls=LINCLink ) # KSCYMO09 STLSMO09
self.addLink( O27, O71, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 420, "durable": "true" }, cls=LINCLink ) # KSCYMO09 TULSOKTB
self.addLink( O30, O47, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 494, "durable": "true" }, cls=LINCLink ) # LSVGNV02 PHNXAZMA
self.addLink( O30, O56, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 701, "durable": "true" }, cls=LINCLink ) # LSVGNV02 SLKCUTMA
self.addLink( O32, O35, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 249, "durable": "true" }, cls=LINCLink ) # LTRKARFR MMPHTNMA
self.addLink( O28, O41, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 40, "durable": "true" }, cls=LINCLink ) # L_Island NYCMNY54
self.addLink( O29, O59, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 212, "durable": "true" }, cls=LINCLink ) # LSANCA03 SNDGCA02
self.addLink( O29, O58, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 167, "durable": "true" }, cls=LINCLink ) # LSANCA03 SNBBCA01
self.addLink( O31, O38, port1=104, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 298, "durable": "true" }, cls=LINCLink ) # LSVLKYCS NSVLTNMT
self.addLink( O31, O64, port1=102, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 468, "durable": "true" }, cls=LINCLink ) # LSVLKYCS STLSMO09
self.addLink( O35, O38, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 380, "durable": "true" }, cls=LINCLink ) # MMPHTNMA NSVLTNMT
self.addLink( O33, O67, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 407, "durable": "true" }, cls=LINCLink ) # MIAMFLAC TAMQFLFN
self.addLink( O33, O74, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 125, "durable": "true" }, cls=LINCLink ) # MIAMFLAC WPBHFLAN
self.addLink( O34, O36, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 574, "durable": "true" }, cls=LINCLink ) # MILWWIHE MPLSMNDT
self.addLink( O36, O44, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 560, "durable": "true" }, cls=LINCLink ) # MPLSMNDT OMAHNENW
self.addLink( O39, O69, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 670, "durable": "true" }, cls=LINCLink ) # NWORLAMA TLHSFLAT
self.addLink( O41, O40, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 19, "durable": "true" }, cls=LINCLink ) # NYCMNY54 NWRKNJ02
self.addLink( O41, O55, port1=102, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 187, "durable": "true" }, cls=LINCLink ) # NYCMNY54 SCTNPA01
self.addLink( O41, O73, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 210, "durable": "true" }, cls=LINCLink ) # NYCMNY54 WLMGDE01
self.addLink( O40, O46, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 146, "durable": "true" }, cls=LINCLink ) # NWRKNJ02 PHLAPASL
self.addLink( O37, O52, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 290, "durable": "true" }, cls=LINCLink ) # NRFLVABS RLGHNCMO
self.addLink( O37, O73, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 392, "durable": "true" }, cls=LINCLink ) # NRFLVABS WLMGDE01
self.addLink( O43, O54, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 131, "durable": "true" }, cls=LINCLink ) # OKLDCA03 SCRMCA01
self.addLink( O43, O56, port1=102, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1142, "durable": "true" }, cls=LINCLink ) # OKLDCA03 SLKCUTMA
self.addLink( O43, O60, port1=103, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 13, "durable": "true" }, cls=LINCLink ) # OKLDCA03 SNFCCA21
self.addLink( O42, O71, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 188, "durable": "true" }, cls=LINCLink ) # OKCYOKCE TULSOKTB
self.addLink( O45, O74, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 290, "durable": "true" }, cls=LINCLink ) # ORLDFLMA WPBHFLAN
self.addLink( O46, O55, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 201, "durable": "true" }, cls=LINCLink ) # PHLAPASL SCTNPA01
self.addLink( O47, O59, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 575, "durable": "true" }, cls=LINCLink ) # PHNXAZMA SNDGCA02
self.addLink( O47, O68, port1=102, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 205, "durable": "true" }, cls=LINCLink ) # PHNXAZMA TCSNAZMA
self.addLink( O48, O55, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 457, "durable": "true" }, cls=LINCLink ) # PITBPADG SCTNPA01
self.addLink( O50, O54, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 934, "durable": "true" }, cls=LINCLink ) # PTLDOR62 SCRMCA01
self.addLink( O50, O56, port1=102, port2=108, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 1225, "durable": "true" }, cls=LINCLink ) # PTLDOR62 SLKCUTMA
self.addLink( O50, O65, port1=103, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 280, "durable": "true" }, cls=LINCLink ) # PTLDOR62 STTLWA06
self.addLink( O51, O72, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 184, "durable": "true" }, cls=LINCLink ) # RCMDVAGR WASHDCSW
self.addLink( O53, O66, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 143, "durable": "true" }, cls=LINCLink ) # ROCHNYXA SYRCNYSU
self.addLink( O60, O61, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 80., "durable": "true" }, cls=LINCLink ) # SNFCCA21 SNJSCA02
self.addLink( O61, O58, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 455, "durable": "true" }, cls=LINCLink ) # SNJSCA02 SNBBCA01
self.addLink( O55, O66, port1=101, port2=105, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 223, "durable": "true" }, cls=LINCLink ) # SCTNPA01 SYRCNYSU
self.addLink( O65, O63, port1=101, port2=107, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 442, "durable": "true" }, cls=LINCLink ) # STTLWA06 SPKNWA01
self.addLink( O62, O64, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 165, "durable": "true" }, cls=LINCLink ) # SPFDILSD STLSMO09
self.addLink( O69, O67, port1=101, port2=106, annotations={ "optical.waves": 80, "optical.type": "WDM", "optical.kms": 384, "durable": "true" }, cls=LINCLink ) # TLHSFLAT TAMQFLFN
# Packet/Optical cross connect links (this will be the tap interfaces)
self.addLink( WASHDCSWR, O72, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( WASHDCSWR, O72, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( WASHDCSWR, O72, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( WASHDCSWR, O72, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( WASHDCSWR, O72, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNJSCA02R, O61, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNJSCA02R, O61, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNJSCA02R, O61, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNJSCA02R, O61, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNJSCA02R, O61, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNANTXCAR, O57, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNANTXCAR, O57, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNANTXCAR, O57, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNANTXCAR, O57, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( SNANTXCAR, O57, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ROCHNYXAR, O53, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ROCHNYXAR, O53, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ROCHNYXAR, O53, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ROCHNYXAR, O53, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ROCHNYXAR, O53, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( PHNXAZMAR, O47, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( PHNXAZMAR, O47, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( PHNXAZMAR, O47, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( PHNXAZMAR, O47, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( PHNXAZMAR, O47, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ORLDFLMAR, O45, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ORLDFLMAR, O45, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ORLDFLMAR, O45, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ORLDFLMAR, O45, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ORLDFLMAR, O45, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( NWRKNJ02R, O40, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( NWRKNJ02R, O40, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( NWRKNJ02R, O40, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( NWRKNJ02R, O40, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( NWRKNJ02R, O40, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( MPLSMNDTR, O36, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( MPLSMNDTR, O36, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( MPLSMNDTR, O36, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( MPLSMNDTR, O36, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( MPLSMNDTR, O36, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( LSANCA03R, O29, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( LSANCA03R, O29, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( LSANCA03R, O29, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( LSANCA03R, O29, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( LSANCA03R, O29, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( DLLSTXTLR, O18, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( DLLSTXTLR, O18, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( DLLSTXTLR, O18, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( DLLSTXTLR, O18, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( DLLSTXTLR, O18, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ATLNGATLR, O4, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ATLNGATLR, O4, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ATLNGATLR, O4, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ATLNGATLR, O4, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( ATLNGATLR, O4, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=OpticalLink )
self.addLink( WASHDCSWR, O72, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( WASHDCSWR, O72, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( WASHDCSWR, O72, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( WASHDCSWR, O72, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( WASHDCSWR, O72, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNJSCA02R, O61, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNJSCA02R, O61, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNJSCA02R, O61, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNJSCA02R, O61, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNJSCA02R, O61, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNANTXCAR, O57, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNANTXCAR, O57, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNANTXCAR, O57, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNANTXCAR, O57, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( SNANTXCAR, O57, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ROCHNYXAR, O53, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ROCHNYXAR, O53, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ROCHNYXAR, O53, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ROCHNYXAR, O53, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ROCHNYXAR, O53, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( PHNXAZMAR, O47, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( PHNXAZMAR, O47, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( PHNXAZMAR, O47, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( PHNXAZMAR, O47, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( PHNXAZMAR, O47, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ORLDFLMAR, O45, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ORLDFLMAR, O45, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ORLDFLMAR, O45, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ORLDFLMAR, O45, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ORLDFLMAR, O45, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( NWRKNJ02R, O40, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( NWRKNJ02R, O40, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( NWRKNJ02R, O40, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( NWRKNJ02R, O40, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( NWRKNJ02R, O40, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( MPLSMNDTR, O36, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( MPLSMNDTR, O36, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( MPLSMNDTR, O36, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( MPLSMNDTR, O36, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( MPLSMNDTR, O36, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( LSANCA03R, O29, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( LSANCA03R, O29, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( LSANCA03R, O29, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( LSANCA03R, O29, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( LSANCA03R, O29, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( DLLSTXTLR, O18, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( DLLSTXTLR, O18, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( DLLSTXTLR, O18, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( DLLSTXTLR, O18, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( DLLSTXTLR, O18, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ATLNGATLR, O4, port1=2, port2=10, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ATLNGATLR, O4, port1=3, port2=11, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ATLNGATLR, O4, port1=4, port2=12, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ATLNGATLR, O4, port1=5, port2=13, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
self.addLink( ATLNGATLR, O4, port1=6, port2=14, speed1=10000, annotations={ "bandwidth": 100000, "optical.type": "cross-connect", "durable": "true" }, cls=LINCLink )
# Attach hosts to the packet layer switches
......@@ -379,7 +379,7 @@ if __name__ == '__main__':
if len( sys.argv ) >= 2:
controllers = sys.argv[1:]
else:
print 'Usage: ./opticalUtils.py (<Controller IP>)+'
print 'Usage: sudo -E python opticalTestBig.py (<Controller IP>)+'
print 'Using localhost...\n'
controllers = [ '127.0.0.1' ]
......
......@@ -4,7 +4,7 @@
Notes:
This file contains classes and methods useful for integrating LincOE with Mininet,
such as startOE, stopOE, OpticalLink, and OpticalSwitch
such as startOE, stopOE, LINCLink, and OpticalSwitch
- $ONOS_ROOT ust be set
- Need to run with sudo -E to preserve ONOS_ROOT env var
......@@ -22,10 +22,10 @@ such as startOE, stopOE, OpticalLink, and OpticalSwitch
Usage:
------------
- import OpticalLink and OpticalSwitch from this module
- import LINCLink and OpticalSwitch from this module
- import startOE and stopOE from this module
- create topology as you would a normal topology. when
to an optical switch with topo.addLink, always specify cls=OpticalLink
to an optical switch with topo.addLink, always specify cls=LINCLink
- when creating an optical switch, use cls=OpticalSwitch in topo.addSwitch
- for annotations on links and switches, a dictionary must be passed in as
the annotations argument
......@@ -51,7 +51,7 @@ switches have been started, the new Mininet start() method should also push the
Topology configuration file to ONOS.
'''
import sys
import re
import json
import os
......@@ -65,25 +65,123 @@ from mininet.log import setLogLevel, info, error, warn
from mininet.link import Link, Intf
from mininet.cli import CLI
class OpticalSwitch( Switch ):
def __init__( self, name, dpid=None, allowed=True,
switchType='ROADM', annotations={}, **params ):
class OpticalSwitch(Switch):
"""
For now, same as Switch class.
"""
pass
class OpticalIntf(Intf):
"""
For now,same as Intf class.
"""
pass
class OpticalLink(Link):
"""
For now, same as Link.
"""
pass
class LINCSwitch(OpticalSwitch):
"""
LINCSwitch class
"""
# FIXME:Sometimes LINC doesn't remove pipes and on restart increase the pipe
# number from erlang.pipe.1.* to erlang.pipe.2.*, so should read and write
# from latest pipe files. For now we are removing all the pipes before
# starting LINC.
### User Name ###
user = os.getlogin()
### pipes ###
readPipe = "/tmp/home/{}/linc-oe/rel/linc/erlang.pipe.1.r".format(user)
writePipe = "/tmp/home/{}/linc-oe/rel/linc/erlang.pipe.1.w".format(user)
### sys.config path ###
sysConfig = "/home/{}/linc-oe/rel/linc/releases/1.0/sys.config".format(user)
### method, mapping dpid to LINC switchId ###
@staticmethod
def dpids_to_ids(sysConfig):
'''
return the dict containing switch dpids as key and LINC switch id as values
'''
dpids_to_ids = {}
fd = None
try:
with open(sysConfig, 'r', 0) as fd:
switch_id = 1
for line in fd:
dpid = re.search(r'([0-9A-Fa-f]{2}[:-]){7}([0-9A-Fa-f]{2})+', line, re.I)
if dpid:
dpids_to_ids[dpid.group().replace(':', '')] = switch_id
switch_id += 1
return dpids_to_ids
except:
print "Error working with {}\nError: {}\n".format(sysConfig, sys.exc_info())
fd.close()
return None
### dict of containing dpids as key and corresponding LINC switchId as values ###
dpidsToLINCSwitchId = dpids_to_ids.__func__(sysConfig)
@staticmethod
def findDir(directory, userName):
"finds and returns the path of any directory in the user's home directory"
homeDir = '/home/' + userName
Dir = quietRun('find %s -maxdepth 1 -name %s -type d' % (homeDir, directory)).strip('\n')
DirList = Dir.split('\n')
if not Dir:
return None
elif len(DirList) > 1 :
warn('***WARNING: Found multiple instances of %s; using %s\n'
% (directory, DirList[ 0 ]))
return DirList[ 0 ]
else:
return Dir
### ONOS Directory ###
try:
onosDir = os.environ[ 'ONOS_ROOT' ]
except:
onosDir = findDir('onos', user)
if not onosDir:
error('Please set ONOS_ROOT environment variable!\n')
else:
os.environ[ 'ONOS_ROOT' ] = onosDir
### LINC-directory
lincDir = findDir.__func__('linc-oe', user)
if not lincDir:
error("***ERROR: Could not find linc-oe in user's home directory\n")
### LINC config generator directory###
configGen = findDir.__func__('LINC-config-generator', user)
if not configGen:
error("***ERROR: Could not find LINC-config-generator in user's home directory\n")
# list of all the controllers
controllers = None
def __init__(self, name, dpid=None, allowed=True,
switchType='ROADM', topo=None, annotations={}, controller=None, **params):
params[ 'inNamespace' ] = False
Switch.__init__( self, name, dpid=dpid, **params )
Switch.__init__(self, name, dpid=dpid, **params)
self.name = name
self.annotations = annotations
self.allowed = allowed
self.switchType = switchType
self.configDict = {} # dictionary that holds all of the JSON configuration data
def start( self, *opts, **params ):
self.configDict = {} # dictionary that holds all of the JSON configuration data
self.crossConnects = []
self.deletedCrossConnects = []
self.controller = controller
self.lincId = self._get_linc_id() # use to communicate with LINC
self.lincStarted = False
def start(self, *opts, **params):
'''Instead of starting a virtual switch, we build the JSON
dictionary for the emulated optical switch'''
# TODO:Once LINC has the ability to spawn network element dynamically
# we need to use this method to spawn new logical LINC switch rather then
# bulding JSON.
# if LINC is started then we can start and stop logical switches else create JSON
if self.lincStarted:
return self.start_oe()
self.configDict[ 'uri' ] = 'of:' + self.dpid
self.configDict[ 'annotations' ] = self.annotations
self.configDict[ 'annotations' ].setdefault( 'name', self.name )
self.configDict[ 'hw' ] = 'OE'
self.configDict[ 'annotations' ].setdefault('name', self.name)
self.configDict[ 'hw' ] = 'LINC-OE'
self.configDict[ 'mfr' ] = 'Linc'
self.configDict[ 'mac' ] = 'ffffffffffff' + self.dpid[-2] + self.dpid[-1]
self.configDict[ 'type' ] = self.switchType
......@@ -92,74 +190,417 @@ class OpticalSwitch( Switch ):
if intf.name == 'lo':
continue
else:
self.configDict[ 'ports' ].append( intf.json() )
self.configDict[ 'ports' ].append(intf.json())
self.lincStarted = True
def stop(self, deleteIntfs=False):
'''
stop the existing switch
'''
# TODO:Add support for deleteIntf
self.stop_oe()
def dpctl( self, *args ):
"Run dpctl command: ignore for now"
pass
def write_to_cli(self, command):
'''
send command to LINC
'''
fd = None
try:
fd = open(self.writePipe, 'w', 0)
fd.write(command)
fd.close()
except:
print "Error working with {}\nError: {}\n".format(self.writePipe, sys.exc_info())
if fd:
fd.close()
def read_from_cli(self):
'''
read the output from the LINC CLI
'''
response = None
fd = None
try:
fd = open(self.readPipe, 'r', 0)
fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK) # for non-blocking read
# FIXME:Due to non-blocking read most for the time we read nothing
response = fd.read()
fd.close()
except :
# print "Error working with {}\nError: {}\n".format(self.readPipe, sys.exc_info())
if fd:
fd.close()
return response
def _get_linc_id(self):
'''
return the corresponding LINC switchId.
'''
return LINCSwitch.dpidsToLINCSwitchId.get(self.dpid)
#--------------------------------------------------------------------------
# LINC CLI commands
#--------------------------------------------------------------------------
def start_oe(self):
'''
start the existing LINC switch
'''
#starting Switch
cmd = "linc:start_switch({}).\r\n".format(self.lincId)
self.write_to_cli(cmd)
#hanlding taps interfaces related to the switch
crossConnectJSON = {}
linkConfig = []
for i in range(0,len(self.deletedCrossConnects)):
crossConnect = self.deletedCrossConnects.pop()
tap = None
if isinstance(crossConnect.intf1.node, LINCSwitch):
intf = crossConnect.intf2
tapPort = crossConnect.intf1.port
else:
intf = crossConnect.intf1
tapPort = crossConnect.intf2.port
tap = LINCSwitch.findTap(self, tapPort)
if tap:
LINCSwitch.setupInts([tap])
intf.node.attach(tap)
self.crossConnects.append(crossConnect)
linkConfig.append(crossConnect.json())
#Sending crossConnect info to the ONOS.
crossConnectJSON['links'] = linkConfig
with open("crossConnect.json", 'w') as fd:
json.dump(crossConnectJSON, fd, indent=4, separators=(',', ': '))
info('*** Pushing crossConnect.json to ONOS\n')
output = quietRun('%s/tools/test/bin/onos-topo-cfg %s\
Topology.json' % (self.onosDir, self.controllers[ 0 ].ip), shell=True)
def stop_oe(self):
'''
stop the existing LINC switch
'''
cmd = "linc:stop_switch({}).\r\n".format(self.lincId)
self.write_to_cli(cmd)
#handling taps if any
for i in range(0, len(self.crossConnects)):
crossConnect = self.crossConnects.pop()
if isinstance(crossConnect.intf1.node, LINCSwitch):
intf = crossConnect.intf2
tapPort = crossConnect.intf1.port
else:
intf = crossConnect.intf1
tapPort = crossConnect.intf2.port
intf.node.detach(LINCSwitch.findTap(self, tapPort))
self.deletedCrossConnects.append(crossConnect)
def w_port_up(self, port):
'''
port_up
'''
cmd = "linc:port_up({},{}).\r\n".format(self.lincId, port)
self.write_to_cli(cmd)
def w_port_down(self, port):
'''
port_down
'''
cmd = "linc:port_down({},{}).\r\n".format(self.lincId, port)
self.write_to_cli(cmd)
# helper functions
@staticmethod
def switchJSON(switch):
"Returns the json configuration for a packet switch"
configDict = {}
configDict[ 'uri' ] = 'of:' + switch.dpid
configDict[ 'mac' ] = quietRun('cat /sys/class/net/%s/address' % switch.name).strip('\n').translate(None, ':')
configDict[ 'hw' ] = 'PK' # FIXME what about OVS?
configDict[ 'mfr' ] = 'Linc' # FIXME what about OVS?
configDict[ 'type' ] = 'SWITCH' # FIXME what about OVS?
annotations = switch.params.get('annotations', {})
annotations.setdefault('name', switch.name)
configDict[ 'annotations' ] = annotations
ports = []
for port, intf in switch.intfs.items():
if intf.name == 'lo':
continue
portDict = {}
portDict[ 'port' ] = port
portDict[ 'type' ] = 'FIBER' if isinstance(intf.link, LINCLink) else 'COPPER'
intfList = [ intf.link.intf1, intf.link.intf2 ]
intfList.remove(intf)
portDict[ 'speed' ] = intfList[ 0 ].speed if isinstance(intf.link, LINCLink) else 0
ports.append(portDict)
configDict[ 'ports' ] = ports
return configDict
@staticmethod
def bootOE(net):
"Start the LINC optical emulator within a mininet instance"
opticalJSON = {}
linkConfig = []
devices = []
#setting up the controllers for LINCSwitch class
LINCSwitch.controllers = net.controllers
for switch in net.switches:
if isinstance(switch, OpticalSwitch):
devices.append(switch.json())
else:
devices.append(LINCSwitch.switchJSON(switch))
opticalJSON[ 'devices' ] = devices
for link in net.links:
if isinstance(link, LINCLink) :
linkConfig.append(link.json())
opticalJSON[ 'links' ] = linkConfig
info('*** Writing Topology.json file\n')
with open('Topology.json', 'w') as outfile:
json.dump(opticalJSON, outfile, indent=4, separators=(',', ': '))
info('*** Converting Topology.json to linc-oe format (TopoConfig.json) file\n')
output = quietRun('%s/tools/test/bin/onos-oecfg ./Topology.json > TopoConfig.json' % LINCSwitch.onosDir, shell=True)
if output:
error('***ERROR: Error creating topology file: %s ' % output + '\n')
return False
info('*** Creating sys.config...\n')
output = quietRun('%s/config_generator TopoConfig.json %s/sys.config.template %s %s'
% (LINCSwitch.configGen, LINCSwitch.configGen, LINCSwitch.controllers[ 0 ].ip, LINCSwitch.controllers[ 0 ].port), shell=True)
if output:
error('***ERROR: Error creating sys.config file: %s\n' % output)
return False
info ('*** Setting multiple controllers in sys.config...\n')
searchStr = '\[{"Switch.*$'
ctrlStr = ''
for index in range(len(LINCSwitch.controllers)):
ctrlStr += '{"Switch%d-Controller","%s",%d,tcp},' % (index, net.controllers[index].ip, net.controllers[index].port)
replaceStr = '[%s]},' % ctrlStr[:-1] # Cut off last comma
sedCmd = 'sed -i \'s/%s/%s/\' sys.config' % (searchStr, replaceStr)
output = quietRun(sedCmd, shell=True)
info('*** Copying sys.config to linc-oe directory: ', output + '\n')
output = quietRun('cp -v sys.config %s/rel/linc/releases/1.0/' % LINCSwitch.lincDir, shell=True).strip('\n')
info(output + '\n')
info('*** Adding taps and bringing them up...\n')
LINCSwitch.setupInts(LINCSwitch.getTaps())
info('*** removing pipes if any \n')
quietRun('rm /tmp/home/%s/linc-oe/rel/linc/*' % LINCSwitch.user, shell=True)
info('*** Starting linc OE...\n')
output = quietRun('%s/rel/linc/bin/linc start' % LINCSwitch.lincDir, shell=True)
if output:
error('***ERROR: LINC-OE: %s' % output + '\n')
quietRun('%s/rel/linc/bin/linc stop' % LINCSwitch.lincDir, shell=True)
return False
def json( self ):
info('*** Waiting for linc-oe to start...\n')
LINCSwitch.waitStarted(net)
info('*** Adding cross-connect (tap) interfaces to packet switches...\n')
for link in net.links:
if isinstance(link, LINCLink):
if link.annotations[ 'optical.type' ] == 'cross-connect':
for intf in [ link.intf1, link.intf2 ]:
if not isinstance(intf, LINCIntf):
intfList = [ intf.link.intf1, intf.link.intf2 ]
intfList.remove(intf)
intf2 = intfList[ 0 ]
intf.node.attach(LINCSwitch.findTap(intf2.node, intf2.node.ports[ intf2 ]))
info('*** Press ENTER to push Topology.json to onos...\n')
raw_input() # FIXME... we should eventually remove this
info('*** Pushing Topology.json to ONOS\n')
output = quietRun('%s/tools/test/bin/onos-topo-cfg %s Topology.json' % (LINCSwitch.onosDir, LINCSwitch.controllers[ 0 ].ip), shell=True)
# successful output contains the two characters '{}'
# if there is more output than this, there is an issue
if output.strip('{}'):
warn('***WARNING: Could not push topology file to ONOS: %s' % output)
@staticmethod
def waitStarted(net, timeout=None):
"wait until all tap interfaces are available"
tapCount = 0
time = 0
for link in net.links:
if isinstance(link, LINCLink):
if link.annotations[ 'optical.type' ] == 'cross-connect':
tapCount += 1
while True:
if str(tapCount) == quietRun('ip addr | grep tap | wc -l', shell=True).strip('\n'):
return True
if timeout:
if time >= timeout:
error('***ERROR: Linc OE did not start within %s seconds' % timeout)
return False
time += .5
sleep(.5)
@staticmethod
def shutdownOE():
"stop the optical emulator"
info('*** Stopping linc OE...\n')
quietRun('%s/rel/linc/bin/linc stop' % LINCSwitch.lincDir, shell=True)
@staticmethod
def setupInts(intfs):
'''
add taps and bring them up.
'''
for i in intfs:
quietRun('ip tuntap add dev %s mode tap' % i)
quietRun('ip link set dev %s up' % i)
info('*** Intf %s set\n' % i)
@staticmethod
def getTaps(path=None):
'''
return list of all the tops in sys.config
'''
if path is None:
path = '%s/rel/linc/releases/1.0/sys.config' % LINCSwitch.lincDir
fd = open(path, 'r', 0)
sys_data = fd.read()
taps = re.findall('tap\d+', sys_data)
fd.close()
return taps
@staticmethod
def findUser():
"Try to return logged-in (usually non-root) user"
try:
# If we're running sudo
return os.environ[ 'SUDO_USER' ]
except:
try:
# Logged-in user (if we have a tty)
return quietRun('who am i').split()[ 0 ]
except:
# Give up and return effective user
return quietRun('whoami')
@staticmethod
def findTap(node, port, path=None):
'''utility function to parse through a sys.config
file to find tap interfaces for a switch'''
switch = False
portLine = ''
intfLines = []
if path is None:
path = '%s/rel/linc/releases/1.0/sys.config' % LINCSwitch.lincDir
with open(path) as f:
for line in f:
if 'tap' in line:
intfLines.append(line)
if node.dpid in line.translate(None, ':'):
switch = True
continue
if switch:
if 'switch' in line:
switch = False
if 'port_no,%s}' % port in line:
portLine = line
break
if portLine:
m = re.search('port,\d+', portLine)
port = m.group(0).split(',')[ 1 ]
else:
error('***ERROR: Could not find any ports in sys.config\n')
return
for intfLine in intfLines:
if 'port,%s' % port in intfLine:
return re.findall('tap\d+', intfLine)[ 0 ]
def json(self):
"return json configuration dictionary for switch"
return self.configDict
def terminate( self ):
pass
class OpticalLink( Link ):
def terminate(self):
pass
def __init__( self, node1, node2, port1=None, port2=None, allowed=True,
class LINCLink(Link):
"""
LINC link class
"""
def __init__(self, node1, node2, port1=None, port2=None, allowed=True,
intfName1=None, intfName2=None, linkType='OPTICAL',
annotations={}, speed1=0, speed2=0, **params ):
annotations={}, speed1=0, speed2=0, **params):
"Creates a dummy link without a virtual ethernet pair."
self.allowed = allowed
self.annotations = annotations
self.linkType = linkType
self.port1 = port1
self.port2 = port2
params1 = { 'speed': speed1 }
params2 = { 'speed': speed2 }
if isinstance( node1, OpticalSwitch ):
cls1 = OpticalIntf
# self.isCrossConnect = True if self.annotations.get('optical.type') == 'cross-connect' else False
if isinstance(node1, LINCSwitch) and isinstance(node2, LINCSwitch):
self.isCrossConnect = False
else:
self.isCrossConnect = True
if isinstance(node1, LINCSwitch):
cls1 = LINCIntf
if self.isCrossConnect:
node1.crossConnects.append(self)
else:
cls1 = Intf
# bad hack to stop error message from appearing when we try to set up intf in a packet switch,
# and there is no interface there( because we do not run makeIntfPair ). This way, we just set lo up
intfName1 = 'lo'
if isinstance( node2, OpticalSwitch ):
cls2 = OpticalIntf
if isinstance(node2, LINCSwitch):
cls2 = LINCIntf
if self.isCrossConnect:
node2.crossConnects.append(self)
else:
cls2 = Intf
intfName2 = 'lo'
Link.__init__( self, node1, node2, port1=port1, port2=port2,
Link.__init__(self, node1, node2, port1=port1, port2=port2,
intfName1=intfName1, intfName2=intfName2, cls1=cls1,
cls2=cls2, params1=params1, params2=params2 )
cls2=cls2, params1=params1, params2=params2)
@classmethod
def makeIntfPair( _cls, intfName1, intfName2, *args, **kwargs ):
def makeIntfPair(_cls, intfName1, intfName2, *args, **kwargs):
pass
def json( self ):
def json(self):
"build and return the json configuration dictionary for this link"
configData = {}
configData[ 'src' ] = ( 'of:' + self.intf1.node.dpid +
'/%s' % self.intf1.node.ports[ self.intf1 ] )
configData[ 'dst' ] = ( 'of:' + self.intf2.node.dpid +
'/%s' % self.intf2.node.ports[ self.intf2 ] )
configData[ 'src' ] = ('of:' + self.intf1.node.dpid +
'/%s' % self.intf1.node.ports[ self.intf1 ])
configData[ 'dst' ] = ('of:' + self.intf2.node.dpid +
'/%s' % self.intf2.node.ports[ self.intf2 ])
configData[ 'type' ] = self.linkType
configData[ 'annotations' ] = self.annotations
return configData
class OpticalIntf( Intf ):
def __init__( self, name=None, node=None, speed=0,
port=None, link=None, **params ):
class LINCIntf(OpticalIntf):
"""
LINC interface class
"""
def __init__(self, name=None, node=None, speed=0,
port=None, link=None, **params):
self.node = node
self.speed = speed
self.port = port
self.link = link
self.name = name
node.addIntf( self, port=port )
node.addIntf(self, port=port)
self.params = params
self.ip = None
def json( self ):
def json(self):
"build and return the JSON information for this interface( not used right now )"
configDict = {}
configDict[ 'port' ] = self.port
......@@ -167,275 +608,34 @@ class OpticalIntf( Intf ):
configDict[ 'type' ] = 'FIBER'
return configDict
def config( self, *args, **kwargs ):
def config(self, *args, **kwargs):
"dont configure a dummy interface"
pass
def switchJSON( switch ):
"Returns the json configuration for a packet switch"
configDict = {}
configDict[ 'uri' ] = 'of:' + switch.dpid
configDict[ 'mac' ] = quietRun( 'cat /sys/class/net/%s/address' % switch.name ).strip( '\n' ).translate( None, ':' )
configDict[ 'hw' ] = 'PK' # FIXME what about OVS?
configDict[ 'mfr' ] = 'Linc' # FIXME what about OVS?
configDict[ 'type' ] = 'SWITCH' # FIXME what about OVS?
annotations = switch.params.get( 'annotations', {} )
annotations.setdefault( 'name', switch.name )
configDict[ 'annotations' ] = annotations
ports = []
for port, intf in switch.intfs.items():
if intf.name == 'lo':
continue
portDict = {}
portDict[ 'port' ] = port
portDict[ 'type' ] = 'FIBER' if isinstance( intf.link, OpticalLink ) else 'COPPER'
intfList = [ intf.link.intf1, intf.link.intf2 ]
intfList.remove( intf )
portDict[ 'speed' ] = intfList[ 0 ].speed if isinstance( intf.link, OpticalLink ) else 0
ports.append( portDict )
configDict[ 'ports' ] = ports
return configDict
def startOE( net ):
"Start the LINC optical emulator within a mininet instance"
opticalJSON = {}
linkConfig = []
devices = []
for switch in net.switches:
if isinstance( switch, OpticalSwitch ):
devices.append( switch.json() )
else:
devices.append( switchJSON( switch ) )
opticalJSON[ 'devices' ] = devices
for link in net.links:
if isinstance( link, OpticalLink ) :
linkConfig.append( link.json() )
opticalJSON[ 'links' ] = linkConfig
try:
onosDir = os.environ[ 'ONOS_ROOT' ]
except:
onosDir = findDir( 'onos' )
if not onosDir:
error( 'Please set ONOS_ROOT environment variable!\n' )
return False
else:
os.environ[ 'ONOS_ROOT' ] = onosDir
info( '*** Writing Topology.json file\n' )
with open( 'Topology.json', 'w' ) as outfile:
json.dump( opticalJSON, outfile, indent=4, separators=(',', ': ') )
info( '*** Converting Topology.json to linc-oe format (TopoConfig.json) file\n' )
output = quietRun( '%s/tools/test/bin/onos-oecfg ./Topology.json > TopoConfig.json' % onosDir, shell=True )
if output:
error( '***ERROR: Error creating topology file: %s ' % output + '\n' )
return False
info( '*** Creating sys.config...\n' )
configGen = findDir( 'LINC-config-generator' )
if not configGen:
error( "***ERROR: Could not find LINC-config-generator in user's home directory\n" )
return False
output = quietRun( '%s/config_generator TopoConfig.json %s/sys.config.template %s %s'
% ( configGen, configGen, net.controllers[ 0 ].ip, net.controllers[ 0 ].port ), shell=True )
if output:
error( '***ERROR: Error creating sys.config file: %s\n' % output )
return False
info ('*** Setting multiple controllers in sys.config...\n' )
searchStr = '\[{"Switch.*$'
ctrlStr = ''
for index in range(len(net.controllers)):
ctrlStr += '{"Switch%d-Controller","%s",%d,tcp},' % (index, net.controllers[index].ip, net.controllers[index].port)
replaceStr = '[%s]},' % ctrlStr[:-1] # Cut off last comma
sedCmd = 'sed -i \'s/%s/%s/\' sys.config' % (searchStr, replaceStr)
output = quietRun( sedCmd, shell=True )
info( '*** Copying sys.config to linc-oe directory: ', output + '\n' )
lincDir = findDir( 'linc-oe' )
if not lincDir:
error( "***ERROR: Could not find linc-oe in user's home directory\n" )
return False
output = quietRun( 'cp -v sys.config %s/rel/linc/releases/1.0/' % lincDir, shell=True ).strip( '\n' )
info( output + '\n' )
info( '*** Starting linc OE...\n' )
output = quietRun( '%s/rel/linc/bin/linc start' % lincDir, shell=True )
if output:
error( '***ERROR: LINC-OE: %s' % output + '\n' )
quietRun( '%s/rel/linc/bin/linc stop' % lincDir, shell=True )
return False
info( '*** Waiting for linc-oe to start...\n' )
waitStarted( net )
info( '*** Adding cross-connect (tap) interfaces to packet switches...\n' )
for link in net.links:
if isinstance( link, OpticalLink ):
if link.annotations[ 'optical.type' ] == 'cross-connect':
for intf in [ link.intf1, link.intf2 ]:
if not isinstance( intf, OpticalIntf ):
intfList = [ intf.link.intf1, intf.link.intf2 ]
intfList.remove( intf )
intf2 = intfList[ 0 ]
intf.node.attach( findTap( intf2.node, intf2.node.ports[ intf2 ] ) )
info( '*** Press ENTER to push Topology.json to onos...\n' )
raw_input() # FIXME... we should eventually remove this
info( '*** Pushing Topology.json to ONOS\n' )
output = quietRun( '%s/tools/test/bin/onos-topo-cfg %s Topology.json' % ( onosDir, net.controllers[ 0 ].ip ), shell=True )
# successful output contains the two characters '{}'
# if there is more output than this, there is an issue
if output.strip( '{}' ):
warn( '***WARNING: Could not push topology file to ONOS: %s' % output )
def waitStarted( net, timeout=None ):
"wait until all tap interfaces are available"
tapCount = 0
time = 0
for link in net.links:
if isinstance( link, OpticalLink ):
if link.annotations[ 'optical.type' ] == 'cross-connect':
tapCount += 1
while True:
if str( tapCount ) == quietRun( 'ip addr | grep tap | wc -l', shell=True ).strip( '\n' ):
return True
if timeout:
if time >= timeout:
error( '***ERROR: Linc OE did not start within %s seconds' % timeout )
return False
time += .5
sleep( .5 )
def stopOE():
"stop the optical emulator"
info( '*** Stopping linc OE...\n' )
lincDir = findDir( 'linc-oe' )
quietRun( '%s/rel/linc/bin/linc stop' % lincDir, shell=True )
def findDir( directory ):
"finds and returns the path of any directory in the user's home directory"
user = findUser()
homeDir = '/home/' + user
Dir = quietRun( 'find %s -maxdepth 1 -name %s -type d' % ( homeDir, directory ) ).strip( '\n' )
DirList = Dir.split( '\n' )
if not Dir:
return None
elif len( DirList ) > 1 :
warn( '***WARNING: Found multiple instances of %s; using %s\n'
% ( directory, DirList[ 0 ] ) )
return DirList[ 0 ]
else:
return Dir
def findUser():
"Try to return logged-in (usually non-root) user"
try:
# If we're running sudo
return os.environ[ 'SUDO_USER' ]
except:
try:
# Logged-in user (if we have a tty)
return quietRun( 'who am i' ).split()[ 0 ]
except:
# Give up and return effective user
return quietRun( 'whoami' )
def ifconfig(self, status):
"configure the status"
if status == "up":
return self.node.w_port_up(self.port)
elif status == "down":
return self.node.w_port_down(self.port)
def findTap( node, port, path=None ):
'''utility function to parse through a sys.config
file to find tap interfaces for a switch'''
switch=False
portLine = ''
intfLines = []
if path is None:
lincDir = findDir( 'linc-oe' )
if not lincDir:
error( '***ERROR: Could not find linc-oe in users home directory\n' )
return None
path = '%s/rel/linc/releases/1.0/sys.config' % lincDir
with open( path ) as f:
for line in f:
if 'tap' in line:
intfLines.append( line )
if node.dpid in line.translate( None, ':' ):
switch=True
continue
if switch:
if 'switch' in line:
switch = False
if 'port_no,%s}' % port in line:
portLine = line
break
if portLine:
m = re.search( 'port,\d+', portLine )
port = m.group( 0 ).split( ',' )[ 1 ]
else:
error( '***ERROR: Could not find any ports in sys.config\n' )
return
for intfLine in intfLines:
if 'port,%s' % port in intfLine:
return re.findall( 'tap\d+', intfLine )[ 0 ]
class MininetOE( Mininet ):
class MininetOE(Mininet):
"Mininet with Linc-OE support (starts and stops linc-oe)"
def start( self ):
Mininet.start( self )
startOE( self )
def start(self):
Mininet.start(self)
LINCSwitch.bootOE(self)
def stop( self ):
Mininet.stop( self )
stopOE()
def stop(self):
Mininet.stop(self)
LINCSwitch.shutdownOE()
def addControllers( self, controllers ):
def addControllers(self, controllers):
i = 0
for ctrl in controllers:
self.addController( RemoteController( 'c%d' % i, ip=ctrl ) )
class OpticalTestTopo( Topo ):
def build( self ):
opticalAnn = { 'optical.waves': 80, 'optical.type': "WDM", 'durable': True }
switchAnn = { 'bandwidth': 100000, 'optical.type': 'cross-connect', 'durable': True }
h1 = self.addHost( 'h1' )
h2 = self.addHost( 'h2' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
O4 = self.addSwitch( 'O4', cls=OpticalSwitch )
O5 = self.addSwitch( 'O5', cls=OpticalSwitch )
O6 = self.addSwitch( 'O6', cls=OpticalSwitch )
self.addLink( O4, O5, cls=OpticalLink, annotations=opticalAnn )
self.addLink( O5, O6, cls=OpticalLink, annotations=opticalAnn )
self.addLink( s1, O4, cls=OpticalLink, annotations=switchAnn )
self.addLink( s2, O6, cls=OpticalLink, annotations=switchAnn )
self.addLink( h1, s1 )
self.addLink( h2, s2 )
self.addController(RemoteController('c%d' % i, ip=ctrl))
i += 1
if __name__ == '__main__':
import sys
if len( sys.argv ) >= 2:
controllers = sys.argv[1:]
else:
print 'Usage: ./opticalUtils.py (<Controller IP>)+'
print 'Using localhost...\n'
controllers = [ '127.0.0.1' ]
setLogLevel( 'info' )
net = MininetOE( topo=OpticalTestTopo(), controller=None, autoSetMacs=True )
net.addControllers( controllers )
net.start()
CLI( net )
net.stop()
pass
......