About Solaris DHCP (Overview)
This chapter introduces the Dynamic Host Configuration Protocol (DHCP), explains the concepts underlying the protocol, and describes the advantages of using it in your network.
This chapter contains the following information:
About the DHCP Protocol
The DHCP protocol enables host systems in a TCP/IP network to be configured automatically for the network as they boot. DHCP uses a client/server mechanism. Servers store and manage configuration information for clients, and provide that information upon a client's request. The information includes the client's IP address and information about network services available to the client.
DHCP evolved from an earlier protocol, BOOTP, which was designed for booting over a TCP/IP network. DHCP uses the same format as BOOTP for messages between client and sever, but includes more information in the messages. The additional information is the network configuration data for the client.
A primary benefit of DHCP is its ability to manage IP address assignments through leasing, which allows IP addresses to be reclaimed when not in use and reassigned to other clients. This enables a site to use a smaller pool of IP address than would be needed if all clients were assigned a permanent address.
Advantages of Using Solaris DHCP
DHCP relieves the system or network administrator of some of the time-consuming tasks involved in setting up a TCP/IP network and the daily management of that network. Note that Solaris DHCP works only with IPv4.
Solaris DHCP offers the following advantages:
IP address management - A primary advantage of DHCP is easier management of IP addresses. In a network without DHCP, an administrator must manually assign IP addresses, being careful to assign unique IP addresses to each client and configure each client individually. If a client moves to a different network, the administrator must make manual modifications for that client. When DHCP is enabled, the DHCP server manages and assigns IP addresses without administrator intervention. Clients can move to other subnets without manual reconfiguration because they obtain, from a DHCP server, new client information appropriate for the new network.
Centralized network client configuration - A network administrator can create a tailored configuration for certain clients, or certain types of clients, and keep the information in one place, the DHCP data store. The administrator does not need to log in to a client to change its configuration. The administrator can make changes for multiple clients just by changing the information in the data store.
Support of BOOTP clients - Both BOOTP servers and DHCP servers listen and respond to broadcasts from clients. The DHCP server can respond to requests from BOOTP clients as well as DHCP clients. BOOTP clients receive an IP address and the information needed to boot from a server.
Support of local and remote clients - BOOTP provides for the relaying of messages from one network to another. DHCP takes advantage of the BOOTP relay feature in several ways. Most network routers can be configured to act as BOOTP relay agents to pass BOOTP requests to a server that is not on the client's network. DHCP requests can be relayed in the same manner because, to the router, they are indistinguishable from BOOTP requests. The Solaris DHCP server can also be configured to behave as a BOOTP relay agent, if a router that supports BOOTP relay is not available.
Network booting - Clients can use DHCP to obtain the information needed to boot from a server on the network, instead of using RARP (Reverse Address Resolution Protocol) and bootparams. The DHCP server can give a client all the information it needs to function, including IP address, boot server, and network configuration information. Because DHCP network boot requests can be relayed across subnets, you can deploy fewer boot servers in your network when you use DHCP network booting. RARP booting requires that each subnet has a boot server.
Large network support - Networks with millions of DHCP clients can use Solaris DHCP. The DHCP server uses multithreading to process many client requests simultaneously and supports data stores optimized to handle large amounts of data. Data store access is handled by separate processing modules, and sites can add support for any database they want to use for their DHCP data.
How DHCP Works
The DHCP server must first be installed and configured by a system administrator. During configuration, the administrator enters information about the network that clients will need to operate on the network. After this information is in place, clients are able to request and receive network information.
The sequence of events for DHCP service is shown in the following diagram. The numbers in circles correlate to the numbered items in the description following the diagram.
Figure 7-1 Sequence of Events for DHCP Service
LEGEND:
The client discovers a DHCP server by broadcasting a discover message to the limited broadcast address (255.255.255.255) on the local subnet. If a router is present and configured to behave as a BOOTP relay agent, the request is passed to other DHCP servers on different subnets. The client's broadcast includes its unique ID, which in the Solaris DHCP implementation, is derived from the client's Media Access Control (MAC) address. On an Ethernet network, the MAC address is the same as the Ethernet address.
DHCP servers that receive the discover message can determine the client's network by looking at the following information:
Which network interface did the request come in on? This tells the server that the client is either on the network to which the interface is connected, or that the client is using a BOOTP relay agent connected to that network.
Does the request include the IP address of a BOOTP relay agent? When a request passes through a relay agent, the relay agent inserts its address in the request header. When the server detects a relay agent address, it knows that the network portion of the address indicates the client's network address because the relay agent must be connected to the client's network.
Is the client's network subnetted? The server consults the netmasks table to find the subnet mask used on the network indicated by the relay agent's address or the address of the network interface that received the request. Once the server knows the subnet mask used, it can determine which portion of the network address is the host portion, and then select an IP address appropriate for the client. (See netmasks(4) for information on netmasks.)
After they determine the client's network, DHCP servers select an appropriate IP address and verify that the address is not already in use. The DHCP servers then respond to the client by broadcasting an offer message that includes the selected IP address and information about services that can be configured for the client. Each server temporarily reserves the offered IP address until it can determine if the client will use it.
The client selects the best offer (based on the number and type of services offered) and broadcasts a request that specifies the IP address of the server that made the best offer. The broadcast ensures that all the responding DHCP servers know the client has chosen a server, and those servers not chosen can cancel the reservations for the IP addresses they had offered.
The selected server allocates the IP address for the client, stores the information in the DHCP data store, and sends an acknowledgement (ACK) to the client. The acknowledgement message contains the network configuration parameters for the client. The client uses ping to test the IP address to make sure no other system is using it, then continues booting to join the network.
The client monitors the lease time, and when a set period of time has elapsed, the client sends a new message to the chosen server to increase its lease time.
The DHCP server that receives the request extends the lease time if it still adheres to the local lease policy set by the administrator. If the server does not respond within 20 seconds, the client broadcasts a request so that one of the other DHCP servers can extend the lease.
When the client no longer needs the IP address, it notifies the server that it is releasing the IP address. This can happen during an orderly shutdown and can also be done manually.
Solaris DHCP Server
The Solaris DHCP server runs as a daemon in the Solaris operating environment on a host system. The server has two basic functions:
Managing IP addresses - The server controls a range of IP addresses, and allocates them to clients, either permanently or for a defined period of time. The DHCP server uses a lease mechanism to determine how long a client can use a nonpermanent address. When the address is no longer in use, it is returned to the pool and can be reassigned. The server maintains information about the binding of IP addresses to clients in its DHCP network tables, ensuring that no address is used by more than one client.
Providing network configuration for clients - The server assigns an IP address and provides other information for network configuration, such as a hostname, broadcast address, network subnet mask, default gateway, name service, and potentially much more information. The network configuration information is obtained from the server's dhcptab database.
The Solaris DHCP server can also be configured to perform the following additional functions:
Responding to BOOTP client requests - The server listens for broadcasts from BOOTP clients discovering a BOOTP server and provides them with an IP address and boot parameters. The information must have been configured statically by an administrator. The DHCP server can perform as a BOOTP server and DHCP server simultaneously.
Relaying requests - The server relays BOOTP and DHCP requests to appropriate servers on other subnets. The server cannot provide DHCP or BOOTP service when configured as a BOOTP relay agent.
Providing network booting support for DHCP clients - The server can provide DHCP clients with information needed to boot over the network: IP address, boot parameters, and network configuration information.
Updating DNS tables for clients that supply a host name - For clients that provide a Hostname option and value in their requests for DHCP service, the server can attempt DNS updates on their behalf.