How DHCP Works and DHCP Interview Questions and Answers
How DHCP Works and DHCP Interview Questions and Answers
1. DHCPDISCOVER
It is a DHCP message that marks the beginning of a DHCP interaction between client and server.
This message is sent by a client (host or device connected to a network) that is connected to a local
subnet. Its a broadcast message that uses 255.255.255.255 as destination IP address while the
source IP address is 0.0.0.0
2. DHCPOFFER
It is DHCP message that is sent in response to DHCPDISCOVER by a DHCP server to DHCP client.
This message contains the network configuration settings for the client that sent the
DHCPDISCOVER message.
3. DHCPREQUEST
This DHCP message is sent in response to DHCPOFFER indicating that the client has accepted the
network configuration sent in DHCPOFFER message from the server.
4. DHCPACK
This message is sent by the DHCP server in response to DHCPREQUEST recieved from the client.
This message marks the end of the process that started with DHCPDISCOVER. The DHCPACK
message is nothing but an acknowledgement by the DHCP server that authorizes the DHCP client to
start using the network configuration it received from the DHCP server earlier.
5. DHCPNAK
This message is the exact opposite to DHCPACK described above. This message is sent by the
DHCP server when it is not able to satisfy the DHCPREQUEST message from the client.
6. DHCPDECLINE
This message is sent from the DHCP client to the server in case the client finds that the IP address
assigned by DHCP server is already in use.
7. DHCPINFORM
This message is sent from the DHCP client in case the IP address is statically configured on the
client and only other network settings or configurations are desired to be dynamically acquired from
DHCP server.
8. DHCPRELEASE
This message is sent by the DHCP client in case it wants to terminate the lease of network address it
has be provided by DHCP server.
Now as we know about the various DHCP messages, its time to go through the the complete DHCP
process to give a better Idea of how DHCP works. Note that the steps mentioned below assume that
DHCP functionality is enabled by default on the client side.
Here are the steps :
Step 1: When the client computer (or device) boots up or is connected to a network, a
DHCPDISCOVER message is sent from the client to the server. As there is no network
configuration information on the client so the message is sent with 0.0.0.0 as source address
and 255.255.255.255 as destination address. If the DHCP server is on local subnet then it
directly receives the message or in case it is on different subnet then a relay agent connected on
clients subnet is used to pass on the request to DHCP server. The transport protocol used for
this message is UDP and the port number used is 67. The client enters the initializing stage
during this step.
Step 2: When the DHCP server receives the DHCPDISCOVER request message then it
replies with a DHCPOFFER message. As already explained, this message contains all the
network configuration settings required by the client. For example, the yaddr field of the message
will contain the IP address to be assigned to client. Similarly the the subnet mask and gateway
information is filled in the options field. Also, the server fills in the client MAC address in the
chaddr field. This message is sent as a broadcast (255.255.255.255) message for the client to
receive it directly or if DHCP server is in different subnet then this message is sent to the relay
agent that takes care of whether the message is to be passed as unicast or broadcast. In this
case also, UDP protocol is used at the transport layer with destination port as 68. The client
enters selecting stage during this step
Step 4: Once the server receives DHCPREQUEST from the client, it sends the DHCPACK
message indicating that now the client is allowed to use the IP address assigned to it. The client
enters the bound state during this step.
What is dhcp?
Dynamic Host Configuration Protocol (DHCP) is a network protocol that enables
The DHCPInform message is sent after the IPCP negotiation is concluded. The
DHCPInform message received by the remote access server is then forwarded
to a DHCP server. The remote access server forwards DHCPInform messages
only if it has been configured with the DHCP Relay Agent.
Describe the integration between DHCP and DNS?
Traditionally, DNS and DHCP servers have been configured and managed one at
a time. Similarly, changing authorization rights for a particular user on a group
of devices has meant visiting each one and making configuration changes.
DHCP integration with DNS allows the aggregation of these tasks across
devices, enabling a company's network services to scale in step with the growth
of network users, devices, and policies, while reducing administrative operations
and costs. This integration provides practical operational efficiencies that lower
total cost of ownership.
Creating a DHCP network automatically creates an associated DNS zone, for
example, reducing the number of tasks required of network administrators. And
integration of DNS and DHCP in the same database instance provides
unmatched consistency between service and management views of IP addresscentric network services data.