Notes

DHCP

Back to networking page


What is DHCP?

Dynamic Host Configuration Protocol is protocols that assign IP to connected devices. The Dynamic Host Configuration Protocol is a network management protocol used on Internet Protocol(IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a client–server architecture.


Why ?

Assigning IP for every device is very tedious task. Also If device is turned off and IP is not revoked then that IP is wasted. This way we can run out of IP’s that can assign in network . Also If IP is self assign then mistakes of same IP for two devices can be there.


How DHCP assigns IP?

DHCP servers assign IP address from a range of IP’s to device on lease. Mostly follows what’s called DORA Process

Process Work
DHCP Discover Looks for DHCP server
DHCP Offer server offers IP
DHCP Request Host requests to lease that IP
DHCP Acknowledgement Server assigns IP , subnet mask and lease time

DHCP working

Ports use for DHCP communication :


DHCP messsage format

DHCP message format

If DHCP fails then windows has backup plan called APIPA If DHCP server is not in same network then we need to set relay agent which will act as mailman for communication. To check if address is alotted , it pings devices. If reply gets to DHCP server and conflict is found then server automatically removes that IP from server pool.


Sources