Friday 20 February 2015

NetBSD DHCP Client Optimization to discover interfaces

Hi , 

Here is some information about  Internet Systems Consortium (ISF) dhcp client software


ISF DHCP Client software has dhcp client statemachine , well written to acquire ip address for multiple interfaces. 

It maintains three different interface  list for maintain the interface where dhcp client enabled . 

The interface database (list) are 

(a) interfaces 
(b) dummy_interfaces 
(c) fallback_interfaces

Here my share on optimization of discover_interfaces function.

This topic would be used those who are using ISF dhcp client library,  to achieve ip address assignment via dhcp 


discover_interfaces 

-- This function mainly to walk through the interfaces database and get the interfaces who are looking for ip address 
-- In the whole library discover_interfaces function , called for multiple times with different state 

DISCOVER
REQUESTED 
UNCONFIGURED  and so on..

-- I have removed many of the calling places 

-- And introduced passing the interface index as input to discover_interfaces function

--- By this way  i achieved following 

 (a) For every state transition you dont need  to call discover_interfaces 
(b)  During initialization also no need to call discover_interfaces 
(c) The effective use passing interface index solved looking at interface details from the database 
   Instead of walking though the entire interfaces in the system and find out what are interfaces looking for ip address 


--- Two things are achieved ,

1. Calling many times discover_interfaces  (optimized passing interface index and do discover only for the given interface )
2.  Achieved  less CPU Memory Utilization.. 

By this optimization i could able to have more number of interfaces shall able to  get ip address using ISF DHCP Client library. 

IF YOU HAVE ANY COMMENTS ARE CLARIFICATION NEEDED PLEASE FEEL FREE TO COMMENT 

No comments:

Post a Comment