DHCP (Dynamic Host Configuration Protocol) provides a framework to be delivered to clients containing information about network configuration. DHCP works based on the BOOTP protocol, where functions are added to allocate the use of IP addresses and other network configurations.
The DHCP specifications can be found in RFC 2131 -- Dynamic Host Configuration Protocol, and RFC 2132 -- DHCP options and BOOTP vendor extension.
DHCP performs transactions by looking at the type of message sent. These messages include:
- DHCPDISCOVER : broadcast by client to find server
- DHCPOFFER: response from the server because it receives a DHCP DISCOVER and offers an IP address to the client.
- DHCPREQUEST : message from client to get network information
- DHCPACK : acknowledge from server
- DHCPNACK : negative acknowledge from the server stating that the lease time from the client has expired.
- DHCPDECLINE : a message from the client stating that it is using information from the server.
- DHCPRELEASE: message from the client that the client is no longer using information from the server.
- DHCPINFORM: message from the client that it has used network information manually.
1. Network address allocation process
This section describes the interaction between the client and the server, where the client does not know its IP address. Assume the DHCP server has 1 block of network addresses that can be used on the network. Each server has a database containing IP address info and leases for network usage on a permanent storage location.
Figure 5.3 Interaction between DHCP client and DHCP server
The following is a description of the interaction between a DHCP client and a DHCP server:
- The client broadcasts DHCPDISCOVER on the local network.
- The server responds with a DHCPOFFER message, which also provides information about the IP address.
- DHCP client receives 1 or more DHCPOFFER messages from 1 or more DHCP servers. The client selects one of those and sends a DHCPREQUEST message and information about which network is selected.
- The server receives the DHCPREQUEST message and responds by sending a DHCPACK message with complete information.
- The client receives the DHCPACK and configures its network interface.
- If the client no longer wants the IP address, the client will send a DHCPRELEASE message.
What is Bootstrap Protocol (BOOTP)?
Bootstrap Protocol (BOOTP) can make a client/workstation to perform initialization (booting process on a computer) with a minimal IP Stack so that it gets an IP Address, Gateway address, and Name server address from a BOOTP server.
The BOOTP specification can be found in RFC 951 -- bootstrap protocol.
The BOOTP process includes:
- The client detects the physical network address on its own system, usually located in ROM on the interface.
- BOOTP celint sends its physical network address information to the server using the UDP protocol on port 67.
- The server receives a message from the client and records the client's physical address information, then compares it with the data on the server. If the data being searched for exists, the server will provide an IP address to the client via port 68 of the UDP protocol.
- When the client receives a reply from the server, the client will record the IP address record and then perform the bootstrap process.