DHCP leases, scopes and APIPA 169.254 addresses for A+
A DHCP client gets its address through a broadcast exchange over UDP, server port 67 and client port 68, and renews by default at half the lease time. If no DHCP server answers, a host can give itself a 169.254.x.x link-local address. That address reaches only the local link, because routers must not forward it.
Getting and renewing a lease
RFC 2131 describes the exchange: the client broadcasts DHCPDISCOVER, servers reply with DHCPOFFER, the client broadcasts DHCPREQUEST for the offer it chose, and that server confirms with DHCPACK.
DHCP runs over UDP. Client messages go to the DHCP server port, 67. Server messages go to the DHCP client port, 68. A firewall rule that allows TCP 67 and 68 blocks DHCP.
The client keeps two timers. T1 defaults to 0.5 times the lease duration, and at T1 the client asks the server that issued the address to extend it. T2 defaults to 0.875 times the lease. If no DHCPACK has arrived by T2, the client broadcasts its request to any server.
169.254.x.x (APIPA, link-local)
RFC 3927 lets a host configure itself with an address in 169.254/16 when no address configuration is available, such as when no DHCP server answers. Microsoft calls this feature Automatic Private IP Addressing (APIPA): a Windows computer set to use DHCP assigns itself an address in 169.254.0.0-169.254.255.255 if no DHCP server is available.
These addresses work only with devices on the same physical or logical link. RFC 3927 says a router must not forward a packet with a link-local source or destination address, whatever its routes. Adding a default gateway does not help.
Two self-addressed PCs on the same switch can reach each other. Neither can reach a server on another subnet. While DHCP is down, the way to get a routable address is to configure a static IP address by hand.
Serving several subnets
Microsoft's DHCP deployment guide says DHCP messages are broadcasts, so routers do not forward them between subnets by default. To serve several subnets, either install a DHCP server on each subnet, or have routers forward DHCP broadcasts and create one scope per subnet on the server.
A scope is the range of addresses for one subnet, with options such as DNS servers and the default gateway. If a router already forwards a new subnet's requests but clients get no address, the server is missing a scope for that subnet.
Exclusion ranges keep addresses in a scope from being leased, for devices you configure statically.
Where the exam catches people
Believing a lease is renewed only when it expires: by default the client first tries at half the lease time (T1).
Believing DHCP uses TCP: RFC 2131 says it uses UDP on ports 67 and 68.
Believing a 169.254 address works once a gateway is set: routers must not forward link-local packets, so the host needs a routable address.
Believing forwarding DHCP broadcasts is enough for a new subnet: the server also needs a scope for that subnet.