of the BOOTP packets. The following table describes the packet format (the
number in the brackets indicates the field length, in bytes):
Figure 153 Format of DHCP packets
0
7
op (1)
secs (2)
The field meanings are illustrated as follows:
op: Operation types of DHCP packets: 1 for request packets and 2 for response
■
packets.
htype, hlen: Hardware address type and length of the DHCP client.
■
hops: Number of DHCP relay agents which a DHCP packet passes. For each
■
DHCP relay agent that the DHCP request packet passes, the field value
increases by 1.
xid: Random number that the client selects when it initiates a request. The
■
number is used to identify an address-requesting process.
secs: Elapsed time after the DHCP client initiates a DHCP request.
■
flags: The first bit is the broadcast response flag bit. It is used to identify that
■
the DHCP response packet is sent in the unicast or broadcast mode. Other bits
are reserved.
ciaddr: IP address of a DHCP client.
■
yiaddr: IP address that the DHCP server assigns to a client.
■
siaddr: IP address of the DHCP server.
■
giaddr: IP address of the first DHCP relay agent that the DHCP client passes
■
after it sent the request packet.
chaddr: Hardware address of the DHCP client.
■
sname: Name of the DHCP server.
■
file: Name of the start configuration file that the DHCP server specifies for the
■
DHCP client.
option: Optional variable-length fields, including packet type, valid lease time,
■
IP address of a DNS server, and IP address of the WINS server.
15
htype (1)
hlen (1)
xid (4)
ciaddr (4)
yiaddr (4)
siaddr (4)
giaddr (4)
chaddr (16)
sname (64)
file (128)
options (variable)
DHCP Packet Format
591
23
hops (1)
flags (2)
31