When you join a Wi-Fi network, you're assigned an IP address within seconds. This magic is handled by the Dynamic Host Configuration Protocol (DHCP).
The DORA Process
- Discover: Your device shouts: "Is there a DHCP server here?"
- Offer: The router replies: "Yes, you can use 192.168.1.15."
- Request: Your device says: "Great, I'll take that one!"
- Acknowledge: The router confirms: "Okay, it's yours for the next 24 hours."
Lease Times
IPs aren't given forever. They are Leased. If a device leaves the network, the router eventually takes the IP back and gives it to someone else. This prevents the network from "running out" of internal addresses.