This is how DHCP (Dynamically Host Configuration Protocol) works internally when you connect a laptop to a LAN with DHCP server configured.
When you connect a computer in a network , automatically you will get an ip address for your computer or when you try with ipconfig/release and ipconfig/renew from your DOS prompt in your system you will get a new ip address.
It’s a four step process:
DHCP (D)iscover
DHCP (O)ffer
DHCP (R)equest
DHCP (A)ck
Step 1:
Your laptop sends a “Discovery” request, asking for it’s IP information from any listening DHCP servers on your LAN.
Step 2:
Any listening DHCP servers will “Offer” their configuration information to your workstation, here your laptop.
Step 3:
You workstation chooses the best lease; then “Requests” that lease from the corresponding DHCP server.
Step 4:
The DHCP server you requested the IP configuration information from then “Acknowledges” your request and leases you the IP configuration information.
Last but not least, if none of the DHCP server is availble in your network or the connection is broken to your DHCP server APIPA would automatically assign a unique class B IP address to each machine in the range of 169.254.0.1 to 169.254.255.254 range.