DHCP stands for Dynamic Host Configuration Protocol. It is a protocol which enables a computer that is connected to a network to obtain its configuration (mainly, its network configuration) dynamically (i.e. without special intervention). You only have to specify to the computer to find a stand alone IP address by DHCP. The main aim being to simplify network administration.
The DHCP protocol mainly serves to distribute IP addresses on a network, but was designed from the start as a complement to the BOOTP protocol (Bootstrap Protocol) which is used for example when installing a machine across a network (BOOTP is used closely with a TFTP server upon which the client will find the files to be loaded and copied onto the hard disk). A DHCP server can send back the BOOTP parameters or the configuration specific to a given host.
Firstly, a DHCP server is needed which distributes the IP addresses. This machine will serve as a base for all DHCP requests and must also have a fixed IP address. Therefore, on a network there can only be one machine with a fixed IP address, the DHCP server.
The basic communication system is BOOTP (with UDP frame). When a machine is turned on, it has no information on its network configuration, and there is nothing special that the user needs to do to find an IP address. In order to do this, the technique used is the broadcast: to find and talk with a DHCP server, the machine will simply send a special broadcast packet (broadcast on 255.255.255.255 with other information such as the type of request, the connection ports, etc.) over the local network. When the DHCP receives the broadcast packet, it will send back another broadcast packet (do not forget that the client does not obviously have the IP address and that therefore cannot be connected to directly) containing all the information required for the client.
It could be believed that one single packet is enough for the protocol to work. In fact, there are several types of DHCP packets likely to be issued either by the client for the server(s), or by the servers to a client:
The first packet issued by the client is a DHCPDISCOVER type packet. The server responds with a DHCPOFFER packet, particularly in order to submit an IP address to the client. The client establishes its configuration and then makes a DHCPREQUEST to validate its IP address (a broadcast request since DHCPOFFER does not contain the IP address). The server simply responds with a DHCPACK with the IP address for confirmation of the allocation. Normally, this is enough for the client to obtain an effective network configuration, but it can be longer or shorter according to whether the client accepts the IP address or not...
In order to optimize network resources, the IP addresses are delivered with a start and end date for their validity. This is what is known as a "lease". A client that sees its lease expire can ask the server for an extension of the lease by a DHCPREQUEST. Likewise, when the server sees a lease expire, it will send a DCHPNAK to ask the client if it wants to extend its lease. If the server does not receive a valid response, it will make the IP address available.
This is the subtlety of DHCP: allocation of IP addresses can be optimized by playing on the lease durations. The problem is that if no address is released at the end of a certain time limit, no further DHCP request can be satisfied due to a lack of addresses to distribute.
On a network where many computers are connecting and disconnecting regularly (school or sales office network for example), it is good to offer short term leases. Conversely, on a network mostly comprised of fixed machines, seldomly rebooted, long term leases are sufficient. Do not forget that DHCP mainly works by broadcast, and that it can take up bandwidth on small networks with high demand.
The Internet Software Consortium develops DHCP servers in the world of open software. This is the most commonly used DHCP server, and one that best "follows" the RFCs. ATTENTION! A DHCP server is far from simple to develop and the servers that that they offer are regularly patched and added to. The latest version to date is 3.0 but it is still a beta version. One of the principal innovations in this version is the opportunity to dynamically update a DNS according to IP addresses supplied by the DHCP server. For information, the first draft on dynamic DNS dates from March 1996... More information on the updating of DNS by DHCP servers.
Of course, Microsoft has its own DHCP server for NT, but this still does not implement dynamic updating of DNS.
The main documentation on DHCP is comprised of the essential RFCs:
written by Sylvain Baudoin