Cover V06, I01
Article
Figure 1
Listing 1

jan97.tar


Administering Network Information for PCsUsing a Database

David Leibfritz and Michael Eisenberg

Adding and removing PCs on a TCP/IP network requires constant effort by the administrator to keep track of each PC's location and its IP number. The assignment of IP addresses must be maintained by the network administrator to avoid duplicate IP addresses that can bring the network to a halt. Additionally, as PCs get upgraded and moved from office to office, the administrator must have a record of where each PC is located. This is especially important when the environment has hundreds of PCs and several support personnel who need quick access to network information about PCs that they might not have initially configured.

In an environment that uses NIS+ and DNS for network administration and Unix servers for print and bootp/dhcp servers, we have been successful in using an Oracle database to gather all the information for each PC and to automatically maintain the network information on the Unix servers. Any database could have been chosen for this task.

Each PC that is added to the network must first be recorded in the database before it is attached to the network. The database will assign the next available IP address to this PC then update the network information by calling scripts on the Unix server. These scripts will create a bootp or dhcp entry for the PC on the appropriate Unix server for the subnet. The PC will then automatically retrieve its IP from the Unix server via bootp or dhcp. The scripts will also add the IP address and PC network name to the NIS+ hosts and netgroup tables, nameserver, and /etc/hosts.lpd file for printer access. The entire process of adding a PC is automated through the database including modification or removal of the PC information; however, the database must be modified every time a change occurs.

Through the management of hundreds of PCs, we have learned that keeping all the PC information in one location is more effective and efficient than maintaining the various system files on the server. Before this implementation, we would search the NIS+ hosts table or nameserver to find the PC's IP address. When PCs were moved from subnet to subnet, the NIS+ hosts table and nameserver files would become inconsistent because they were not always updated simultaneously. This led to confusion in determining which IP address the PC was using currently. Also, from just the IP address, we could not determine the location of the PC or the principal user. Information on the type of PC and property numbers are now included with each record for inventory purposes.

All the information on a PC could be kept in a flat file, but this would not lend itself to some of the capabilities a database can provide. By placing this information in a database, such as Oracle, you can generate reports based on selected information for inventory. The database can also detect when a duplicate IP or Ethernet address is being entered. Triggers can be created that will execute scripts to update the NIS+ hosts table and nameserver when an IP address is modified. By using a database, you can automate the entire process of maintaining the network information for each PC and check that the data is accurate before it is entered.

Each PC is represented by a record in the database (figure 1). The database record stores information such as node name, custodian, location, equipment type, manufacturer, serial number, hard disk capacity, RAM capacity, boot protocol, Ethernet address, IP address, subnet, and domain. The node name corresponds to the computer's host name on the network. PCs are indexed in the database by their node name. Custodian and location data are used to identify a contact person and the physical location of the PC. Equipment type, manufacturer, serial number, hard drive capacity, and RAM capacity data provide information to be used to manage or classify PC resources or in the event of problem with a PC. Boot protocol, Ethernet address, IP address, subnet, and domain data provide all necessary networking information. Boot protocol is either bootp or dhcp; both protocols are supported. The Ethernet address is used by the bootp protocol to identify a specific PC's boot request and to track any problems that occur on the network. The IP address is selected from a pool of available IP addresses maintained by the database. The database record contains all necessary information required to manage the PC reliably on the network.

To maintain the uniqueness of the IP addresses, we entered all the IP addresses for each subnet into the database. When a machine is added, the system administrator can select an available IP address from the current IP list that is maintained by the database. The database will then remove the selected IP address from the list of available IP addresses. If the system administrator tries to enter an IP address that is already in use, the database will notify the system administrator and not permit this entry. When a machine is deleted from the database, the IP number will be added back to available list by the database.

Once the data for a PC has been entered into the database, the database will automatically generate the bootp or dhcp information required for the server, if that protocol has been selected for booting this particular PC. Only the unique information for the PC needs to be added to the server. This includes the PC network name, the IP address, the subnet, and the Ethernet address. Listed below is a sample bootp entry that would be added to the bootp server for a PC named eagle:

eagle:
:tc=.subxx.template:
:ha=xxxxxxxxxxxx:
:ip=xxx.xxx.xxx.xxx:

The x's would be replaced by the actual numbers. The database would then append this information to /etc/bootptab file on the appropriate bootp server for the subnet selected. To maintain accuracy of the bootp information, the database can regenerate the entire /etc/bootptab file each time the information is modified. The database would maintain a template entry for each subnet and then simply add all the PCs that require bootp to that template to create the /etc/bootptab file for the server. The /etc/bootptab can be copied to the server using rcp.

In addition to adding the PC to bootp or dhcp, the network information must be added to the hosts table, netgroup table, nameserver, and hosts.lpd file on the server. This procedure can also be automated using the database to call scripts that will be executed on the server with the required data. The sample code shown in Listing 1 can be used to update the system files on the server that receives, as arguments, the network name of the PC and the IP number.

After the script executes all the network information for the PC, the information will be accurate and complete. This prevents typographical errors from occurring when adding the information and confirms that each system file is updated with the appropriate data. After the system files have the network data for the PC, it is ready to be configured and attached to the network.

The networking software is installed on the PC client and is configured to use either bootp or dhcp. Once the TCP/IP stack is installed, the client is connected to file and print services on the Unix server, telnet and ftp services are configured, and a World Wide Web browser is installed.

Many of the TCP/IP stacks provide bootp and dhcp remote management of PCs. On a large computer network, it is impractical to manage IP addresses locally. A minor change to the network configuration could require visiting each PC individually. Since the database uses scripts to generate the bootptab file, the scripts can be modified to create a bootptab file to support any vendor's bootp/dhcp implementation.

Microsoft's TCP/IP stack supports dhcp in Windows 3.11, Windows 95, and Windows NT. The TCP/IP stack is simply configured "to obtain an IP address automatically" rather than "specifying an IP address" locally. When the PC enters Windows, the networking software broadcasts a dhcp request on the network and obtains the PC's networking information from the server. A Windows 95 utility called winipcfg allows a user to view the dhcp information received from the server. This utility also allows the server information to be released and renewed and can be used to troubleshoot a PC that is having problems obtaining information via dhcp.

Many vendors have TCP/IP stacks that support bootp and dhcp protocols. Some vendors have included proprietary tags that can be used to manage license information for their network software. Others support only a limited subset of the tags in the bootptab file. In many cases, the documentation was lacking, and the implementation required extensive testing to successfully obtain network information from the server.

The networking information for each PC can be changed by modifying the database record and running the scripts. If a PC is physically moved from one subnet to another and requires a new IP address, the database record is modified to reflect the changed address. The old IP address is released into the pool of available addresses, and the new IP address is selected from the pool of available addresses in the new subnet. The scripts generate the bootptab file to reflect the new IP address and update the nameserver and other system files. The PC can now be disconnected, moved to its new location, and reconnected to the network. It will obtain its new network information from the server when it is booted.

Database records may also be configured with boot information for multiple subnets. The bootptab files are modified on the bootp/dhcp servers for each subnet. The PC only receives boot information from the server on the subnet to which it is attached. This setup allows PCs to be moved transparently between different subnets. Database scripts are triggered only when they are required. For example, changing the Ethernet card will require the bootptab to be generated but will not require an update to the nameserver or any system files.

When a PC is removed from the network, its network information should be removed from the database and system files. The user must delete the record from the database to release the IP number for use somewhere else. Additionally, the database should automatically remove the network information for this PC from the system network files by calling a script. This script will remove the PCP2s entry from the hosts file, netgroup file, /etc/hosts.lpd file, and nameserver to prevent a conflict caused by two PCs having the same IP address in the system network files. Another useful safety check is to have the script that adds the PC to the system network files check the files first for the presence of the PC name or IP address and delete the old entries before adding the new ones.

A database can be used to remotely manage PC resources on a large network. The database maintains a record of every node on the network. Each node is configured remotely by the data entered into the fields of the database. Database-triggered scripts manage changing IP addresses, editing entries in the bootptab file, updating the nameserver, and defining network clients in various system files. The database scripts eliminate the errors involved in editing files by hand and managing IP addresses in a flat file. This management allows for a fairly standard configuration of PC network clients. Standardization is the key to management of PC resources in any network.

About the Author

Michael Eisenberg is currently employed at Argonne National Laboratory as a PC LAN specialist. He will complete his M.S. in Computer Science in December of 1996. He has worked in a multiplatform environment for the past five years specializing in integrating PC and Macintosh computers with Unix host systems.