DHCP Interview Q&A-2019
DHCP Interview Q&A-2019
DHCP is the Dynamic Host Control Protocol. It assigns the IP address to the
hosts/endpoints machines dynamically. With the use of DHCP services, there is no need to
statically configure the IP address, subnet mask and other configuration on the hosts. It is used in
the large LAN environment where hundreds of hosts or more than hundreds of computers
need an IPaddress. It reduces the manual task of the administrator of going to each machine and
configuring the IP schema.
DHCP works on client/server architecture. The DHCP server uses UDP port 67 to provide the
services. DHCP client uses UDP port number 68 for the communication. DHCP clients send the
broadcast request as soon they boot up and DHCP server reply to the client requests.
DISCOVER:
As the host boots up, it requires the IP details for its automatic configuration, For that, it needs to
locate the DHCP server. To locate the DHCP server, the client sends the broadcast
DISCOVER message over the LAN. This broadcast is known as DHCP DISCOVER. The DHCP
DISCOVER message will have the destination mac address FF::FF::FF::FF::FF:: FF and destination
IPv4 address will be 255.255.255.255.
While sending the DISCOVER request client uses the source port UDP 68 and Destination Port is
UDP 67.
Note: Source IP: 0.0.0.0 ,Destination IP: 255.255.255.255, Source MAC: Mac address of host,
Destination MAC: FF::FF::FF::FF::FF:: FF, Host to DHCP server Communication: Broadcast
OFFER:
Once the request is received by the DHCP server of the host. DHCP server OFFER message to the
client, the message sent by the DHCP server to the client is the unicast communication because
the DHCP server knows the MAC address of the host now. The OFFER message contains the
proposed IP schema for the host which is the Host IP address, Default Gateway IP address, DNS
server details, Subnet Mask Information.
Note: Source MAC: MAC address of DHCP Server, Destination MAC: MAC address of the Host
machine
REQUEST:
After receiving the IP schema proposal from the DHCP server, the client checks the configuration
file received by the DHCP server. If the client finds the offer agreeable it sends the DHCP REQUEST
message to the DHCP server for the acceptance of the proposal and asking the DHCP server to
lease the IP address for itself.
Acknowledgment:
Once the DHCP server receives the REQUEST message from the host. It adds the IP address into its
configuration against the MAC address of the host. It defines the lease time for the IP address for
how much time it will be with that client. In return, it sends the
unicast ACKNOWLEDGEMENT message to the client confirming the request has been accepted.
4. What are the minimum and maximum packet length of DHCP Packet?
The minimum packet length of DHCP packet is 236 ( without the options field)
and maximum length of DHCP packet is 300 bytes ( with the options field).
When the client and server are on two different networks distinguish by several other
networks. Clients are not able to get the IP address because when they broadcast the Discover
message for DHCP server. The edge Routers connecting two different networks drop the packets
because Routers do not forward the broadcast packets. In that case, some solution is required.
We can configure one of the hosts ( or router itself ) to transform the broadcast messages into
unicast messages.so that they can pass through the router.
6. What is APIPA address and What is the range used for APIPA address scheme?
APIPA is Automatic Private IP Addressing. When the machine is unable to get the IP information
from the DHCP server and static IP is not configured in the system than the client machine will
automatically assign an IP address to itself of APIPA range. The range used for APIPA addressing is
169.254.0.1 to 169.255.255.254 (class B).
When the lease time of the DHCP host reaches 50%. The client sendsanother DHCP REQUEST
message to the DHCP server to ask for the renewalof the lease. If the lease is renewed again then
DHCP host resets its timer and if DHCP ACK message is not received by the DHCP host it goes to
the rebinding state.
When host request the DHCP server for the local configuration parameters and client host has
externally configured address.
When DHCP server OFFER the IP address to the host. After acknowledgment host sends
the gracious ARP to check network address is not use already. If gracious ARP reply comes than
host sends the DHCPDECLINE message to the server indicating that network address is already in
use.
When the host is ready to release the IP address or decided to move on in other subnets. It sends
the message to the DHCP server to release the IP and cancel the remaining time of lease.
Conclusion
DHCP is a very important protocol and uses in almost 99% networks now as days. All the network
engineers should have
Ans: DHCP stand for Dynamic Host Configuration Protocol. It is network protocol that enable a server to
assign automatically IP address range such as subnet, gateway etc. to computer in network. It uses 67
and 68 port number.
Q2: How does it work?
Ans: 67 and 68
Ans: It’s range of possible IP Addresses that DHCP server can lease IP address to client on a subnet.
Ans: A super scope is a collection of individual scopes that can be managed as a single administrative
unit in network.
Ans: DHCP reservation feature is used to reserve IP address for providing permanent IP address to client.
Ans: 8 days
Ans: A DHCP relay agent is any host or IP router that forwards DHCP packets between clients and
servers.
Q14: Suppose we have a PC which is connected to our corporate network and unable to get ip address
and when I am using ipconfig command to check ip address so show 169.254.x.x ip address what is the
reason behind it?
Ans: It possible that DHCP down or unable to make connection between server to client.