Share via


DHCP Messages

Table F.1 shows the fields in a DHCP message.

Table F.1 DHCP Message Fields

Field Name

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. To work around some clients that cannot accept IP unicast datagrams before the TCP/IP software is configured, DHCP uses the flags field. The leftmost bit is defined as the BROADCAST (B) flag. The remaining bits of the flags field are reserved for future use. They must be set to zero by clients and ignored by servers and relay agents.

ciaddr

4

Client IP address; only filled in if client is in BOUND, RENEW, or REBINDING state and can respond to ARP requests.

yiaddr

4

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

Clients hardware address.

sname

64

Optional server host name, null terminated string.

file

128

File name, null terminated string; "generic" name or null in DHCPDiscover, fully qualified path name in DHCPOffer.

options

variable

Optional parameters field. For more information about DHCP options, see "DHCP Options" in this book.

Table F.2 shows the fields and options used by DHCP servers.

note-iconNote

In Tables F.2 and F.3, "MUST," "MUST NOT," "SHOULD," and "MAY" refer to whether or not that particular information must, must not, should, or may be included in the message.

Table F.2 Message Fields and Options

Field

DHCPOffer

DHCPAck

DHCPNak

op

BOOTREPLY

BOOTREPLY

BOOTREPLY

htype

Dependent on hardware type; see RFC 1700, Assigned Numbers , for more information.

 

 

hlen

Hardware address length in octets

 

 

hops

0

0

0

xid

xid from client DHCPDiscover message

xid from client DHCPRequest message

xid from client DHCPRequest message

secs

0

0

0

ciaddr

0

ciaddr from 0 DHCPRequest or 0

0

yiaddr

IP address offered to client

IP address assigned to client

0

siaddr

IP address of next bootstrap server

IP address of next bootstrap server

0

flags

flags from client DHCPDiscover

flags from client DHCPRequest

flags from client DHCPRequest

giaddr

giaddr from client DHCPDiscover

giaddr from client DHCPRequest

giaddr from client DHCPRequest

chaddr

chaddr from client DHCPDiscover

chaddr from client DHCPRequest

chaddr from client DHCPRequest

sname

Server host name or options

Server host name or options

(Unused)

file

Client file or options

Client file or options

(Unused)

options

Options

Options

 

Option

DHCPOffer

DHCPAck

DHCPNak

Requested IP address

MUST NOT

MUST NOT

MUST NOT

IP address lease time

MUST

MUST (DHCPRequest)

MUST NOT

 

 

MUST NOT (DHCPInform)

 

Use file or sname field

MAY

MAY

MUST NOT

DHCP message type

DHCPOffer

DHCPAck

DHCPNak

Parameter request list

MUST NOT

MUST NOT

MUST NOT

Message

SHOULD

SHOULD

SHOULD

Client identifier

MUST NOT

MUST NOT

MAY

Vendor class identifier

MAY

MAY

MAY

Server identifier

MUST

MUST

MUST

Maximum message size

MUST NOT

MUST NOT

MUST NOT

All others

MAY

MAY

MUST NOT

Table F.3 shows the fields and options used by DHCP clients.

Table F.3 DHCP Client Message Fields and Options

Field

DHCPDiscover DHCPInform

DHCPRequest

DHCPDecline DHCPRelease

op

BOOTREQUEST

BOOTREQUEST

BOOTREQUEST

htype

Dependent on hardware type; see RFC 1700, Assigned Numbers , for more information.

Dependent on hardware type; see RFC 1700, Assigned Numbers , for more information.

Dependent on hardware type; see RFC 1700, Assigned Numbers , for more information.

hlen

Hardware address length in octets

Hardware address length in octets

Hardware address length in octets

hops

0

0

0

xid

Selected by client

xid from server DHCPOffer message

Selected by client

secs

0 or seconds since DHCP process started

0 or seconds since DHCP process started

0

flags

Set BROADCAST flag if client requires broadcast reply

Set BROADCAST flag if client requires broadcast reply

0

ciaddr

0 (DHCPDiscover) or network address (DHCPInform)

0 or network address (BOUND/RENEW/ REBIND)

0 (DHCPDecline) network address (DHCPRelease)

yiaddr

0

0

0

siaddr

0

0

0

giaddr

0

0

0

chaddr

hardware address

hardware address

hardware address

sname

Options, if indicated in sname/file option; otherwise unused

Options, if indicated in sname/file option; otherwise unused

(Unused)

file

Options, if indicated in sname/file option; otherwise unused

Options, if indicated in sname/file option; otherwise unused

(Unused)

options

Options

Options

(Unused)

Requested IP address

MAY (DISCOVER) MUST NOT (INFORM)

MUST (in SELECTING or INIT-REBOOT) MUST NOT (in BOUND or RENEWING)

MUST (DHCPDecline) MUST NOT (DHCPRelease)

IP address lease time

MAY (DISCOVER) MUST NOT (INFORM)

MAY

MUST NOT

Use file or sname field

MAY

MAY

MAY

DHCP message type

DHCPDiscover/ DHCPInform

DHCPRequest

DHCPDecline/ DHCPRelease

Client identifier

MAY

MAY

MAY

Vendor class identifier

MAY

MAY

MUST NOT

Server identifier

MUST NOT

MUST (after SELECTING, MUST NOT (after INIT-REBOOT, BOUND, RENEWING, or REBINDING)

MUST

Parameter request list

MAY

MAY

MUST NOT

Maximum message size

MAY

MAY

MUST NOT

Message

SHOULD NOT

SHOULD NOT

SHOULD

Site-specific

MAY

MAY

MUST NOT

All others

MAY

MAY

MUST NOT