diff --git a/build.gradle b/build.gradle
index 06fa3a2..46acf1f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,20 +22,25 @@
     // The tag used to tag the docker images push to the target registry
     targetTag = project.hasProperty('targetTag') ? project.getProperty('targetTag') : 'candidate'
 
+    cordTesterPath = project.hasProperty('cordTesterPath') ? project.getProperty('cordTesterPath') : './src/test/setup'
+
+    dockerPath = project.hasProperty('dockerPath') ? project.getProperty('dockerPath') : '/usr/bin'
 }
 
 // ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
 
 // To be used to fetch upstream binaries, clone repos, etc.
-task fetch {
+task fetch (type: Exec) {
     // this is where we fetch upstream artifacts that we do not need internet for the build phase"
     // ...
+    commandLine "$cordTesterPath/onos_pull.sh", 'latest'
 }
 
 // To be used to generate all needed binaries that need to be present on the target
 // as docker images in the local docker runner.
-task buildImages {
+task buildImages (type: Exec) {
     // ...
+    commandLine "$cordTesterPath/cord-test.py", 'build', 'all'
 }
 
 // Publish image(s) built during the build step into targetReg registry using the targetTag
diff --git a/src/test/dhcp/dhcpTest.py b/src/test/dhcp/dhcpTest.py
index 14a9d4a..74891c0 100644
--- a/src/test/dhcp/dhcpTest.py
+++ b/src/test/dhcp/dhcpTest.py
@@ -1,12 +1,12 @@
-# 
+#
 # Copyright 2016-present Ciena Corporation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
-# 
+#
 # http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,7 +38,7 @@
         "startip": "10.1.11.51",
         "endip": "10.1.11.100"
     }
-    
+
     app = 'org.onosproject.dhcp'
 
     ip_count = 0
@@ -91,15 +91,15 @@
         return cip,sip
 
 
-    def stats(self,success_rate = False, iface = 'veth0'):
-       
+    def stats(self,success_rate = False, only_discover = False, iface = 'veth0'):
+
 	self.ip_count = 0
 	self.failure_count = 0
 	self.start_time = 0
 	self.diff = 0
 	self.transaction_count = 0
 
-	config = {'startip':'182.17.0.3', 'endip':'182.17.0.180', 
+	config = {'startip':'182.17.0.3', 'endip':'182.17.0.180',
                   'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe",
                   'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'}
         self.onos_dhcp_table_load(config)
@@ -107,17 +107,22 @@
 	self.start_time = time.time()
 
 	while self.diff <= 60:
-            
-	    cip, sip = self.send_recv(update_seed = True, validate = False)
+	    if only_discover:
+		cip, sip, mac, _ = self.dhcp.only_discover(multiple = True)
+                log.info('Got dhcp client IP %s from server %s for mac %s' %
+                          (cip, sip, mac))
+            else:
+                cip, sip = self.send_recv(update_seed = True, validate = False)
+
 	    if cip:
 	    	self.ip_count +=1
 	    elif cip == None:
 		self.failure_count += 1
                 log.info('Failed to get ip')
-		if success_rate:
-			break
-	    
-	    self.diff = round(time.time() - self.start_time, 2)
+		if success_rate and self.ip_count > 0:
+		   break
+	    self.diff = round(time.time() - self.start_time, 0)
+
 
 	self.transaction_count = round((self.ip_count+self.failure_count)/self.diff, 2)
 
@@ -129,7 +134,7 @@
 
 
     def test_dhcp_1request(self, iface = 'veth0'):
-        config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', 
+        config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
                   'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
                   'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
         self.onos_dhcp_table_load(config)
@@ -137,7 +142,7 @@
         self.send_recv()
 
     def test_dhcp_Nrequest(self, iface = 'veth0'):
-        config = {'startip':'192.168.1.20', 'endip':'192.168.1.69', 
+        config = {'startip':'192.168.1.20', 'endip':'192.168.1.69',
                   'ip':'192.168.1.2', 'mac': "ca:fe:ca:fe:cc:fe",
                   'subnet': '255.255.255.0', 'broadcast':'192.168.1.255', 'router': '192.168.1.1'}
         self.onos_dhcp_table_load(config)
@@ -151,7 +156,7 @@
             ip_map[cip] = sip
 
     def test_dhcp_1release(self, iface = 'veth0'):
-        config = {'startip':'10.10.100.20', 'endip':'10.10.100.21', 
+        config = {'startip':'10.10.100.20', 'endip':'10.10.100.21',
                   'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe",
                   'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'}
         self.onos_dhcp_table_load(config)
@@ -167,7 +172,7 @@
         assert_equal(self.dhcp.release(cip2), True)
 
     def test_dhcp_Nrelease(self, iface = 'veth0'):
-        config = {'startip':'192.170.1.20', 'endip':'192.170.1.30', 
+        config = {'startip':'192.170.1.20', 'endip':'192.170.1.30',
                   'ip':'192.170.1.2', 'mac': "ca:fe:ca:fe:9a:fe",
                   'subnet': '255.255.255.0', 'broadcast':'192.170.1.255', 'router': '192.170.1.1'}
         self.onos_dhcp_table_load(config)
@@ -198,7 +203,7 @@
 
 
     def test_dhcp_starvation(self, iface = 'veth0'):
-        config = {'startip':'193.170.1.20', 'endip':'193.170.1.69', 
+        config = {'startip':'193.170.1.20', 'endip':'193.170.1.69',
                   'ip':'193.170.1.2', 'mac': "ca:fe:c2:fe:cc:fe",
                   'subnet': '255.255.255.0', 'broadcast':'192.168.1.255', 'router': '192.168.1.1'}
         self.onos_dhcp_table_load(config)
@@ -213,7 +218,7 @@
 
 
     def test_dhcp_starvation(self, iface = 'veth0'):
-        config = {'startip':'182.17.0.20', 'endip':'182.17.0.69', 
+        config = {'startip':'182.17.0.20', 'endip':'182.17.0.69',
                   'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe",
                   'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'}
         self.onos_dhcp_table_load(config)
@@ -229,16 +234,16 @@
 
 
     def test_dhcp_same_client_multiple_discover(self, iface = 'veth0'):
-	config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', 
+	config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
                  'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %  
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
 		  (cip, sip, mac) )
 	log.info('Triggering DHCP discover again.')
-	new_cip, new_sip, new_mac = self.dhcp.only_discover()
+	new_cip, new_sip, new_mac, _ = self.dhcp.only_discover()
 	if cip == new_cip:
 		log.info('Got same ip for 2nd DHCP discover for client IP %s from server %s for mac %s. Triggering DHCP Request. '
 			  % (new_cip, new_sip, new_mac) )
@@ -249,7 +254,7 @@
 
 
     def test_dhcp_same_client_multiple_request(self, iface = 'veth0'):
-	config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', 
+	config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
                  'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
         self.onos_dhcp_table_load(config)
@@ -260,70 +265,65 @@
 	log.info("Sending DHCP request again.")
 	new_cip, new_sip = self.dhcp.only_request(cip, mac)
 	if (new_cip,new_sip) == (cip,sip):
-		
 		log.info('Got same ip for 2nd DHCP Request for client IP %s from server %s for mac %s.'
 			  % (new_cip, new_sip, mac) )
 	elif (new_cip,new_sip):
-		
-		log.info('No DHCP ACK')
-		assert_equal(new_cip, None)
-		assert_equal(new_sip, None)
+                log.info('No DHCP ACK')
+                assert_equal(new_cip, None)
+                assert_equal(new_sip, None)
 	else:
-		print "Something went wrong."	
-    
+		log.info('Something went wrong.')
+
     def test_dhcp_client_desired_address(self, iface = 'veth0'):
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.31', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover(desired = True)
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 	if cip == self.dhcp.seed_ip:
-		log.info('Got dhcp client IP %s from server %s for mac %s as desired .' %  
+		log.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
 		  (cip, sip, mac) )
 	elif cip != self.dhcp.seed_ip:
-		log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+		log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 		log.info('The desired ip was: %s .' % self.dhcp.seed_ip)
 		assert_equal(cip, self.dhcp.seed_ip)
-		
-		
+
     def test_dhcp_client_desired_address_out_of_pool(self, iface = 'veth0'):
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.35', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover(desired = True)
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 	if cip == self.dhcp.seed_ip:
-		log.info('Got dhcp client IP %s from server %s for mac %s as desired .' %  
+		log.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
 		  (cip, sip, mac) )
 		assert_equal(cip, self.dhcp.seed_ip) #Negative Test Case
-
 	elif cip != self.dhcp.seed_ip:
-		log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+		log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 		log.info('The desired ip was: %s .' % self.dhcp.seed_ip)
 		assert_not_equal(cip, self.dhcp.seed_ip)
-
 	elif cip == None:
 		log.info('Got DHCP NAK')
-	
-			
+
+
     def test_dhcp_server_nak_packet(self, iface = 'veth0'):
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
-	
+
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
@@ -331,13 +331,13 @@
 	else:
 		new_cip, new_sip = self.dhcp.only_request('20.20.20.31', mac)
 		if new_cip == None:
-			
+
 			log.info("Got DHCP server NAK.")
 			assert_equal(new_cip, None)  #Negative Test Case
-		
-	
+
+
     def test_dhcp_lease_packet(self, iface = 'veth0'):
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
@@ -350,27 +350,26 @@
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
 		assert_not_equal(cip, None)
 	elif lval != 700:
-		log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' %  
+		log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' %
 		 	 (cip, sip, mac, lval) )
 		assert_not_equal(lval, 700)
 
     def test_dhcp_client_request_after_reboot(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
-	
+
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
-	
+
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
 		assert_not_equal(cip, None)
-		
+
 	else:
 		new_cip, new_sip = self.dhcp.only_request(cip, mac)
 		if new_cip == None:
@@ -378,12 +377,12 @@
 		os.system('ifconfig '+iface+' down')
 		log.info('Client goes down.')
 		log.info('Delay for 5 seconds.')
-		
+
 		time.sleep(5)
-		
+
 		os.system('ifconfig '+iface+' up')
 		log.info('Client is up now.')
-		
+
 		new_cip, new_sip = self.dhcp.only_request(cip, mac, cl_reboot = True)
 		if new_cip == None:
 			log.info("Got DHCP server NAK.")
@@ -391,35 +390,35 @@
 		elif new_cip != None:
 			log.info("Got DHCP ACK.")
 		os.system('ifconfig '+iface+' up')
-		
 
-	
-     
+
+
+
     def test_dhcp_server_after_reboot(self, iface = 'veth0'):
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
-	
+
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
-	
+
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
 		assert_not_equal(cip, None)
-		
+
 	else:
 		new_cip, new_sip = self.dhcp.only_request(cip, mac)
 		if new_cip == None:
 			log.info("Got DHCP server NAK.")
 			assert_not_equal(new_cip, None)
 		log.info('Getting DHCP server Down.')
-        	
+
 		self.onos_ctrl.deactivate()
-			
+
 		for i in range(0,4):
 			log.info("Sending DHCP Request.")
 			log.info('')
@@ -430,13 +429,13 @@
 			elif new_cip and new_sip:
 				log.info("Got Reply from DHCP server.")
 				assert_equal(new_cip,None) #Neagtive Test Case
-		
+
 		log.info('Getting DHCP server Up.')
-        
+
 		status, _ = self.onos_ctrl.activate()
         	assert_equal(status, True)
         	time.sleep(3)
-		
+
 		for i in range(0,4):
 			log.info("Sending DHCP Request after DHCP server is up.")
 			log.info('')
@@ -447,82 +446,82 @@
 			elif new_cip and new_sip:
 				log.info("Got Reply from DHCP server.")
 				assert_equal(new_cip,None) #Neagtive Test Case
-		
+
 
     def test_dhcp_specific_lease_packet(self, iface = 'veth0'):
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
 	log.info('Sending DHCP discover with lease time of 700')
-	cip, sip, mac = self.dhcp.only_discover(lease_time = True)
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover(lease_time = True)
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
+		assert_not_equal(cip, None)
 	elif cip and sip and mac:
-		
+
 		log.info("Triggering DHCP Request.")
 		new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, lease_time = True)
-		log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' %  
+		log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' %
 		 	 (new_cip, new_sip, mac, lval) )
 		assert_not_equal(lval, 700) #Negative Test Case
 
 
-		
+
     def test_dhcp_lease_packet(self, iface = 'veth0'):
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
-		
+
 		log.info("Triggering DHCP Request.")
 		new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, lease_time = True)
 		if lval == 600:
-			log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s.' %  
-		 		 (new_cip, new_sip, mac, lval) ) 
+			log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s.' %
+		 		 (new_cip, new_sip, mac, lval) )
 		else:
-			log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s.' %  
-		 		 (new_cip, new_sip, mac, lval) ) 
+			log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s.' %
+		 		 (new_cip, new_sip, mac, lval) )
 			log.info('The lease time suppossed to be 600 secs or 10 mins.')
 			assert_equal(lval, 600)
-			
+
     def test_dhcp_client_renew_time(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
-		
+
 		log.info("Triggering DHCP Request.")
 		new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
-	
+
 		if new_cip and new_sip and lval:
 
 			log.info("Clinet 's Renewal time is :%s",lval)
@@ -535,37 +534,37 @@
 			if latest_cip and latest_sip:
 				log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
 						(latest_cip, mac, latest_sip) )
-		
+
 			elif latest_cip == None:
 				log.info("Got DHCP NAK. Lease not renewed.")
-				
+
 		elif new_cip == None or new_sip == None or lval == None:
 
 			log.info("Got DHCP NAK.")
 
-			
-		
+
+
     def test_dhcp_client_rebind_time(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
-		
+
 		log.info("Triggering DHCP Request.")
 		new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True)
-	
+
 		if new_cip and new_sip and lval:
 
 			log.info("Clinet 's Rebind time is :%s",lval)
@@ -573,14 +572,15 @@
 			time.sleep(lval)
 
 			log.info("Client Sending broadcast DHCP requests for renewing lease or for getting new ip.")
-	
+
 			for i in range(0,4):
 				latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac)
 
 				if latest_cip and latest_sip:
 					log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
 							(latest_cip, mac, latest_sip) )
-		
+					break
+
 				elif latest_cip == None:
 					log.info("Got DHCP NAK. Lease not renewed.")
 			assert_not_equal(latest_cip, None)
@@ -590,286 +590,330 @@
 
 
     def test_dhcp_client_expected_subnet_mask(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
 	expected_subnet = '255.255.255.0'
 	self.dhcp.return_option = 'subnet'
-	
+
 	cip, sip, mac, subnet_value = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
-		
+
 		if expected_subnet == subnet_value:
 			log.info("Got same subnet as passed in DHCP server configuration.")
-	
+
 		elif expected_subnet != subnet_value:
 			log.info("Not getting same subnet as passed in DHCP server configuration.")
 			assert_equal(expected_subnet, subnet_value)
 
 
     def test_dhcp_client_sends_dhcp_request_with_wrong_subnet_mask(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
 
 		self.dhcp.send_different_option = 'subnet'
 		log.info("Sending DHCP Request with wrong subnet mask.")
 		new_cip, new_sip = self.dhcp.only_request(cip, mac)
 		if new_cip == None:
-			
+
 			log.info("Got DHCP NAK.")
 			assert_not_equal(new_cip, None)
 
 		elif new_cip and new_sip:
-	
+
 			log.info("Got DHCP Ack despite of specifying wrong Subnet Mask in DHCP Request.")
 			log.info("Getting subnet mask as per server 's configuration.")
-		
+
 
     def test_dhcp_client_expected_router_address(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
 	expected_router_address = '20.20.20.1'
 	self.dhcp.return_option = 'router'
-	
+
 	cip, sip, mac, router_address_value = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
-		
+
 		if expected_router_address == router_address_value:
 			log.info("Got same router address as passed in DHCP server configuration.")
-	
+
 		elif expected_router_address != router_address_value:
 			log.info("Not getting same router address as passed in DHCP server configuration.")
 			assert_equal(expected_router_address, router_address_value)
 
 
     def test_dhcp_client_sends_dhcp_request_with_wrong_router_address(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
 
 		self.dhcp.send_different_option = 'router'
 		log.info("Sending DHCP Request with wrong router address.")
 		new_cip, new_sip = self.dhcp.only_request(cip, mac)
 		if new_cip == None:
-			
+
 			log.info("Got DHCP NAK.")
 			assert_not_equal(new_cip, None)
 
 		elif new_cip and new_sip:
-	
+
 			log.info("Got DHCP Ack despite of specifying wrong Router Address in DHCP Request.")
 			log.info("Getting Router Address as per server 's configuration.")
-		
+
 
     def test_dhcp_client_expected_broadcast_address(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
 	expected_broadcast_address = '20.20.20.255'
 	self.dhcp.return_option = 'broadcast_address'
-	
+
 	cip, sip, mac, broadcast_address_value = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
-		
+
 		if expected_broadcast_address == broadcast_address_value:
 			log.info("Got same router address as passed in DHCP server configuration.")
-	
+
 		elif expected_broadcast_address != broadcast_address_value:
 			log.info("Not getting same router address as passed in DHCP server configuration.")
 			assert_equal(expected_broadcast_address, broadcast_address_value)
 
 
     def test_dhcp_client_sends_dhcp_request_with_wrong_broadcast_address(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
 
 		self.dhcp.send_different_option = 'broadcast_address'
 		log.info("Sending DHCP Request with wrong broadcast address.")
 		new_cip, new_sip = self.dhcp.only_request(cip, mac)
 		if new_cip == None:
-			
+
 			log.info("Got DHCP NAK.")
 			assert_not_equal(new_cip, None)
 
 		elif new_cip and new_sip:
-	
+
 			log.info("Got DHCP Ack despite of specifying wrong Broadcast Address in DHCP Request.")
 			log.info("Getting Broadcast Address as per server 's configuration.")
-		
+
     def test_dhcp_client_expected_dns_address(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1', 'domain':'8.8.8.8'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
 	expected_dns_address = '8.8.8.8'
 	self.dhcp.return_option = 'dns'
-	
+
 	cip, sip, mac, dns_address_value = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
-		
+
 		if expected_dns_address == dns_address_value:
 			log.info("Got same DNS address as passed in DHCP server configuration.")
-	
+
 		elif expected_dns_address != dns_address_value:
 			log.info("Not getting same DNS address as passed in DHCP server configuration.")
 			assert_equal(expected_dns_address, dns_address_value)
 
 
-    def test_dhcp_client_sends_dhcp_request_with_wrong_dns_address(self, iface = 'veth0'):
-	
-	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', 
+    def test_dhcp_client_sends_request_with_wrong_dns_address(self, iface = 'veth0'):
+
+	config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
                  'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
                  'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1', 'domain':'8.8.8.8'}
         self.onos_dhcp_table_load(config)
         self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
-	
-	cip, sip, mac = self.dhcp.only_discover()
-	log.info('Got dhcp client IP %s from server %s for mac %s .' %  
+
+	cip, sip, mac, _ = self.dhcp.only_discover()
+	log.info('Got dhcp client IP %s from server %s for mac %s .' %
 		  (cip, sip, mac) )
 
 	log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
 	if (cip == None and mac != None):
 		log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
-		assert_not_equal(cip, None) 
-	
+		assert_not_equal(cip, None)
+
 	elif cip and sip and mac:
 
 		self.dhcp.send_different_option = 'dns'
 		log.info("Sending DHCP Request with wrong DNS address.")
 		new_cip, new_sip = self.dhcp.only_request(cip, mac)
 		if new_cip == None:
-			
 			log.info("Got DHCP NAK.")
 			assert_not_equal(new_cip, None)
-
 		elif new_cip and new_sip:
-	
 			log.info("Got DHCP Ack despite of specifying wrong DNS Address in DHCP Request.")
 			log.info("Getting DNS Address as per server 's configuration.")
-		
+
     def test_dhcp_server_transactions_per_second(self, iface = 'veth0'):
-       
-	for i in range(1,4):	
+
+	for i in range(1,4):
 		self.stats()
-		log.info("Statics for run %d",i)
+		log.info("Stats for run %d",i)
 		log.info("----------------------------------------------------------------------------------")
 		log.info("No. of transactions     No. of successes     No. of failures     Running Time ")
 	        log.info("    %d                    %d                     %d                  %d" %(self.ip_count+self.failure_count, 		               self.ip_count, self.failure_count, self.diff))
 		log.info("----------------------------------------------------------------------------------")
 		log.info("No. of transactions per second in run %d:%f" %(i, self.transaction_count))
 
-	log.info("Final Statatics for total transactions")
+	log.info("Final Statistics for total transactions")
 	log.info("----------------------------------------------------------------------------------")
 	log.info("Total transactions     Total No. of successes     Total No. of failures     Running Time ")
-	log.info("    %d                     %d                         %d                        %d" %(self.transactions, 
+	log.info("    %d                     %d                         %d                        %d" %(self.transactions,
                  self.total_success, self.total_failure, self.running_time))
 	log.info("----------------------------------------------------------------------------------")
 	log.info("Average no. of transactions per second: %d", round(self.transactions/self.running_time,0))
 
     def test_dhcp_server_consecutive_successes_per_second(self, iface = 'veth0'):
-       
-	for i in range(1,4):	
+
+	for i in range(1,4):
 		self.stats(success_rate = True)
-		log.info("Statics for run %d",i)
+		log.info("Stats for run %d",i)
 		log.info("----------------------------------------------------------------------------------")
 		log.info("No. of consecutive successful transactions          Running Time ")
 	        log.info("                   %d                                   %d        " %(self.ip_count, self.diff))
 		log.info("----------------------------------------------------------------------------------")
 		log.info("No. of successful transactions per second in run %d:%f" %(i, self.transaction_count))
+		log.info("----------------------------------------------------------------------------------")
 
-	log.info("Final Statatics for total successful transactions")
+	log.info("Final Statistics for total successful transactions")
 	log.info("----------------------------------------------------------------------------------")
 	log.info("Total transactions     Total No. of consecutive successes         Running Time ")
-	log.info("    %d                                 %d                             %d        " %(self.transactions, 
+	log.info("    %d                                 %d                             %d        " %(self.transactions,
                  self.total_success, self.running_time))
 	log.info("----------------------------------------------------------------------------------")
-	log.info("Average no. of transactions per second: %d", round((self.transactions-i)/self.running_time,0))
+	log.info("Average no. of consecutive successful transactions per second: %d", round(self.total_success/self.running_time,0))
+	log.info("----------------------------------------------------------------------------------")
 
+
+    def test_dhcp_server_client_transactions_per_second(self, iface = 'veth0'):
+
+        for i in range(1,4):
+		self.stats(only_discover = True)
+		log.info("----------------------------------------------------------------------------------")
+		log.info("Stats for run %d of sending only DHCP Discover",i)
+		log.info("----------------------------------------------------------------------------------")
+		log.info("No. of transactions     No. of successes     No. of failures     Running Time ")
+	        log.info("    %d                    %d                     %d                  %d" %(self.ip_count+self.failure_count, 		               self.ip_count, self.failure_count, self.diff))
+		log.info("----------------------------------------------------------------------------------")
+		log.info("No. of clients per second in run %d:%f                                      "
+			%(i, self.transaction_count))
+		log.info("----------------------------------------------------------------------------------")
+	log.info("Final Statistics for total transactions of sending only DHCP Discover")
+	log.info("----------------------------------------------------------------------------------")
+	log.info("Total transactions     Total No. of successes     Total No. of failures     Running Time ")
+	log.info("    %d                     %d                         %d                        %d" %(self.transactions,
+                 self.total_success, self.total_failure, self.running_time))
+	log.info("----------------------------------------------------------------------------------")
+	log.info("Average no. of clients per second: %d                                        ",
+		round(self.transactions/self.running_time,0))
+	log.info("----------------------------------------------------------------------------------")
+
+    def test_dhcp_server_consecutive_successful_clients_per_second(self, iface = 'veth0'):
+
+        for i in range(1,4):
+		self.stats(success_rate = True, only_discover = True)
+		log.info("----------------------------------------------------------------------------------")
+		log.info("Stats for run %d for sending only DHCP Discover",i)
+		log.info("----------------------------------------------------------------------------------")
+		log.info("No. of consecutive successful transactions          Running Time ")
+	        log.info("                   %d                                   %d        " %(self.ip_count, self.diff))
+		log.info("----------------------------------------------------------------------------------")
+		log.info("No. of consecutive successful clients per second in run %d:%f" %(i, self.transaction_count))
+		log.info("----------------------------------------------------------------------------------")
+
+	log.info("Final Statistics for total successful transactions")
+	log.info("----------------------------------------------------------------------------------")
+	log.info("Total transactions     Total No. of consecutive successes         Running Time ")
+	log.info("    %d                                 %d                             %d        " %(self.transactions,
+                 self.total_success, self.running_time))
+	log.info("----------------------------------------------------------------------------------")
+	log.info("Average no. of consecutive successful clients per second: %d", round(self.total_success/self.running_time,0))
+	log.info("----------------------------------------------------------------------------------")
diff --git a/src/test/utils/DHCP.py b/src/test/utils/DHCP.py
index 34ca04b..0692be7 100644
--- a/src/test/utils/DHCP.py
+++ b/src/test/utils/DHCP.py
@@ -1,12 +1,12 @@
-# 
+#
 # Copyright 2016-present Ciena Corporation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
-# 
+#
 # http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -55,12 +55,12 @@
         L5 = BOOTP(chaddr=chmac)
         L6 = DHCP(options=[("message-type","discover"),"end"])
         resp = srp1(L2/L3/L4/L5/L6, filter="udp and port 68", timeout=10, iface=self.iface)
-	self.dhcpresp = resp
+        self.dhcpresp = resp
         try:
             srcIP = resp.yiaddr
             serverIP = resp.siaddr
         except AttributeError:
-            print("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
+            log.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
             return (None, None)
 
         subnet_mask = "0.0.0.0"
@@ -81,11 +81,15 @@
         self.mac_inverse_map[srcIP] = (mac, serverIP)
         return (srcIP, serverIP)
 
-    def only_discover(self, mac = None, desired = False, lease_time = False):  
+    def only_discover(self, mac = None, desired = False, lease_time = False, multiple = False):
         '''Send a DHCP discover'''
 
         if mac is None:
-            mac = self.seed_mac
+	    if multiple:
+               mac = RandMAC()._fix()
+	    else:
+               mac = self.seed_mac
+
 
         chmac = self.macToChaddr(mac)
 	self.bootpmac = chmac
@@ -95,69 +99,68 @@
         L5 = BOOTP(chaddr=chmac)
 	if desired:
 		L6 = DHCP(options=[("message-type","discover"),("requested_addr",self.seed_ip),"end"])
-	
+
 	elif lease_time:
 		L6 = DHCP(options=[("message-type","discover"),("lease_time",700),"end"])
-		
+
 	else:
 	        L6 = DHCP(options=[("message-type","discover"),"end"])
-		
+
 
         resp = srp1(L2/L3/L4/L5/L6, filter="udp and port 68", timeout=10, iface=self.iface)
 	if resp == None:
-        	return (None, None, mac)
-		
+                return (None, None, mac, None)
+
 	self.dhcpresp = resp
         for x in resp.lastlayer().options:
             if(x == 'end'):
                 break
             op,val = x
             if(op == "message-type"):
-            	
+
 	    	if(val == 2):
-		
+
 			try:
             			srcIP = resp.yiaddr
             			serverIP = resp.siaddr
         		except AttributeError:
-           			print "In Attribute error."
-            		 	print("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
-            		 	return (None, None, None)
+           			log.info("In Attribute error.")
+            		 	log.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
+                                return (None, None, None, None)
 
 			if self.return_option:
 				for x in resp.lastlayer().options:
         	    			if(x == 'end'):
                 				break
 	            			op,val = x
-		
+
 	        	    		if op == "lease_time":
 						if self.return_option == 'lease':
 							return (srcIP, serverIP, mac, val)
 
 	        	    		elif op == "subnet_mask":
 						if self.return_option == 'subnet':
-							return (srcIP, serverIP, mac, val)		
+							return (srcIP, serverIP, mac, val)
 					elif op == "router":
 						if self.return_option == 'router':
-							return (srcIP, serverIP, mac, val)		
+							return (srcIP, serverIP, mac, val)
 					elif op == "broadcast_address":
 						if self.return_option == 'broadcast_address':
-							return (srcIP, serverIP, mac, val)		
+							return (srcIP, serverIP, mac, val)
 					elif op == "name_server":
 						if self.return_option == 'dns':
-							return (srcIP, serverIP, mac, val)		
+							return (srcIP, serverIP, mac, val)
 
-				
+
 			else:
-				return (srcIP, serverIP, mac)
+				return (srcIP, serverIP, mac, None)
 		elif(val == 6):
-		
-			return (None, None, mac)
+			return (None, None, mac, None)
 
-	
+
     def only_request(self, cip, mac, cl_reboot = False, lease_time = False, renew_time = False, rebind_time = False, unicast = False):
         '''Send a DHCP offer'''
-        
+
 	subnet_mask = "0.0.0.0"
         for x in self.dhcpresp.lastlayer().options:
             	if(x == 'end'):
@@ -171,22 +174,22 @@
 	if unicast and self.servermac:
         	L2 = Ether(dst=self.servermac, src=mac)
 	        L3 = IP(src=cip, dst=server_id)
-	else:	
+	else:
 	        L2 = Ether(dst="ff:ff:ff:ff:ff:ff", src=mac)
 		if self.after_T2:
 	        	L3 = IP(src=cip, dst="255.255.255.255")
 		else:
 		        L3 = IP(src="0.0.0.0", dst="255.255.255.255")
         L4 = UDP(sport=68, dport=67)
-	
+
 	if self.after_T2 == True:
         	L5 = BOOTP(chaddr=self.bootpmac, ciaddr = cip)
 	else:
 
 	        L5 = BOOTP(chaddr=self.bootpmac, yiaddr=cip)
-	
+
 	if cl_reboot or self.after_T2:
-        	L6 = DHCP(options=[("message-type","request"),("subnet_mask",subnet_mask), ("requested_addr",cip), "end"])		
+                L6 = DHCP(options=[("message-type","request"),("subnet_mask",subnet_mask), ("requested_addr",cip), "end"])
 	elif self.send_different_option:
 		if self.send_different_option == 'subnet':
 	       		L6 = DHCP(options=[("message-type","request"),("server_id",server_id),
@@ -201,7 +204,7 @@
 		elif self.send_different_option == 'dns':
 	       		L6 = DHCP(options=[("message-type","request"),("server_id",server_id),
         	                   	("subnet_mask",subnet_mask), ("name_server",'1.1.1.1'), ("requested_addr",cip), "end"])
-		
+
 	else:
        		L6 = DHCP(options=[("message-type","request"), ("server_id",server_id),
                            	("subnet_mask",subnet_mask), ("requested_addr",cip), "end"])
@@ -218,22 +221,22 @@
                 	break
             	op,val = x
             	if(op == "message-type"):
-	
+
 			if(val == 5):
 				try:
             				srcIP = resp.yiaddr
             				serverIP = resp.siaddr
         			except AttributeError:
-           				print "In Attribute error."
-            				print("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
+           				log.info("In Attribute error.")
+            				log.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
             				return (None, None)
-        		
+
 				if lease_time or renew_time or rebind_time:
 					for x in resp.lastlayer().options:
             					if(x == 'end'):
                 					break
 	            				op,val = x
-				
+
         	    				if op == "lease_time":
 							if lease_time == True:
 								self.mac_map[mac] = (srcIP, serverIP)
@@ -254,11 +257,11 @@
 					self.mac_inverse_map[srcIP] = (mac, serverIP)
 					return (srcIP, serverIP)
 			elif(val == 6):
-		
+
 				log.info("Got DHCP NAK.")
 				return (None, None)
-	
-		
+
+
 
     def discover_next(self):
         '''Send next dhcp discover/request with updated mac'''
