I am seeing a DHCP packet flow, which consists of at least 4 packets:
-
Discovery
-
Offer
-
Request
-
ACK
With the discovery packet, client tries to find DHCP server. Since client does not know his own IP address and DHCP server's IP address, src and destination IP address are 0.0.0.0 and 255.255.255.255.
With the offer packet, the server responds to the client by setting the src IP address to his IP and dest IP address to client's new IP address.
But I have a question now.
The client at point does not know his IP address.
How can the client accept this packet without knowing his IP address?
Best Answer
Remember that the exchange happens using layer-2 addressing, not layer-3 addressing. The frame is addressed to the host MAC address, so the host will accept the frame. A problem may arise at layer-3 for an unconfigured IPv4 process. Some, generally older, clients cannot process a unicast layer-3 packet until IPv4 has been configured, but there is a workaround for that. The client sets the broadcast flag so that it receives the offer as a broadcast.
It is all explained in _RFC 2131, Dynamic Host Configuration Protocol: