DHCP Packet Format
Field Octets Description
op 1 Message op code / message type, 1 = BOOTREQUEST, 2=BOOTREPLY.
htype 1 Hardware address type.
hlen 1 Hardware address length.
hops 1 Client sets to zero; optionally used by relay agents when booting via a relay agent.
xid 4 Transaction ID; a random number chosen by the client, used by the client and server to associate messages and responses between a client and a server.
secs 2 Filled in by client; seconds elapsed since client began address acquisition or renewal process.
flags 2 Flags.
ciaddr 4 Client IP address; filled in only if client is in BOUND, RENEW, or REBINDING state and can respond to ARP requests.
yiaddr 4 Your (client) IP address.
siaddr 4 IP address of next server to use in bootstrap; returned in DHCPOFFER, DHCPACK by server
giaddr 4 Relay agent IP address; used in booting via a relay agent.
chaddr 16 Client hardware address.
sname 64 Optional server host name, null terminated string.
file 128 Boot file name, null terminated string; generic name or null in DHCPDISCOVER, fully qualified directory path name in DHCPOFFER.
options Variable Optional parameters field.

DHCP Messages

DHCPDISCOVER: Client broadcast to locate available servers.

DHCPOFFER: Server to client in response to DHCPDISCOVER with offer of configuration parameters.

DHCPREQUEST: Client message to servers either requesting offered parameters from one server and implicitly declining offers from all others or confirming correctness of previously allocated addresses after their receipt. For example, a system reboot or extending the lease on a particular network address.

DHCPACK: Server to client with configuration parameters, including committed network address.

DHCPNAK: Server to client indicating that the client's notion of the network address is incorrect (e.g., client has moved to new subnet) or that the client's lease has expired.

DHCPDECLTNE: Client to server indicating that the network address is already in use.

DHCPRELEASE: Client to server relinquishing the network address and canceling the remaining lease.

DHCPINFORM: Client to server, asking only for local configuration parameters; client already has externally configured network address.