Merge pull request #106 from opennetworkinglab/devl/newOnosCHO

Devl/new onos cho
diff --git a/TestON/drivers/common/cli/emulator/lincoedriver.py b/TestON/drivers/common/cli/emulator/lincoedriver.py
index b1bc05a..0f22b28 100644
--- a/TestON/drivers/common/cli/emulator/lincoedriver.py
+++ b/TestON/drivers/common/cli/emulator/lincoedriver.py
@@ -207,6 +207,26 @@
             main.cleanup()
             main.exit()
 
+    def attachLincOESession( self ):
+        """
+            Since executing opticalTest.py will give you mininet
+            prompt, you would at some point require to get onto
+            console of LincOE ((linc@onosTestBench)1>) to execute
+            commands like bring a optical port up or down on a ROADM
+            You can attach to console of Linc-OE session by a cmd:
+            sudo ~/linc-oe/rel/linc/bin/linc attach
+        """
+        try:
+            self.handle.sendline( "" )
+            self.handle.expect( "\$" )
+            self.handle.sendline( "sudo ~/linc-oe/rel/linc/bin/linc attach" )
+            self.handle.expect( ">" )
+            return main.TRUE
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            return main.FALSE
+
     def listPorts( self, swId ):
         """
         List all ports of a switch by switch id
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index f96a60e..27c2d92 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -685,6 +685,46 @@
             main.cleanup()
             main.exit()
 
+    def onosCfgSet( self, ONOSIp, configName, configParam ):
+        """
+        Uses 'onos <node-ip> cfg set' to change a parameter value of an
+        application. 
+        
+        ex)
+            onos 10.0.0.1 cfg set org.onosproject.myapp appSetting 1
+
+        ONOSIp = '10.0.0.1'
+        configName = 'org.onosproject.myapp'
+        configParam = 'appSetting 1'
+
+        """
+        try:
+            cfgStr = ( "onos "+str(ONOSIp)+" cfg set "+
+                       str(configName) + " " +
+                       str(configParam)
+                     )
+
+            self.handle.sendline( "" )
+            self.handle.expect( "\$" )
+            self.handle.sendline( cfgStr )
+            self.handle.expect( "\$" )
+        
+            # TODO: Add meaningful assertion
+            
+            return main.TRUE
+
+        except pexpect.ExceptionPexpect as e:
+            main.log.error( self.name + ": Pexpect exception found of type " +
+                            str( type( e ) ) )
+            main.log.error ( e.get_trace() )
+            main.log.error( self.name + ":    " + self.handle.before )
+            main.cleanup()
+            main.exit()
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanup()
+            main.exit()
+
     def onosCli( self, ONOSIp, cmdstr ):
         """
         Uses 'onos' command to send various ONOS CLI arguments.
@@ -1294,13 +1334,14 @@
             main.cleanup()
             main.exit()
 
-    def tsharkGrep( self, grep, directory, interface='eth0' ):
+    def tsharkGrep( self, grep, directory, interface='eth0', grepOptions='' ):
         """
         Required:
             * grep string
             * directory to store results
         Optional:
             * interface - default: eth0
+            * grepOptions - options for grep 
         Description:
             Uses tshark command to grep specific group of packets
             and stores the results to specified directory.
@@ -1310,10 +1351,16 @@
             self.handle.sendline( "" )
             self.handle.expect( "\$" )
             self.handle.sendline( "" )
+            if grepOptions:
+                grepStr = "grep "+str(grepOptions)
+            else:
+                grepStr = "grep"
+            
             self.handle.sendline(
                 "tshark -i " +
                 str( interface ) +
-                " -t e | grep --line-buffered \"" +
+                " -t e | " +
+                grepStr + " --line-buffered \"" +
                 str(grep) +
                 "\" >" +
                 directory +
@@ -1802,7 +1849,7 @@
                 else:
                     time.sleep(1)
 
-            assert ("value=" + str(numPorts)) in verification and (" value=" + fileName) in verification
+            assert ("value=" + str(numPorts)) in verification and (" value=" + devicesString) in verification
         
         except AssertionError:
             main.log.error("Incorrect Config settings: " + verification)
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.params b/TestON/tests/IntentEventTP/IntentEventTP.params
index 7f355dc..6ea5285 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.params
+++ b/TestON/tests/IntentEventTP/IntentEventTP.params
@@ -1,15 +1,15 @@
 <PARAMS>
 
-    <testcases>1,3,2,3,2,3,2,3</testcases>
+    <testcases>1,2</testcases>
     
     <debugMode></debugMode>  #nothing means false 
 
     <ENV>
     <cellName>intentTP</cellName>
-    <cellFeatures>"webconsole,onos-core,onos-api,onos-cli,onos-null,onos-gui,onos-rest,onos-app-metrics,onos-app-metrics-intent,onos-app-metrics-topology"</cellFeatures>
+    <cellApps>null,intentperf</cellApps>
     </ENV>
 
-    <SCALE>2</SCALE>
+    <SCALE>1,3,5,7</SCALE>
     <availableNodes>7</availableNodes>
 
     <GIT>
@@ -20,41 +20,44 @@
     <CTRL> 
         <USER>admin</USER>
 
-        <ip1>10.254.1.201</ip1>
+        <ip1>10.128.5.51</ip1>
         <port1>6633</port1>
 
-        <ip2>10.254.1.202</ip2>
+        <ip2>10.128.5.52</ip2>
         <port2>6633</port2>
 
-        <ip3>10.254.1.203</ip3>
+        <ip3>10.128.5.53</ip3>
         <port3>6633</port3>
 
-        <ip4>10.254.1.204</ip4>
+        <ip4>10.128.5.54</ip4>
         <port4>6633</port4>
 
-        <ip5>10.254.1.205</ip5>
+        <ip5>10.128.5.65</ip5>
         <port5>6633</port5>
 
-        <ip6>10.254.1.206</ip6>
+        <ip6>10.128.5.66</ip6>
         <port6>6633</port6>
 
-         <ip7>10.254.1.207</ip7>
+         <ip7>10.128.5.67</ip7>
         <port7>6633</port7> 
     </CTRL>
 
-    <MN><ip1>10.254.1.200</ip1></MN>
+    <MN><ip1>10.128.5.55</ip1></MN>
 
     <BENCH>
         <user>admin</user>
-        <ip1>10.254.1.200</ip1>
+        <ip1>10.128.5.55</ip1>
     </BENCH>
 
     <TEST> 
         <loadFrom>1,1,1,1,1,1,1</loadFrom>                                     #generate load on server, 1 = generator on 
         <numSwitches>10,10,10,10,10,10,10</numSwitches>
         <skipCleanInstall>yes</skipCleanInstall>
-        <duration>600</duration>
-        <log_interval>20</log_interval>                            
+        <duration>15</duration>
+        <log_interval>20</log_interval>
+        <numKeys>5000</numKeys>
+        <cyclePeriod>1000</cyclePeriod>
+        <neighbors>0,a</neighbors>           #a == all nodes (-1)
     </TEST>
 
     <METRICS>
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.py b/TestON/tests/IntentEventTP/IntentEventTP.py
index 863599c..9a6f938 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.py
+++ b/TestON/tests/IntentEventTP/IntentEventTP.py
@@ -1,12 +1,11 @@
-# ScaleOutTemplate --> IntentEventTP
+# ScaleOutTemplate
 #
 # CASE1 starts number of nodes specified in param file
 #
 # cameron@onlab.us
 
 import sys
-import os
-import time
+import os.path
 
 
 class IntentEventTP:
@@ -14,210 +13,113 @@
     def __init__( self ):
         self.default = ''
 
-    def CASE1( self, main ):            #This is the initialization case
-        import os.path                  #this case will clean up all nodes 
-        import time                     #but only node 1 is started in this case
-        
-        global clusterCount             #number of nodes running
-        global ONOSIp                   #list of ONOS IP addresses 
-        clusterCount = 1
-        ONOSIp = [ 0 ]
-
+    def CASE1( self, main ):           
+                                        
+        import time                     
+        global init       
+        try: 
+            if type(init) is not bool: 
+                init = False  
+        except NameError: 
+            init = False 
+       
         #Load values from params file
         checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
         gitPull = main.params[ 'GIT' ][ 'autopull' ]
         cellName = main.params[ 'ENV' ][ 'cellName' ]
-        Features= main.params[ 'ENV' ][ 'cellFeatures' ]
+        Apps = main.params[ 'ENV' ][ 'cellApps' ]
         BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
         BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
         maxNodes = int(main.params[ 'availableNodes' ])
-        MNip = main.params[ 'MN' ][ 'ip1' ]
         skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]        
         numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
 
-        homeDir = os.path.expanduser('~')
-        
-        main.ONOSbench.handle.sendline("export TERM=vt100")
-        dump = main.ONOSbench.handle.expect(":~")
 
-        #Populate ONOSIp with ips from params 
-        for i in range(1, maxNodes + 1): 
-            ipString = 'ip' + str(i) 
-            ONOSIp.append(main.params[ 'CTRL' ][ ipString ])   
+        # ?? homeDir = os.path.expanduser('~')
+        # ?? main.ONOSbench.handle.sendline("export TERM=vt100")
+        # ?^ dump = main.ONOSbench.handle.expect(":~")        
+
+
+        # -- INIT SECTION, ONLY RUNS ONCE -- # 
+        if init == False: 
+            init = True
+            global clusterCount             #number of nodes running
+            global ONOSIp                   #list of ONOS IP addresses
+            global scale 
+            
+            clusterCount = 0
+            ONOSIp = [ 0 ]
+            scale = (main.params[ 'SCALE' ]).split(",")            
+            clusterCount = int(scale[0])
+
+            #Populate ONOSIp with ips from params 
+            for i in range(1, maxNodes + 1): 
+                ipString = 'ip' + str(i) 
+                ONOSIp.append(main.params[ 'CTRL' ][ ipString ])   
+            
+            #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+            if skipMvn != "yes":
+                mvnResult = main.ONOSbench.cleanInstall()
+
+            #git
+            main.step( "Git checkout and pull " + checkoutBranch )
+            if gitPull == 'on':
+                checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+                pullResult = main.ONOSbench.gitPull()
+
+            else:
+                checkoutResult = main.TRUE
+                pullResult = main.TRUE
+                main.log.info( "Skipped git checkout and pull" )
         
-        #kill off all onos processes
+        # -- END OF INIT SECTION --#
+         
+        clusterCount = int(scale[0])
+        scale.remove(scale[0])       
+        
+        #kill off all onos processes 
         main.log.step("Safety check, killing all ONOS processes")
         main.log.step("before initiating enviornment setup")
         for node in range(1, maxNodes + 1):
-            main.log.info("killing node " + str(node))
             main.ONOSbench.onosDie(ONOSIp[node])
-
-        #construct the cell file
-        main.log.info("Creating cell file")
-        exec "a = main.ONOSbench.createCellFile"
-        cellIp = []
-        for node in range (1, clusterCount + 1):
-            cellIp.append(ONOSIp[node])
-        a(BENCHIp,cellName,MNip,str(Features), *cellIp)   
-
-        main.step( "Set Cell" )
-        main.ONOSbench.setCell(cellName)
-
+        
         #Uninstall everywhere
         main.log.step( "Cleaning Enviornment..." )
         for i in range(1, maxNodes + 1):
             main.log.info(" Uninstalling ONOS " + str(i) )
             main.ONOSbench.onosUninstall( ONOSIp[i] )
+       
+        #construct the cell file
+        main.log.info("Creating cell file")
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+            cellIp.append(ONOSIp[node])
 
-        #git 
-        main.step( "Git checkout and pull " + checkoutBranch )
-        if gitPull == 'on':
-            checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
-            pullResult = main.ONOSbench.gitPull()
-        else:
-            checkoutResult = main.TRUE
-            pullResult = main.TRUE
-            main.log.info( "Skipped git checkout and pull" )
-        
-        #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
-        if skipMvn != "yes":
-            mvnResult = main.ONOSbench.cleanInstall()
- 
-        #null link
-        #null provider 
-        #linkgraph 
-        #intentPerf
+        main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
+
+        main.step( "Set Cell" )
+        main.ONOSbench.setCell(cellName)
 
         myDistribution = []
         for node in range (1, clusterCount + 1):
             myDistribution.append(numSwitches[node-1])
 
         main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution)
-        main.ONOSbench.createNullDevProviderFile( BENCHIp, cellIp, myDistribution)
-        main.ONOSbench.createNullLinkProviderFile(BENCHIp)
-
-        main.log.step("Writing IntentPerf config file") 
-        intentPerfConfig = open( homeDir + "/onos/tools/package/etc/org.onosproject.intentperf.IntentPerfInstaller.cfg", "w+")
-        intentPerfConfig.write("numKeys = 40000\n")        
-        intentPerfConfig.write("cyclePeriod = 1000\n")
-        intentPerfConfig.write("numNeighors = 0\n")
-        intentPerfConfig.close()
-        
+       
         main.step( "Creating ONOS package" )
         packageResult = main.ONOSbench.onosPackage()  
 
-        main.step( "Installing ONOS package" )
-        install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] )
-
         main.step( "verify cells" )
         verifyCellResult = main.ONOSbench.verifyCell()
-
-        main.step( "Checking if ONOS is up yet" )
-        for i in range( 2 ):
-            isup = main.ONOSbench.isup( ONOSIp[1] )
-            if isup:
-                break
-        if not isup:
-            main.log.report( "ONOS1 didn't start!" )
-
-        lastOutput = "--" 
-        origin = time.time()
-        clockStarted = False 
-        while True:
-            main.ONOSbench.handle.sendline("onos $OC1 summary")
-            main.ONOSbench.handle.expect(":~")
-            clusterCheck = ((main.ONOSbench.handle.before).splitlines())[3]
-            print("\nBefore: " + str(clusterCheck))
-            if "SCC(s)=1," in clusterCheck:     
-                break 
-            if clusterCheck != lastOutput:
-                sameOutput = False 
-            elif clusterCheck == lastOutput:
-                if clockStarted == False: 
-                    start = time.time()
-                    clockStarted = True
-                if time.time() > (start + 30):
-                    main.log.error("TIMEOUT EXCEEDED: Clusters have not converged, continuing anyway...") 
-                    break 
-            lastOutput = clusterCheck
-            time.sleep(5)
-
-
-
-    def CASE2( self, main ):
-        # This case increases the cluster size by whatever scale is
-        # Note: 'scale' is the size of the step
-        # if scaling is not a part of your test, simply run this case
-        # once after CASE1 to set up your enviornment for your desired 
-        # cluster size. If scaling is a part of you test call this case each time 
-        # you want to increase cluster size
-
-        ''                                                         
-        'Increase number of nodes and initiate CLI'
-        ''
-        import time
-        import os.path
-        global clusterCount
-        
-        Features= main.params[ 'ENV' ][ 'cellFeatures' ] 
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-        MNip = main.params[ 'MN' ][ 'ip1' ]
-        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
-        numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
-        scale = int( main.params[ 'SCALE' ] )
-        maxNodes = int(main.params[ 'availableNodes' ])
-        clusterCount += scale
-        homeDir = os.path.expanduser('~')        
-
-        #kill off all onos processes
-        main.log.step("Safety check, killing all ONOS processes")
-        main.log.step("before initiating enviornment setup")
-        for node in range(1, maxNodes + 1):
-            main.ONOSbench.onosDie(ONOSIp[node]) 
-
-        #Uninstall everywhere
-        main.log.step( "Cleaning Enviornment..." )
-        for i in range(1, maxNodes + 1):
-            main.log.info(" Uninstalling ONOS " + str(i) )
-            main.ONOSbench.onosUninstall( ONOSIp[i] )      
-        
-        #construct the cell file
-        main.log.info("Creating cell file")
-        exec "a = main.ONOSbench.createCellFile"
-        cellIp = []
-        for node in range (1, clusterCount + 1):
-            cellIp.append(ONOSIp[node])
-        a(BENCHIp,cellName,MNip,str(Features), *cellIp)
-
-        main.step( "Set Cell" )
-        main.ONOSbench.setCell(cellName)
-
-        myDistribution = []
-        for node in range (1, clusterCount + 1):
-            myDistribution.append(numSwitches[node-1])
-
-        main.ONOSbench.createLinkGraphFile( BENCHIp, cellIp, myDistribution)
-        main.ONOSbench.createNullDevProviderFile( BENCHIp, cellIp, myDistribution)
-        main.ONOSbench.createNullLinkProviderFile( BENCHIp )
-
-        #neighbors = max(1, clusterCount-1) 
-        neighbors = 0
-
-        main.log.step("Writing IntentPerf config file")
-        intentPerfConfig = open( homeDir + "/onos/tools/package/etc/org.onosproject.intentperf.IntentPerfInstaller.cfg", "w+")
-        intentPerfConfig.write("numKeys = 40000\n")
-        intentPerfConfig.write("cyclePeriod = 1000\n")
-        intentPerfConfig.write("numNeighors = " + str(neighbors) + "\n")
-        intentPerfConfig.close()
-
-        main.step( "Creating ONOS package, preparing to reinstall" )
-        packageResult = main.ONOSbench.onosPackage()   
-       
-        main.log.report( "Reinstalling on all nodes and increasing cluster size to " + str( clusterCount ) )
+      
+        main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
         for node in range(1, clusterCount + 1):
-            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])    
+            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
             main.ONOSbench.onosInstall( ONOSIp[node])
-    
+
+        for node in range(1, clusterCount + 1):
             for i in range( 2 ):
                 isup = main.ONOSbench.isup( ONOSIp[node] )
                 if isup:
@@ -225,7 +127,8 @@
                     break
             if not isup:
                 main.log.report( "ONOS " + str(node) + " didn't start!" )
-        
+        main.log.info("Startup sequence complete")
+
         lastOutput = "--"
         origin = time.time()
         clockStarted = False
@@ -234,7 +137,7 @@
             main.ONOSbench.handle.expect(":~")
             clusterCheck = ((main.ONOSbench.handle.before).splitlines())[3]
             print("\nBefore: " + str(clusterCheck))
-            if ("SCC(s)=1,") in clusterCheck:   
+            if ("SCC(s)=1,") in clusterCheck:
                 break
             if clusterCheck != lastOutput:
                 sameOutput = False
@@ -242,17 +145,18 @@
                 if clockStarted == False:
                     start = time.time()
                     clockStarted = True
-                if time.time() > (start + 60):
+                if time.time() > (start + 10):
                     main.log.error("TIMEOUT EXCEEDED: Clusters have not converged, continuing anyway...")
                     break
             lastOutput = clusterCheck
             time.sleep(5)
-        
-            
-    def CASE3( self, main ):   
+
+        main.ONOSbench.configNullDev(cellIp, myDistribution)
+
+    def CASE2( self, main ): 
         import time
         import json
-        import string 
+        import string
         import csv
         import numpy
 
@@ -264,75 +168,81 @@
         testDuration = main.params[ 'TEST' ][ 'duration' ]
         logInterval = main.params[ 'TEST' ][ 'log_interval' ]
         debug = main.params[ 'debugMode' ]
-
+        numKeys = main.params[ 'TEST' ][ 'numKeys' ]
+        cyclePeriod = main.params[ 'TEST' ][ 'cyclePeriod' ]
+        neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",") 
         metricList = [intentsRate, intentsWithdrawn, intentsFailed]
-        
-        tempsleep =20
-        main.log.info("sleeping " + str(tempsleep)) 
-        time.sleep(tempsleep)
-        
-        loadFrom = ['0']
-        loadFrom.extend((main.params[ 'TEST' ][ 'loadFrom' ]).split(","))
 
-        for node in range(1, clusterCount+1):
-            if loadFrom[node] == "1": 
-                cmd = "onos $OC" + str(node) + " feature:install onos-app-intent-perf"
-                main.ONOSbench.handle.sendline(cmd)
-                main.ONOSbench.handle.expect(":~")
-                main.log.info("Load initiated on node " + str(node))
-        
+        for n in range(0, len(neighbors)): 
+            if neighbors[n] == 'a': 
+                neighbors[n] = str(clusterCount -1)
+        print str(neighbors)
+
+        for n in neighbors:
+            main.log.info("Run with " + n + " neighbors") 
             time.sleep(5)
-            actcmd = "onos $OC" + str(node) + " intent-perf-start"
-            main.ONOSbench.handle.sendline(actcmd)
+            main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numKeys " + numKeys )
             main.ONOSbench.handle.expect(":~")
-            main.log.info("Starting ONOS " + str(node) + "  intent-perf...")
+            main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numNeighbors " + n ) 
+            main.ONOSbench.handle.expect(":~")
+            main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller cyclePeriod " + cyclePeriod )
+            main.ONOSbench.handle.expect(":~")
 
-        main.log.info( "Starting test loop for " + str(testDuration) + " seconds...\n" )
-        stop = time.time() + float( testDuration )
-        
-        while time.time() < stop:
-            time.sleep( float( logInterval ) )
-            groupResult = []
-            for node in range (1, clusterCount + 1):
-                if loadFrom[node] == "0": continue
-                groupResult.append(0)               
-                
-                cmd = " onos-ssh $OC" + str(node) +  """ cat /opt/onos/log/karaf.log | grep "SNAPSHOT | Throughput" | tail -1  """ 
-                main.log.info("COMMAND: " + str(cmd))
-  
-                x = 0 
-                while True: 
-                    main.ONOSbench.handle.sendline(cmd)                   
-                    main.ONOSbench.handle.expect(":~")
-                    raw = main.ONOSbench.handle.before 
-                    if "OVERALL=" in raw: 
-                        break 
-                    x += 1
-                    if x > 10: 
-                        main.log.error("Expected output not being recieved... continuing")
-                        break
-                    time.sleep(2)
+            cmd = "onos $OC1 intent-perf-start"
+            main.ONOSbench.handle.sendline(cmd)
+            main.ONOSbench.handle.expect(":~")
+            main.log.info("Starting ONOS (all nodes)  intent-perf from $OC1" )
 
-                raw = raw.splitlines()
-                splitResults = []
-                for line in raw: 
-                    splitResults.extend(line.split(" "))
+            main.log.info( "Starting test loop for " + str(testDuration) + " seconds...\n" )
+            stop = time.time() + float( testDuration )
 
-                myResult = "--" 
-                for field in splitResults: 
-                    if "OVERALL" in field: 
-                        myResult = field 
-                
-                if myResult == "--": 
-                    main.log.error("Parsing/Pexpect error\n" + str(splitResults)) 
+            while time.time() < stop:
+                time.sleep( float( logInterval ) )
+                groupResult = []
+                for node in range (1, clusterCount + 1):
+                    groupResult.append(0)
 
-                myResult = myResult.replace(";", "") 
-                myResult = myResult.replace("OVERALL=","")
-                myResult = float(myResult)  
-                groupResult[len(groupResult) -1] = myResult 
+                    cmd = " onos-ssh $OC" + str(node) +  """ cat /opt/onos/log/karaf.log | grep "SNAPSHOT | Throughput" | tail -1  """
+                    main.log.info("COMMAND: " + str(cmd))
 
-                main.log.info("Node " + str(node) + " overall rate: " + str(myResult))
+                    x = 0
+                    while True:
+                        main.ONOSbench.handle.sendline(cmd)
+                        main.ONOSbench.handle.expect(":~")
+                        raw = main.ONOSbench.handle.before
+                        if "OVERALL=" in raw:
+                            break
+                        x += 1
+                        if x > 10:
+                            main.log.error("Expected output not being recieved... continuing")
+                            break
+                        time.sleep(2)
 
-            main.log.report("Results from this round of polling: " + str(groupResult)) 
-            main.log.report("Cluster Total: " + str(numpy.sum(groupResult)) + "\n")
-                
+                    raw = raw.splitlines()
+                    splitResults = []
+                    for line in raw:
+                        splitResults.extend(line.split(" "))
+
+                    myResult = "--"
+                    for field in splitResults:
+                        if "OVERALL" in field:
+                            myResult = field
+
+                    if myResult == "--":
+                        main.log.error("Parsing/Pexpect error\n" + str(splitResults))
+
+                    myResult = myResult.replace(";", "")
+                    myResult = myResult.replace("OVERALL=","")
+                    myResult = float(myResult)
+                    groupResult[len(groupResult) -1] = myResult
+
+                    main.log.info("Node " + str(node) + " overall rate: " + str(myResult))
+
+                main.log.report("Results from this round of polling: " + str(groupResult))
+                main.log.report("Cluster Total: " + str(numpy.sum(groupResult)) + "\n")
+            
+            cmd = "onos $OC1 intent-perf-stop"
+            main.ONOSbench.handle.sendline(cmd)
+            main.ONOSbench.handle.expect(":~")
+            main.log.info("Stopping intentperf" )
+     
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.topo b/TestON/tests/IntentEventTP/IntentEventTP.topo
index 0e45e0f..30a1467 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.topo
+++ b/TestON/tests/IntentEventTP/IntentEventTP.topo
@@ -3,7 +3,7 @@
     <COMPONENT>
 
         <ONOSbench>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
@@ -12,7 +12,7 @@
         </ONOSbench>
 
         <ONOS1cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -21,7 +21,7 @@
         </ONOS1cli>
 
         <ONOS2cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -30,7 +30,7 @@
         </ONOS2cli>
 
         <ONOS3cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -39,7 +39,7 @@
         </ONOS3cli>
 
         <ONOS4cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -48,7 +48,7 @@
         </ONOS4cli>
 
         <ONOS5cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -57,7 +57,7 @@
         </ONOS5cli>
 
         <ONOS6cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -66,7 +66,7 @@
         </ONOS6cli>
 
         <ONOS7cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -75,7 +75,7 @@
         </ONOS7cli>
 
         <ONOS1>
-            <host>10.254.1.201</host>
+            <host>10.128.5.51</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -84,7 +84,7 @@
         </ONOS1>
 
         <ONOS2>
-            <host>10.254.1.202</host>
+            <host>10.128.5.52</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -93,7 +93,7 @@
         </ONOS2>
 
         <ONOS3>
-            <host>10.254.1.203</host>
+            <host>10.128.5.53</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -102,7 +102,7 @@
         </ONOS3>
 
         <ONOS4>
-            <host>10.254.1.204</host>
+            <host>10.128.5.54</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -112,7 +112,7 @@
 
     
         <ONOS5>
-            <host>10.254.1.205</host>
+            <host>10.128.5.65</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -121,7 +121,7 @@
         </ONOS5>
 
         <ONOS6>
-            <host>10.254.1.206</host>
+            <host>10.128.5.66</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -130,7 +130,7 @@
         </ONOS6>
 
         <ONOS7>
-            <host>10.254.1.207</host>
+            <host>10.128.5.67</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
diff --git a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.params b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.params
new file mode 100644
index 0000000..3185cc2
--- /dev/null
+++ b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.params
@@ -0,0 +1,66 @@
+<PARAMS>
+
+    <testcases>1,2</testcases>
+
+    <SCALE>3,5,7</SCALE>
+    <availableNodes>7</availableNodes>
+ 
+    <ENV>
+        <cellName>IntentInstallWithdrawCell</cellName>
+        <cellApps>null</cellApps>
+    </ENV>
+
+    <TEST>
+        <skipCleanInstall>yes</skipCleanInstall>
+        <switchCount>7</switchCount>
+        <warmUp>4</warmUp>
+        <sampleSize>10</sampleSize>                     
+        <wait></wait>
+        <intents>1000</intents>                       #list format, will be split on ','
+        <debug>True</debug>                                        #"True" for true
+    </TEST>
+
+    <GIT>
+        <autopull>on</autopull>
+        <checkout>master</checkout>
+    </GIT>
+
+    <CTRL>
+        <USER>admin</USER>
+        
+        <ip1>10.128.5.51</ip1>
+        <port1>6633</port1>
+        
+        <ip2>10.128.5.52</ip2>
+        <port2>6633</port2>
+        
+        <ip3>10.128.5.53</ip3>
+        <port3>6633</port3>
+        
+        <ip4>10.128.5.54</ip4>
+        <port4>6633</port4>
+        
+        <ip5>10.128.5.65</ip5>
+        <port5>6633</port5>
+        
+        <ip6>10.128.5.66</ip6>
+        <port6>6633</port6> 
+       
+        <ip7>10.128.5.67</ip7>
+        <port7>6633</port7>
+
+    </CTRL>
+
+    <MN>
+        <ip1>10.128.5.55</ip1>
+    </MN>
+
+    <BENCH>
+        <user>admin</user>
+        <ip1>10.128.5.55</ip1>
+    </BENCH>
+
+    <JSON>
+    </JSON>
+
+</PARAMS>
diff --git a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py
new file mode 100644
index 0000000..6d0e2b3
--- /dev/null
+++ b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py
@@ -0,0 +1,226 @@
+# ScaleOutTemplate
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os.path
+
+
+class IntentInstallWithdrawLat:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):           
+                                        
+        import time                     
+        global init       
+        try: 
+            if type(init) is not bool: 
+                init = False  
+        except NameError: 
+            init = False 
+       
+        #Load values from params file
+        checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+        gitPull = main.params[ 'GIT' ][ 'autopull' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        Apps = main.params[ 'ENV' ][ 'cellApps' ]
+        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+        BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+        maxNodes = int(main.params[ 'availableNodes' ])
+        skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]        
+        switchCount = main.params[ 'TEST' ][ 'switchCount' ]
+
+        # -- INIT SECTION, ONLY RUNS ONCE -- # 
+        if init == False: 
+            init = True
+            global clusterCount             #number of nodes running
+            global ONOSIp                   #list of ONOS IP addresses
+            global scale 
+            
+            clusterCount = 0
+            ONOSIp = [ 0 ]
+            scale = (main.params[ 'SCALE' ]).split(",")            
+            clusterCount = int(scale[0])
+
+            #Populate ONOSIp with ips from params 
+            for i in range(1, maxNodes + 1): 
+                ipString = 'ip' + str(i) 
+                ONOSIp.append(main.params[ 'CTRL' ][ ipString ])   
+            
+            #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+            if skipMvn != "yes":
+                mvnResult = main.ONOSbench.cleanInstall()
+
+            #git
+            main.step( "Git checkout and pull " + checkoutBranch )
+            if gitPull == 'on':
+                checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+                pullResult = main.ONOSbench.gitPull()
+
+            else:
+                checkoutResult = main.TRUE
+                pullResult = main.TRUE
+                main.log.info( "Skipped git checkout and pull" )
+        
+        # -- END OF INIT SECTION --#
+         
+        clusterCount = int(scale[0])
+        scale.remove(scale[0])       
+        
+        #kill off all onos processes 
+        main.log.step("Safety check, killing all ONOS processes")
+        main.log.step("before initiating enviornment setup")
+        for node in range(1, maxNodes + 1):
+            main.ONOSbench.onosDie(ONOSIp[node])
+        
+        #Uninstall everywhere
+        main.log.step( "Cleaning Enviornment..." )
+        for i in range(1, maxNodes + 1):
+            main.log.info(" Uninstalling ONOS " + str(i) )
+            main.ONOSbench.onosUninstall( ONOSIp[i] )
+       
+        #construct the cell file
+        main.log.info("Creating cell file")
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+            cellIp.append(ONOSIp[node])
+
+        main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
+
+        main.step( "Set Cell" )
+        main.ONOSbench.setCell(cellName)
+        
+        main.ONOSbench.createLinkGraphFile(BENCHIp, cellIp, switchCount)        
+
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage()  
+
+        main.step( "verify cells" )
+        verifyCellResult = main.ONOSbench.verifyCell()
+      
+        main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
+        for node in range(1, clusterCount + 1):
+            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+            main.ONOSbench.onosInstall( ONOSIp[node])
+
+        for node in range(1, clusterCount + 1):
+            for i in range( 2 ):
+                isup = main.ONOSbench.isup( ONOSIp[node] )
+                if isup:
+                    main.log.info("ONOS " + str(node) + " is up\n")
+                    break
+            if not isup:
+                main.log.report( "ONOS " + str(node) + " didn't start!" )
+
+        main.ONOS1cli.startOnosCli( ONOSIp[1] )
+        main.log.info("Startup sequence complete")
+
+        main.ONOSbench.configNullDev(cellIp, switchCount) 
+
+    def CASE2( self, main ):
+         
+        import time
+        import numpy
+
+        sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
+        warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
+        intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
+        switchCount = int(main.params[ 'TEST' ][ 'switchCount' ])
+        debug = main.params[ 'TEST' ][ 'switchCount' ]
+        for i in range(0,len(intentsList)):
+            intentsList[i] = int(intentsList[i])
+
+        if debug == "True":
+            debug = True
+        else:
+            debug = False
+
+        linkCount = 0
+        for i in range(0,10):
+            main.ONOSbench.handle.sendline("onos $OC1 links|wc -l")
+            main.ONOSbench.handle.expect(":~")
+            linkCount = main.ONOSbench.handle.before
+            if debug: main.log.info("Link Count check: " + linkCount)
+            if str((switchCount*2)-2) in linkCount:
+                break
+            time.sleep(2)
+
+        links = "--"
+        while "=null:" not in links:
+            if debug: main.log.info("top of loop")
+            main.ONOSbench.handle.sendline("onos $OC1 links")
+            main.ONOSbench.handle.expect(":~")
+            links = main.ONOSbench.handle.before
+            if debug: main.log.info(str(links))
+            time.sleep(1)
+        links = links.splitlines()
+        templinks = links
+
+        tempDevices = []
+        for line in links:
+            temp = line.split(" ")
+            temp[0].replace("src=","")
+            temp[0] = (temp[0].split("/"))[0]
+            tempDevices.append(temp[0])
+
+        tempDevices.sort()
+        devices = []
+        for i in tempDevices:
+            if "src=null" in i:
+                devices.append(i.replace("src=", ""))
+        if debug: main.log.info(str(devices))
+
+        ingress = devices[0]
+        egress = devices.pop()
+        if debug: main.log.info(ingress)
+        if debug: main.log.info(egress)
+
+        for intentSize in intentsList:
+            cmd = "onos $OC1 push-test-intents "
+            cmd += ingress + "/6 "
+            cmd += egress + "/5 "
+            cmd += str(intentSize) + " 1"
+            installed = []
+            withdrawn = []
+
+            for run in range(0, (warmUp + sampleSize)):
+                if run > warmUp:
+                    time.sleep(5)
+
+                myRawResult = "--"
+                while "ms" not in myRawResult:
+                    main.ONOSbench.handle.sendline(cmd)
+                    main.ONOSbench.handle.expect(":~")
+                    myRawResult = main.ONOSbench.handle.before
+                    if debug: main.log.info(myRawResult)
+
+                if debug: main.log.info(myRawResult)
+
+                if run >= warmUp:
+                    myRawResult = myRawResult.splitlines()
+                    for line in myRawResult:
+                        if "install" in line:
+                            installed.append(int(line.split(" ")[5]))
+
+                    for line in myRawResult:
+                        if "withdraw" in line:
+                            withdrawn.append(int(line.split(" ")[5]))
+
+                    print("installed: " + str(installed))
+                    print("withraw: " + str(withdrawn) + "\n")
+
+            main.log.report("----------------------------------------------------")
+            main.log.report("Scale: " + str(clusterCount) + "\tIntent batch size: " + str(intentSize))
+            main.log.report("Data samples: " + str(sampleSize) + "\tWarm up tests: " + str(warmUp))
+            main.log.report("Installed average: " + str(numpy.mean(installed)))
+            main.log.report("Installed standard deviation: " + str(numpy.std(installed)))
+            main.log.report("Withdraw average: " + str(numpy.mean(withdrawn)))
+            main.log.report("Withdraw standard deviation: " + str(numpy.std(withdrawn)))
+            main.log.report("     ")
+
diff --git a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.topo b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.topo
new file mode 100644
index 0000000..30a1467
--- /dev/null
+++ b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.topo
@@ -0,0 +1,146 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS><home>~/onos</home></COMPONENTS>
+        </ONOSbench>
+
+        <ONOS1cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1cli>
+
+        <ONOS2cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2cli>
+
+        <ONOS3cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3cli>
+
+        <ONOS4cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4cli>
+
+        <ONOS5cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5cli>
+
+        <ONOS6cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6cli>
+
+        <ONOS7cli>
+            <host>10.128.5.55</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS7cli>
+
+        <ONOS1>
+            <host>10.128.5.51</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>9</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1>
+
+        <ONOS2>
+            <host>10.128.5.52</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>10</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2>
+
+        <ONOS3>
+            <host>10.128.5.53</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>11</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3>
+
+        <ONOS4>
+            <host>10.128.5.54</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>12</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4>
+
+    
+        <ONOS5>
+            <host>10.128.5.65</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>13</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5>
+
+        <ONOS6>
+            <host>10.128.5.66</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>14</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6>
+
+        <ONOS7>
+            <host>10.128.5.67</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>15</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS7>
+
+    </COMPONENT>
+
+</TOPOLOGY>
+
+
+    
diff --git a/TestON/tests/IntentInstallWithdrawLat/__init__.py b/TestON/tests/IntentInstallWithdrawLat/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/IntentInstallWithdrawLat/__init__.py
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.params b/TestON/tests/IntentRerouteLat/IntentRerouteLat.params
new file mode 100644
index 0000000..4139613
--- /dev/null
+++ b/TestON/tests/IntentRerouteLat/IntentRerouteLat.params
@@ -0,0 +1,78 @@
+<PARAMS>
+
+    <testcases>1,3,2,3,2,3,2,3</testcases>
+
+    <SCALE>2</SCALE>
+    <availableNodes>7</availableNodes>
+ 
+    <ENV>
+        <cellName>intentRerouteCell</cellName>
+        <cellFeatures>webconsole,onos-core,onos-api,onos-cli,onos-null,onos-gui,onos-rest,onos-app-metrics,onos-app-metrics-intent,onos-app-metrics-topology </cellFeatures>
+        <scale1switches>8,</scale1switches>
+        <scale3switches>2,3,3</scale3switches>
+        <scale5switches>2,3,1,1,1</scale5switches>
+        <scale7switches>1,1,2,1,1,1,1</scale7switches>
+    
+    </ENV>
+
+    <TEST>
+        <skipCleanInstall>yes</skipCleanInstall>
+        <warmUp>4</warmUp>
+        <sampleSize>20</sampleSize>                     
+        <wait></wait>
+        <intents>1,100,1000,5000</intents>                       #list format, will be split on ','
+        <debug>True</debug>                          
+    </TEST>
+
+    <METRICS>
+        <Submitted>0</Submitted>
+        <Installed>1</Installed>
+        <Failed>0</Failed>
+        <Withdraw>0</Withdraw>
+        <Withdrawn>0</Withdrawn>
+    </METRICS>
+
+    <GIT>
+        <autopull>on</autopull>
+        <checkout>master</checkout>
+    </GIT>
+
+    <CTRL>
+        <USER>admin</USER>
+        
+        <ip1>10.254.1.201</ip1>
+        <port1>6633</port1>
+        
+        <ip2>10.254.1.202</ip2>
+        <port2>6633</port2>
+        
+        <ip3>10.254.1.203</ip3>
+        <port3>6633</port3>
+        
+        <ip4>10.254.1.204</ip4>
+        <port4>6633</port4>
+        
+        <ip5>10.254.1.205</ip5>
+        <port5>6633</port5>
+        
+        <ip6>10.254.1.206</ip6>
+        <port6>6633</port6> 
+       
+        <ip7>10.254.1.207</ip7>
+        <port7>6633</port7>
+
+    </CTRL>
+
+    <MN>
+        <ip1>10.254.1.200</ip1>
+    </MN>
+
+    <BENCH>
+        <user>admin</user>
+        <ip1>10.254.1.200</ip1>
+    </BENCH>
+
+    <JSON>
+    </JSON>
+
+</PARAMS>
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.py b/TestON/tests/IntentRerouteLat/IntentRerouteLat.py
new file mode 100644
index 0000000..7198108
--- /dev/null
+++ b/TestON/tests/IntentRerouteLat/IntentRerouteLat.py
@@ -0,0 +1,468 @@
+# ScaleOutTemplate - IntentReroute 
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os.path
+
+
+class IntentRerouteLat:
+
+    def __init__( self ):
+        self.default = ''
+
+    def CASE1( self, main ):            #This is the initialization case
+                                        #this case will clean up all nodes 
+        import time                     #but only node 1 is started in this case
+        import os.path
+
+        global clusterCount             #number of nodes running
+        global ONOSIp                   #list of ONOS IP addresses 
+        clusterCount = 1
+        ONOSIp = [ 0 ]
+
+
+        #Load values from params file
+        checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+        gitPull = main.params[ 'GIT' ][ 'autopull' ]
+        cellName = main.params[ 'ENV' ][ 'cellName' ]
+        Features= main.params[ 'ENV' ][ 'cellFeatures' ]
+        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+        BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+        MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+        maxNodes = int(main.params[ 'availableNodes' ])
+        Features = main.params[ 'ENV' ][ 'cellFeatures' ]
+        skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+        switchCount = (main.params[ 'ENV' ][ 'scale1switches' ]).split(",")
+        homeDir = os.path.expanduser('~')
+
+        #Populate ONOSIp with ips from params 
+        for i in range(1, maxNodes + 1): 
+            ipString = 'ip' + str(i) 
+            ONOSIp.append(main.params[ 'CTRL' ][ ipString ])   
+    
+        tempIp = []
+        for node in range( 1, clusterCount + 1):
+            tempIp.append(ONOSIp[node])
+
+        #kill off all onos processes 
+        main.log.step("Safety check, killing all ONOS processes")
+        main.log.step("before initiating enviornment setup")
+        for node in range(1, maxNodes + 1):
+            main.ONOSbench.onosDie(ONOSIp[node])
+
+        #construct the cell file
+        main.log.info("Creating cell file")
+        exec "a = main.ONOSbench.createCellFile"
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+            cellIp.append(ONOSIp[node])
+        a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
+
+        main.step( "Applying cell file to environment" )
+        cellApplyResult = main.ONOSbench.setCell( cellName )
+
+        #Uninstall everywhere
+        main.log.step( "Cleaning Enviornment..." )
+        for i in range(1, maxNodes + 1):
+            main.log.info(" Uninstalling ONOS " + str(i) )
+            main.ONOSbench.onosUninstall( ONOSIp[i] )
+        
+        #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+        if skipMvn != "yes":
+            mvnResult = main.ONOSbench.cleanInstall()
+                        
+            #git
+            main.step( "Git checkout and pull " + checkoutBranch )
+            if gitPull == 'on':
+                checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+                pullResult = main.ONOSbench.gitPull()
+
+            else:
+                checkoutResult = main.TRUE
+                pullResult = main.TRUE
+                main.log.info( "Skipped git checkout and pull" )
+        
+        main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/oneNode7linear.cfg ~/onos/tools/package/etc/")
+        main.ONOSbench.handle.expect(":~")
+        main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/oneNode7linearCut.cfg ~/onos/tools/package/etc/")
+        main.ONOSbench.handle.expect(":~")
+
+        main.ONOSbench.createNullDevProviderFile(BENCHIp, tempIp, switchCount)
+        main.ONOSbench.createNullLinkProviderFile(BENCHIp, fileName=("/opt/onos/apache-karaf-3.0.2/etc/oneNode7linear.cfg"))
+ 
+        main.step( "Creating ONOS package" )
+        packageResult = main.ONOSbench.onosPackage()  
+
+        main.step( "Installing ONOS package" )
+        install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] )
+
+        main.step( "verify cells" )
+        verifyCellResult = main.ONOSbench.verifyCell()
+
+        main.step( "Set cell for ONOS cli env" )
+        cli1 = main.ONOS1cli.startOnosCli( ONOSIp[1] )
+
+        
+    def CASE2( self, main ):
+        # This case increases the cluster size by whatever scale is
+        # Note: 'scale' is the size of the step
+        # if scaling is not a part of your test, simply run this case
+        # once after CASE1 to set up your enviornment for your desired 
+        # cluster size. If scaling is a part of you test call this case each time 
+        # you want to increase cluster size
+
+        ''                                                         
+        'Increase number of nodes and initiate CLI'
+        ''
+        import time
+        global clusterCount
+        
+        BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+        scale = int( main.params[ 'SCALE' ] )
+        clusterCount += scale
+        homeDir = os.path.expanduser('~')
+        switchParams = ("scale" + str(clusterCount) + "switches")
+        switchCount = (main.params[ 'ENV' ][ switchParams ]).split(",") 
+
+        if clusterCount == 1: 
+            temp = "one"
+        if clusterCount == 3: 
+            temp = "three"
+        if clusterCount == 5: 
+            temp = "five"
+        if clusterCount == 7: 
+            temp = "seven"
+
+        lgfile = temp + "Node7linear.cfg"
+        main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/" + lgfile + " ~/onos/tools/package/etc/")
+        main.ONOSbench.handle.expect(":~")
+        main.ONOSbench.handle.sendline("cp ~/ONLabTest/TestON/dependencies/IntentRerouteTest/" + temp + "Node7linearCut.cfg" + " ~/onos/tools/package/etc/")
+        main.ONOSbench.handle.expect(":~")
+        
+        main.log.info("Creating cell file")
+        exec "a = main.ONOSbench.createCellFile"
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+            cellIp.append(ONOSIp[node])
+        a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp) 
+    
+        main.step( "Applying cell file to environment" )
+        cellApplyResult = main.ONOSbench.setCell( cellName )
+
+        #Uninstall everywhere
+        main.log.step( "Cleaning Enviornment..." )
+        for node in range(1, maxNodes + 1):
+            main.ONOSbench.onosDie(ONOSIp[node])
+            main.log.info(" Uninstalling ONOS " + str(node) )
+            main.ONOSbench.onosUninstall( ONOSIp[node] )
+
+        tempIp = []
+        for node in range( 1, clusterCount + 1): 
+            tempIp.append(ONOSIp[node]) 
+
+        main.ONOSbench.createNullDevProviderFile(BENCHIp, tempIp, switchCount)
+        main.ONOSbench.createNullLinkProviderFile(BENCHIp, fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfile))
+
+        main.ONOSbench.onosPackage()
+        
+        
+        main.log.report( "Increasing cluster size to " + str( clusterCount ) )
+        for node in range(1, clusterCount + 1):
+            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])    
+            main.ONOSbench.onosInstall( node=ONOSIp[node])
+            if node == 1: 
+                main.ONOS1cli.startOnosCli( ONOSIp[1] )
+        
+        for node in range(1, clusterCount + 1): 
+            for i in range( 2 ):
+                isup = main.ONOSbench.isup( ONOSIp[node] )
+                if isup:
+                    main.log.info("ONOS " + str(node) + " is up\n")
+                    break
+            if not isup:
+                main.log.report( "ONOS " + str(node) + " didn't start!" ) 
+    
+    def CASE3( self, main ): 
+
+        import time 
+        import numpy 
+        import datetime
+        #from scipy import stats
+
+        ts = time.time()
+        date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d')
+
+        sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ]) 
+        warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
+        intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
+        debug = main.params[ 'TEST' ][ 'debug' ]
+        for i in range(0,len(intentsList)):
+            intentsList[i] = int(intentsList[i]) 
+        
+        timestampMetrics = []
+        if main.params['METRICS']['Submitted'] == "1":
+            timestampMetrics.append("Submitted")
+        if main.params['METRICS']['Installed'] == "1": 
+            timestampMetrics.append("Installed")
+        if main.params['METRICS']['Failed'] == "1":
+            timestampMetrics.append("Failed")    
+        if main.params['METRICS']['Withdraw'] == "1":
+            timestampMetrics.append("Withdraw")
+        if main.params['METRICS']['Withdrawn'] == "1":
+            timestampMetrics.append("Withdrawn")
+        if debug: main.log.info(timestampMetrics) 
+    
+        if debug == "True": 
+            debug = True
+        else: 
+            debug = False
+
+        if clusterCount == 1:
+            temp = "one"
+        if clusterCount == 3:
+            temp = "three"
+        if clusterCount == 5:
+            temp = "five"
+        if clusterCount == 7:
+            temp = "seven"
+
+        lgfile = temp + "Node7linear.cfg"
+        lgfileCut = temp + "Node7linearCut.cfg"
+        linkCount = 0
+
+        for i in range(0,15):
+            main.ONOSbench.handle.sendline("onos $OC1 links|wc -l")
+            main.ONOSbench.handle.expect(":~")
+            linkCount = main.ONOSbench.handle.before
+            if debug: main.log.info("Link Count check: " + linkCount)
+            if str(16) in linkCount:
+                break
+            time.sleep(3)
+            main.log.info("waiting for links")
+
+        links = "--"
+        while "=null:" not in links:
+            if debug: main.log.info("top of loop")
+            main.ONOSbench.handle.sendline("onos $OC1 links")
+            main.ONOSbench.handle.expect(":~")
+            links = main.ONOSbench.handle.before
+            if debug: main.log.info(str(links))
+            time.sleep(1)
+        links = links.splitlines()
+        templinks = links
+
+        tempDevices = []
+        for line in links:
+            temp = line.split(" ")
+            temp[0].replace("src=","")
+            temp[0] = (temp[0].split("/"))[0]
+            tempDevices.append(temp[0])
+
+        tempDevices.sort()
+        devices = []
+        for i in tempDevices:
+            if "src=null" in i:
+                devices.append(i.replace("src=", ""))
+        if debug: main.log.info(str(devices))
+
+        ingress = devices[0]
+        egress = devices.pop()
+        if debug: main.log.info("ingress: " + ingress)
+        if debug: main.log.info("egress: " + egress)
+
+
+        for intents in intentsList:
+            main.log.report("Intent Batch size: " + str(intents) + "\n      ") 
+            myResult = [["latency", "lastNode"] for x in range(sampleSize)]
+            
+            for run in range(0, (warmUp + sampleSize)):
+                if run > warmUp: 
+                    main.log.info("Starting test iteration " + str(run-warmUp)) 
+
+                cmd = """onos $OC1 "push-test-intents -i """
+                cmd += ingress + "/0 "
+                cmd += egress + "/0 "
+                cmd += str(intents) +""" 1" """
+                if debug: main.log.info(cmd)
+
+                withdrawCmd = cmd.replace("intents -i", "intents -w ")
+                 
+                #push-test-intents 
+                main.ONOSbench.handle.sendline(cmd)
+                main.ONOSbench.handle.expect(":~")
+                myRawResult = main.ONOSbench.handle.before
+              
+                for i in range(0, 40):
+                    main.ONOSbench.handle.sendline("onos $OC1 summary")
+                    main.ONOSbench.handle.expect(":~")
+                    linkCheck = main.ONOSbench.handle.before
+                    if ("flows=" + str(8*intents) + ",") in linkCheck:
+                        break
+                    if i == 39:
+                        main.log.error("Flow count incorrect, data invalid.")
+
+                #cut link
+                nodesLinksCut = []
+                if clusterCount == 1: 
+                    nodesLinksCut.append(1)
+                if clusterCount == 3 or clusterCount == 5:
+                    nodesLinksCut.append(2)
+                if clusterCount == 7:
+                    nodesLinksCut.append(3)
+                    nodesLinksCut.append(4)
+
+                for node in nodesLinksCut:
+                    exec "a = main.ONOS%s.createNullLinkProviderFile" %str(node)
+                    a(ONOSIp[node], fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfileCut), onNode=True)
+
+                #collect timestamp from link cut 
+                cmd = "onos-ssh $OC" + str(nodesLinksCut[len(nodesLinksCut)-1]) + " cat /opt/onos/log/karaf.log | grep " + lgfileCut + "| tail -1" 
+                if debug: main.log.info("COMMAND: " + str(cmd))
+                
+                for i in range(0,10):
+                    main.ONOSbench.handle.sendline(cmd)
+                    main.ONOSbench.handle.expect(":~")
+                    raw = main.ONOSbench.handle.before
+                    if "NullLinkProvider" in raw:
+                        break
+                    if i >= 9:
+                        main.log.error("Expected output not being recieved... continuing")
+                        main.log.info(raw)
+                        break
+                    time.sleep(2) 
+
+                temp = raw.splitlines()
+                for line in temp: 
+                    if str(date) in line: 
+                        temp = line 
+                        break
+
+                cutTimestamp = (temp.split(" "))[0] + " " + (temp.split(" "))[1]
+
+                #validate link count and flow count
+                for i in range(0, 40):
+                    main.ONOSbench.handle.sendline("onos $OC1 summary")
+                    main.ONOSbench.handle.expect(":~")
+                    linkCheck = main.ONOSbench.handle.before
+                    if "links=14," in linkCheck and ("flows=" + str(7*intents) + ",") in linkCheck:
+                        break
+                    if i == 39:
+                        main.log.error("Link or flow count incorrect, data invalid.")
+
+                #intents events metrics installed timestamp 
+                IEMtimestamps = [0]*(clusterCount + 1)
+                installedTemp = [0]*(clusterCount + 1)
+                for node in range(1, clusterCount +1):      
+                    cmd = "onos $OC" + str(node) + " intents-events-metrics|grep Timestamp"
+                    raw = ""
+                    while "Timestamp" not in raw:
+                        main.ONOSbench.handle.sendline(cmd)
+                        main.ONOSbench.handle.expect(":~")
+                        raw = main.ONOSbench.handle.before 
+
+                    intentsTimestamps = {}
+                    rawTimestamps = raw.splitlines()
+                    for line in rawTimestamps: 
+                        if "Timestamp" in line and "grep" not in line: 
+                            metricKey = (line.split(" "))[1]
+                            metricTimestamp = (line.split(" ")[len(line.split(" ")) -1]).replace("epoch)=","")
+                            metricTimestamp = float(metricTimestamp)
+                            metricTimestamp = numpy.divide(metricTimestamp, 1000)
+                            if debug: main.log.info(repr(metricTimestamp))
+                            intentsTimestamps[metricKey] = metricTimestamp
+                            if metricKey == "Installed":
+                                installedTemp[node] = metricTimestamp 
+
+                    main.log.info("Node: " + str(node) + " Timestamps: " + str(intentsTimestamps))
+                    IEMtimestamps[node] = intentsTimestamps
+              
+                myMax = max(installedTemp)
+                indexOfMax = installedTemp.index(myMax)
+
+                #number crunch
+                for metric in timestampMetrics:     #this is where we sould add support for computing other timestamp metrics
+                    if metric == "Installed":
+                        if run >= warmUp: 
+                            main.log.report("link cut timestamp: " + cutTimestamp)
+                            #readableInstalledTimestamp = str(intentsTimestamps["Installed"])
+                            readableInstalledTimestamp = str(myMax)
+
+                            #main.log.report("Intent Installed timestamp: " + str(intentsTimestamps["Installed"]))          
+                            main.log.report("Intent Installed timestamp: " + str(myMax))
+
+                            cutEpoch = time.mktime(time.strptime(cutTimestamp, "%Y-%m-%d %H:%M:%S,%f"))
+                            if debug: main.log.info("cutEpoch=" + str(cutEpoch))
+                            #rerouteLatency = float(intentsTimestamps["Installed"] - cutEpoch)
+                            rerouteLatency = float(myMax - cutEpoch)
+
+                            rerouteLatency = numpy.divide(rerouteLatency, 1000)
+                            main.log.report("Reroute latency:" + str(rerouteLatency) + " (seconds)\n    ") 
+                            myResult[run-warmUp][0] = rerouteLatency
+                            myResult[run-warmUp][1] = indexOfMax
+                            if debug: main.log.info("Latency: " + str(myResult[run-warmUp][0])) 
+                            if debug: main.log.info("last node: " + str(myResult[run-warmUp][1]))  
+
+                #time.sleep(12)
+
+                #reset
+                for node in nodesLinksCut:
+                    exec "a = main.ONOS%s.createNullLinkProviderFile" %str(node)
+                    a(ONOSIp[node], fileName=("/opt/onos/apache-karaf-3.0.2/etc/" + lgfile), onNode=True)
+
+                #wait for intent withdraw
+                if debug: main.log.info(withdrawCmd)
+                main.ONOSbench.handle.sendline(withdrawCmd)
+                main.ONOSbench.handle.expect(":~")
+                main.ONOSbench.handle.sendline("onos $OC1 intents|grep WITHDRAWN|wc -l")
+                main.ONOSbench.handle.expect(":~")
+                intentWithdrawCheck = main.ONOSbench.handle.before
+                if (str(intents)) in intentWithdrawCheck: 
+                    main.log.info("intents withdrawn")
+                if debug: main.log.info(intentWithdrawCheck)
+                
+                # wait for links to be reestablished  
+                for i in range(0, 10): 
+                    main.ONOSbench.handle.sendline("onos $OC1 summary")
+                    main.ONOSbench.handle.expect(":~") 
+                    linkCheck = main.ONOSbench.handle.before
+                    if "links=16," in linkCheck:
+                        break
+                    time.sleep(1)
+                    if i == 9: 
+                        main.log.info("Links Failed to reconnect, next iteration of data invalid.") 
+
+                if run < warmUp: 
+                    main.log.info("Warm up run " + str(run+1) + " completed") 
+            
+            if debug: main.log.info(myResult)
+            latTemp = []
+            nodeTemp = []
+            for i in myResult: 
+                latTemp.append(i[0])
+                nodeTemp.append(i[1])
+
+            mode = {}
+            for i in nodeTemp: 
+                if i in mode: 
+                    mode[i] += 1
+                else: 
+                    mode[i] = 1
+
+            for i in mode.keys():
+                if mode[i] == max(mode.values()):
+                    nodeMode = i 
+            
+            average = numpy.average(latTemp)
+            stdDev = numpy.std(latTemp) 
+
+            main.log.report("Scale: " + str(clusterCount) + "  \tIntent batch: " + str(intents))
+            main.log.report("Latency average:................" + str(average)) 
+            main.log.report("Latency standard deviation:....." + str(stdDev))
+            main.log.report("Mode of last node to respond:..." + str(nodeMode))
+            main.log.report("________________________________________________________")
+
+
+             
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo b/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo
new file mode 100644
index 0000000..0e45e0f
--- /dev/null
+++ b/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo
@@ -0,0 +1,146 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+
+        <ONOSbench>
+            <host>10.254.1.200</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS><home>~/onos</home></COMPONENTS>
+        </ONOSbench>
+
+        <ONOS1cli>
+            <host>10.254.1.200</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1cli>
+
+        <ONOS2cli>
+            <host>10.254.1.200</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2cli>
+
+        <ONOS3cli>
+            <host>10.254.1.200</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3cli>
+
+        <ONOS4cli>
+            <host>10.254.1.200</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4cli>
+
+        <ONOS5cli>
+            <host>10.254.1.200</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5cli>
+
+        <ONOS6cli>
+            <host>10.254.1.200</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6cli>
+
+        <ONOS7cli>
+            <host>10.254.1.200</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS7cli>
+
+        <ONOS1>
+            <host>10.254.1.201</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>9</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS1>
+
+        <ONOS2>
+            <host>10.254.1.202</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>10</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS2>
+
+        <ONOS3>
+            <host>10.254.1.203</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>11</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS3>
+
+        <ONOS4>
+            <host>10.254.1.204</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>12</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS4>
+
+    
+        <ONOS5>
+            <host>10.254.1.205</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>13</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS5>
+
+        <ONOS6>
+            <host>10.254.1.206</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>14</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS6>
+
+        <ONOS7>
+            <host>10.254.1.207</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosDriver</type>
+            <connect_order>15</connect_order>
+            <COMPONENTS> </COMPONENTS>
+        </ONOS7>
+
+    </COMPONENT>
+
+</TOPOLOGY>
+
+
+    
diff --git a/TestON/tests/IntentRerouteLat/__init__.py b/TestON/tests/IntentRerouteLat/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/IntentRerouteLat/__init__.py
diff --git a/TestON/tests/MultiProd/MultiProd.py b/TestON/tests/MultiProd/MultiProd.py
index eca4da5..aac631f 100644
--- a/TestON/tests/MultiProd/MultiProd.py
+++ b/TestON/tests/MultiProd/MultiProd.py
@@ -248,7 +248,7 @@
         ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
 
         main.log.report(
-            "This testcase is testing if all ONOS nodes are in topologyi" +
+            "This testcase is testing if all ONOS nodes are in topology" +
             " sync with mininet and its peer ONOS nodes" )
         main.log.report( "__________________________________" )
         main.case(
diff --git a/TestON/tests/ProdFunc/ProdFunc.params b/TestON/tests/ProdFunc/ProdFunc.params
index a9b212f..4367bf4 100755
--- a/TestON/tests/ProdFunc/ProdFunc.params
+++ b/TestON/tests/ProdFunc/ProdFunc.params
@@ -38,11 +38,4 @@
         <LinkDiscovery>5</LinkDiscovery>
         <SwitchDiscovery>15</SwitchDiscovery>
     </timers>
-
-    <OPTICAL>
-        <jsonfile> /home/admin/ONOS/tools/test/topos/oe-nonlinear-4.json </jsonfile>
-    </OPTICAL>    
-
-
-
 </PARAMS>
diff --git a/TestON/tests/ProdFunc/ProdFunc.py b/TestON/tests/ProdFunc/ProdFunc.py
index fdba3ad..2cd04c1 100644
--- a/TestON/tests/ProdFunc/ProdFunc.py
+++ b/TestON/tests/ProdFunc/ProdFunc.py
@@ -231,8 +231,8 @@
     def CASE21( self, main ):
         """
             On ONOS bench, run this command:
-             ./~/ONOS/tools/test/bin/onos-topo-cfg
-            which starts the rest and copies the links
+            sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1
+            which spawns packet optical topology and copies the links
             json file to the onos instance.
             Note that in case of Packet Optical, the links are not learnt
             from the topology, instead the links are learnt
@@ -243,18 +243,10 @@
         main.log.report( "_____________________________________________" )
         main.case( "Starting LINC-OE and other components" )
         main.step( "Starting LINC-OE and other components" )
-        startConsoleResult = main.LincOE1.startConsole()
+        appInstallResult = main.ONOS2.featureInstall( "onos-app-optical" )
         opticalMnScript = main.LincOE2.runOpticalMnScript()
-        onosTopoCfgResult = main.ONOSbench.runOnosTopoCfg(
-            instanceName=main.params[ 'CTRL' ][ 'ip1' ],
-            jsonFile=main.params[ 'OPTICAL' ][ 'jsonfile' ] )
 
-        print "start_console_result =", startConsoleResult
-        print "optical_mn_script = ", opticalMnScript
-        print "onos_topo_cfg_result =", onosTopoCfgResult
-
-        case21Result = startConsoleResult and opticalMnScript and \
-            onosTopoCfgResult
+        case21Result = opticalMnScript and appInstallResult
         utilities.assert_equals(
             expect=main.TRUE,
             actual=case21Result,
@@ -263,11 +255,12 @@
 
     def CASE22( self, main ):
         """
-            Curretly we use, 4 linear switch optical topology and
-            2 packet layer mininet switches each with one host.
-            Therefore, the roadmCount variable = 4,
-            packetLayerSWCount variable = 2 and hostCount = 2
-            and this is hardcoded in the testcase. If the topology changes,
+            Curretly we use, 10 optical switches(ROADM's) and
+            6 packet layer mininet switches each with one host.
+            Therefore, the roadmCount variable = 10,
+            packetLayerSWCount variable = 6, hostCount=6 and
+            links=42.
+            All this is hardcoded in the testcase. If the topology changes,
             these hardcoded values need to be changed
         """
         main.log.report(
@@ -291,7 +284,7 @@
                 roadmCount += 1
             elif availability == 'true' and type == 'SWITCH':
                 packetLayerSWCount += 1
-        if roadmCount == 4:
+        if roadmCount == 10:
             print "Number of Optical Switches = %d and is" % roadmCount +\
                   " correctly detected"
             main.log.info(
@@ -307,7 +300,7 @@
                 " and is wrong" )
             opticalSWResult = main.FALSE
 
-        if packetLayerSWCount == 2:
+        if packetLayerSWCount == 6:
             print "Number of Packet layer or mininet Switches = %d "\
                     % packetLayerSWCount + "and is correctly detected"
             main.log.info(
@@ -328,6 +321,16 @@
         linksResult = main.ONOS3.links( jsonFormat=False )
         print "links_result = ", linksResult
         print "_________________________________"
+        linkActiveCount = linksResult.count("state=ACTIVE") 
+        main.log.info( "linkActiveCount = " + str( linkActiveCount ))
+        if linkActiveCount == 42:
+            linkActiveResult = main.TRUE
+            main.log.info(
+                "Number of links in ACTIVE state are correct")
+        else:
+            linkActiveResult = main.FALSE
+            main.log.info(
+                "Number of links in ACTIVE state are wrong")
 
         # NOTE:Since only point intents are added, there is no
         # requirement to discover the hosts
@@ -356,7 +359,8 @@
                             is wrong" )
             hostDiscovery = main.FALSE
         """
-        case22Result = opticalSWResult and packetSWResult
+        case22Result = opticalSWResult and packetSWResult and \
+                        linkActiveResult
         utilities.assert_equals(
             expect=main.TRUE,
             actual=case22Result,
@@ -377,45 +381,45 @@
         main.step( "Adding point intents" )
         ptpIntentResult = main.ONOS3.addPointIntent(
             "of:0000ffffffff0001/1",
-            "of:0000ffffffff0002/1" )
+            "of:0000ffffffff0005/1" )
         if ptpIntentResult == main.TRUE:
             main.ONOS3.intents( jsonFormat=False )
             main.log.info( "Point to point intent install successful" )
 
         ptpIntentResult = main.ONOS3.addPointIntent(
-            "of:0000ffffffff0002/1",
+            "of:0000ffffffff0005/1",
             "of:0000ffffffff0001/1" )
         if ptpIntentResult == main.TRUE:
             main.ONOS3.intents( jsonFormat=False )
             main.log.info( "Point to point intent install successful" )
 
-        time.sleep( 10 )
+        time.sleep( 30 )
         flowHandle = main.ONOS3.flows()
         main.log.info( "flows :" + flowHandle )
 
         # Sleep for 30 seconds to provide time for the intent state to change
-        time.sleep( 30 )
+        time.sleep( 60 )
         intentHandle = main.ONOS3.intents( jsonFormat=False )
         main.log.info( "intents :" + intentHandle )
 
         PingResult = main.TRUE
         count = 1
-        main.log.info( "\n\nh1 is Pinging h2" )
-        ping = main.LincOE2.pingHostOptical( src="h1", target="h2" )
+        main.log.info( "\n\nh1 is Pinging h5" )
+        ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
         # ping = main.LincOE2.pinghost()
         if ping == main.FALSE and count < 5:
             count += 1
             PingResult = main.FALSE
             main.log.info(
-                "Ping between h1 and h2  failed. Making attempt number " +
+                "Ping between h1 and h5  failed. Making attempt number " +
                 str( count ) +
                 " in 2 seconds" )
             time.sleep( 2 )
         elif ping == main.FALSE:
-            main.log.info( "All ping attempts between h1 and h2 have failed" )
+            main.log.info( "All ping attempts between h1 and h5 have failed" )
             PingResult = main.FALSE
         elif ping == main.TRUE:
-            main.log.info( "Ping test between h1 and h2 passed!" )
+            main.log.info( "Ping test between h1 and h5 passed!" )
             PingResult = main.TRUE
         else:
             main.log.info( "Unknown error" )
@@ -443,20 +447,39 @@
         import time
         import json
         """
+            LINC uses its own switch IDs. You can use the following
+            command on the LINC console to find the mapping between 
+            DPIDs and LINC IDs.
+            rp(application:get_all_key(linc)).
+            
             Test Rerouting of Packet Optical by bringing a port down
-            ( port 22 ) of a switch( switchID=1 ), so that link
-            ( between switch1 port22 - switch4-port30 ) is inactive
+            ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ), 
+            so that link
+            ( between switch1 port20 - switch5 port50 ) is inactive
             and do a ping test. If rerouting is successful,
             ping should pass. also check the flows
         """
         main.log.report(
             "This testcase tests rerouting and pings mininet hosts" )
         main.case( "Test rerouting and pings mininet hosts" )
+        main.step( "Attach to the Linc-OE session" )
+        attachConsole = main.LincOE1.attachLincOESession() 
+        print "attachConsole = ", attachConsole
+
         main.step( "Bring a port down and verify the link state" )
-        main.LincOE1.portDown( swId="1", ptId="22" )
+        main.LincOE1.portDown( swId="9", ptId="20" )
         linksNonjson = main.ONOS3.links( jsonFormat=False )
         main.log.info( "links = " + linksNonjson )
 
+        linkInactiveCount = linksNonjson.count("state=INACTIVE")
+        main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
+        if linkInactiveCount == 2:
+            main.log.info(
+                "Number of links in INACTIVE state are correct")
+        else:
+            main.log.info(
+                "Number of links in INACTIVE state are wrong")
+        
         links = main.ONOS3.links()
         main.log.info( "links = " + links )
 
@@ -464,9 +487,9 @@
         linksStateResult = main.FALSE
         for item in linksResult:
             if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
-                    'src' ][ 'port' ] == "22":
-                if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff04" and item[
-                        'dst' ][ 'port' ] == "30":
+                    'src' ][ 'port' ] == "20":
+                if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
+                        'dst' ][ 'port' ] == "50":
                     linksState = item[ 'state' ]
                     if linksState == "INACTIVE":
                         main.log.info(
@@ -492,22 +515,22 @@
         main.step( "Verify Rerouting by a ping test" )
         PingResult = main.TRUE
         count = 1
-        main.log.info( "\n\nh1 is Pinging h2" )
-        ping = main.LincOE2.pingHostOptical( src="h1", target="h2" )
+        main.log.info( "\n\nh1 is Pinging h5" )
+        ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
         # ping = main.LincOE2.pinghost()
         if ping == main.FALSE and count < 5:
             count += 1
             PingResult = main.FALSE
             main.log.info(
-                "Ping between h1 and h2  failed. Making attempt number " +
+                "Ping between h1 and h5  failed. Making attempt number " +
                 str( count ) +
                 " in 2 seconds" )
             time.sleep( 2 )
         elif ping == main.FALSE:
-            main.log.info( "All ping attempts between h1 and h2 have failed" )
+            main.log.info( "All ping attempts between h1 and h5 have failed" )
             PingResult = main.FALSE
         elif ping == main.TRUE:
-            main.log.info( "Ping test between h1 and h2 passed!" )
+            main.log.info( "Ping test between h1 and h5 passed!" )
             PingResult = main.TRUE
         else:
             main.log.info( "Unknown error" )
@@ -768,7 +791,7 @@
 
     def CASE12( self ):
         """
-        Verify the default flows on each switch
+        Verify the default flows on each switch in proactive mode
         """
         main.log.report( "This testcase is verifying num of default" +
                          " flows on each switch" )
@@ -844,11 +867,12 @@
             host2 = "00:00:00:00:00:" + \
                 str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
             # NOTE: get host can return None
-            # TODO: handle this
-            host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
-      
-            host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
-            main.ONOS2.addHostIntent( host1Id, host2Id )
+            if host1:
+                host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
+            if host2:
+                host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
+            if host1Id and host2Id:
+                main.ONOS2.addHostIntent( host1Id, host2Id )
 
         time.sleep( 10 )
         hIntents = main.ONOS2.intents( jsonFormat=False )
@@ -1076,8 +1100,8 @@
         main.step( "Determine the current number of switches and links" )
         topologyOutput = main.ONOS2.topology()
         topologyResult = main.ONOS1.getTopology( topologyOutput )
-        activeSwitches = topologyResult[ 'devices' ]
-        links = topologyResult[ 'links' ]
+        activeSwitches = topologyResult[ 'deviceCount' ]
+        links = topologyResult[ 'linkCount' ]
         print "activeSwitches = ", type( activeSwitches )
         print "links = ", type( links )
         main.log.info(
diff --git a/TestON/tests/ProdFunc/ProdFunc.topo b/TestON/tests/ProdFunc/ProdFunc.topo
index 73a0b4f..3f3323e 100755
--- a/TestON/tests/ProdFunc/ProdFunc.topo
+++ b/TestON/tests/ProdFunc/ProdFunc.topo
@@ -69,25 +69,22 @@
         </Mininet2>
 
         <LincOE1>
-            <host>10.128.20.30</host>
+            <host>10.128.10.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>LincOEDriver</type>
             <connect_order>7</connect_order>
             <COMPONENTS>
-                <arg1> </arg1>
             </COMPONENTS>
         </LincOE1>
 
         <LincOE2>
-            <host>10.128.20.30</host>
+            <host>10.128.10.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>RemoteMininetDriver</type>
             <connect_order>8</connect_order>
             <COMPONENTS>
-                <arg1> sudo python /home/admin/optical.py </arg1>
-                <arg2> </arg2>
             </COMPONENTS>
         </LincOE2>
 
diff --git a/TestON/tests/ProdFunc13/ProdFunc13.params b/TestON/tests/ProdFunc13/ProdFunc13.params
index a9b212f..4367bf4 100755
--- a/TestON/tests/ProdFunc13/ProdFunc13.params
+++ b/TestON/tests/ProdFunc13/ProdFunc13.params
@@ -38,11 +38,4 @@
         <LinkDiscovery>5</LinkDiscovery>
         <SwitchDiscovery>15</SwitchDiscovery>
     </timers>
-
-    <OPTICAL>
-        <jsonfile> /home/admin/ONOS/tools/test/topos/oe-nonlinear-4.json </jsonfile>
-    </OPTICAL>    
-
-
-
 </PARAMS>
diff --git a/TestON/tests/ProdFunc13/ProdFunc13.py b/TestON/tests/ProdFunc13/ProdFunc13.py
index 44e78b7..ada4168 100644
--- a/TestON/tests/ProdFunc13/ProdFunc13.py
+++ b/TestON/tests/ProdFunc13/ProdFunc13.py
@@ -231,8 +231,8 @@
     def CASE21( self, main ):
         """
             On ONOS bench, run this command:
-             ./~/ONOS/tools/test/bin/onos-topo-cfg
-            which starts the rest and copies the links
+            sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1
+            which spawns packet optical topology and copies the links
             json file to the onos instance.
             Note that in case of Packet Optical, the links are not learnt
             from the topology, instead the links are learnt
@@ -243,18 +243,10 @@
         main.log.report( "_____________________________________________" )
         main.case( "Starting LINC-OE and other components" )
         main.step( "Starting LINC-OE and other components" )
-        startConsoleResult = main.LincOE1.startConsole()
+        appInstallResult = main.ONOS2.featureInstall( "onos-app-optical" )
         opticalMnScript = main.LincOE2.runOpticalMnScript()
-        onosTopoCfgResult = main.ONOSbench.runOnosTopoCfg(
-            instanceName=main.params[ 'CTRL' ][ 'ip1' ],
-            jsonFile=main.params[ 'OPTICAL' ][ 'jsonfile' ] )
 
-        print "start_console_result =", startConsoleResult
-        print "optical_mn_script = ", opticalMnScript
-        print "onos_topo_cfg_result =", onosTopoCfgResult
-
-        case21Result = startConsoleResult and opticalMnScript and \
-            onosTopoCfgResult
+        case21Result = opticalMnScript and appInstallResult
         utilities.assert_equals(
             expect=main.TRUE,
             actual=case21Result,
@@ -263,11 +255,12 @@
 
     def CASE22( self, main ):
         """
-            Curretly we use, 4 linear switch optical topology and
-            2 packet layer mininet switches each with one host.
-            Therefore, the roadmCount variable = 4,
-            packetLayerSWCount variable = 2 and hostCount = 2
-            and this is hardcoded in the testcase. If the topology changes,
+            Curretly we use, 10 optical switches(ROADM's) and
+            6 packet layer mininet switches each with one host.
+            Therefore, the roadmCount variable = 10,
+            packetLayerSWCount variable = 6, hostCount=6 and
+            links=42.
+            All this is hardcoded in the testcase. If the topology changes,
             these hardcoded values need to be changed
         """
         main.log.report(
@@ -291,7 +284,7 @@
                 roadmCount += 1
             elif availability == 'true' and type == 'SWITCH':
                 packetLayerSWCount += 1
-        if roadmCount == 4:
+        if roadmCount == 10:
             print "Number of Optical Switches = %d and is" % roadmCount +\
                   " correctly detected"
             main.log.info(
@@ -307,7 +300,7 @@
                 " and is wrong" )
             opticalSWResult = main.FALSE
 
-        if packetLayerSWCount == 2:
+        if packetLayerSWCount == 6:
             print "Number of Packet layer or mininet Switches = %d "\
                     % packetLayerSWCount + "and is correctly detected"
             main.log.info(
@@ -328,6 +321,16 @@
         linksResult = main.ONOS3.links( jsonFormat=False )
         print "links_result = ", linksResult
         print "_________________________________"
+        linkActiveCount = linksResult.count("state=ACTIVE") 
+        main.log.info( "linkActiveCount = " + str( linkActiveCount ))
+        if linkActiveCount == 42:
+            linkActiveResult = main.TRUE
+            main.log.info(
+                "Number of links in ACTIVE state are correct")
+        else:
+            linkActiveResult = main.FALSE
+            main.log.info(
+                "Number of links in ACTIVE state are wrong")
 
         # NOTE:Since only point intents are added, there is no
         # requirement to discover the hosts
@@ -356,7 +359,8 @@
                             is wrong" )
             hostDiscovery = main.FALSE
         """
-        case22Result = opticalSWResult and packetSWResult
+        case22Result = opticalSWResult and packetSWResult and \
+                        linkActiveResult
         utilities.assert_equals(
             expect=main.TRUE,
             actual=case22Result,
@@ -377,45 +381,45 @@
         main.step( "Adding point intents" )
         ptpIntentResult = main.ONOS3.addPointIntent(
             "of:0000ffffffff0001/1",
-            "of:0000ffffffff0002/1" )
+            "of:0000ffffffff0005/1" )
         if ptpIntentResult == main.TRUE:
             main.ONOS3.intents( jsonFormat=False )
             main.log.info( "Point to point intent install successful" )
 
         ptpIntentResult = main.ONOS3.addPointIntent(
-            "of:0000ffffffff0002/1",
+            "of:0000ffffffff0005/1",
             "of:0000ffffffff0001/1" )
         if ptpIntentResult == main.TRUE:
             main.ONOS3.intents( jsonFormat=False )
             main.log.info( "Point to point intent install successful" )
 
-        time.sleep( 10 )
+        time.sleep( 30 )
         flowHandle = main.ONOS3.flows()
         main.log.info( "flows :" + flowHandle )
 
         # Sleep for 30 seconds to provide time for the intent state to change
-        time.sleep( 30 )
+        time.sleep( 60 )
         intentHandle = main.ONOS3.intents( jsonFormat=False )
         main.log.info( "intents :" + intentHandle )
 
         PingResult = main.TRUE
         count = 1
-        main.log.info( "\n\nh1 is Pinging h2" )
-        ping = main.LincOE2.pingHostOptical( src="h1", target="h2" )
+        main.log.info( "\n\nh1 is Pinging h5" )
+        ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
         # ping = main.LincOE2.pinghost()
         if ping == main.FALSE and count < 5:
             count += 1
             PingResult = main.FALSE
             main.log.info(
-                "Ping between h1 and h2  failed. Making attempt number " +
+                "Ping between h1 and h5  failed. Making attempt number " +
                 str( count ) +
                 " in 2 seconds" )
             time.sleep( 2 )
         elif ping == main.FALSE:
-            main.log.info( "All ping attempts between h1 and h2 have failed" )
+            main.log.info( "All ping attempts between h1 and h5 have failed" )
             PingResult = main.FALSE
         elif ping == main.TRUE:
-            main.log.info( "Ping test between h1 and h2 passed!" )
+            main.log.info( "Ping test between h1 and h5 passed!" )
             PingResult = main.TRUE
         else:
             main.log.info( "Unknown error" )
@@ -443,20 +447,39 @@
         import time
         import json
         """
+            LINC uses its own switch IDs. You can use the following
+            command on the LINC console to find the mapping between 
+            DPIDs and LINC IDs.
+            rp(application:get_all_key(linc)).
+            
             Test Rerouting of Packet Optical by bringing a port down
-            ( port 22 ) of a switch( switchID=1 ), so that link
-            ( between switch1 port22 - switch4-port30 ) is inactive
+            ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ), 
+            so that link
+            ( between switch1 port20 - switch5 port50 ) is inactive
             and do a ping test. If rerouting is successful,
             ping should pass. also check the flows
         """
         main.log.report(
             "This testcase tests rerouting and pings mininet hosts" )
         main.case( "Test rerouting and pings mininet hosts" )
+        main.step( "Attach to the Linc-OE session" )
+        attachConsole = main.LincOE1.attachLincOESession() 
+        print "attachConsole = ", attachConsole
+
         main.step( "Bring a port down and verify the link state" )
-        main.LincOE1.portDown( swId="1", ptId="22" )
+        main.LincOE1.portDown( swId="9", ptId="20" )
         linksNonjson = main.ONOS3.links( jsonFormat=False )
         main.log.info( "links = " + linksNonjson )
 
+        linkInactiveCount = linksNonjson.count("state=INACTIVE")
+        main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
+        if linkInactiveCount == 2:
+            main.log.info(
+                "Number of links in INACTIVE state are correct")
+        else:
+            main.log.info(
+                "Number of links in INACTIVE state are wrong")
+        
         links = main.ONOS3.links()
         main.log.info( "links = " + links )
 
@@ -464,9 +487,9 @@
         linksStateResult = main.FALSE
         for item in linksResult:
             if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
-                    'src' ][ 'port' ] == "22":
-                if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff04" and item[
-                        'dst' ][ 'port' ] == "30":
+                    'src' ][ 'port' ] == "20":
+                if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
+                        'dst' ][ 'port' ] == "50":
                     linksState = item[ 'state' ]
                     if linksState == "INACTIVE":
                         main.log.info(
@@ -492,22 +515,22 @@
         main.step( "Verify Rerouting by a ping test" )
         PingResult = main.TRUE
         count = 1
-        main.log.info( "\n\nh1 is Pinging h2" )
-        ping = main.LincOE2.pingHostOptical( src="h1", target="h2" )
+        main.log.info( "\n\nh1 is Pinging h5" )
+        ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
         # ping = main.LincOE2.pinghost()
         if ping == main.FALSE and count < 5:
             count += 1
             PingResult = main.FALSE
             main.log.info(
-                "Ping between h1 and h2  failed. Making attempt number " +
+                "Ping between h1 and h5  failed. Making attempt number " +
                 str( count ) +
                 " in 2 seconds" )
             time.sleep( 2 )
         elif ping == main.FALSE:
-            main.log.info( "All ping attempts between h1 and h2 have failed" )
+            main.log.info( "All ping attempts between h1 and h5 have failed" )
             PingResult = main.FALSE
         elif ping == main.TRUE:
-            main.log.info( "Ping test between h1 and h2 passed!" )
+            main.log.info( "Ping test between h1 and h5 passed!" )
             PingResult = main.TRUE
         else:
             main.log.info( "Unknown error" )
@@ -844,11 +867,12 @@
             host2 = "00:00:00:00:00:" + \
                 str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
             # NOTE: get host can return None
-            # TODO: handle this
-            host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
-      
-            host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
-            main.ONOS2.addHostIntent( host1Id, host2Id )
+            if host1:
+                host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
+            if host2:
+                host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
+            if host1Id and host2Id:
+                main.ONOS2.addHostIntent( host1Id, host2Id )
 
         time.sleep( 10 )
         hIntents = main.ONOS2.intents( jsonFormat=False )
diff --git a/TestON/tests/ProdFunc13/ProdFunc13.topo b/TestON/tests/ProdFunc13/ProdFunc13.topo
index 11a2e6c..9cef3f7 100755
--- a/TestON/tests/ProdFunc13/ProdFunc13.topo
+++ b/TestON/tests/ProdFunc13/ProdFunc13.topo
@@ -69,25 +69,22 @@
         </Mininet2>
 
         <LincOE1>
-            <host>10.128.20.30</host>
+            <host>10.128.10.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>LincOEDriver</type>
             <connect_order>7</connect_order>
             <COMPONENTS>
-                <arg1> </arg1>
             </COMPONENTS>
         </LincOE1>
 
         <LincOE2>
-            <host>10.128.20.30</host>
+            <host>10.128.10.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>RemoteMininetDriver</type>
             <connect_order>8</connect_order>
             <COMPONENTS>
-                <arg1> sudo python /home/admin/optical.py </arg1>
-                <arg2> </arg2>
             </COMPONENTS>
         </LincOE2>
 
diff --git a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
index c290155..4400262 100644
--- a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
+++ b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
@@ -13,9 +13,9 @@
     def __init__( self ):
         self.default = ''
 
-    def CASE1( self, main ):            #This is the initialization case
-                                        #this case will clean up all nodes 
-        import time                     #but only node 1 is started in this case
+    def CASE1( self, main ):           
+                                        
+        import time                     
         global init       
         try: 
             if type(init) is not bool: 
@@ -92,13 +92,16 @@
 
         main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
 
+        main.step( "Set Cell" )
+        main.ONOSbench.setCell(cellName)
         
         main.step( "Creating ONOS package" )
         packageResult = main.ONOSbench.onosPackage()  
 
         main.step( "verify cells" )
         verifyCellResult = main.ONOSbench.verifyCell()
-       
+      
+        main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
         for node in range(1, clusterCount + 1):
             main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
             main.ONOSbench.onosInstall( ONOSIp[node])
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params
deleted file mode 100644
index 24588e0..0000000
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params
+++ /dev/null
@@ -1,95 +0,0 @@
-<PARAMS>
-    <testcases>1,2,3,4,2,3,4,2,3,4,2,3</testcases>
-
-    <ENV>
-        <cellName>topo_perf_test</cellName>
-        <cellFeatures>"webconsole,onos-core,onos-api,onos-cli,onos-app-metrics,onos-app-gui,onos-openflow"</cellFeatures>
-    </ENV>
-
-    <GIT>
-        #autoPull 'on' or 'off'
-        <autoPull>off</autoPull>
-        <checkout>master</checkout>
-    </GIT>
-
-    <CTRL>
-        <user>sdn</user>
-        <ip1>10.254.1.201</ip1>
-        <port1>6633</port1>
-        <ip2>10.254.1.202</ip2>
-        <port2>6633</port2>
-        <ip3>10.254.1.203</ip3>
-        <port3>6633</port3>
-        <ip4>10.254.1.204</ip4>
-        
-        <ip5>10.254.1.205</ip5>
-        <ip6>10.254.1.206</ip6>
-        <ip7>10.254.1.207</ip7>
-    </CTRL>
-
-    <MN>
-        <ip1>10.254.1.200</ip1>
-        <ip2>10.254.1.200</ip2>
-    </MN>
-
-    <BENCH>
-        <ip>10.254.1.200</ip>
-    </BENCH>
-
-    <TSHARK>
-        <ofpPortStatus>OF 1.3 146</ofpPortStatus>
-        <ofpRoleReply>OF 1.3 90 of_role_reply</ofpRoleReply>
-        <featureReply>OF 1.3 98 of_features_reply</featureReply>
-        <roleRequest>OF 1.3 90 of_role_request</roleRequest>
-        <tcpSynAck>TCP 74 6633</tcpSynAck>
-    </TSHARK>
-
-    <TEST>
-        #'on' or 'off' debug mode.
-        #If on, logging will be more verbose and
-        #tshark pcap will be enabled
-        #pcap file located at /tmp/'capture_name'
-        <debugMode>on</debugMode>
-        <onosLogFile>/opt/onos/log/karaf*</onosLogFile>
-        <mci>off</mci>
-
-        <topoConfigFile>
-        single_topo_event_accumulator.cfg
-        </topoConfigFile>
-        <topoConfigName>
-        org.onlab.onos.net.topology.impl.DefaultTopologyProvider.cfg
-        </topoConfigName>
-
-        #Number of times to iterate each case
-        <numIter>35</numIter>
-        <numSwitch>2</numSwitch>
-        #Number of iterations to ignore initially
-        <iterIgnore>2</iterIgnore>
-
-        <singleSwThreshold>0,1000</singleSwThreshold>
-        <portUpThreshold>0,1000</portUpThreshold>
-        <portDownThreshold>0,1000</portDownThreshold>
-        <linkUpThreshold>0,10000</linkUpThreshold>
-        <linkDownThreshold>0,10000</linkDownThreshold>
-        <swDisc100Threshold>0,10000</swDisc100Threshold>
-    
-        <tabletFile>tablets_3node.json</tabletFile>
-   </TEST>
-
-    <DB>
-        <postToDB>on</postToDB>
-        <portEventResultPath>
-        /home/admin/ONLabTest/TestON/tests/TopoPerfNextBM/portEventResultDb.log
-        </portEventResultPath>
-        <switchEventResultPath>
-        /home/admin/ONLabTest/TestON/tests/TopoPerfNextBM/switchEventResultDb.log
-        </switchEventResultPath>
-    </DB>
-
-    <JSON>
-        <deviceTimestamp>topologyDeviceEventTimestamp</deviceTimestamp>
-        <hostTimestamp>topologyHostEventTimestamp</hostTimestamp>
-        <linkTimestamp>topologyLinkEventTimestamp</linkTimestamp>
-        <graphTimestamp>topologyGraphEventTimestamp</graphTimestamp>
-    </JSON>
-</PARAMS>
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
index 8a9591d..e73c588 100644
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
+++ b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
@@ -17,6 +17,7 @@
         global clusterCount
         global timeToPost
         global runNum
+
         import time
         clusterCount = 1
         timeToPost = time.strftime('%Y-%m-%d %H:%M:%S')
@@ -24,17 +25,21 @@
         cellName = main.params['ENV']['cellName']
         gitPull = main.params['GIT']['autoPull']
         checkoutBranch = main.params['GIT']['checkout']
-        
-        ONOS1Ip = main.params['CTRL']['ip1']
-        ONOS2Ip = main.params['CTRL']['ip2']
-        ONOS3Ip = main.params['CTRL']['ip3']
-        ONOS4Ip = main.params['CTRL']['ip4']
-        ONOS5Ip = main.params['CTRL']['ip5']
-        ONOS6Ip = main.params['CTRL']['ip6']
-        ONOS7Ip = main.params['CTRL']['ip7']
+       
+        global CLIs
+        CLIs = []
+        global nodes
+        nodes = []
+        global nodeIpList
+        nodeIpList = []
+        for i in range( 1, 8 ):
+            CLIs.append( getattr( main, 'ONOS' + str( i ) + 'cli' ) )
+            nodes.append( getattr( main, 'ONOS' + str( i ) ) )
+            nodeIpList.append( main.params[ 'CTRL' ][ 'ip'+str(i) ] )
+
         MN1Ip = main.params['MN']['ip1']
         BENCHIp = main.params['BENCH']['ip']
-        
+        cellFeatures = main.params['ENV']['cellFeatures']
         topoCfgFile = main.params['TEST']['topoConfigFile']
         topoCfgName = main.params['TEST']['topoConfigName']
         portEventResultPath = main.params['DB']['portEventResultPath']
@@ -42,12 +47,14 @@
         mvnCleanInstall = main.params['TEST']['mci']
         
         main.case('Setting up test environment')
-        main.log.info('Copying topology event accumulator config' +
-                ' to ONOS /package/etc')
-        main.ONOSbench.handle.sendline('cp ~/' +
-                topoCfgFile + ' ~/ONOS/tools/package/etc/' +
-                topoCfgName)
-        main.ONOSbench.handle.expect('\\$')
+
+        # NOTE: Below is deprecated after new way to install features
+        #main.log.info('Copying topology event accumulator config' +
+        #        ' to ONOS /package/etc')
+        #main.ONOSbench.handle.sendline('cp ~/' +
+        #        topoCfgFile + ' ~/ONOS/tools/package/etc/' +
+        #        topoCfgName)
+        #main.ONOSbench.handle.expect('\\$')
         
         main.log.report('Setting up test environment')
         
@@ -55,12 +62,9 @@
         main.Mininet1.startNet()
         
         main.step('Cleaning previously installed ONOS if any')
-        main.ONOSbench.onosUninstall(nodeIp=ONOS2Ip)
-        main.ONOSbench.onosUninstall(nodeIp=ONOS3Ip)
-        main.ONOSbench.onosUninstall(nodeIp=ONOS4Ip)
-        main.ONOSbench.onosUninstall(nodeIp=ONOS5Ip)
-        main.ONOSbench.onosUninstall(nodeIp=ONOS6Ip)
-        main.ONOSbench.onosUninstall(nodeIp=ONOS7Ip)
+        # Nodes 2 ~ 7
+        for i in range( 1, 7 ):
+            main.ONOSbench.onosUninstall(nodeIp=nodeIpList[i])
         
         main.step('Clearing previous DB log file')
         
@@ -71,12 +75,9 @@
         fSwitchLog.write('')
         fSwitchLog.close()
         
-        cellStr = 'webconsole,onos-core,onos-api,onos-app-metrics,' +\
-                'onos-app-gui,onos-cli,onos-openflow'
-        
         main.step('Creating cell file')
         cellFileResult = main.ONOSbench.createCellFile(
-                BENCHIp, cellName, MN1Ip, cellStr, ONOS1Ip)
+                BENCHIp, cellName, MN1Ip, cellFeatures, nodeIpList[0])
         
         main.step('Applying cell file to environment')
         cellApplyResult = main.ONOSbench.setCell(cellName)
@@ -100,18 +101,33 @@
             main.log.info('mci turned off by settings')
             mvnResult = main.TRUE
         main.step('Set cell for ONOS cli env')
-        main.ONOS1cli.setCell(cellName)
+        CLIs[0].setCell(cellName)
         
         main.step('Creating ONOS package')
         packageResult = main.ONOSbench.onosPackage()
         
         main.step('Installing ONOS package')
-        install1Result = main.ONOSbench.onosInstall(node=ONOS1Ip)
+        install1Result = main.ONOSbench.onosInstall(node=nodeIpList[0])
         
         time.sleep(10)
         
         main.step('Start onos cli')
-        cli1 = main.ONOS1cli.startOnosCli(ONOS1Ip)
+        cli1 = CLIs[0].startOnosCli(nodeIpList[0])
+        
+        main.step( 'activating essential applications' )
+        CLIs[0].activateApp( 'org.onosproject.metrics' )
+        CLIs[0].activateApp( 'org.onosproject.openflow' )
+
+        main.step( 'Configuring application parameters' )
+        
+        configName = 'org.onosproject.net.topology.impl.DefaultTopologyProvider'
+        configParam = 'maxEvents 1'
+        main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
+        configParam = 'maxBatchMs 0'
+        main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
+        configParam = 'maxIdleMs 0'
+        main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
+        
         utilities.assert_equals(expect=main.TRUE,
                 actual=cellFileResult and cellApplyResult and\
                         verifyCellResult and checkoutResult and\
@@ -144,29 +160,21 @@
         import os
         import numpy
         
-        ONOS1Ip = main.params['CTRL']['ip1']
-        ONOS2Ip = main.params['CTRL']['ip2']
-        ONOS3Ip = main.params['CTRL']['ip3']
-        ONOS4Ip = main.params['CTRL']['ip4']
-        ONOS5Ip = main.params['CTRL']['ip5']
-        ONOS6Ip = main.params['CTRL']['ip6']
-        ONOS7Ip = main.params['CTRL']['ip7']
-        
         ONOSUser = main.params['CTRL']['user']
         defaultSwPort = main.params['CTRL']['port1']
         numIter = main.params['TEST']['numIter']
         iterIgnore = int(main.params['TEST']['iterIgnore'])
         
-        deviceTimestamp = main.params['JSON']['deviceTimestamp']
-        graphTimestamp = main.params['JSON']['graphTimestamp']
+        deviceTimestampKey = main.params['JSON']['deviceTimestamp']
+        graphTimestampKey = main.params['JSON']['graphTimestamp']
 
         debugMode = main.params['TEST']['debugMode']
         onosLog = main.params['TEST']['onosLogFile']
         resultPath = main.params['DB']['switchEventResultPath']
         thresholdStr = main.params['TEST']['singleSwThreshold']
         thresholdObj = thresholdStr.split(',')
-        thresholdMin = int(thresholdObj[0])
-        thresholdMax = int(thresholdObj[1])
+        thresholdMin = float(thresholdObj[0])
+        thresholdMax = float(thresholdObj[1])
        
         # Look for 'role-request' messages,
         # which replaces the 'vendor' messages previously seen
@@ -175,12 +183,57 @@
         tsharkFeatureReply = main.params[ 'TSHARK' ][ 'featureReply' ]
         tsharkRoleRequest = main.params[ 'TSHARK' ][ 'roleRequest' ]
         tsharkOfString = main.params[ 'TSHARK' ][ 'ofpRoleReply' ]
+        tsharkFinAckSequence = main.params[ 'TSHARK' ][ 'finAckSequence' ]
 
         tsharkOfOutput = '/tmp/tshark_of_topo.txt'
         tsharkTcpOutput = '/tmp/tshark_tcp_topo.txt'
         tsharkRoleOutput = '/tmp/tshark_role_request.txt'
         tsharkFeatureOutput = '/tmp/tshark_feature_reply.txt'
+        tsharkFinAckOutput = '/tmp/tshark_fin_ack.txt'
 
+        # Switch connect measurement list
+        # TCP Syn/Ack -> Feature Reply latency collection for each node
+        tcpToFeatureLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
+        # Feature Reply -> Role Request latency collection for each node
+        featureToRoleRequestLatNodeIter = numpy.zeros((clusterCount, 
+            int(numIter)))
+        # Role Request -> Role Reply latency collection for each node
+        roleRequestToRoleReplyLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+        # Role Reply -> Device Update latency collection for each node
+        roleReplyToDeviceLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+        # Device Update -> Graph Update latency collection for each node
+        deviceToGraphLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+        
+        # Switch disconnect measurement lists
+        # Mininet Fin / Ack -> Mininet Ack
+        finAckTransactionLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+        # Mininet Ack -> Device Event
+        ackToDeviceLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+        # Device event -> Graph event
+        deviceToGraphDiscLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+
+        # TCP Syn/Ack -> Feature Reply latency collection for each node
+        tcpToFeatureLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
+        # Feature Reply -> Role Request latency collection for each node
+        featureToRoleRequestLatNodeIter = numpy.zeros((clusterCount, 
+            int(numIter)))
+        # Role Request -> Role Reply latency collection for each node
+        roleRequestToRoleReplyLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+        # Role Reply -> Device Update latency collection for each node
+        roleReplyToDeviceLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+        # Device Update -> Graph Update latency collection for each node
+        deviceToGraphLatNodeIter = numpy.zeros((clusterCount,
+            int(numIter)))
+
+    
         endToEndLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
         ofpToGraphLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
         ofpToDeviceLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
@@ -214,7 +267,7 @@
            
             main.log.info('Assigning s3 to controller')
             main.Mininet1.assignSwController(sw='3',
-                    ip1=ONOS1Ip, port1=defaultSwPort)
+                    ip1=nodeIpList[0], port1=defaultSwPort)
             
             time.sleep(10)
             
@@ -222,14 +275,14 @@
             main.ONOS1.tsharkStop()
             
             main.log.info('Copying over tshark files')
-            os.system('scp ' + ONOSUser + '@' + ONOS1Ip +
+            os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
                     ':' + tsharkTcpOutput + ' /tmp/')
-            os.system('scp ' + ONOSUser + '@' + ONOS1Ip +
+            os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
                     ':' + tsharkRoleOutput + ' /tmp/')
-            os.system('scp ' + ONOSUser + '@' + ONOS1Ip +
+            os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
                     ':' + tsharkFeatureOutput + ' /tmp/')
             os.system('scp ' + ONOSUser + '@' +
-                      ONOS1Ip + ':' + tsharkOfOutput + ' /tmp/')
+                      nodeIpList[0] + ':' + tsharkOfOutput + ' /tmp/')
            
             # Get tcp syn / ack output
             time.sleep(5)
@@ -303,279 +356,96 @@
             # TODO: calculate feature reply, role request times
             # stack measurements correctly and report
 
-            """
             #TODO: Refactor in progress
 
             for node in range(0, clusterCount):
                 nodeNum = node+1
-                exec "metricsSwUp = main.ONOS%scli.topologyEventsMetrics"%str(nodeNum) 
+                metricsSwUp = CLIs[node].topologyEventsMetrics
                 jsonStr = metricsSwUp()
                 jsonObj = json.loads(jsonStr)
-                graphTimestamp = jsonObj[graphTimestamp]['value']
-                deviceTimestamp = jsonObj[deviceTimestamp]['value']
-               
-                deltaGraphTcp = int(graphTimestamp) - int(t0Tcp)
-                deltaDeviceTcp = int(deviceTimestamp) - int(t0Tcp)
-                deltaGraphOfp = int(graphTimestamp) - int(t0Ofp)
-                deltaDeviceOfp = int(deviceTimestamp) - int(t0Ofp)
-                deltaRoleTcp = int(roleTimestamp) - int(t0Tcp) 
-                deltaFeatureTcp = int(featureTimestamp) - int(t0Tcp)
-                deltaOfpTcp = int(t0Ofp) - int(t0Tcp)
-
-                if deltaGraphTcp > thresholdMin and\
-                   deltaGraphTcp < thresholdMax and i >= iterIgnore:
-                    endToEndLatNodeIter[node][i] = deltaGraphTcp
-                    main.log.info("ONOS "+str(nodeNum)+ " tcp-to-graph: "+
-                            str(deltaGraphTcp) + " ms")
+                if jsonObj:
+                    graphTimestamp = jsonObj[graphTimestampKey]['value']
+                    deviceTimestamp = jsonObj[deviceTimestampKey]['value']
                 else:
-                    main.log.info("ONOS "+str(nodeNum)+ " tcp-to-graph "+
+                    main.log.error( "Unexpected JSON object" )
+                    # If we could not obtain the JSON object, 
+                    # set the timestamps to 0, which will be
+                    # excluded from the measurement later on
+                    # (realized as invalid)
+                    graphTimestamp = 0
+                    deviceTimestamp = 0
+                
+                endToEnd = int(graphTimestamp) - int(t0Tcp)
+                
+                # Below are measurement breakdowns of the end-to-end
+                # measurement. 
+                tcpToFeature = int(featureTimestamp) - int(t0Tcp)
+                featureToRole = int(roleTimestamp) - int(featureTimestamp)
+                roleToOfp = int(t0Ofp) - int(roleTimestamp)
+                ofpToDevice = int(deviceTimestamp) - int(t0Ofp)
+                deviceToGraph = float(graphTimestamp) - float(deviceTimestamp)
+                
+                if endToEnd > thresholdMin and\
+                   endToEnd < thresholdMax and i >= iterIgnore:
+                    endToEndLatNodeIter[node][i] = endToEnd 
+                    main.log.info("ONOS "+str(nodeNum)+ " end-to-end: "+
+                            str(endToEnd) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+ " end-to-end "+
                             "measurement ignored due to excess in "+
                             "threshold or premature iteration")
 
-                if deltaGraphOfp > thresholdMin and\
-                   deltaGraphOfp < thresholdMax and i >= iterIgnore:
-                    ofpToGraphLatNodeIter[node][i] = deltaGraphOfp
-                    main.log.info("ONOS "+str(nodeNum)+ " ofp-to-graph: "+
-                            str(deltaGraphOfp) + " ms")
+                if tcpToFeature > thresholdMin and\
+                   tcpToFeature < thresholdMax and i >= iterIgnore:
+                    tcpToFeatureLatNodeIter[node][i] = tcpToFeature 
+                    main.log.info("ONOS "+str(nodeNum)+ " tcp-to-feature: "+
+                            str(tcpToFeature) + " ms")
                 else:
-                    main.log.info("ONOS "+str(nodeNum)+ " ofp-to-graph: "+
+                    main.log.info("ONOS "+str(nodeNum)+ " tcp-to-feature "+
                             "measurement ignored due to excess in "+
                             "threshold or premature iteration")
 
-                if deltaDeviceOfp > thresholdMin and\
-                   deltaDeviceOfp < thresholdMax and i >= iterIgnore:
-                    ofpToDeviceLatNodeIter[node][i] = deltaDeviceOfp
-                    main.log.info("ONOS "+str(nodeNum)+ " ofp-to-device: "+
-                            str(deltaDeviceOfp) + " ms")
+                if featureToRole > thresholdMin and\
+                   featureToRole < thresholdMax and i >= iterIgnore:
+                    featureToRoleRequestLatNodeIter[node][i] = featureToRole 
+                    main.log.info("ONOS "+str(nodeNum)+ " feature-to-role: "+
+                            str(featureToRole) + " ms")
                 else:
-                    main.log.info("ONOS "+str(nodeNum)+ " ofp-to-device: "+
+                    main.log.info("ONOS "+str(nodeNum)+ " feature-to-role "+
                             "measurement ignored due to excess in "+
                             "threshold or premature iteration")
 
+                if roleToOfp > thresholdMin and\
+                   roleToOfp < thresholdMax and i >= iterIgnore:
+                    roleRequestToRoleReplyLatNodeIter[node][i] = roleToOfp
+                    main.log.info("ONOS "+str(nodeNum)+ " role-to-reply: "+
+                            str(roleToOfp) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+ " role-to-reply "+
+                            "measurement ignored due to excess in "+
+                            "threshold or premature iteration")
+                
+                if ofpToDevice > thresholdMin and\
+                   ofpToDevice < thresholdMax and i >= iterIgnore:
+                    roleReplyToDeviceLatNodeIter[node][i] = ofpToDevice 
+                    main.log.info("ONOS "+str(nodeNum)+ " reply-to-device: "+
+                            str(ofpToDevice) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+ " role-to-reply "+
+                            "measurement ignored due to excess in "+
+                            "threshold or premature iteration")
 
+                if deviceToGraph > thresholdMin and\
+                   deviceToGraph < thresholdMax and i >= iterIgnore:
+                    deviceToGraphLatNodeIter[node][i] = deviceToGraph
+                    main.log.info("ONOS "+str(nodeNum)+ " device-to-graph: "+
+                            str(deviceToGraph) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+ " device-to-graph "+
+                            "measurement ignored due to excess in "+
+                            "threshold or premature iteration")
+                                
             # ********************
-            """
-            jsonStr1 = main.ONOS1cli.topologyEventsMetrics()
-            jsonStr2 = ''
-            jsonStr3 = ''
-            jsonStr4 = ''
-            jsonStr5 = ''
-            jsonStr6 = ''
-            jsonStr7 = ''
-            
-            jsonObj1 = json.loads(jsonStr1)
-            jsonObj2 = ''
-            jsonObj3 = ''
-            jsonObj4 = ''
-            jsonObj5 = ''
-            jsonObj6 = ''
-            jsonObj7 = ''
-
-
-            graphTimestamp1 = jsonObj1[graphTimestamp]['value']
-            deviceTimestamp1 = jsonObj1[deviceTimestamp]['value']
-            
-            main.log.info(' GraphTimestamp: ' + str(graphTimestamp1))
-            main.log.info(' DeviceTimestamp: ' + str(deviceTimestamp1))
-            
-            deltaDevice1 = int(deviceTimestamp1) - int(t0Tcp)
-            deltaGraph1 = int(graphTimestamp1) - int(t0Tcp)
-            deltaOfpGraph1 = int(graphTimestamp1) - int(t0Ofp)
-            deltaOfpDevice1 = int(deviceTimestamp1) - int(t0Ofp)
-            # Tshark timestamps 
-            deltaTcpOfp1 = int(t0Ofp) - int(t0Tcp)
-            deltaRoleTcp1 = int(roleTimestamp) - int(t0Tcp) 
-            deltaFeatureTcp1 = int(featureTimestamp) - int(t0Tcp)
-            deltaOfpTcp1 = int(t0Ofp) - int(t0Tcp)
-            
-            if deltaTcpOfp1 > thresholdMin and\
-               deltaTcpOfp1 < thresholdMax and i >= iterIgnore:
-                tcpToOfpLatIter.append(deltaTcpOfp1)
-            main.log.info('ONOS1 iter' + str(i) +
-                              ' tcp-to-ofp: ' +
-                              str(deltaTcpOfp1) + ' ms')
-            if deltaFeatureTcp1 > thresholdMin and\
-               deltaFeatureTcp1 < thresholdMax and i >= iterIgnore:
-                tcpToFeatureLatIter.append(deltaFeatureTcp1)
-            main.log.info('ONOS1 iter' + str(i) +
-                            ' tcp-to-feature-reply: ' +
-                            str(deltaFeatureTcp1) + ' ms')
-            if deltaRoleTcp1 > thresholdMin and\
-               deltaRoleTcp1 < thresholdMax and i >= iterIgnore:
-                tcpToRoleLatIter.append(deltaRoleTcp1)
-            main.log.info('ONOS1 iter' + str(i) +
-                            ' tcp-to-role-request: ' +
-                            str(deltaRoleTcp1) + ' ms')
-            if deltaGraph1 > thresholdMin and\
-               deltaGraph1 < thresholdMax and i >= iterIgnore:
-                endToEndLatNodeIter[0][i] = deltaGraph1
-            main.log.info('ONOS1 iter' + str(i) +
-                              ' end-to-end: ' +
-                              str(deltaGraph1) + ' ms')
-            if deltaOfpGraph1 > thresholdMin and \
-               deltaOfpGraph1 < thresholdMax and i >= iterIgnore:
-                ofpToGraphLatNodeIter[0][i] = deltaOfpGraph1
-            main.log.info('ONOS1 iter' + str(i) +
-                        ' ofp-to-graph: ' +
-                        str(deltaOfpGraph1) + ' ms')
-            if deltaOfpDevice1 > thresholdMin and\
-               deltaOfpDevice1 < thresholdMax and i >= iterIgnore:
-                ofpToDeviceLatNodeIter[0][i] = deltaOfpDevice1
-            main.log.info('ONOS1 iter' + str(i) +
-                        ' ofp-to-device: ' +
-                        str(deltaOfpDevice1))
-            
-            if clusterCount >= 3:
-                jsonStr2 = main.ONOS2cli.topologyEventsMetrics()
-                jsonStr3 = main.ONOS3cli.topologyEventsMetrics()
-                jsonObj2 = json.loads(jsonStr2)
-                jsonObj3 = json.loads(jsonStr3)
-                graphTimestamp2 = jsonObj2[graphTimestamp]['value']
-                graphTimestamp3 = jsonObj3[graphTimestamp]['value']
-                deviceTimestamp2 = jsonObj2[deviceTimestamp]['value']
-                deviceTimestamp3 = jsonObj3[deviceTimestamp]['value']
-                deltaDevice2 = int(deviceTimestamp2) - int(t0Tcp)
-                deltaDevice3 = int(deviceTimestamp3) - int(t0Tcp)
-                deltaGraph2 = int(graphTimestamp2) - int(t0Tcp)
-                deltaGraph3 = int(graphTimestamp3) - int(t0Tcp)
-                deltaOfpGraph2 = int(graphTimestamp2) - int(t0Ofp)
-                deltaOfpGraph3 = int(graphTimestamp3) - int(t0Ofp)
-                deltaOfpDevice2 = int(deviceTimestamp2) - int(t0Ofp)
-                deltaOfpDevice3 = int(deviceTimestamp3) - int(t0Ofp)
-                if deltaGraph2 > thresholdMin and\
-                   deltaGraph2 < thresholdMax and i >= iterIgnore:
-                    endToEndLatNodeIter[1][i] = deltaGraph2
-                main.log.info('ONOS2 iter' + str(i) +
-                            ' end-to-end: ' +
-                            str(deltaGraph2) + ' ms')
-                if deltaOfpGraph2 > thresholdMin and\
-                   deltaOfpGraph2 < thresholdMax and i >= iterIgnore:
-                    ofpToGraphLatNodeIter[1][i] = deltaOfpGraph2
-                main.log.info('ONOS2 iter' + str(i) +
-                            ' ofp-to-graph: ' +
-                            str(deltaOfpGraph2) + ' ms')
-                if deltaOfpDevice2 > thresholdMin and\
-                   deltaOfpDevice2 < thresholdMax and i >= iterIgnore:
-                    ofpToDeviceLatNodeIter[1][i] = deltaOfpDevice2
-                main.log.info('ONOS2 iter' + str(i) +
-                            ' ofp-to-device: ' +
-                            str(deltaOfpDevice2)+ ' ms')
-                if deltaGraph3 > thresholdMin and\
-                   deltaGraph3 < thresholdMax and i >= iterIgnore:
-                    endToEndLatNodeIter[2][i] = deltaGraph3
-                main.log.info('ONOS3 iter' + str(i) +
-                            ' end-to-end: ' + str(deltaGraph3) + ' ms')
-                if deltaOfpGraph3 > thresholdMin and\
-                   deltaOfpGraph3 < thresholdMax and i >= iterIgnore:
-                    ofpToGraphLatNodeIter[2][i] = deltaOfpGraph3
-                main.log.info('ONOS3 iter' + str(i) +
-                            ' ofp-to-graph: ' +
-                            str(deltaOfpGraph3) + ' ms')
-                if deltaOfpDevice3 > thresholdMin and\
-                   deltaOfpDevice3 < thresholdMax and i >= iterIgnore:
-                    ofpToDeviceLatNodeIter[2][i] = deltaOfpDevice3
-                main.log.info('ONOS3 iter' + str(i) +
-                            ' ofp-to-device: ' + str(deltaOfpDevice3))
-            if clusterCount >= 5:
-                jsonStr4 = main.ONOS4cli.topologyEventsMetrics()
-                jsonStr5 = main.ONOS5cli.topologyEventsMetrics()
-                jsonObj4 = json.loads(jsonStr4)
-                jsonObj5 = json.loads(jsonStr5)
-                graphTimestamp4 = jsonObj4[graphTimestamp]['value']
-                graphTimestamp5 = jsonObj5[graphTimestamp]['value']
-                deviceTimestamp4 = jsonObj4[deviceTimestamp]['value']
-                deviceTimestamp5 = jsonObj5[deviceTimestamp]['value']
-                deltaDevice4 = int(deviceTimestamp4) - int(t0Tcp)
-                deltaDevice5 = int(deviceTimestamp5) - int(t0Tcp)
-                deltaGraph4 = int(graphTimestamp4) - int(t0Tcp)
-                deltaGraph5 = int(graphTimestamp5) - int(t0Tcp)
-                deltaOfpGraph4 = int(graphTimestamp4) - int(t0Ofp)
-                deltaOfpGraph5 = int(graphTimestamp5) - int(t0Ofp)
-                deltaOfpDevice4 = int(deviceTimestamp4) - int(t0Ofp)
-                deltaOfpDevice5 = int(deviceTimestamp5) - int(t0Ofp)
-                if deltaGraph4 > thresholdMin and \
-                   deltaGraph4 < thresholdMax and i >= iterIgnore:
-                    endToEndLatNodeIter[3][i] = deltaGraph4
-                main.log.info('ONOS4 iter' + str(i) +
-                            ' end-to-end: ' + str(deltaGraph4) + ' ms')
-                if deltaOfpDevice4 > thresholdMin and \
-                   deltaOfpDevice4 < thresholdMax and i >= iterIgnore:
-                    ofpToDeviceLatNodeIter[3][i] = deltaOfpDevice4
-                main.log.info('ONOS4 iter' + str(i) +
-                            ' ofp-to-device: ' + str(deltaOfpDevice4))
-                if deltaOfpGraph4 > thresholdMin and \
-                        deltaOfpGraph4 < thresholdMax and i >= iterIgnore:
-                    ofpToGraphLatNodeIter[3][i] = deltaOfpGraph4
-                main.log.info('ONOS4 iter' + str(i) +
-                            ' ofp-to-graph: ' + str(deltaOfpGraph4) + ' ms')
-                if deltaGraph5 > thresholdMin and\
-                        deltaGraph5 < thresholdMax and i >= iterIgnore:
-                    endToEndLatNodeIter[4][i] = deltaGraph5
-                main.log.info('ONOS5 iter' + str(i) +
-                            ' end-to-end: ' + str(deltaGraph5) + ' ms')
-                if deltaOfpDevice5 > thresholdMin and\
-                        deltaOfpDevice5 < thresholdMax and i >= iterIgnore:
-                    ofpToDeviceLatNodeIter[4][i] = deltaOfpDevice5
-                main.log.info('ONOS5 iter' + str(i) +
-                            ' ofp-to-device: ' + str(deltaOfpDevice5))
-                if deltaOfpGraph5 > thresholdMin and\
-                        deltaOfpGraph5 < thresholdMax and i >= iterIgnore:
-                    ofpToGraphLatNodeIter[4][i] = deltaOfpGraph5
-                main.log.info('ONOS5 iter' + str(i) +
-                            ' ofp-to-graph: ' +
-                            str(deltaOfpGraph5) + ' ms')
-            if clusterCount >= 7:
-                jsonStr6 = main.ONOS6cli.topologyEventsMetrics()
-                jsonStr7 = main.ONOS7cli.topologyEventsMetrics()
-                jsonObj6 = json.loads(jsonStr6)
-                jsonObj7 = json.loads(jsonStr7)
-                graphTimestamp6 = jsonObj6[graphTimestamp]['value']
-                graphTimestamp7 = jsonObj7[graphTimestamp]['value']
-                deviceTimestamp6 = jsonObj6[deviceTimestamp]['value']
-                deviceTimestamp7 = jsonObj7[deviceTimestamp]['value']
-                deltaDevice6 = int(deviceTimestamp6) - int(t0Tcp)
-                deltaDevice7 = int(deviceTimestamp7) - int(t0Tcp)
-                deltaGraph6 = int(graphTimestamp6) - int(t0Tcp)
-                deltaGraph7 = int(graphTimestamp7) - int(t0Tcp)
-                deltaOfpGraph6 = int(graphTimestamp6) - int(t0Ofp)
-                deltaOfpGraph7 = int(graphTimestamp7) - int(t0Ofp)
-                deltaOfpDevice6 = int(deviceTimestamp6) - int(t0Ofp)
-                deltaOfpDevice7 = int(deviceTimestamp7) - int(t0Ofp)
-                if deltaGraph6 > thresholdMin and \
-                   deltaGraph6 < thresholdMax and i >= iterIgnore:
-                    endToEndLatNodeIter[5][i] = deltaGraph6
-                main.log.info('ONOS6 iter' + str(i) +
-                            ' end-to-end: ' + str(deltaGraph6) + ' ms')
-                if deltaOfpDevice6 > thresholdMin and\
-                   deltaOfpDevice6 < thresholdMax and i >= iterIgnore:
-                    ofpToDeviceLatNodeIter[5][i] = deltaOfpDevice6
-                main.log.info('ONOS6 iter' + str(i) +
-                            ' ofp-to-device: ' + str(deltaOfpDevice6))
-                if deltaOfpGraph6 > thresholdMin and\
-                   deltaOfpGraph6 < thresholdMax and i >= iterIgnore:
-                    ofpToGraphLatNodeIter[5][i] = deltaOfpGraph6
-                main.log.info('ONOS6 iter' + str(i) +
-                            ' ofp-to-graph: ' +
-                            str(deltaOfpGraph6) + ' ms')
-                if deltaGraph7 > thresholdMin and \
-                   deltaGraph7 < thresholdMax and i >= iterIgnore:
-                    endToEndLatNodeIter[6][i] = deltaGraph7
-                main.log.info('ONOS7 iter' + str(i) +
-                            ' end-to-end: ' + 
-                            str(deltaGraph7) + ' ms')
-                if deltaOfpDevice7 > thresholdMin and\
-                        deltaOfpDevice7 < thresholdMax and i >= iterIgnore:
-                    ofpToDeviceLatNodeIter[6][i] = deltaOfpDevice7
-                main.log.info('ONOS7 iter' + str(i) +
-                            ' ofp-to-device: ' +
-                            str(deltaOfpDevice7))
-                if deltaOfpGraph7 > thresholdMin and \
-                        deltaOfpGraph7 < thresholdMax and i >= iterIgnore:
-                    ofpToGraphLatNodeIter[6][i] = deltaOfpGraph7
-                main.log.info('ONOS7 iter' + str(i) +
-                            ' ofp-to-graph: ' +
-                            str(deltaOfpGraph7) + ' ms')
-
             time.sleep(5)
         
             # Get device id to remove
@@ -587,18 +457,129 @@
             deviceList = []
             for device in deviceId:
                 deviceList.append(device['id'])
-            
+           
+            # Measure switch down metrics 
+            # TCP FIN/ACK -> TCP FIN
+            # TCP FIN -> Device Event
+            # Device Event -> Graph Event
+            # Capture switch down FIN / ACK packets
+
+            main.ONOS1.tsharkGrep( tsharkFinAckSequence, tsharkFinAckOutput, 
+                    grepOptions = '-A 1' )
+           
+            time.sleep( 5 )
+
+            removeJsonList = []
+
             main.step('Remove switch from controller')
             main.Mininet1.deleteSwController('s3')
-            
-            #firstDevice = deviceList[0] 
-            firstDevice = "of:0000000000000003"
+            firstDevice = deviceList[0] 
             main.log.info( "Removing device " +str(firstDevice)+
                     " from ONOS" )
+            
+            time.sleep( 5 )
+           
+            # We need to get metrics before removing
+            # device from the store below.
+            for node in range(0, clusterCount):
+                metricsSwDown = CLIs[node].topologyEventsMetrics
+                jsonStr = metricsSwDown()
+                removeJsonList.append( json.loads(jsonStr) ) 
+            
             #if deviceId:
             main.ONOS1cli.deviceRemove(firstDevice)
+           
+            main.ONOS1.tsharkStop()
+
+            main.log.info('Copying over tshark files')
+            os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
+                    ':' + tsharkFinAckOutput + ' /tmp/')
+           
+            time.sleep( 10 )
+            finAckOutputList = []
+            with open(tsharkFinAckOutput, 'r') as f:
+                tempLine = f.readlines()
+                main.log.info('Object read in from FinAck capture: ' +
+                    str(tempLine))
+                
+                index = 1
+                for line in tempLine:
+                    obj = line.split(' ')
             
+                    if len(obj) > 1:
+                        if index == 1:
+                            tFinAck = float(obj[1]) * 1000.0
+                        elif index == 3:
+                            tAck = float(obj[1]) * 1000.0
+                    else:
+                        main.log.error('Tshark output file for OFP' +
+                            ' returned unexpected results')
+                        tFinAck = 0
+                        tAck = 0
+                        assertion = main.FALSE
+                    
+                    index = index+1
+
+            # with open() as f takes care of closing file
+
             time.sleep(5)
+            
+            for node in range(0, clusterCount):
+                nodeNum = node+1
+                jsonObj = removeJsonList[node]
+                if jsonObj:
+                    graphTimestamp = jsonObj[graphTimestampKey]['value']
+                    deviceTimestamp = jsonObj[deviceTimestampKey]['value']
+                    main.log.info("Graph timestamp: "+str(graphTimestamp))
+                    main.log.info("Device timestamp: "+str(deviceTimestamp))
+                else:
+                    main.log.error( "Unexpected JSON object" )
+                    # If we could not obtain the JSON object, 
+                    # set the timestamps to 0, which will be
+                    # excluded from the measurement later on
+                    # (realized as invalid)
+                    graphTimestamp = 0
+                    deviceTimestamp = 0
+               
+                finAckTransaction = int(tAck) - int(tFinAck)
+                ackToDevice = int(deviceTimestamp) - int(tAck)
+                deviceToGraph = int(graphTimestamp) - int(deviceTimestamp)
+                
+                if finAckTransaction > thresholdMin and\
+                   finAckTransaction < thresholdMax and i >= iterIgnore:
+                    finAckTransactionLatNodeIter[node][i] = finAckTransaction 
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " fin/ack transaction: "+
+                            str(finAckTransaction) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " fin/ack transaction "+
+                            "measurement ignored due to excess in "+
+                            "threshold or premature iteration")
+                
+                if ackToDevice > thresholdMin and\
+                   ackToDevice < thresholdMax and i >= iterIgnore:
+                    ackToDeviceLatNodeIter[node][i] = ackToDevice
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " ack-to-device: "+
+                            str(ackToDevice) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " ack-to-device "+
+                            "measurement ignored due to excess in "+
+                            "threshold or premature iteration")
+                
+                if deviceToGraph > thresholdMin and\
+                   deviceToGraph < thresholdMax and i >= iterIgnore:
+                    deviceToGraphDiscLatNodeIter[node][i] = deviceToGraph
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " device-to-graph disconnect: "+
+                            str(deviceToGraph) + " ms")
+                else:
+                    main.log.info("ONOS "+str(nodeNum)+
+                            " device-to-graph disconnect "+
+                            "measurement ignored due to excess in "+
+                            "threshold or premature iteration")
 
         endToEndAvg = 0
         ofpToGraphAvg = 0
@@ -606,67 +587,143 @@
         for node in range(0, clusterCount):
             # List of latency for each node
             endToEndList = []
-            ofpToGraphList = []
-            ofpToDeviceList = []
-            tcpToOfpList = []
+            
             tcpToFeatureList = []
-            tcpToRoleList = []
+            featureToRoleList = []
+            roleToOfpList = []
+            ofpToDeviceList = []
+            deviceToGraphList = []
+            
+            finAckTransactionList = []
+            ackToDeviceList = []
+            deviceToGraphDiscList = []
 
             # LatNodeIter 2d arrays contain all iteration latency
             # for each node of the current scale cluster size
-
+            # Switch connection measurements
+            # Set further acceptance criteria for measurements
+            # here if you would like to filter reporting results
             for item in endToEndLatNodeIter[node]:
                 if item > 0.0:
                     endToEndList.append(item)
 
-            for item in ofpToGraphLatNodeIter[node]:
-                if item > 0.0:
-                    ofpToGraphList.append(item)
-
-            for item in ofpToDeviceLatNodeIter[node]:
-                if item > 0.0:
-                    ofpToDeviceList.append(item)
-
-            for item in tcpToOfpLatIter:
-                if item > 0.0:
-                    tcpToOfpList.append(item)
-
-            for item in tcpToFeatureLatIter:
+            for item in tcpToFeatureLatNodeIter[node]:
                 if item > 0.0:
                     tcpToFeatureList.append(item)
 
-            for item in tcpToRoleLatIter:
+            for item in featureToRoleRequestLatNodeIter[node]:
                 if item > 0.0:
-                    tcpToRoleList.append(item)
+                    featureToRoleList.append(item)
 
+            for item in roleRequestToRoleReplyLatNodeIter[node]:
+                if item > 0.0:
+                    roleToOfpList.append(item)
+
+            for item in roleReplyToDeviceLatNodeIter[node]:
+                if item > 0.0:
+                    tcpToFeatureList.append(item)
+
+            for item in featureToRoleRequestLatNodeIter[node]:
+                if item > 0.0:
+                    featureToRoleList.append(item)
+
+            for item in deviceToGraphLatNodeIter[node]:
+                if item > 0.0:
+                    deviceToGraphList.append(item)
+
+            # Switch disconnect measurements
+            for item in finAckTransactionLatNodeIter[node]:
+                if item > 0.0:
+                    finAckTransactionList.append(item)
+
+            for item in ackToDeviceLatNodeIter[node]:
+                if item > 0.0:
+                    ackToDeviceList.append(item)
+
+            for item in deviceToGraphDiscLatNodeIter[node]:
+                if item > 0.0:
+                    deviceToGraphDiscList.append(item)
+            
             endToEndAvg = round(numpy.mean(endToEndList), 2)
-            tcpToOfpAvg = round(numpy.mean(tcpToOfpList), 2)
+            endToEndStdDev = round(numpy.std(endToEndList), 2)
+
             tcpToFeatureAvg = round(numpy.mean(tcpToFeatureList), 2)
-            tcpToRoleAvg = round(numpy.mean(tcpToRoleList), 2)
-            ofpToGraphAvg = round(numpy.mean(ofpToGraphList), 2)
-            endToEndStd = round(numpy.std(endToEndList), 2)
-            ofpToGraphStd = round(numpy.std(ofpToGraphList), 2)
+            tcpToFeatureStdDev = round(numpy.std(tcpToFeatureList), 2)
+
+            featureToRoleAvg = round(numpy.mean(featureToRoleList), 2)
+            featureToRoleStdDev = round(numpy.std(featureToRoleList), 2)
+            
+            roleToOfpAvg = round(numpy.mean(roleToOfpList), 2)
+            roleToOfpStdDev = round(numpy.std(roleToOfpList), 2)
+
             ofpToDeviceAvg = round(numpy.mean(ofpToDeviceList), 2)
-            ofpToDeviceStd = round(numpy.std(ofpToDeviceList), 2)
+            ofpToDeviceStdDev = round(numpy.std(ofpToDeviceList), 2)
+            
+            deviceToGraphAvg = round(numpy.mean(deviceToGraphList), 2)
+            deviceToGraphStdDev = round(numpy.std(deviceToGraphList), 2)
+
+            finAckAvg = round(numpy.mean(finAckTransactionList), 2)
+            finAckStdDev = round(numpy.std(finAckTransactionList), 2)
+            
+            ackToDeviceAvg = round(numpy.mean(ackToDeviceList), 2)
+            ackToDeviceStdDev = round(numpy.std(ackToDeviceList), 2)
+            
+            deviceToGraphDiscAvg = round(numpy.mean(deviceToGraphDiscList), 2)
+            deviceToGraphDiscStdDev = round(numpy.std(deviceToGraphDiscList), 2)
+
             main.log.report(' - Node ' + str(node + 1) + ' Summary - ')
+            main.log.report(' - Switch Connection Statistics - ')
+            
             main.log.report(' End-to-end Avg: ' + str(endToEndAvg) +
                     ' ms' + ' End-to-end Std dev: ' +
-                    str(endToEndStd) + ' ms')
-            main.log.report(' Tcp-to-role-reply : ' + str(tcpToOfpAvg) + ' ms')
-            main.log.report(' Tcp-to-feature-reply : ' + str(tcpToFeatureAvg) + ' ms')
-            main.log.report(' Tcp-to-role-request : ' + str(tcpToRoleAvg) + ' ms')
-            main.log.report(' Ofp-to-graph Avg: ' + str(ofpToGraphAvg) +
-                    ' ms' + ' Ofp-to-graph Std dev: ' +
-                    str(ofpToGraphStd) + ' ms')
-            main.log.report(' Ofp-to-device Avg: ' + str(ofpToDeviceAvg) +
-                    ' ms' + ' Ofp-to-device Std dev: ' +
-                    str(ofpToDeviceStd) + ' ms')
+                    str(endToEndStdDev) + ' ms')
+            
+            main.log.report(' Tcp-to-feature-reply Avg: ' +
+                    str(tcpToFeatureAvg) + ' ms')
+            main.log.report(' Tcp-to-feature-reply Std dev: '+
+                    str(tcpToFeatureStdDev) + ' ms')
+            
+            main.log.report(' Feature-reply-to-role-request Avg: ' +
+                    str(featureToRoleAvg) + ' ms')
+            main.log.report(' Feature-reply-to-role-request Std Dev: ' +
+                    str(featureToRoleStdDev) + ' ms')
+            
+            main.log.report(' Role-request-to-role-reply Avg: ' +
+                    str(roleToOfpAvg) +' ms')
+            main.log.report(' Role-request-to-role-reply Std dev: ' +
+                    str(roleToOfpStdDev) + ' ms')
+            
+            main.log.report(' Role-reply-to-device Avg: ' +
+                    str(ofpToDeviceAvg) +' ms')
+            main.log.report(' Role-reply-to-device Std dev: ' +
+                    str(ofpToDeviceStdDev) + ' ms')
+            
+            main.log.report(' Device-to-graph Avg: ' +
+                    str(deviceToGraphAvg) + ' ms')
+            main.log.report( 'Device-to-graph Std dev: ' +
+                    str(deviceToGraphStdDev) + ' ms')
+            
+            main.log.report(' - Switch Disconnection Statistics - ')
+            main.log.report(' Fin/Ack-to-Ack Avg: ' + str(finAckAvg) + ' ms')
+            main.log.report(' Fin/Ack-to-Ack Std dev: ' +
+                    str(finAckStdDev) + ' ms')
+            
+            main.log.report(' Ack-to-device Avg: ' + str(ackToDeviceAvg) + 
+                    ' ms')
+            main.log.report(' Ack-to-device Std dev: ' + str(ackToDeviceStdDev) +
+                    ' ms')
+
+            main.log.report(' Device-to-graph (disconnect) Avg: ' +
+                    str(deviceToGraphDiscAvg) + ' ms')
+            main.log.report(' Device-to-graph (disconnect) Std dev: ' +
+                    str(deviceToGraphDiscStdDev) + ' ms')
+
             dbCmdList.append(
                     "INSERT INTO switch_latency_tests VALUES('" +
                     timeToPost + "','switch_latency_results'," +
                     runNum + ',' + str(clusterCount) + ",'baremetal" + 
                     str(node + 1) + "'," + str(endToEndAvg) + ',' +
-                    str(endToEndStd) + ',0,0);')
+                    str(endToEndStdDev) + ',0,0);')
 
         if debugMode == 'on':
             main.ONOS1.cpLogsToDir('/opt/onos/log/karaf.log',
@@ -706,9 +763,10 @@
         assertion = main.TRUE
         numIter = main.params['TEST']['numIter']
         iterIgnore = int(main.params['TEST']['iterIgnore'])
-        deviceTimestamp = main.params['JSON']['deviceTimestamp']
-        graphTimestamp = main.params['JSON']['graphTimestamp']
-        linkTimestamp = main.params['JSON']['linkTimestamp']
+        
+        deviceTimestampKey = main.params['JSON']['deviceTimestamp']
+        graphTimestampKey = main.params['JSON']['graphTimestamp']
+        linkTimestampKey = main.params['JSON']['linkTimestamp']
         
         tsharkPortUp = '/tmp/tshark_port_up.txt'
         tsharkPortDown = '/tmp/tshark_port_down.txt'
@@ -764,22 +822,34 @@
         for i in range(0, int(numIter)):
             main.step('Starting wireshark capture for port status down')
             main.ONOS1.tsharkGrep(tsharkPortStatus, tsharkPortDown)
+            
             time.sleep(5)
+            
             main.step('Disable port: ' + interfaceConfig)
             main.Mininet1.handle.sendline('sh ifconfig ' +
                     interfaceConfig + ' down')
             main.Mininet1.handle.expect('mininet>')
+            
             time.sleep(3)
+            
             main.ONOS1.tsharkStop()
+            
             os.system('scp ' + ONOSUser + '@' + ONOS1Ip + ':' +
                     tsharkPortDown + ' /tmp/')
+            
             fPortDown = open(tsharkPortDown, 'r')
             fLine = fPortDown.readline()
             objDown = fLine.split(' ')
             if len(fLine) > 0:
                 timestampBeginPtDown = int(float(objDown[1]) * 1000)
+                # At times, tshark reports timestamp at the 3rd 
+                # index of the array. If initial readings were 
+                # unlike the epoch timestamp, then check the 3rd
+                # index and set that as a timestamp
                 if timestampBeginPtDown < 1400000000000:
                     timestampBeginPtDown = int(float(objDown[2]) * 1000)
+                # If there are any suspicion of invalid results
+                # check this reported value
                 main.log.info('Port down begin timestamp: ' +
                         str(timestampBeginPtDown))
             else:
@@ -788,25 +858,28 @@
                 timestampBeginPtDown = 0
             fPortDown.close()
           
-            """
-            # TODO: Refactor in progress
-
             for node in range(0, clusterCount):
                 nodeNum = node+1
-                exec "metricsDown = main.ONOS%scli.topologyEventsMetrics"%str(nodeNum) 
+                metricsDown = CLIs[node].topologyEventsMetrics
                 jsonStrDown = metricsDown()
                 jsonObj = json.loads(jsonStrDown)
                 
-                graphTimestamp = jsonObj[graphTimestamp]['value']
-                deviceTimestamp = jsonObj[deviceTimestamp]['value']
-                linkTimestamp = jsonObj[linkTimestamp]['value']
-                
+                if jsonObj:
+                    graphTimestamp = jsonObj[graphTimestampKey]['value']
+                    deviceTimestamp = jsonObj[deviceTimestampKey]['value']
+                    linkTimestamp = jsonObj[linkTimestampKey]['value']
+                else:
+                    main.log.error( "Unexpected json object" )
+                    graphTimestamp = 0
+                    deviceTimestamp = 0
+                    linkTimestamp = 0
+
                 ptDownGraphToOfp = int(graphTimestamp) - int(timestampBeginPtDown)
                 ptDownDeviceToOfp = int(deviceTimestamp) - int(timestampBeginPtDown)
                 ptDownLinkToOfp = int(linkTimestamp) - int(timestampBeginPtDown)
 
                 if ptDownGraphToOfp > downThresholdMin and\
-                   ptDownGraphToOfp < downThresholdMax and i > iterIgnore:
+                   ptDownGraphToOfp < downThresholdMax and i >= iterIgnore:
                     portDownGraphNodeIter[node][i] = ptDownGraphToOfp
                     main.log.info("ONOS "+str(nodeNum)+ 
                             " port down graph-to-ofp: "+
@@ -817,8 +890,8 @@
                             " due to excess in threshold or premature iteration")
 
                 if ptDownDeviceToOfp > downThresholdMin and\
-                   ptDownDeviceToOfp < downThresholdMax and i > iterIgnore:
-                    portDownDeviceNodeIter[node][i] = ptDownDeviceToOfp
+                   ptDownDeviceToOfp < downThresholdMax and i >= iterIgnore:
+                    portDownDevNodeIter[node][i] = ptDownDeviceToOfp
                     main.log.info("ONOS "+str(nodeNum)+ 
                             " port down device-to-ofp: "+
                             str(ptDownDeviceToOfp) + " ms") 
@@ -828,7 +901,7 @@
                             " due to excess in threshold or premature iteration")
 
                 if ptDownLinkToOfp > downThresholdMin and\
-                   ptDownLinkToOfp < downThresholdMax and i > iterIgnore:
+                   ptDownLinkToOfp < downThresholdMax and i >= iterIgnore:
                     portDownLinkNodeIter[node][i] = ptDownLinkToOfp
                     main.log.info("ONOS "+str(nodeNum)+
                             " port down link-to-ofp: "+
@@ -837,199 +910,6 @@
                     main.log.info("ONOS "+str(nodeNum)+
                             " port down link-to-ofp ignored"+
                             " due to excess in threshold or premature iteration")
-            """
-            # *************************
-
-            main.step('Obtain t1 by metrics call')
-            
-            jsonStrUp1 = main.ONOS1cli.topologyEventsMetrics()
-            jsonObj1 = json.loads(jsonStrUp1)
-            graphTimestamp1 = jsonObj1[graphTimestamp]['value']
-            deviceTimestamp1 = jsonObj1[deviceTimestamp]['value']
-            linkTimestamp1 = jsonObj1[linkTimestamp]['value']
-            ptDownGraphToOfp1 = int(graphTimestamp1) - int(timestampBeginPtDown)
-            ptDownDeviceToOfp1 = int(deviceTimestamp1) - int(timestampBeginPtDown)
-            ptDownLinkToOfp1 = int(linkTimestamp1) - int(timestampBeginPtDown)
-           
-            if ptDownGraphToOfp1 > downThresholdMin and\
-               ptDownGraphToOfp1 < downThresholdMax and i > iterIgnore:
-                portDownGraphNodeIter[0][i] = ptDownGraphToOfp1
-                main.log.info('ONOS1 iter' + str(i) +
-                        ' port down graph-to-ofp: ' +
-                        str(ptDownGraphToOfp1) + ' ms')
-            
-            if ptDownDeviceToOfp1 > downThresholdMin and \
-               ptDownDeviceToOfp1 < downThresholdMax and i > iterIgnore:
-                portDownDevNodeIter[0][i] = ptDownDeviceToOfp1
-                main.log.info('ONOS1 iter' + str(i) + 
-                        ' port down device-to-ofp: ' +
-                        str(ptDownDeviceToOfp1) + ' ms')
-            if ptDownLinkToOfp1 > downThresholdMin and\
-               ptDownLinkToOfp1 < downThresholdMax and i > iterIgnore:
-                portDownLinkNodeIter[0][i] = ptDownLinkToOfp1
-                main.log.info('ONOS1 iter' + str(i) +
-                        ' port down link-to-ofp: ' +
-                        str(ptDownLinkToOfp1) + ' ms')
-            
-            if clusterCount >= 3:
-                jsonStrUp2 = main.ONOS2cli.topologyEventsMetrics()
-                jsonStrUp3 = main.ONOS3cli.topologyEventsMetrics()
-                jsonObj2 = json.loads(jsonStrUp2)
-                jsonObj3 = json.loads(jsonStrUp3)
-                graphTimestamp2 = jsonObj2[graphTimestamp]['value']
-                graphTimestamp3 = jsonObj3[graphTimestamp]['value']
-                deviceTimestamp2 = jsonObj2[deviceTimestamp]['value']
-                deviceTimestamp3 = jsonObj3[deviceTimestamp]['value']
-                linkTimestamp2 = jsonObj2[linkTimestamp]['value']
-                linkTimestamp3 = jsonObj3[linkTimestamp]['value']
-                ptDownGraphToOfp2 = int(graphTimestamp2) - int(timestampBeginPtDown)
-                ptDownGraphToOfp3 = int(graphTimestamp3) - int(timestampBeginPtDown)
-                ptDownDeviceToOfp2 = int(deviceTimestamp2) - int(timestampBeginPtDown)
-                ptDownDeviceToOfp3 = int(deviceTimestamp3) - int(timestampBeginPtDown)
-                ptDownLinkToOfp2 = int(linkTimestamp2) - int(timestampBeginPtDown)
-                ptDownLinkToOfp3 = int(linkTimestamp3) - int(timestampBeginPtDown)
-                if ptDownGraphToOfp2 > downThresholdMin and\
-                   ptDownGraphToOfp2 < downThresholdMax and i > iterIgnore:
-                    portDownGraphNodeIter[1][i] = ptDownGraphToOfp2
-                    main.log.info('ONOS2 iter' + str(i) +
-                            ' graph-to-ofp: ' +
-                            str(ptDownGraphToOfp2) + ' ms')
-                if ptDownDeviceToOfp2 > downThresholdMin and \
-                   ptDownDeviceToOfp2 < downThresholdMax and i > iterIgnore:
-                    portDownDevNodeIter[1][i] = ptDownDeviceToOfp2
-                    main.log.info('ONOS2 iter' + str(i) +
-                            ' device-to-ofp: ' +
-                            str(ptDownDeviceToOfp2) + ' ms')
-                if ptDownLinkToOfp2 > downThresholdMin and\
-                   ptDownLinkToOfp2 < downThresholdMax and i > iterIgnore:
-                    portDownLinkNodeIter[1][i] = ptDownLinkToOfp2
-                    main.log.info('ONOS2 iter' + str(i) +
-                            ' link-to-ofp: ' +
-                            str(ptDownLinkToOfp2) + ' ms')
-                if ptDownGraphToOfp3 > downThresholdMin and\
-                   ptDownGraphToOfp3 < downThresholdMax and i > iterIgnore:
-                    portDownGraphNodeIter[2][i] = ptDownGraphToOfp3
-                    main.log.info('ONOS3 iter' + str(i) +
-                            ' graph-to-ofp: ' +
-                            str(ptDownGraphToOfp3) + ' ms')
-                if ptDownDeviceToOfp3 > downThresholdMin and\
-                   ptDownDeviceToOfp3 < downThresholdMax and i > iterIgnore:
-                    portDownDevNodeIter[2][i] = ptDownDeviceToOfp3
-                    main.log.info('ONOS3 iter' + str(i) +
-                            ' device-to-ofp: ' +
-                            str(ptDownDeviceToOfp3) + ' ms')
-                if ptDownLinkToOfp3 > downThresholdMin and\
-                   ptDownLinkToOfp3 < downThresholdMax and i > iterIgnore:
-                    portDownLinkNodeIter[2][i] = ptDownLinkToOfp3
-                    main.log.info('ONOS3 iter' + str(i) +
-                            ' link-to-ofp: ' +
-                            str(ptDownLinkToOfp3) + ' ms')
-            if clusterCount >= 5:
-                jsonStrUp4 = main.ONOS4cli.topologyEventsMetrics()
-                jsonStrUp5 = main.ONOS5cli.topologyEventsMetrics()
-                jsonObj4 = json.loads(jsonStrUp4)
-                jsonObj5 = json.loads(jsonStrUp5)
-                graphTimestamp4 = jsonObj4[graphTimestamp]['value']
-                graphTimestamp5 = jsonObj5[graphTimestamp]['value']
-                deviceTimestamp4 = jsonObj4[deviceTimestamp]['value']
-                deviceTimestamp5 = jsonObj5[deviceTimestamp]['value']
-                linkTimestamp4 = jsonObj4[linkTimestamp]['value']
-                linkTimestamp5 = jsonObj5[linkTimestamp]['value']
-                ptDownGraphToOfp4 = int(graphTimestamp4) - int(timestampBeginPtDown)
-                ptDownGraphToOfp5 = int(graphTimestamp5) - int(timestampBeginPtDown)
-                ptDownDeviceToOfp4 = int(deviceTimestamp4) - int(timestampBeginPtDown)
-                ptDownDeviceToOfp5 = int(deviceTimestamp5) - int(timestampBeginPtDown)
-                ptDownLinkToOfp4 = int(linkTimestamp4) - int(timestampBeginPtDown)
-                ptDownLinkToOfp5 = int(linkTimestamp5) - int(timestampBeginPtDown)
-                if ptDownGraphToOfp4 > downThresholdMin and \
-                   ptDownGraphToOfp4 < downThresholdMax and i > iterIgnore:
-                    portDownGraphNodeIter[3][i] = ptDownGraphToOfp4
-                    main.log.info('ONOS4 iter' + str(i) +
-                            ' graph-to-ofp: ' +
-                            str(ptDownGraphToOfp4) + ' ms')
-                if ptDownDeviceToOfp4 > downThresholdMin and\
-                   ptDownDeviceToOfp4 < downThresholdMax and i > iterIgnore:
-                    portDownDevNodeIter[3][i] = ptDownDeviceToOfp4
-                    main.log.info('ONOS4 iter' + str(i) +
-                            ' device-to-ofp: ' +
-                            str(ptDownDeviceToOfp4) + ' ms')
-                if ptDownLinkToOfp4 > downThresholdMin and\
-                   ptDownLinkToOfp4 < downThresholdMax and i > iterIgnore:
-                    portDownLinkNodeIter[3][i] = ptDownLinkToOfp4
-                    main.log.info('ONOS4 iter' + str(i) +
-                            ' link-to-ofp: ' +
-                            str(ptDownLinkToOfp4) + ' ms')
-                if ptDownGraphToOfp5 > downThresholdMin and\
-                   ptDownGraphToOfp5 < downThresholdMax and i > iterIgnore:
-                    portDownGraphNodeIter[4][i] = ptDownGraphToOfp5
-                    main.log.info('ONOS5 iter' + str(i) +
-                            ' graph-to-ofp: ' +
-                            str(ptDownGraphToOfp5) + ' ms')
-                if ptDownDeviceToOfp5 > downThresholdMin and\
-                   ptDownDeviceToOfp5 < downThresholdMax and i > iterIgnore:
-                    portDownDevNodeIter[4][i] = ptDownDeviceToOfp5
-                    main.log.info('ONOS5 iter' + str(i) +
-                            ' device-to-ofp: ' +
-                            str(ptDownDeviceToOfp5) + ' ms')
-                if ptDownLinkToOfp5 > downThresholdMin and\
-                   ptDownLinkToOfp5 < downThresholdMax and i > iterIgnore:
-                    portDownLinkNodeIter[4][i] = ptDownLinkToOfp5
-                    main.log.info('ONOS5 iter' + str(i) +
-                            ' link-to-ofp: ' +
-                            str(ptDownLinkToOfp5) + ' ms')
-            if clusterCount >= 7:
-                jsonStrUp6 = main.ONOS6cli.topologyEventsMetrics()
-                jsonStrUp7 = main.ONOS7cli.topologyEventsMetrics()
-                jsonObj6 = json.loads(jsonStrUp6)
-                jsonObj7 = json.loads(jsonStrUp7)
-                graphTimestamp6 = jsonObj6[graphTimestamp]['value']
-                graphTimestamp7 = jsonObj7[graphTimestamp]['value']
-                deviceTimestamp6 = jsonObj6[deviceTimestamp]['value']
-                deviceTimestamp7 = jsonObj7[deviceTimestamp]['value']
-                linkTimestamp6 = jsonObj6[linkTimestamp]['value']
-                linkTimestamp7 = jsonObj7[linkTimestamp]['value']
-                ptDownGraphToOfp6 = int(graphTimestamp6) - int(timestampBeginPtDown)
-                ptDownGraphToOfp7 = int(graphTimestamp7) - int(timestampBeginPtDown)
-                ptDownDeviceToOfp6 = int(deviceTimestamp6) - int(timestampBeginPtDown)
-                ptDownDeviceToOfp7 = int(deviceTimestamp7) - int(timestampBeginPtDown)
-                ptDownLinkToOfp6 = int(linkTimestamp6) - int(timestampBeginPtDown)
-                ptDownLinkToOfp7 = int(linkTimestamp7) - int(timestampBeginPtDown)
-                if ptDownGraphToOfp6 > downThresholdMin and\
-                   ptDownGraphToOfp6 < downThresholdMax and i > iterIgnore:
-                    portDownGraphNodeIter[5][i] = ptDownGraphToOfp6
-                    main.log.info('ONOS6 iter' + str(i) +
-                            ' graph-to-ofp: ' +
-                            str(ptDownGraphToOfp6) + ' ms')
-                if ptDownDeviceToOfp6 > downThresholdMin and\
-                   ptDownDeviceToOfp6 < downThresholdMax and i > iterIgnore:
-                    portDownDevNodeIter[5][i] = ptDownDeviceToOfp6
-                    main.log.info('ONOS6 iter' + str(i) +
-                            ' device-to-ofp: ' +
-                            str(ptDownDeviceToOfp6) + ' ms')
-                if ptDownLinkToOfp6 > downThresholdMin and\
-                   ptDownLinkToOfp6 < downThresholdMax and i > iterIgnore:
-                    portDownLinkNodeIter[5][i] = ptDownLinkToOfp6
-                    main.log.info('ONOS6 iter' + str(i) +
-                            ' link-to-ofp: ' +
-                            str(ptDownLinkToOfp6) + ' ms')
-                if ptDownGraphToOfp7 > downThresholdMin and\
-                   ptDownGraphToOfp7 < downThresholdMax and i > iterIgnore:
-                    portDownGraphNodeIter[6][i] = ptDownGraphToOfp7
-                    main.log.info('ONOS7 iter' + str(i) +
-                            ' graph-to-ofp: ' +
-                            str(ptDownGraphToOfp7) + ' ms')
-                if ptDownDeviceToOfp7 > downThresholdMin and\
-                   ptDownDeviceToOfp7 < downThresholdMax and i > iterIgnore:
-                    portDownDevNodeIter[6][i] = ptDownDeviceToOfp7
-                    main.log.info('ONOS7 iter' + str(i) +
-                            ' device-to-ofp: ' + 
-                            str(ptDownDeviceToOfp7) + ' ms')
-                if ptDownLinkToOfp7 > downThresholdMin and\
-                   ptDownLinkToOfp7 < downThresholdMax and i > iterIgnore:
-                    portDownLinkNodeIter[6][i] = ptDownLinkToOfp7
-                    main.log.info('ONOS7 iter' + str(i) +
-                            ' link-to-ofp: ' +
-                            str(ptDownLinkToOfp7) + ' ms')
 
             time.sleep(3)
             
@@ -1060,21 +940,23 @@
                 main.log.info('Tshark output file returned unexpected' + ' results.')
                 timestampBeginPtUp = 0
             fPortUp.close()
-            """ 
-            # TODO: Refactoring in progress
             
             for node in range(0, clusterCount):
                 nodeNum = node+1
-                exec "metricsUp = main.ONOS%scli.topologyEventsMetrics"%str(nodeNum) 
+                metricsUp = CLIs[node].topologyEventsMetrics
                 jsonStrUp = metricsUp()
                 jsonObj = json.loads(jsonStrUp)
-                
-                print jsonObj
+               
+                if jsonObj:
+                    graphTimestamp = jsonObj[graphTimestampKey]['value']
+                    deviceTimestamp = jsonObj[deviceTimestampKey]['value']
+                    linkTimestamp = jsonObj[linkTimestampKey]['value']
+                else:
+                    main.log.error( "Unexpected json object" )
+                    graphTimestamp = 0
+                    deviceTimestamp = 0
+                    linkTimestamp = 0
 
-                graphTimestamp = jsonObj[graphTimestamp]['value']
-                deviceTimestamp = jsonObj[deviceTimestamp]['value']
-                linkTimestamp = jsonObj[linkTimestamp]['value']
-                
                 ptUpGraphToOfp = int(graphTimestamp) - int(timestampBeginPtUp)
                 ptUpDeviceToOfp = int(deviceTimestamp) - int(timestampBeginPtUp)
                 ptUpLinkToOfp = int(linkTimestamp) - int(timestampBeginPtUp)
@@ -1092,7 +974,7 @@
 
                 if ptUpDeviceToOfp > upThresholdMin and\
                    ptUpDeviceToOfp < upThresholdMax and i > iterIgnore:
-                    portUpDeviceNodeIter[node][i] = ptUpDeviceToOfp
+                    portUpDevNodeIter[node][i] = ptUpDeviceToOfp
                     main.log.info("ONOS "+str(nodeNum)+ 
                             " port up device-to-ofp: "+
                             str(ptUpDeviceToOfp) + " ms") 
@@ -1112,198 +994,6 @@
                             " port up link-to-ofp ignored"+
                             " due to excess in threshold or premature iteration")
 
-            """
-
-            # *****************************
-            
-            main.step('Obtain t1 by REST call')
-            jsonStrUp1 = main.ONOS1cli.topologyEventsMetrics()
-            jsonObj1 = json.loads(jsonStrUp1)
-            graphTimestamp1 = jsonObj1[graphTimestamp]['value']
-            deviceTimestamp1 = jsonObj1[deviceTimestamp]['value']
-            linkTimestamp1 = jsonObj1[linkTimestamp]['value']
-            ptUpGraphToOfp1 = int(graphTimestamp1) - int(timestampBeginPtUp)
-            ptUpDeviceToOfp1 = int(deviceTimestamp1) - int(timestampBeginPtUp)
-            ptUpLinkToOfp1 = int(linkTimestamp1) - int(timestampBeginPtUp)
-            if ptUpGraphToOfp1 > upThresholdMin and\
-               ptUpGraphToOfp1 < upThresholdMax and i > iterIgnore:
-                portUpGraphNodeIter[0][i] = ptUpGraphToOfp1
-                main.log.info('ONOS1 iter' + str(i) +
-                        ' port up graph-to-ofp: ' +
-                        str(ptUpGraphToOfp1) + ' ms')
-            if ptUpDeviceToOfp1 > upThresholdMin and \
-               ptUpDeviceToOfp1 < upThresholdMax and i > iterIgnore:
-                portUpDevNodeIter[0][i] = ptUpDeviceToOfp1
-                main.log.info('ONOS1 iter' + str(i) +
-                        ' port up device-to-ofp: ' +
-                        str(ptUpDeviceToOfp1) + ' ms')
-            if ptUpLinkToOfp1 > downThresholdMin and\
-               ptUpLinkToOfp1 < downThresholdMax and i > iterIgnore:
-                portUpLinkNodeIter[0][i] = ptUpLinkToOfp1
-                main.log.info('ONOS1 iter' + str(i) +
-                        ' link-to-ofp: ' +
-                        str(ptUpLinkToOfp1) + ' ms')
-            if clusterCount >= 3:
-                jsonStrUp2 = main.ONOS2cli.topologyEventsMetrics()
-                jsonStrUp3 = main.ONOS3cli.topologyEventsMetrics()
-                jsonObj2 = json.loads(jsonStrUp2)
-                jsonObj3 = json.loads(jsonStrUp3)
-                graphTimestamp2 = jsonObj2[graphTimestamp]['value']
-                graphTimestamp3 = jsonObj3[graphTimestamp]['value']
-                deviceTimestamp2 = jsonObj2[deviceTimestamp]['value']
-                deviceTimestamp3 = jsonObj3[deviceTimestamp]['value']
-                linkTimestamp2 = jsonObj2[linkTimestamp]['value']
-                linkTimestamp3 = jsonObj3[linkTimestamp]['value']
-                ptUpGraphToOfp2 = int(graphTimestamp2) - int(timestampBeginPtUp)
-                ptUpGraphToOfp3 = int(graphTimestamp3) - int(timestampBeginPtUp)
-                ptUpDeviceToOfp2 = int(deviceTimestamp2) - int(timestampBeginPtUp)
-                ptUpDeviceToOfp3 = int(deviceTimestamp3) - int(timestampBeginPtUp)
-                ptUpLinkToOfp2 = int(linkTimestamp2) - int(timestampBeginPtUp)
-                ptUpLinkToOfp3 = int(linkTimestamp3) - int(timestampBeginPtUp)
-                if ptUpGraphToOfp2 > upThresholdMin and\
-                   ptUpGraphToOfp2 < upThresholdMax and i > iterIgnore:
-                    portUpGraphNodeIter[1][i] = ptUpGraphToOfp2
-                    main.log.info('ONOS2 iter' + str(i) +
-                            ' port up graph-to-ofp: ' +
-                            str(ptUpGraphToOfp2) + ' ms')
-                if ptUpDeviceToOfp2 > upThresholdMin and\
-                   ptUpDeviceToOfp2 < upThresholdMax and i > iterIgnore:
-                    portUpDevNodeIter[1][i] = ptUpDeviceToOfp2
-                    main.log.info('ONOS2 iter' + str(i) +
-                            ' port up device-to-ofp: ' +
-                            str(ptUpDeviceToOfp2) + ' ms')
-                if ptUpLinkToOfp2 > downThresholdMin and\
-                   ptUpLinkToOfp2 < downThresholdMax and i > iterIgnore:
-                    portUpLinkNodeIter[1][i] = ptUpLinkToOfp2
-                    main.log.info('ONOS2 iter' + str(i) +
-                            ' port up link-to-ofp: ' +
-                            str(ptUpLinkToOfp2) + ' ms')
-                if ptUpGraphToOfp3 > upThresholdMin and\
-                   ptUpGraphToOfp3 < upThresholdMax and i > iterIgnore:
-                    portUpGraphNodeIter[2][i] = ptUpGraphToOfp3
-                    main.log.info('ONOS3 iter' + str(i) +
-                            ' port up graph-to-ofp: ' +
-                            str(ptUpGraphToOfp3) + ' ms')
-                if ptUpDeviceToOfp3 > upThresholdMin and\
-                   ptUpDeviceToOfp3 < upThresholdMax and i > iterIgnore:
-                    portUpDevNodeIter[2][i] = ptUpDeviceToOfp3
-                    main.log.info('ONOS3 iter' + str(i) +
-                            ' port up device-to-ofp: ' +
-                            str(ptUpDeviceToOfp3) + ' ms')
-                if ptUpLinkToOfp3 > downThresholdMin and\
-                   ptUpLinkToOfp3 < downThresholdMax and i > iterIgnore:
-                    portUpLinkNodeIter[2][i] = ptUpLinkToOfp3
-                    main.log.info('ONOS3 iter' + str(i) +
-                            ' port up link-to-ofp: ' +
-                            str(ptUpLinkToOfp3) + ' ms')
-            if clusterCount >= 5:
-                jsonStrUp4 = main.ONOS4cli.topologyEventsMetrics()
-                jsonStrUp5 = main.ONOS5cli.topologyEventsMetrics()
-                jsonObj4 = json.loads(jsonStrUp4)
-                jsonObj5 = json.loads(jsonStrUp5)
-                graphTimestamp4 = jsonObj4[graphTimestamp]['value']
-                graphTimestamp5 = jsonObj5[graphTimestamp]['value']
-                deviceTimestamp4 = jsonObj4[deviceTimestamp]['value']
-                deviceTimestamp5 = jsonObj5[deviceTimestamp]['value']
-                linkTimestamp4 = jsonObj4[linkTimestamp]['value']
-                linkTimestamp5 = jsonObj5[linkTimestamp]['value']
-                ptUpGraphToOfp4 = int(graphTimestamp4) - int(timestampBeginPtUp)
-                ptUpGraphToOfp5 = int(graphTimestamp5) - int(timestampBeginPtUp)
-                ptUpDeviceToOfp4 = int(deviceTimestamp4) - int(timestampBeginPtUp)
-                ptUpDeviceToOfp5 = int(deviceTimestamp5) - int(timestampBeginPtUp)
-                ptUpLinkToOfp4 = int(linkTimestamp4) - int(timestampBeginPtUp)
-                ptUpLinkToOfp5 = int(linkTimestamp5) - int(timestampBeginPtUp)
-                if ptUpGraphToOfp4 > upThresholdMin and\
-                   ptUpGraphToOfp4 < upThresholdMax and i > iterIgnore:
-                    portUpGraphNodeIter[3][i] = ptUpGraphToOfp4
-                    main.log.info('ONOS4 iter' + str(i) +
-                            ' port up graph-to-ofp: ' +
-                            str(ptUpGraphToOfp4) + ' ms')
-                if ptUpDeviceToOfp4 > upThresholdMin and\
-                   ptUpDeviceToOfp4 < upThresholdMax and i > iterIgnore:
-                    portUpDevNodeIter[3][i] = ptUpDeviceToOfp4
-                    main.log.info('ONOS4 iter' + str(i) +
-                            ' port up device-to-ofp: ' +
-                            str(ptUpDeviceToOfp4) + ' ms')
-                if ptUpLinkToOfp4 > downThresholdMin and\
-                   ptUpLinkToOfp4 < downThresholdMax and i > iterIgnore:
-                    portUpLinkNodeIter[3][i] = ptUpLinkToOfp4
-                    main.log.info('ONOS4 iter' + str(i) +
-                            ' port up link-to-ofp: ' +
-                            str(ptUpLinkToOfp4) + ' ms')
-                if ptUpGraphToOfp5 > upThresholdMin and\
-                    ptUpGraphToOfp5 < upThresholdMax and i > iterIgnore:
-                    portUpGraphNodeIter[4][i] = ptUpGraphToOfp5
-                    main.log.info('ONOS5 iter' + str(i) +
-                            ' port up graph-to-ofp: ' +
-                            str(ptUpGraphToOfp5) + ' ms')
-                if ptUpDeviceToOfp5 > upThresholdMin and \
-                   ptUpDeviceToOfp5 < upThresholdMax and i > iterIgnore:
-                    portUpDevNodeIter[4][i] = ptUpDeviceToOfp5
-                    main.log.info('ONOS5 iter' + str(i) +
-                            ' port up device-to-ofp: ' +
-                            str(ptUpDeviceToOfp5) + ' ms')
-                if ptUpLinkToOfp5 > downThresholdMin and\
-                   ptUpLinkToOfp5 < downThresholdMax and i > iterIgnore:
-                    portUpLinkNodeIter[4][i] = ptUpLinkToOfp5
-                    main.log.info('ONOS5 iter' + str(i) +
-                            ' port up link-to-ofp: ' +
-                            str(ptUpLinkToOfp5) + ' ms')
-            
-            if clusterCount >= 7:
-                jsonStrUp6 = main.ONOS6cli.topologyEventsMetrics()
-                jsonStrUp7 = main.ONOS7cli.topologyEventsMetrics()
-                jsonObj6 = json.loads(jsonStrUp6)
-                jsonObj7 = json.loads(jsonStrUp7)
-                graphTimestamp6 = jsonObj6[graphTimestamp]['value']
-                graphTimestamp7 = jsonObj7[graphTimestamp]['value']
-                deviceTimestamp6 = jsonObj6[deviceTimestamp]['value']
-                deviceTimestamp7 = jsonObj7[deviceTimestamp]['value']
-                linkTimestamp6 = jsonObj6[linkTimestamp]['value']
-                linkTimestamp7 = jsonObj7[linkTimestamp]['value']
-                ptUpGraphToOfp6 = int(graphTimestamp6) - int(timestampBeginPtUp)
-                ptUpGraphToOfp7 = int(graphTimestamp7) - int(timestampBeginPtUp)
-                ptUpDeviceToOfp6 = int(deviceTimestamp6) - int(timestampBeginPtUp)
-                ptUpDeviceToOfp7 = int(deviceTimestamp7) - int(timestampBeginPtUp)
-                ptUpLinkToOfp6 = int(linkTimestamp6) - int(timestampBeginPtUp)
-                ptUpLinkToOfp7 = int(linkTimestamp7) - int(timestampBeginPtUp)
-                if ptUpGraphToOfp6 > upThresholdMin and\
-                   ptUpGraphToOfp6 < upThresholdMax and i > iterIgnore:
-                    portUpGraphNodeIter[5][i] = ptUpGraphToOfp6
-                    main.log.info('ONOS6 iter' + str(i) +
-                            ' port up graph-to-ofp: ' +
-                            str(ptUpGraphToOfp6) + ' ms')
-                if ptUpDeviceToOfp6 > upThresholdMin and\
-                   ptUpDeviceToOfp6 < upThresholdMax and i > iterIgnore:
-                    portUpDevNodeIter[5][i] = ptUpDeviceToOfp6
-                    main.log.info('ONOS6 iter' + str(i) +
-                            ' port up device-to-ofp: ' + 
-                            str(ptUpDeviceToOfp6) + ' ms')
-                if ptUpLinkToOfp6 > downThresholdMin and\
-                   ptUpLinkToOfp6 < downThresholdMax and i > iterIgnore:
-                    portUpLinkNodeIter[5][i] = ptUpLinkToOfp6
-                    main.log.info('ONOS6 iter' + str(i) +
-                            ' port up link-to-ofp: ' +
-                            str(ptUpLinkToOfp6) + ' ms')
-                if ptUpGraphToOfp7 > upThresholdMin and \
-                   ptUpGraphToOfp7 < upThresholdMax and i > iterIgnore:
-                    portUpGraphNodeIter[6][i] = ptUpGraphToOfp7
-                    main.log.info('ONOS7 iter' + str(i) +
-                            ' port up graph-to-ofp: ' + 
-                            str(ptUpGraphToOfp7) + ' ms')
-                if ptUpDeviceToOfp7 > upThresholdMin and\
-                   ptUpDeviceToOfp7 < upThresholdMax and i > iterIgnore:
-                    portUpDevNodeIter[6][i] = ptUpDeviceToOfp7
-                    main.log.info('ONOS7 iter' + str(i) +
-                            ' port up device-to-ofp: ' +
-                            str(ptUpDeviceToOfp7) + ' ms')
-                if ptUpLinkToOfp7 > downThresholdMin and\
-                   ptUpLinkToOfp7 < downThresholdMax and i > iterIgnore:
-                    portUpLinkNodeIter[6][i] = ptUpLinkToOfp7
-                    main.log.info('ONOS7 iter' + str(i) +
-                            ' port up link-to-ofp: ' +
-                            str(ptUpLinkToOfp7) + ' ms')
-
         dbCmdList = []
         for node in range(0, clusterCount):
             portUpDevList = []
@@ -1382,6 +1072,9 @@
                 fResult.write(line + '\n')
 
         fResult.close()
+
+        # Delete switches from controller to prepare for next
+        # set of tests
         main.Mininet1.deleteSwController('s1')
         main.Mininet1.deleteSwController('s2')
         utilities.assert_equals(expect=main.TRUE,
@@ -1454,7 +1147,18 @@
             if not isup:
                 main.log.error( "ONOS "+str(node) + " did not start" )
 
-        for node in range( 1, clusterCount + 1):
-            exec "a = main.ONOS%scli.startOnosCli" %str(node)
-            a(main.params[ 'CTRL' ][ 'ip'+str(node) ])
+        for node in range( 0, clusterCount ):
+            CLIs[node].startOnosCli( cellIp[node] )
+       
+        main.step( 'Setting configurations for metrics' )
+        configParam = 'maxEvents 1'
+        main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
+        configParam = 'maxBatchMs 0'
+        main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
+        configParam = 'maxIdleMs 0'
+        main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
+       
+        main.step( 'Activating essential applications' )
+        CLIs[0].activateApp( 'org.onosproject.metrics' )
+        CLIs[0].activateApp( 'org.onosproject.openflow' )
 
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo
index a92e391..6a70f60 100644
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo
+++ b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo
@@ -2,7 +2,7 @@
     <COMPONENT>
         
         <ONOSbench>
-            <host>10.254.1.200</host>
+            <host>10.128.174.10</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
@@ -11,7 +11,7 @@
         </ONOSbench>
 
         <ONOS1cli>
-            <host>10.254.1.200</host>
+            <host>10.128.174.10</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -20,7 +20,7 @@
         </ONOS1cli>
 
         <ONOS2cli>
-            <host>10.254.1.200</host>
+            <host>10.128.174.10</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -29,7 +29,7 @@
         </ONOS2cli>
         
         <ONOS3cli>
-            <host>10.254.1.200</host>
+            <host>10.128.174.10</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -38,7 +38,7 @@
         </ONOS3cli>
         
         <ONOS4cli>
-            <host>10.254.1.200</host>
+            <host>10.128.174.10</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -47,7 +47,7 @@
         </ONOS4cli>
         
         <ONOS5cli>
-            <host>10.254.1.200</host>
+            <host>10.128.174.10</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -56,7 +56,7 @@
         </ONOS5cli>
         
         <ONOS6cli>
-            <host>10.254.1.200</host>
+            <host>10.128.174.10</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -65,7 +65,7 @@
         </ONOS6cli>
         
         <ONOS7cli>
-            <host>10.254.1.200</host>
+            <host>10.128.174.10</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -74,7 +74,7 @@
         </ONOS7cli>
 
         <ONOS1>
-            <host>10.254.1.201</host>
+            <host>10.128.174.1</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
diff --git a/TestON/tests/flowTP1g/flowTP1g.params b/TestON/tests/flowTP1g/flowTP1g.params
index 5771a62..bb05f0e 100644
--- a/TestON/tests/flowTP1g/flowTP1g.params
+++ b/TestON/tests/flowTP1g/flowTP1g.params
@@ -1,29 +1,28 @@
 <PARAMS>
 
-    <testcases>1,3</testcases>
+    <testcases>1,2</testcases>
     
-    <isOnBaremetal>true</isOnBaremetal>
-    <SCALE>1</SCALE>
+    <isOnBaremetal>False</isOnBaremetal>
+    <SCALE>7</SCALE>
     <availableNodes>7</availableNodes>
     
 
 
     <ENV>
         <cellName>flowTP</cellName>
-        <cellFeatures>webconsole,onos-core,onos-api,onos-cli,onos-null,onos-app-demo,onos-rest,onos-app-metrics,onos-app-metrics-intent,onos-app-metrics-topology</cellFeatures>
+        <cellApps>null,demo</cellApps>
     </ENV>
 
     <TEST>
         <skipCleanInstall>yes</skipCleanInstall> 
-        <warmUp>4</warmUp>                               #number of runs to warm up the system
-        <sampleSize>20</sampleSize>                      #number of runs to take data from
-        <neighbors>4,2,0</neighbors>                    #list of number of neighbors
-        <servers>7,5,3,1</servers>                      #list of servers
-        <flows>122500</flows>
+        <warmUp>4</warmUp>                              #number of runs to warm up the system
+        <sampleSize>2</sampleSize>                     #number of runs to take data from
+        <neighbors>0,a</neighbors>                      #list of number of neighbors, a = all 
+        <flows>3500</flows>
         <switches>35</switches>
 
-        <testCMD0>flow-tester.py -f</testCMD0>      #base command 
-        <testCMD1> -n </testCMD1>                        #neighbors 
+        <testCMD0>flow-tester.py -f</testCMD0>          #base command 
+        <testCMD1> -n </testCMD1>                       #neighbors 
         
     </TEST>
 
@@ -35,36 +34,36 @@
     <CTRL>
         <USER>admin</USER>
         
-        <ip1>10.254.1.201</ip1>
+        <ip1>10.128.5.51</ip1>
         <port1>6633</port1>
         
-        <ip2>10.254.1.202</ip2>
+        <ip2>10.128.5.52</ip2>
         <port2>6633</port2>
         
-        <ip3>10.254.1.203</ip3>
+        <ip3>10.128.5.53</ip3>
         <port3>6633</port3>
         
-        <ip4>10.254.1.204</ip4>
+        <ip4>10.128.5.54</ip4>
         <port4>6633</port4>
         
-        <ip5>10.254.1.205</ip5>
+        <ip5>10.128.5.65</ip5>
         <port5>6633</port5>
         
-        <ip6>10.254.1.206</ip6>
+        <ip6>10.128.5.66</ip6>
         <port6>6633</port6> 
        
-         <ip7>10.254.1.207</ip7>
+        <ip7>10.128.5.67</ip7>
         <port7>6633</port7>
 
     </CTRL>
 
     <MN>
-        <ip1>10.254.1.200</ip1>
+        <ip1>10.128.5.55</ip1>
     </MN>
 
     <BENCH>
         <user>admin</user>
-        <ip1>10.254.1.200</ip1>
+        <ip1>10.128.5.55</ip1>
     </BENCH>
 
     <JSON>
diff --git a/TestON/tests/flowTP1g/flowTP1g.py b/TestON/tests/flowTP1g/flowTP1g.py
index 8261a47..946864c 100644
--- a/TestON/tests/flowTP1g/flowTP1g.py
+++ b/TestON/tests/flowTP1g/flowTP1g.py
@@ -13,63 +13,52 @@
     def __init__( self ):
         self.default = ''
 
-    def CASE1( self, main ):            #This is the initialization case
-                                        #this case will clean up all nodes 
-                                        #but only node 1 is started in this case
-        
-        global clusterCount             #number of nodes running
-        global ONOSIp                   #list of ONOS IP addresses 
-        clusterCount = 1
-        ONOSIp = [ 0 ]
+    def CASE1( self, main ):          
 
+        import time
+        global init
+        try:
+            if type(init) is not bool:
+                init = False
+        except NameError:
+            init = False
 
         #Load values from params file
         checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
         gitPull = main.params[ 'GIT' ][ 'autopull' ]
         cellName = main.params[ 'ENV' ][ 'cellName' ]
-        Features= main.params[ 'ENV' ][ 'cellFeatures' ]
+        Apps = main.params[ 'ENV' ][ 'cellApps' ]
         BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
         BENCHUser = main.params[ 'BENCH' ][ 'user' ]
         MN1Ip = main.params[ 'MN' ][ 'ip1' ]
         maxNodes = int(main.params[ 'availableNodes' ])
-        Features = main.params[ 'ENV' ][ 'cellFeatures' ]
         skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
-        
-        main.ONOSbench.handle.sendline("export TERM=vt100")
+        cellName = main.params[ 'ENV' ][ 'cellName' ]       
+ 
+        #----do i need this line?
+        #main.ONOSbench.handle.sendline("export TERM=vt100")
 
-        #Populate ONOSIp with ips from params 
-        for i in range(1, maxNodes + 1): 
-            ipString = 'ip' + str(i) 
-            ONOSIp.append(main.params[ 'CTRL' ][ ipString ])   
+        # -- INIT SECTION, ONLY RUNS ONCE -- #
+        if init == False:
+            init = True
+            global clusterCount             #number of nodes running
+            global ONOSIp                   #list of ONOS IP addresses
+            global scale
 
-        #kill off all onos processes 
-        main.log.step("Safety check, killing all ONOS processes")
-        main.log.step("before initiating enviornment setup")
-        for node in range(1, maxNodes + 1):
-            main.ONOSbench.onosDie(ONOSIp[node])
+            clusterCount = 0
+            ONOSIp = [ 0 ]
+            scale = (main.params[ 'SCALE' ]).split(",")
+            clusterCount = int(scale[0])
 
+            #Populate ONOSIp with ips from params
+            for i in range(1, maxNodes + 1):
+                ipString = 'ip' + str(i)
+                ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
 
-        #construct the cell file
-        main.log.info("Creating initial cell file")
-        exec "a = main.ONOSbench.createCellFile"
-        cellIp = []
-        for node in range(1, 2):
-        #for node in range (1, maxNodes + 1):
-            cellIp.append(ONOSIp[node])
-        a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
+            #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+            if skipMvn != "yes":
+                mvnResult = main.ONOSbench.cleanInstall()
 
-        main.log.info(cellIp)
-
-        #Uninstall everywhere
-        #main.log.step( "Cleaning Enviornment..." )
-        #for i in range(1, maxNodes + 1):
-        #    main.log.info(" Uninstalling ONOS " + str(i) )
-        #    main.ONOSbench.onosUninstall( ONOSIp[i] )
-        
-        #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
-        if skipMvn != "yes":
-            mvnResult = main.ONOSbench.cleanInstall()
-                        
             #git
             main.step( "Git checkout and pull " + checkoutBranch )
             if gitPull == 'on':
@@ -81,53 +70,64 @@
                 pullResult = main.TRUE
                 main.log.info( "Skipped git checkout and pull" )
 
+        # -- END OF INIT SECTION --#
 
-        #main.step( "Set cell for ONOS cli env" )
-        #main.ONOS1cli.setCell( cellName )
+        clusterCount = int(scale[0])
+        scale.remove(scale[0])
+        main.log.info("CLUSTER COUNT: " + str(clusterCount))
+
+        #kill off all onos processes 
+        main.log.step("Safety check, killing all ONOS processes")
+        main.log.step("before initiating enviornment setup")
+        for node in range(1, maxNodes + 1):
+            main.ONOSbench.onosDie(ONOSIp[node])
+
+        #Uninstall everywhere
+        main.log.step( "Cleaning Enviornment..." )
+        for i in range(1, maxNodes + 1):
+            main.log.info(" Uninstalling ONOS " + str(i) )
+            main.ONOSbench.onosUninstall( ONOSIp[i] )
+
+        #construct the cell file
+        main.log.info("Creating cell file")
+        cellIp = []
+        for node in range (1, clusterCount + 1):
+            cellIp.append(ONOSIp[node])        
         
+        main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
+        main.log.info("Cell Ip list: " + str(cellIp))
+        
+        main.step( "Set Cell" )
+        main.ONOSbench.setCell(cellName)       
+ 
         main.step( "Creating ONOS package" )
         packageResult = main.ONOSbench.onosPackage()  
 
-        #main.step( "Installing ONOS package" )
-        #install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] )
-
-        cellName = main.params[ 'ENV' ][ 'cellName' ]
-        main.step( "Applying cell file to environment" )
-        cellApplyResult = main.ONOSbench.setCell( cellName )
         main.step( "verify cells" )
         verifyCellResult = main.ONOSbench.verifyCell()
 
-        #main.step( "Set cell for ONOS cli env" )
-        #cli1 = main.ONOS1cli.startOnosCli( node=ONOSIp[1] )
+        main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
+        for node in range(1, clusterCount + 1):
+            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+            main.ONOSbench.onosInstall( ONOSIp[node])
 
-    def CASE2( self, main ):
-        # This case increases the cluster size by whatever scale is
-        # Note: 'scale' is the size of the step
-        # if scaling is not a part of your test, simply run this case
-        # once after CASE1 to set up your enviornment for your desired 
-        # cluster size. If scaling is a part of you test call this case each time 
-        # you want to increase cluster size
-
-        ''                                                         
-        'Increase number of nodes and initiate CLI'
-        ''
-        import time
-        global clusterCount
-
-        scale = int( main.params[ 'SCALE' ] )
-        clusterCount += scale
-
-        main.log.report( "Increasing cluster size to " + str( clusterCount ) )
-        for node in range((clusterCount - scale) + 1, clusterCount + 1):
-            main.ONOSbench.onosDie(ONOSIp[node])
-            time.sleep(10)
-            main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])    
-            main.ONOSbench.onosInstall( node=ONOSIp[node])
+        for node in range(1, clusterCount + 1):
+            for i in range( 2 ):
+                isup = main.ONOSbench.isup( ONOSIp[node] )
+                if isup:
+                    main.log.info("ONOS " + str(node) + " is up\n")
+                    break
+            if not isup:
+                main.log.report( "ONOS " + str(node) + " didn't start!" )
+        
+        for node in range(1, clusterCount + 1):
             exec "a = main.ONOS%scli.startOnosCli" %str(node)
             a(ONOSIp[node])
-    
-    
-    def CASE3( self, main ):
+         
+        main.log.info("Startup sequence complete")
+
+        
+    def CASE2( self, main ):
         #
         # This is the flow TP test 
         #
@@ -142,27 +142,26 @@
         warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
         sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
         switches = int(main.params[ 'TEST' ][ 'switches' ])
-        neighborList = main.params[ 'TEST' ][ 'neighbors' ]
-        serverList = main.params[ 'TEST' ][ 'servers' ]
-        #flows = int(main.params[ 'TEST' ][ 'flows' ]) 
+        neighborList = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
         testCMD[0] = main.params[ 'TEST' ][ 'testCMD0' ]
         testCMD[1] = main.params[ 'TEST' ][ 'testCMD1' ]
         maxNodes = main.params[ 'availableNodes' ]
         onBaremetal = main.params['isOnBaremetal']
 
-
         cellName = main.params[ 'ENV' ][ 'cellName' ]
-        Features= main.params[ 'ENV' ][ 'cellFeatures' ]
         BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
         BENCHUser = main.params[ 'BENCH' ][ 'user' ]
         MN1Ip = main.params[ 'MN' ][ 'ip1' ]
         maxNodes = int(main.params[ 'availableNodes' ])
-        Features = main.params[ 'ENV' ][ 'cellFeatures' ]
         homeDir = os.path.expanduser('~')
-    
-        serverList = serverList.split(",")
-        main.log.info("serverlist: " + str(serverList))
-        neighborList = neighborList.split(",") 
+  
+        servers = str(clusterCount) 
+        for i in range(0, len(neighborList)):
+            if neighborList[i] == 'a':
+                neighborList[i] = str(clusterCount - 1)  
+        
+        if clusterCount == 1: 
+            neighborList = ['0']
         main.log.info("neightborlist: " + str(neighborList))
 
         ts = time.time()
@@ -191,222 +190,170 @@
             serviceConfig.close()
 
         for n in neighborList:
-            for servers in serverList:
-                main.log.step("\tSTARTING TEST")
-                main.log.step("\tSERVERS:  \t" + servers ) 
-                main.log.step("\tNEIGHBORS:\t" + n )  
-                main.log.info("=============================================================")
-                main.log.info("=============================================================")
-                #write file to configure nil link
-                ipCSV = ""
-                for i in range (1, int(maxNodes) + 1):
-                    tempstr = "ip" + str(i)
-                    ipCSV += main.params[ 'CTRL' ][ tempstr ] 
-                    if i < int(maxNodes):
-                        ipCSV +=","
-                
-                filename = "/onos/tools/package/etc/org.onosproject.provider.nil.link.impl.NullLinkProvider.cfg"
-                linkConfig = open(homeDir + filename,'w+')
-                linkConfig.write("# eventRate = 2000\n")
-                linkConfig.write("neighbors = "  + ipCSV)
-                main.log.info(" NullLinkProvider.cfg: " + ipCSV)
-                linkConfig.close()
-
-  
-                #write file for null device 
-                filename = "/onos/tools/package/etc/org.onosproject.provider.nil.device.impl.NullDeviceProvider.cfg"
-                deviceConfig = open(homeDir + filename,'w+')    
+            main.log.step("\tSTARTING TEST")
+            main.log.step("\tLOADING FROM SERVERS:  \t" + str(clusterCount) ) 
+            main.log.step("\tNEIGHBORS:\t" + n )  
+            main.log.info("=============================================================")
+            main.log.info("=============================================================")
+            #write file to configure nil link
+            ipCSV = ""
+            for i in range (1, int(maxNodes) + 1):
+                tempstr = "ip" + str(i)
+                ipCSV += main.params[ 'CTRL' ][ tempstr ] 
+                if i < int(maxNodes):
+                    ipCSV +=","
             
-                serversToRun = max(int(servers), (int(n) + 1))
+            filename = "/onos/tools/package/etc/org.onosproject.provider.nil.link.impl.NullLinkProvider.cfg"
+            linkConfig = open(homeDir + filename,'w+')
+            linkConfig.write("# eventRate = 2000\n")
+            linkConfig.write("neighbors = "  + ipCSV)
+            main.log.info(" NullLinkProvider.cfg: " + ipCSV)
+            linkConfig.close()
+            
+            #config null device
+            cellIp = [] 
+            for node in range(1, clusterCount + 1): 
+                cellIp.append(ONOSIp[node])
+            main.log.info(" NullDeviceProvider.cfg: " + str(cellIp))
+            main.ONOSbench.configNullDev(cellIp, switches) 
+            
+            #devide flows
+            flows = int(main.params[ 'TEST' ][ 'flows' ])
+            main.log.info("Flow Target  = " + str(flows))
 
-                switchDistribution = [(switches/int(serversToRun))]*int(serversToRun) 
-                main.log.info("Switch distribution init: " + str(switchDistribution))
-                remainder = switches % int(serversToRun) 
-                for r in range(0, remainder): 
-                    switchDistribution[r] += 1 
-                main.log.info("Switch distribution: " + str(switchDistribution))
-                    
-                deviceSettings = ""
-                for i in range(0, serversToRun):
-                    deviceSettings += (ONOSIp[i+1] + ":" + str(switchDistribution[i]))
-                    if i < int(serversToRun)-1: 
-                        deviceSettings +=","         
+            flows = (flows *max(int(n)+1,int(servers)))/((int(n) + 1)*int(servers)*(switches))
 
-                deviceConfig.write("devConfigs = "  + deviceSettings)
-                main.log.info(" NullDeviceProvider.cfg: " + deviceSettings)
-                deviceConfig.close() 
+            main.log.info("Flows per switch = " + str(flows))
+            #main.log.info("Total flows = " + str(switches * flows))
 
-                main.log.info("Creating cell file for this step")
-                exec "a = main.ONOSbench.createCellFile"
-                cellIp = []
-                for node in range (1, serversToRun + 1):
-                    cellIp.append(ONOSIp[node]) 
-                main.log.info("Cells are: " + str(cellIp) )
-                a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
-                main.step( "Applying cell file to environment for this step" )
-                cellApplyResult = main.ONOSbench.setCell( cellName )
-                main.step( "verify cells for this step" )
-                verifyCellResult = main.ONOSbench.verifyCell()
+            #build list of servers in "$OC1, $OC2...." format
+            serverEnvVars = ""
+            for i in range (1,int(servers)+1):
+                serverEnvVars += ("-s " + ONOSIp[i] + " ")
+            
+            data = [[""]*int(servers)]*int(sampleSize)
+            maxes = [""]*int(sampleSize)
+
+            for test in range(0, (warmUp + sampleSize)): 
+                flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
+                flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1] 
+                flowCMD += " " + str(n) + " " + str(serverEnvVars)
+                print("\n")                    
+                main.log.info("COMMAND: " + flowCMD)
+                main.log.info("Executing command") 
                 
-                #devide flows
-                flows = int(main.params[ 'TEST' ][ 'flows' ])
-                main.log.info("Flow Target  = " + str(flows))
-
-                flows = (flows *max(int(n)+1,int(servers)))/((int(n) + 1)*int(servers)*(switches))
-
-                main.log.info("Flows per switch = " + str(flows))
-                #main.log.info("Total flows = " + str(switches * flows))
-
-                
-                #kill off all onos processes
-                main.log.step("Safety check, killing all ONOS processes")
-                for node in range(1, int(maxNodes) + 1):
-                    main.ONOSbench.onosDie(ONOSIp[node]) 
-                  
-                #Uninstall everywhere
-                main.log.step( "Cleaning Enviornment..." )
-                for i in range(1, int(maxNodes) + 1):
-                    main.log.info(" Uninstalling ONOS " + str(i) )
-                    main.ONOSbench.onosUninstall( ONOSIp[i] )
-
-                #package
-                main.log.step( "Repackaging onos to reflect config file changes" )
-                main.ONOSbench.onosPackage()
-                
-                # install on relevant nodes
-                startNodes = max(int(n), serversToRun)
-                main.log.step( "Reinstalling ONOS on relevant nodes (1-" + str(startNodes) + ")" )          
-                for s in range(1, startNodes + 1): 
-                    main.ONOSbench.onosInstall( node=ONOSIp[s])    
-                    exec "a = main.ONOS%scli.startOnosCli" %str(s)
-                    a(ONOSIp[s])
-
-                main.log.info("sleeping 30 second waiting for null provider bundle...")
-                time.sleep(30)
-
-                #build list of servers in "$OC1, $OC2...." format
-                serverEnvVars = ""
-                for i in range (1,int(servers)+1):
-                    serverEnvVars += ("-s " + ONOSIp[i] + " ")
-                
-                data = [[""]*int(servers)]*int(sampleSize)
-                maxes = [""]*int(sampleSize)
-
-                for test in range(0, (warmUp + sampleSize)): 
-                    flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
-                    flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1] 
-                    flowCMD += " " + str(n) + " " + str(serverEnvVars)
-                    print("\n")                    
-                    main.log.info("COMMAND: " + flowCMD)
-                    main.log.info("Executing command") 
+                for i in range(0,15):
                     main.ONOSbench.handle.sendline(flowCMD)
-                    result = []
-                    for s in range(0, int(servers)):
-                        result.append("q")
-                    
-                    for s in range(0, int(servers)):
-                        main.ONOSbench.handle.expect("ms")
-                        rawResult = ((main.ONOSbench.handle.before).splitlines())
+                    time.sleep(1)
+                    main.ONOSbench.handle.expect(":~")
+                    rawResult = main.ONOSbench.handle.before
+                    if " -> " in rawResult:
+                        break
 
-                        rawResult = ((rawResult.pop()).split(" "))
-                        main.log.info("Debug: rawResult: " + str(rawResult))
+                result = [""]*(clusterCount)
+                rawResult = rawResult.splitlines()
+                print(rawResult)
+                for node in range(1, clusterCount + 1):        
+                    for line in rawResult
+                        if ONOSIp[node] in line and " -> " in line:
+                            myLine = line.split(" ")
+                            for word in myLine:
+                                if "ms" in word:
+                                    result[node-1] = int(word.replace("ms",""))
+                                    main.log.info("Parsed result: " + str(result[node-1]))
+                                    break
+                            break
 
-                        myresult = int(rawResult[2])
-                        main.log.info("Result: " + str(myresult))                    
-                            
-                        myIp = rawResult[0]
-                        main.log.info("myIp: " + myIp)
+                if test >= warmUp:
+                    for i in result: 
+                        if i == "": 
+                            main.log.error("Missing data point, critical failure incoming")
 
-                        serverIndex = int(ONOSIp.index(myIp))
-                        main.log.info("server index = " + str(serverIndex))
-                            
-                        result[serverIndex - 1] = myresult
-                    
-                    if test >= warmUp:
-                        maxes[test-warmUp] = max(result)
-                        main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize))
-                        main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")                
+                    print result
+                    maxes[test-warmUp] = max(result)
+                    main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize))
+                    main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")                
 
-                    if test >= warmUp:
-                        data[test-warmUp] = result
+                if test >= warmUp:
+                    data[test-warmUp] = result
 
-                    # wait for flows = 0 
-                    removedFlows = False
-                    repeat = 0
-                    time.sleep(3)
-                    while removedFlows == False & repeat <= 10:
-                        main.ONOSbench.handle.sendline("onos $OC1 summary| cut -d ' ' -f6")
-                        main.ONOSbench.handle.expect("~")
-                        before = main.ONOSbench.handle.before
-                        parseTest = before.splitlines()
-                        flowsummary = ""
-                        for line in parseTest:
-                            if "flow" in str(line):
-                                flowsummary = line 
-                                break
-                        currentflow = ""
-                        for word in flowsummary.split(" "): 
-                            if "flow" in str(word):
-                                currentflow = str(word)
-                        currentflow = currentflow.replace(",","")
-                        currentflow = currentflow.replace("\n","")
-                        main.log.info(currentflow)
+                # wait for flows = 0 
+                removedFlows = False
+                repeat = 0
+                time.sleep(3)
+                while ( removedFlows == False and repeat <= 10 ):
+                    main.ONOSbench.handle.sendline("onos $OC1 summary| cut -d ' ' -f6")
+                    main.ONOSbench.handle.expect("~")
+                    before = main.ONOSbench.handle.before
+                    parseTest = before.splitlines()
+                    flowsummary = ""
+                    for line in parseTest:
+                        if "flow" in str(line):
+                            flowsummary = line 
+                            break
+                    currentflow = ""
+                    for word in flowsummary.split(" "): 
+                        if "flow" in str(word):
+                            currentflow = str(word)
+                    currentflow = currentflow.replace(",","")
+                    currentflow = currentflow.replace("\n","")
+                    #main.log.info(currentflow)
 
-                        zeroFlow = "flows=0"                
-                        if zeroFlow in before:
-                            removedFlows = True 
-                            main.log.info("\t Wait 5 sec of cool down...")
-                            time.sleep(5)
-
+                    zeroFlow = "flows=0"                
+                    if zeroFlow in before:
+                        removedFlows = True 
+                        main.log.info("\t Wait 5 sec of cool down...")
                         time.sleep(5)
-                        repeat +=1
-         
-                main.log.info("raw data: " + str(data))
-                main.log.info("maxes:" + str(maxes))
 
-                
-                # report data
-                print("")
-                main.log.info("\t Results (measurments are in milliseconds)")
-                print("")
+                    time.sleep(5)
+                    repeat +=1
+     
+            main.log.info("raw data: " + str(data))
+            main.log.info("maxes:" + str(maxes))
 
-                nodeString = ""
-                for i in range(1, int(servers) + 1):
-                    nodeString += ("\tNode " + str(i)) 
-                 
-                for test in range(0, sampleSize ):
-                    main.log.info("\t Test iteration " + str(test + 1) )
-                    main.log.info("\t------------------")
-                    main.log.info(nodeString)       
-                    resultString = ""
+            
+            # report data
+            print("")
+            main.log.info("\t Results (measurments are in milliseconds)")
+            print("")
 
-                    for i in range(0, int(servers) ):
-                        resultString += ("\t" + str(data[test][i]) ) 
-                    main.log.info(resultString)
+            nodeString = ""
+            for i in range(1, int(servers) + 1):
+                nodeString += ("\tNode " + str(i)) 
+             
+            for test in range(0, sampleSize ):
+                main.log.info("\t Test iteration " + str(test + 1) )
+                main.log.info("\t------------------")
+                main.log.info(nodeString)       
+                resultString = ""
 
-                    print("\n")
+                for i in range(0, int(servers) ):
+                    resultString += ("\t" + str(data[test][i]) ) 
+                main.log.info(resultString)
 
-                avgOfMaxes = numpy.mean(maxes)
-                main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes))
+                print("\n")
 
-                stdOfMaxes = numpy.std(maxes)
-                main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))       
-                print("\n\n")
+            avgOfMaxes = numpy.mean(maxes)
+            main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes))
 
-                avgTP = int(main.params[ 'TEST' ][ 'flows' ])  / avgOfMaxes #result in kflows/second
-                
-                tp = []
-                for i in maxes: 
-                    tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i ))
+            stdOfMaxes = numpy.std(maxes)
+            main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))       
+            print("\n\n")
 
-                stdTP = numpy.std(tp)
+            avgTP = int(main.params[ 'TEST' ][ 'flows' ])  / avgOfMaxes #result in kflows/second
+            
+            tp = []
+            for i in maxes: 
+                tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i ))
 
-                main.log.info("Average thoughput:  " + str(avgTP) + " Kflows/second" )
-                main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second") 
+            stdTP = numpy.std(tp)
 
-                resultsLog = open(logFileName,"a")
-                resultsLog.write(str(main.params[ 'TEST' ][ 'flows' ]) + "," + n + "," + str(servers) + str(switches) + "," + str(warmUp))
-                resultsLog.write("," +str(sampleSize) + "," + str(avgTP) + "," + str(stdTP) + "\n")
-                resultsLog.close()
- 
-                    
+            main.log.info("Average thoughput:  " + str(avgTP) + " Kflows/second" )
+            main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second") 
+
+            resultsLog = open(logFileName,"a")
+            resultsLog.write(str(main.params[ 'TEST' ][ 'flows' ]) + "," + n + "," + str(servers) + str(switches) + "," + str(warmUp))
+            resultsLog.write("," +str(sampleSize) + "," + str(avgTP) + "," + str(stdTP) + "\n")
+            resultsLog.close()
+
+            
diff --git a/TestON/tests/flowTP1g/flowTP1g.topo b/TestON/tests/flowTP1g/flowTP1g.topo
index 0e45e0f..30a1467 100644
--- a/TestON/tests/flowTP1g/flowTP1g.topo
+++ b/TestON/tests/flowTP1g/flowTP1g.topo
@@ -3,7 +3,7 @@
     <COMPONENT>
 
         <ONOSbench>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosDriver</type>
@@ -12,7 +12,7 @@
         </ONOSbench>
 
         <ONOS1cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -21,7 +21,7 @@
         </ONOS1cli>
 
         <ONOS2cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -30,7 +30,7 @@
         </ONOS2cli>
 
         <ONOS3cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -39,7 +39,7 @@
         </ONOS3cli>
 
         <ONOS4cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -48,7 +48,7 @@
         </ONOS4cli>
 
         <ONOS5cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -57,7 +57,7 @@
         </ONOS5cli>
 
         <ONOS6cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -66,7 +66,7 @@
         </ONOS6cli>
 
         <ONOS7cli>
-            <host>10.254.1.200</host>
+            <host>10.128.5.55</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -75,7 +75,7 @@
         </ONOS7cli>
 
         <ONOS1>
-            <host>10.254.1.201</host>
+            <host>10.128.5.51</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -84,7 +84,7 @@
         </ONOS1>
 
         <ONOS2>
-            <host>10.254.1.202</host>
+            <host>10.128.5.52</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -93,7 +93,7 @@
         </ONOS2>
 
         <ONOS3>
-            <host>10.254.1.203</host>
+            <host>10.128.5.53</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -102,7 +102,7 @@
         </ONOS3>
 
         <ONOS4>
-            <host>10.254.1.204</host>
+            <host>10.128.5.54</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -112,7 +112,7 @@
 
     
         <ONOS5>
-            <host>10.254.1.205</host>
+            <host>10.128.5.65</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -121,7 +121,7 @@
         </ONOS5>
 
         <ONOS6>
-            <host>10.254.1.206</host>
+            <host>10.128.5.66</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>
@@ -130,7 +130,7 @@
         </ONOS6>
 
         <ONOS7>
-            <host>10.254.1.207</host>
+            <host>10.128.5.67</host>
             <user>sdn</user>
             <password>rocks</password>
             <type>OnosDriver</type>