Introduction
DHCP full form is Dynamic Host Configuration Protocol, which offers an important networking protocol that automates the assignment of an IP address and configuration of an IP address for devices. The significance of DHCP in Computer Networks is to alleviate the administrative burden of assigning an IP address dynamically to the networking device, as well as to become an administrator for other IP address information, such as subnet masks, gateways, and DNS information. When IP addresses are assigned automatically, you don’t have to do the repetitive work of setting them up manually. This prevents mistakes and makes it easy to set up devices on the network automatically.
Furthermore, DHCP automatically configures a client and server model while concurrently maintaining communication with the devices during the DORA process and manages resources in a highly efficient network utilized by carefully organized devices. In this blog, we will discuss what DHCP in computer networks is, its core components, how it works, and some security concerns that you should keep in mind. We will also look into the DHCP packet Structure for better understanding.
Before getting into more details, let us first understand what DHCP in computer networks is.
What is DHCP in Computer Networks?
DHCP in computer networks is a network protocol that automatically assigns IP addresses and other key network settings to devices, making it easier to manage networks and avoid connection issues. Each of your devices (computers, phones, printers, etc.) has the right configuration to access the network without user intervention. The DHCP mechanism means you don’t have to configure or adjust each device yourself.
DHCP has an auto-configuration process where DHCP will automatically assign:
- IP address
- Subnet mask
- Default gateway
- DNS server details
When we talk about the DHCP port number, it operates using two specific port numbers: port 67 for the DHCP server to receive client requests and port 68 for DHCP clients to receive server responses. These UDP ports enable reliable communication between devices seeking IP addresses and the servers that assign them across the network.
Components of DHCP In Computer Networks
Components of DHCP in computer networks are:
- DHCP Server: This contains IP address information and network configurations and will automatically allocate that information to client computers.
- DHCP Relay: This is a working device in case there is a connection between the clients and servers, and they are in different subnets.
- Subnets: Logical network segments in a network that are utilized to create a logical structure in the distribution of IP addresses.
- Lease: This is defined as the time that an IP address is allocated to a device. After its expiry, the machine would have to be renewed or lease another one.
- DNS Servers: DHCP gives DNS information to its clients in order to convert domain names to IP addresses.
Other important components for DHCP in computer networks are the default Gateway, the DHCP Client, and the IP Address pool.
DHCP Packet Structure

- Hardware Length (8 bits): How long the device’s unique ID is (usually 6 for regular networks).
- Hop Count (8 bits): Maximum number of routers the message can pass through.
- Transaction ID (32 bits): A unique number set by the device to match questions with answers.
- Number of Seconds (16 bits): How long the device has been trying to connect since it started up.
- Flags (16 bits): Tells whether the reply should be sent to everyone or just this device.
- Client IP Address (4 bytes): The device’s current address if it has one, otherwise empty.
- Your IP Address (4 bytes): The new address the server gives to the device.
- Server IP Address (4 bytes): The address of the DHCP server that’s helping.
- Gateway IP Address (4 bytes): The router’s address (if there is one).
- Client Hardware Address: The device’s unique physical ID (MAC address).
- Server Name (64 bytes): The server’s name (optional).
- Boot Filename (128 bytes): Location of startup files (for devices without hard drives).
- Options (variable): Extra settings and special configurations.
How Does DHCP in Computer Networks Work?
The primary message occurs in the form of four main messages, which are also referred to as the DORA process: Discover, Offer, Request, and Acknowledge.

DORA covers the core exchange, but there are eight total types of messages supported by DHCP.
1. DHCP Discover Message
- The client sends the message to check if there are any DHCP servers available
- It is sent as a broadcast to all devices on the network so that a DHCP server can respond.
- The packet size of the message is around 342 or 576 bytes
- Source MAC address: Client’s MAC address
- Destination MAC address
- Source IP address
- Destination IP address
2. DHCP Offers a Message
- The server broadcasts it, and it is about 342 bytes in size.
- If multiple servers reply, the client accepts the first Offer it receives.
- The message also contains a Server ID to identify which server sent the offer.
3. DHCP Request Message
- Upon receiving an Offer, a client responds with a DHCP Request to the server.
- This message indicates that the client is specifically accepting the offered IP address provided by the server.
- The client first performs a Gratuitous ARP to check whether another device is using the same IP address. If another device is on the network and responds to the ARP request, the address is in use; otherwise, the IP address is determined as free, and the client can proceed to take the address.
- This message also includes the Client ID (which is typically the MAC address).
4. DHCP Acknowledgement Message
- Once the server receives the client’s Request, it will send an Acknowledge message (ACK) to confirm the assignment.
- The server now binds the client’s ID to the offered IP address and lease time.
- The client is now the owner of the IP address provided by the server.
- The server also records this entry so that another device does not receive the same IP address during the lease time.
5. DHCP Negative Acknowledgement Message
- The DHCP server sends a NACK message when it cannot assign an IP address to a client.
- This happens when the requested IP is invalid or not available within the server’s configured range (scope).
6. DHCP Decline
This normally occurs when the client does a Gratuitous ARP and gets a response to the request by another device on the network, meaning that the IP address that is being offered is occupied by someone. The client indicates to the server that the given IP address is not appropriate to use by sending the Decline message, and the server notes this address as unavailable and provides the client with an alternative one.
7. DHCP Release
A DHCP client sends a DHCP release packet to the server to release the IP address and cancel any remaining lease time.
8. DHCP Inform
- If an address has been assigned a manual IP address, then the customer can use DHCP messages to receive other local configuration parameters, like the domain name.
- Upon receipt of a DHCP inform message, the DHCP server replies with a DHCP ack message, which provides the computer with local configuration suitable for that computer without providing a new IP address.
- This DHCP ack message is sent as a unicast to the computer.
Security Concerns with DHCP in Computer Networks
Some of the security concerns with DHCP that you have to keep in mind are:
- Limited IP Pool: In a DHCP starvation attack, attackers can use all of the available IP addresses by flooding the network with fictitious DHCP requests.
- Fake DHCP Servers: Rogue or unauthorized servers have the potential to give clients dangerous IP configurations, posing a security risk.
- Man-in-the-Middle Attacks: To intercept or change data sent between devices, cybercriminals can install phony DHCP servers.
- DNS Misuse: Cybercriminals may use fictitious DNS settings to send users to unapproved or dangerous websites.
Frequently Asked Questions
Q1. What is the DHCP port number?
DHCP port numbers include UDP port number 67 (server-side) and UDP port number 68 (client-side) to relay messages utilised to make the configuration effortlessly.
Q2. What is the objective of DHCP in Computer Networks?
DHCP is an automatic IP addressing system and networking configuration whereby the IP addresses and the networking configurations are automatically assigned to the devices.
Q3. What are the two types of DHCP?
There are two types of DHCP. The first type is Dynamic DHCP, which assigns IP’s automatically temporarily. The second type is Static DHCP. This type of DHCP assigns fixed IP’s to devices permanently.
Q4. Is DHCP TCP or IP?
DHCP is neither TCP nor IP. DHCP works at the application layer and uses the UDP protocol for communication between clients and servers.
Q5. What is DHCP full form?
DHCP full form is Dynamic Host Configuration Protocol.
Q6. What is DHCP with IPv6?
DHCP with IPv6 (DHCPv6) automatically assigns IPv6 addresses to devices, just like regular DHCP. It’s useful for providing extra details like DNS settings, especially when SLAAC doesn’t cover everything.
Conclusion
DHCP in Computer Networks simplifies the management of a network by allocating and configuring IP addresses automatically. It is reliable, provides less admin effort, and allows connectivity for more secure, scalable and efficient devices across modern network environments. This protocol eliminates manual IP assignment errors, prevents address conflicts, and supports dynamic device mobility. It also reduces network downtime, streamlines device deployment, and enables centralized control of network settings. DHCP servers can reserve specific addresses for critical devices while maintaining flexible address pools for general use.








