|
|
|
|
||||||||||||||||||
| |
||||||||||||||||||
|
Print-friendly version |
TUTORIALS > INTEROPERABILITY > Lesson 91: Dynamic Host Configuration ProtocolAutomatic assignment of IP numbers to network clients on boot-up eliminates some of IP's administrative complexity. As an open, standards-based protocol that is robust and WAN efficient-not to mention the fact that it's the protocol of the Internet-TCP/IP offers many advantages over other network protocols. But like anything else, TCP/IP has a downside. Its biggest drawback is administrative complexity; great effort is required to keep a TCP/IP network running well. The problem stems from the protocol's need to have a valid IP address for every device on the network. If you've worked with TCP/IP networks, you're probably aware of several important rules that network administrators must follow when assigning IP addresses:
Communicating with nodes on a different subnet or a different network requires a router. (For more information on TCP/IP addressing, see the Tutorial by Steve Steinke in the October 1995 LAN Magazine issue, "IP Addresses and Subnet Masks.") Assigning an IP address to a node-and doing it correctly-can be a significant administrative hassle. In particular, you need to track the addresses that have been assigned in order to avoid duplication. Moreover, if a node is moved to a different subnet, the subnet portion of the address must be changed to that of the new subnet. You also need to check that the node-specific portion of the IP address (the remainder, after you exclude the subnet bits) doesn't conflict with any other node on the new subnet.
AUTOMATING THE JOBKeeping track of IP address assignments and making new assignments sounds like the perfect kind of mind-numbing task to delegate to computers-and it is! The Dynamic Host Configuration Protocol (DHCP) was developed, fairly recently, to accomplish that exact job. DHCP is fully described in the Internet Requests for Comments (RFC) 1541, but I'll summarize the highlights. DHCP is based upon the Bootstrap Protocol (BOOTP), a system for automatically delivering configuration information from a BOOTP server to BOOTP clients on boot-up-the point when clients first connect to the network. Under DHCP, a computer is designated as the DHCP server. All of the other computers on the network-at least, those that need an IP address-will be DHCP clients (computers that already have a permanently set IP address don't need to participate). The network administrator needs to initially configure the DHCP server. Part of that configuration process involves assigning the DHCP server a block of IP address numbers that it can dispense to nodes that need IP addresses. When a new node comes onto the network-assuming it is capable of being a DHCP client-it will broadcast a request for an IP address. Simply put, the DHCP server will respond by checking its table of address assignments, selecting the next available address, and sending a response back to the requesting node. The actual process is more complex than that, as the requesting client must first find a DHCP server. Also, the protocol is constructed so that a client may negotiate with more than one DHCP server.
Here's how it works: A DHCP client that is in need of configuration broadcasts a
The client then selects one from among the
The chosen server then issues an acknowledgment packet (
Note that more than one DHCP server may respond to a dhcpdiscover with a
As mentioned, the selected server finalizes the offer by issuing the
DISPENSING IP ADDRESSESDHCP provides for IP addresses to be allocated in three different ways: With automatic allocation, the DHCP server assigns a permanent IP address to a DHCP client requesting an address. Using dynamic allocation, the DHCP server would assign an IP address for a limited period of time (the "lease period") or until the DHCP client specifically relinquishes it, whichever comes first. The third method is manual allocation in which the IP address is chosen by the network administrator, but the DHCP server is used to convey the assignment to a DHCP client. Dynamic allocation is particularly useful for computers that will connect to the network only occasionally. When a DHCP client is about to disconnect from the network, and thus no longer needs an IP address, it can notify the DHCP server, which can then reassign the number to the next node that needs an address. Dynamic allocation makes more efficient use of a limited number of IP addresses. A group of occasional users, for example, can share a smaller pool of IP addresses than if each required a permanent address of its own. Dynamic allocation won't work for every node, however. If the IP addresses of network servers were to change frequently and randomly, network clients would have a hard time finding servers. Thus, as a general rule, it's best to use static addresses for servers and dynamic addresses for clients. As mentioned earlier, DHCP is an offshoot of BOOTP. Where DHCP differs from BOOTP is that the BOOTP server merely stores a preset configuration for a BOOTP client and delivers it on boot-up. It doesn't eliminate the need to set up a configuration for the client. DHCP, by contrast, automatically configures DHCP clients, using rules preestablished by the administrator. When setting up DHCP on a network you must decide where to locate the DHCP servers. You could put one server on each subnet, or you could have one central DHCP server to which all the clients must connect in order to get an IP configuration. Because much of the communications between DHCP clients and servers take place via broadcasts, the central DHCP server approach requires that routers be capable of forwarding DHCP packets or that some other type of "relay agent" forwards the packets. BOOTP uses relay agents, and DHCP takes advantage of this. The format of DHCP packets is specifically designed to be nearly identical to BOOTP packets, so that BOOTP relay agents can forward DHCP packets. Figure 2 shows a simple two-subnet network, in which a router is acting as a relay agent. When a DHCP client on Subnet 1 issues a broadcast in order to discover a DHCP server, the router forwards the packet onto Subnet 2 where the DHCP server resides, using the unicast address of the DHCP server as the destination address. The router also notes from which subnet the discovery packet was issued and encodes that information into the discovery packet. When the DHCP server issues a reply packet, the router will forward it to Subnet 1, using IP unicast or broadcast, depending on the clients capabilities. A DHCP client on Subnet 2 doesnt need the services of a relay agent, because it can interact directly with the DHCP server (both are on the same subnet). WHO'S USING ITDHCP is a relatively new protocol, with the first RFCs issued in 1993. Several vendors, however, have already adopted it and developed products that support it. Most prominently, perhaps, is Microsoft, which has built DHCP server capability into Windows NT 3.5 and higher. Windows for Workgroups 3.11 and Windows 95 both have DHCP client capability. Thus, you could set up one or more Windows NT Servers to be DHCP servers. Other networked nodes running Windows 95, Windows for Workgroups, Windows NT Workstation, or Windows NT Server could be DHCP clients. Apple's Open Transport (the successor to MacTCP) includes DHCP client capability. SunSoft's (Mountain View, CA) SolarNet PC Admin network management software includes a DHCP server. Many of the third-party TCP/IP packages for Windows have DHCP client capability. At press time, On Technology (Cambridge, MA) had announced a DHCP server NLM for NetWare 3.11 and 4.x file servers.
THE SIMPLE LIFEDHCP can simplify life dramatically for managers of TCP/IP networks. It automates the process of assigning an initial IP address to a client, easing the task of adding new clients to a network. Moreover, if a client moves from one subnet to another, DHCP can make the appropriate adjustments to the client's IP configuration. Lastly, dynamic allocation lets you time-share a block of IP addresses among many clients, reducing the total number of IP addresses required. Alan Frank is reviews editor for Network Magazine. He can be reached via the Internet at afrank@mfi.com
This tutorial was originally published in the March 1996 issue of LAN Magazine/Network Magazine. |
|||||||||||||||||
|
HOME PAGE |
CURRENT ISSUE |
SEARCH ARCHIVE |
TUTORIALS | PRODUCTS GUIDE | NEWS & ANALYSIS | VISITOR SURVEYS MEMBERSHIP | SUBSCRIBE | MASTHEAD | MEDIA KIT | FAQ | SITE MAP |
|