For many of us, connecting to the internet is as simple as logging into our computer and launching our favorite browser.

But there are a lot of things that go behind the scenes in delivering this seamless internet experience. One of them is assigning IP addresses to devices connected to the web. This is where DHCP comes into the picture.

So, what is DHCP? How does it work?

What Is DHCP and What Is Its Function?

DHCP stands for Dynamic Host Configuration Protocol.

At the most basic level, it dynamically assigns IP addresses to devices connected to your network. DHCP is essentially a protocol, i.e., it is a set of rules and instructions on how devices on a network will communicate.

Think of DHCP as a city that leases mailing addresses for a specific duration of time, usually one week. In the context of your network, these mailing addresses are the IP addresses assigned to the devices connected to your LAN, such as computers and mobile phones. Each of them has an IP address that is used to send and receive internet data packets.

Now, the IP addresses assigned to your devices are not fixed. There are a finite number of IP addresses available, and it's a DHCP server's job to find out which ones aren't in use and assign them. In most cases, no two devices can have the same IP address and be connected to the internet simultaneously. That is why DHCP is important when connecting to the internet.

While DHCP servers usually assign IP addresses automatically, they can also be configured to assign a particular IP address to a specific device based on its MAC address or other hardware level information. This IP address is referred to as a Static IP.

Related: What Is a Static IP Address? Here's Why You Don't Need One

Security

DHCP is a vulnerable protocol. This is mainly because it doesn't require any authentication whatsoever. This allows unauthorized clients to be assigned IP addresses. On the server-side, a client has no way of verifying the authenticity of the DHCP server. This leads to clients being assigned wrong information, potentially jeopardizing the network integrity.

Centralized DHCP Server

While most modern routers and computers have DHCP functionality built-in, some organizations opt to use a dedicated DHCP server. This is mainly due to better IP assignment that is required for big organizations, as well as the extended scope for customization.

For home use, however, a dedicated DHCP server is not necessary.

How Does DHCP Work?

Now you know what DHCP does, it's time to understand how it does it. There are various steps involved in assigning a dynamic IP address to a device on your network. Even so, these steps can broadly be divided into four categories:

  1. Discovery: In this set, the client (your computer or any other device) broadcasts a DHCPDISCOVER message throughout your network to find the DHCP server.
  2. Offer: Upon receiving the DHCPDISCOVER message from a client, the DHCP server books an IP address for the client and makes a lease offer. The DHCP server does this by sending a DHCPOFFER message to the client. This message contains all relevant information such as the IP address that is available for the client, the MAC address of the client, the subnet mask, and the lease duration of the IP address being offered.
  3. Request: Upon receiving the DHCPOFFER message from the DHCP server, the client checks whether any other device on the network uses the same IP address configuration. If there isn't any, the client then sends a DHCPREQUEST message to the DHCP server, requesting the IP address to be assigned to it.
  4. Acknowledgment: This is the final step involved in the IP address assignment process. After the DHCP server receives the DHCPREQUEST message, it sends a DHCPPACK packet back to the client, confirming everything along with any additional information the client may have requested.

The whole process happens quickly, and there are rarely any conflicts between the server and the client. However, if you do seem to be having network problems, these diagnostic tricks may come in handy.

Are You Using DHCP?

Short answer, you probably are. Most home networks are set up to use DHCP when assigning IP addresses. This is due to the completely automated process and the fact that DHCP functionality is included in your router.

Furthermore, a static IP address is usually not required for home use.

However, you can easily check whether you're using DHCP or not using the Command Prompt on a Windows machine:

Command Prompt displaying network information after entering ipconfig /all
  1. In the Start menu search bar, type cmd. From the results, right-click on Command Prompt > Run as administrator.
  2. In the Command Prompt console, type ipconfig /all and hit Enter.
  3. Depending on whether you are using Ethernet or WiFi, you should see an entry called "DHCP Enabled" and a Yes or No next to it.

There are a plethora of other CMD commands to manage wireless networks as well.

Alternatively, you can also use the network adapter settings to check whether DHCP is enabled or not:

WiFi network adapter details in Windows 10
  1. In the Start menu search bar, type Control Panel and open it from the results.
  2. In the Control Panel, under Network and Internet, click on View network status and tasks.
  3. On the next window, click on Change adapter settings on the left.
  4. From the list of network adapters, double-click on the one you're using. For example, if you're using WiFi, then double-click the one that mentions "WiFi."
  5. On the Network Status window, click on Details.
  6. Look for "DHCP Enabled" and check whether its value is "Yes."

The process of finding your DHCP settings will differ on iOS and Linux, but will yield similar results.

DHCP Demystified

Though the DHCP protocol does have its shortcomings when it comes to security, it does provide the average user with a no-hassle Internet experience.

It is just one of the many networking terms that may seem vague or difficult to learn, but understanding them will help you better understand your home network.