▸Protocol notes for this page (click to expand)

DHCP (Dynamic Host Configuration Protocol) / DHCPv6

What it is for

Sending a packet requires a source IP address, and an IP address is exactly what a host that has just powered on needs to obtain.

DHCP starts with a broadcast request: source 0.0.0.0 (meaning no address yet) and destination 255.255.255.255 (received by every host on the segment).

Besides the IP address, DHCP also hands out the mask, the gateway and the DNS servers, completing the configuration in one exchange.

The four DORA steps

Four steps are needed because a segment may hold two DHCP servers, and both will answer.

· D: the client broadcasts a request for an address -> O: each server offers one;
· R: the client picks one and broadcasts again to say which;
· A: the chosen server confirms; the server not chosen receives that broadcast and takes its offered address back.

Step three is a broadcast so that the server not chosen receives it too.

Common misconceptions

A DHCP address comes with a lease: it must be renewed before it expires, and if renewal fails the client has to request an address again.

The DHCP server may be on a different segment from the client: a relay (DHCP relay) on a switch or router converts the broadcast into a unicast to the server.

IPv6 does not necessarily use DHCPv6 for addresses; the IPv6 default is SLAAC.