What is DHCP?
DHCP (Dynamic Host Configuration Protocol) is the standard procedure used to assign IP addresses within a network. When a client device joins a network, it asks for an IP (Internet Protocol) address from the DHCP server. After the server assigns an IP address, the device can communicate with the internal network and internet.
When using the Wi-Fi at home, the router is the DHCP server in the home network. In a business setting, a DHCP server is a dedicated computer. It dynamically assigns IP addresses plus provides relevant parameters. This includes how long the IP address can be used (through a “time to live” or TTL), the default gateway, and the subnet mask.
The DHCP client, or client device, and the server actually send many communications back and forth to fulfill a DHCP request. When the client is connected to a network, it kicks off the process:
- The client sends a request, a DHCPDISCOVER packet, to the server.
- The server receives the request and attempts to find an available IP address. Once one is identified, the server sends a DHCPOFFER packet.
- The client receives the packet and sends a DHCPREQUEST packet. This is to accept the IP address.
- The server sends a DHCPACK packet to confirm the chosen IP address and the period of time the device can use it.
If a server can’t confirm an IP address for a device, it will send a DHCPNACK packet. Typically, this happens when the server receives two DHCPREQUEST packets from the same client.
Without a DHCP server, a network administrator needs to manually assign IP addresses. It’s a time-consuming task to set up each network device, especially when its lease for an address expires. The manual work is challenging because the admin needs to ensure each device has a unique IP address. Otherwise, it would result in a network error.
DHCP servers can only assign dynamic IP addresses, meaning a device doesn’t have a “forever” IP address. It will periodically change as the IP address lease expires. DHCP servers also have a defined range of IP addresses they can assign.
For services that always need to be on, a static IP address is better than a dynamic one. It’s more common to use them in a business setting. When an IP address is needed, a network admin needs to manually configure the device. Use cases include mail servers or security cameras.
However, dedicating a specific IP address to a device or service has its shortcomings. An admin must manually assign and track the IP address. Oftentimes, that requires the admin to physically be with the device.
Dynamic IP addresses are usually the preferred choice for these reasons:
- They cost less than static IP addresses.
- They offer more privacy and security with the constantly changing IP address.
- They require fewer resources to maintain.
DHCP is commonly referred to in the term DDI, which stands for DNS, DHCP, and IPAM. DDI is used to describe the integration of all three technologies in a single solution. Together, they provide core network services and enable communications across all points of the network.