Understanding DHCP- Configuring DHCP and IPAM

When you’re setting up a network, the computers need to communicate with each other using the same type of computer language. This is referred to as a protocol. TCP/IP is the priority protocol for Windows Server 2022. For all of your machines to work using TCP/ IP, each system must have its own unique IP address. There are two ways to have clients and servers get TCP/IP addresses:

         You can manually assign the addresses.

         The addresses can be assigned automatically.

Manually assigning addresses is a fairly simple process. You go to each of the machines on the network and assign TCP/IP addresses. The problem with this method arises when the network becomes midsized or larger. Think if you had to individually assign 4,000 TCP/IP addresses, subnet masks, default gateways, and all other configuration options needed to run your network.

DHCP’s job is to centralize the process of IP address and option assignment. You can configure a DHCP server with a range of addresses (called a pool) and other configuration information and let it assign all of the IP parameters— addresses, default gateways, DNS server addresses, and so on.

One of the nice advantages of DHCP is that you can install DHCP onto a Server Core server. DHCP is one of the roles that can be deployed onto a Server Core server. As of this writing, DHCP was not supported on a Nano server. So, you can’t load DHCP on a Windows Server 2022 Nano server.

Introducing the DORA Process

An easy way to remember how DHCP works is to learn the acronym DORA. DORA stands for Discover, Offer, Request, and Acknowledge. In brief, here is DHCP’s DORA process:

  1. Discover: When IP networking starts up on a DHCP-e nabled client, a special message called a DHCPDISCOVER is broadcast within the local physical subnet.
  2. Offer: Any DHCP server that hears the request checks its internal database and replies with a message called a DHCPOFFER, which contains an available IP address.

The contents of this message depend on how the DHCP server is configured— there are numerous options aside from an IP address that you can specify to pass to the client on a Windows Server DHCP server.

3. Request: The client receives one or more DHCPOFFERs (depending on how many DHCP servers exist on the local subnet), chooses an address from one of the offers, and sends a DHCPREQUEST message to the server to signal acceptance of the DHCPOFFER.

This message might also request additional configuration parameters.

Other DHCP servers that sent offers take the request message as an acknowledgment that the client didn’t accept their offer.

4. Acknowledge: When the DHCP server receives the DHCPREQUEST, it marks the IP address as being in use (i.e., usually, though it’s not required). Then it sends a DHCPACK to the client.

The acknowledgment message might contain requested configuration parameters.

If the server is unable to accept the DHCPREQUEST for any reason, it sends a DHCPNAK message. If a client receives a DHCPNAK, it begins the configuration process over again.

5. When the client accepts the IP offer, the address is assigned to the client for a specified period of time, called a lease. After receiving the DHCPACK message, the client performs a final check on the parameters (sometimes it sends an ARP request for the offered IP address) and makes note of the duration of the lease. The client is now configured. If the client detects that the address is already in use, it sends a DHCPDECLINE.

If the DHCP server has given out all the IP addresses in its pool, it won’t make an offer. If no other servers make an offer, the client’s IP network initialization will fail, and the client will use Automatic Private IP Addressing (APIPA).

DHCP Lease Renewal

No matter how long the lease period, the client sends a new lease request message directly to the DHCP server when the lease period is half over (give or take some randomness required by RFC 2131). This period goes by the name T1 (not to be confused with the T1 type of network connection). If the server hears the request message and there’s no reason to reject it, it sends a DHCPACK to the client. This resets the lease period.

If the DHCP server isn’t available, the client realizes that the lease can’t be renewed.

The client continues to use the address, and once 87.5 percent of the lease period has elapsed (again, give or take some randomness), the client sends out another renewal request. This interval is known as T2. At that point, any DHCP server that hears the renewal can respond to this DHCP request message (which is a request for a lease renewal) with a DHCPACK and renew the lease. If at any time during this process the client gets a negative DHCPNACK message, it must stop using its IP address immediately and start the leasing process over from the beginning by requesting a new lease.

When a client initializes its IP networking, it always attempts to renew its old address. If the client has time left on the lease, it continues to use the lease until its end. If the client is unable to get a new lease by that time, the client will swap over to using an APIPA address and that client would only be able to talk to the local segment with other computers using an APIPA address.

DHCP Lease Release

Although leases can be renewed repeatedly, at some point they might run out. Furthermore, the lease process is “at will.” In other words, the client or server can cancel the lease before it ends. In addition, if the client doesn’t succeed in renewing the lease before it expires, the client loses its lease and reverts to APIPA. This release process is important for reclaiming extinct IP addresses used by systems that have moved or switched to a non- DHCP address.

Advantages and Disadvantages of DHCP

DHCP was designed from the start to simplify network management. It has some significant advantages, but it also has some drawbacks.

Leave a Reply

Your email address will not be published. Required fields are marked *