AlgoMaster Logo

DHCP: How Your Laptop Gets an IP

Low Priority23 min readUpdated August 14, 2026

A laptop joining a network does not initially know which IP address it may use. It also needs a subnet prefix, a default gateway, DNS resolver addresses, and other settings before most applications can communicate.

The Dynamic Host Configuration Protocol, or DHCP, supplies that configuration. A client broadcasts a request on its local network, a server selects an available address, and the client receives a time-limited lease along with network options.

DHCP is an application-layer protocol carried over UDP, but most of the information it delivers controls network-layer behavior. A wrong subnet mask changes which destinations the client considers local. A wrong gateway breaks off-subnet communication. A wrong DNS server can make a working IP path appear unusable.

Premium Content

Subscribe to unlock full access to this content and more premium articles.