Brian O'Connor

Adding more T-ports to big topo

Setting up bidirectional T-ports in OpticalPathProvisioner

Change-Id: I4e97b2eb53d3d4182aae9c98a227de982f492950
...@@ -192,7 +192,9 @@ public class OpticalPathProvisioner { ...@@ -192,7 +192,9 @@ public class OpticalPathProvisioner {
192 } 192 }
193 // provision both directions 193 // provision both directions
194 intents.addAll(getOpticalPath(one.location(), two.location())); 194 intents.addAll(getOpticalPath(one.location(), two.location()));
195 - intents.addAll(getOpticalPath(two.location(), one.location())); 195 + // note: bi-directional intent is set up
196 + // HostToHost Intent requires symmetric path!
197 + //intents.addAll(getOpticalPath(two.location(), one.location()));
196 } else if (intent instanceof PointToPointIntent) { 198 } else if (intent instanceof PointToPointIntent) {
197 PointToPointIntent p2pIntent = (PointToPointIntent) intent; 199 PointToPointIntent p2pIntent = (PointToPointIntent) intent;
198 intents.addAll(getOpticalPath(p2pIntent.ingressPoint(), p2pIntent.egressPoint())); 200 intents.addAll(getOpticalPath(p2pIntent.ingressPoint(), p2pIntent.egressPoint()));
...@@ -265,8 +267,13 @@ public class OpticalPathProvisioner { ...@@ -265,8 +267,13 @@ public class OpticalPathProvisioner {
265 Intent opticalIntent = new OpticalConnectivityIntent(appId, 267 Intent opticalIntent = new OpticalConnectivityIntent(appId,
266 srcWdmPoint, 268 srcWdmPoint,
267 dstWdmPoint); 269 dstWdmPoint);
270 + Intent opticalIntent2 = new OpticalConnectivityIntent(appId,
271 + dstWdmPoint,
272 + srcWdmPoint);
268 log.info("Creating optical intent from {} to {}", srcWdmPoint, dstWdmPoint); 273 log.info("Creating optical intent from {} to {}", srcWdmPoint, dstWdmPoint);
274 + log.info("Creating optical intent from {} to {}", dstWdmPoint, srcWdmPoint);
269 connectionList.add(opticalIntent); 275 connectionList.add(opticalIntent);
276 + connectionList.add(opticalIntent2);
270 277
271 break; 278 break;
272 } 279 }
......
...@@ -28,7 +28,7 @@ class SmallOpticalTopo( Topo ): ...@@ -28,7 +28,7 @@ class SmallOpticalTopo( Topo ):
28 o9ann = { "latitude": 40.8, "longitude": -73.1, "optical.regens": 0 } 28 o9ann = { "latitude": 40.8, "longitude": -73.1, "optical.regens": 0 }
29 O9 = self.addSwitch( 'JFK-M10', dpid='0000ffffffffff09', annotations=o9ann, cls=OpticalSwitch ) 29 O9 = self.addSwitch( 'JFK-M10', dpid='0000ffffffffff09', annotations=o9ann, cls=OpticalSwitch )
30 o10ann = { "latitude": 33.8, "longitude": -84.1, "optical.regens": 0 } 30 o10ann = { "latitude": 33.8, "longitude": -84.1, "optical.regens": 0 }
31 - O10 = self.addSwitch( 'ATL-S10', dpid='0000ffffffffff0A', annotations=o10ann, cls=OpticalSwitch ) 31 + O10 = self.addSwitch( 'ATL-S10', dpid='0000ffffffffff0a', annotations=o10ann, cls=OpticalSwitch )
32 32
33 33
34 SFOR10 = self.addSwitch( 'SFO-R10', dpid='0000ffffffff0001', annotations={"latitude": 37.6, "longitude": -122.3} ) 34 SFOR10 = self.addSwitch( 'SFO-R10', dpid='0000ffffffff0001', annotations={"latitude": 37.6, "longitude": -122.3} )
......
This diff is collapsed. Click to expand it.
...@@ -226,10 +226,11 @@ def startOE( net, controllerIP=None, controllerPort=None ): ...@@ -226,10 +226,11 @@ def startOE( net, controllerIP=None, controllerPort=None ):
226 onosDir = os.environ[ 'ONOS_ROOT' ] 226 onosDir = os.environ[ 'ONOS_ROOT' ]
227 except: 227 except:
228 onosDir = findDir( 'onos' ) 228 onosDir = findDir( 'onos' )
229 - os.environ[ 'ONOS_ROOT' ] = onosDir
230 if not onosDir: 229 if not onosDir:
231 error( 'Please set ONOS_ROOT environment variable!\n' ) 230 error( 'Please set ONOS_ROOT environment variable!\n' )
232 return False 231 return False
232 + else:
233 + os.environ[ 'ONOS_ROOT' ] = onosDir
233 234
234 info( '*** Writing Topology.json file\n' ) 235 info( '*** Writing Topology.json file\n' )
235 with open( 'Topology.json', 'w' ) as outfile: 236 with open( 'Topology.json', 'w' ) as outfile:
...@@ -281,7 +282,7 @@ def startOE( net, controllerIP=None, controllerPort=None ): ...@@ -281,7 +282,7 @@ def startOE( net, controllerIP=None, controllerPort=None ):
281 intf2 = intfList[ 0 ] 282 intf2 = intfList[ 0 ]
282 intf.node.attach( findTap( intf2.node, intf2.node.ports[ intf2 ] ) ) 283 intf.node.attach( findTap( intf2.node, intf2.node.ports[ intf2 ] ) )
283 284
284 - info( '*** Press any key to push Topology.json to onos...\n' ) 285 + info( '*** Press ENTER to push Topology.json to onos...\n' )
285 raw_input() # FIXME... we should eventually remove this 286 raw_input() # FIXME... we should eventually remove this
286 info( '*** Pushing Topology.json to ONOS\n' ) 287 info( '*** Pushing Topology.json to ONOS\n' )
287 output = quietRun( '%s/tools/test/bin/onos-topo-cfg %s Topology.json' % ( onosDir, controllerIP ), shell=True ) 288 output = quietRun( '%s/tools/test/bin/onos-topo-cfg %s Topology.json' % ( onosDir, controllerIP ), shell=True )
......