DHCP Packet Structure/Architecture
DHCP
communications use eight different types of messages, all of which use the same
basicpacket format.
The
packet format is shown in following Figure.
The following fields make up the DHCP packet:
op (Op Code), 1 byteSpecifies
whether the message is a request or a reply, usingthe following codes:
1 BOOTREQUEST
2 BOOTREPLY
htype (Hardware Type), 1 byteSpecifies
the type of hardware address used in thechaddr field, E.G: The value for
Ethernet hardware addresses is 1.
hlen (Hardware Address Length), 1 byteSpecifies the length (in bytes) of thehardware address found in
the chaddr field, according to the value of the htype field(for example, if htype is 1, indicating an Ethernet hardware address, the value of hlenwill
be 6 bytes).
hops, 1 byteSpecifies the number of
network segments between the client and theserver. The client sets the value to
0, and each DHCP relay system increments it by 1during the journey to the
server.
xid (Transaction ID), 4 bytesContains
a transaction identifier that systems use toassociate the request and response
messages of a single DHCP transaction.
secs (Seconds), 2 bytes Specifies
the number of seconds elapsed since the IP addresswasassigned or the lease was
last renewed. This enables the systems to distinguishbetweenmessages of the
same type generated during a single DHCP transaction.
flags, 2 bytesContains the
broadcast flag as the first bit, which, when set to a valueof 1, specifies that
DHCP servers and relay agents should use broadcasts, not unicasts,to transmit
to the client. The remaining bits in the field are unused and must have avalue
of 0.
ciaddr (Client IP Address), 4 bytesSpecifies the client’s IP address in DHCPREQUESTmessages
transmitted while in the bound, renewal, or rebinding state. At all othertimes,
the value must be 0.
yiaddr (Your IP Address), 4 bytesSpecifies
the IP address being offered or assignedby a server in DHCPOFFER or DHCPACK
messages. At all other times, thevalue must be 0.
siaddr (Server IP Address), 4 bytesSpecifies the IP address of the next server ina bootstrap
sequence. Servers include this information in DHCPOFFER and DHCPACKmessages onlywhen
DHCP is configured to supply an executable boot file to clientsand the boot
files forvarious client platforms are stored on different servers.
giaddr (Gateway IP Address), 4 bytesSpecifies the IP address of the DHCP relayagent to which a server
should send its replies when the client and server are locatedon different
subnets. When the client and server are on the same segment, the valuemust be
0.
chaddr (Client Hardware Address), 16 bytesSpecifies the hardware address of theclient system in DHCPDISCOVER
and DHCPREQUEST messages, which the server usesto addressits unicast responses
to the client. The format of the hardware address isspecified by the values of
the htype and hlen fields.
sname (Server Host Name), 64 bytesSpecifies
the (optional) host name ofthe DHCP server.
file (Boot File Name), 128 bytesSpecifies
the name of an executable boot filefor diskless client workstations in
DHCPDISCOVER messages (in which case a genericfile name is supplied) or
DHCPOFFER messages (in which the field contains a full pathand file name.
options, variable size, minimum 312 bytesContains the magic cookie that specifieshow therest of the field
should be interpreted and the DHCP Message Type optionthat defines the function
of the message, as well as other options.
Sign up here with your email
ConversionConversion EmoticonEmoticon