DHCP Packet Format¶
Here is a DHCP discover packet sent by a host interface at host5
:
The DHCP message is in the payload portion of an Ethernet packet with the following fields.
Field |
Description |
---|---|
opcode |
Message op code / message type 1 = REQUEST, 2 = REPLY |
yiaddr |
“your” IP address (as assigned by DHCP server) |
siaddr |
Server IP address (in DHCPOFFER and DHCPACK) |
chaddr |
Client hardware address (e.g., Ethernet MAC address) |
Hosts run a DHCP client application that processes DHCP protocol message exchanges. As a result, the host interface gets configured, routes are acquired, and the DNS IP address is recorded.
The DHCP protocol runs on a server within the layer 2 broadcast domain of the network the host resides in. The client application at the host exchanges DHCP messages with this server in the broadcast domain.