DHCP (Dynamic Host Configuration Protocol) is a network management protocol used to automatically assign IP addresses and other network configuration parameters to devices on a network. This removes the need for manual IP configuration.
When a device connects to a network and does not have a statically assigned IP address, it initiates a DHCP exchange to obtain one dynamically.

1- DHCP Operation: The DORA Process
DHCP operates using a 4-step handshake known as DORA:

- DHCP Discover
- The client broadcasts a
DHCPDISCOVER packet to locate available DHCP servers.
- Source IP:
0.0.0.0, Destination IP: 255.255.255.255
- MAC address is used for identification as the client lacks an IP address.
- DHCP Offer
- The DHCP server responds with a
DHCPOFFER packet.
- Includes an available IP address, subnet mask, gateway, lease duration, and DNS servers.
- DHCP Request
- The client replies with a
DHCPREQUEST packet to accept the offer.
- Broadcasted to notify all DHCP servers (if multiple responded) that it is accepting one.
- DHCP Acknowledge
- The DHCP server finalizes the assignment with a
DHCPACK packet.
- The client is now configured and can use the assigned IP.
2- Packet Behavior
- Initial Packets (Discover & Request):
- The client uses IP
0.0.0.0 as it has no IP address yet.
- Broadcasts to
255.255.255.255 on the network.
- Ethernet layer: uses MAC address
ff:ff:ff:ff:ff:ff for broadcasting.
- Server Responses (Offer & Acknowledge):
- Sent directly to the client’s MAC address.
- Contains the proposed IP address and additional configuration.
3- DHCP Lease & Renewal
- Assigned IPs come with a lease time.
- Clients automatically renew:
- At 50% of the lease: attempt to renew with same server.
- At 87.5% of the lease: rebroadcast to any DHCP server.