What DHCP does
The Dynamic Host Configuration Protocol hands out IP addresses and network settings automatically. Without it, every device would need manual configuration. A new device joins a network knowing nothing and leaves with an address, subnet mask, gateway, and DNS servers.
The four step exchange
- Discover the client broadcasts a request because it has no address yet.
- Offer one or more DHCP servers reply with an available address.
- Request the client broadcasts that it accepts a specific offer.
- Acknowledge the chosen server confirms and records the lease.
Each assignment is a lease with a time limit. The client renews the lease partway through its lifetime, and if it leaves the network the address eventually returns to the pool for reuse. Because the early steps are broadcasts, a device can talk to the server before it has any address. On larger networks a relay agent forwards these broadcasts to a central server on another subnet.
Key idea
DHCP automatically leases an IP address and settings to a device through a discover offer request acknowledge exchange.