What is the DHCP message which informs the server the client will not be using the assigned IP address anymore?

DHCP uses the client/server model. A DHCP client sends a message to a DHCP server to request configuration parameters, such as the IP address, subnet mask, and default gateway address. The DHCP server responds with a message carrying the requested configuration parameters. DHCP messages sent between clients and servers share an identical fixed format header and a variable format area for options.

  • DHCP Message Format
  • DHCP Options

DHCP Message Format

Figure 4-2 shows the DHCP message format.

Figure 4-2 DHCP message format

Table 4-1 describes the fields in a DHCP message.

Table 4-1 DHCP message fields

Field

Length

Description

op

1 byte

Message operation code that specifies the message type. The options are as follows:

  • 1: DHCP Request message

  • 2: DHCP Reply message

The specific message type is carried in the options field.

htype

1 byte

Hardware address type. For Ethernet, the value of this field is 1.

hlen

1 byte

Hardware address length. For Ethernet, the value of this field is 6.

hops

1 byte

Number of DHCP relay agents that have relayed this message. This field is set to 0 by a DHCP client. The value increases by 1 each time a DHCP message passes through a relay agent.

NOTE:

A maximum of 16 DHCP relay agents are allowed between a server and a client. If this number is exceeded, DHCP messages are discarded.

xid

4 bytes

Transaction ID for this message exchange. A DHCP client generates a random number, which the client and server use to identify their message exchange.

secs

2 bytes

Number of seconds elapsed since a DHCP client began to request an IP address.

flags

2 bytes

The leftmost bit determines whether the DHCP server unicasts or broadcasts a DHCP Reply message. All remaining bits in this field are set to 0. The options are as follows:

  • 0: The DHCP server unicasts a DHCP Reply message.

  • 1: The DHCP server broadcasts a DHCP Reply message.

ciaddr

4 bytes

Client IP address. The IP address can be an existing IP address of a DHCP client or an IP address assigned by a DHCP server to a DHCP client. During initialization, the client has no IP address, and the value of this field is 0.0.0.0.

NOTE:

The IP address 0.0.0.0 is an invalid address that is used only for temporary communication during system startup in DHCP mode.

yiaddr

4 bytes

Client IP address assigned by the DHCP server. The DHCP server fills this field into a DHCP Reply message.

siaddr

4 bytes

Server IP address from which a DHCP client obtains the startup configuration file.

giaddr

4 bytes

Gateway IP address, which is the IP address of the first DHCP relay agent. If the DHCP server and client are located on different network segments, the first DHCP relay agent fills its own IP address into this field of the DHCP Request message sent by the client. The relay agent forwards the message to the DHCP server, which uses this field to determine the network segment where the client resides. The DHCP server then assigns an IP address on this network segment from an address pool.

The DHCP server also returns a DHCP Reply message to the first DHCP relay agent. The DHCP relay agent then forwards the DHCP Reply message to the client.

NOTE:

If the DHCP Request message passes through multiple DHCP Relay agents before reaching the DHCP server, the value of this field remains as the IP address of the first DHCP relay agent. However, the value of the Hops field increases by 1 each time a DHCP Request message passes through a DHCP relay agent.

chaddr

16 bytes

Client hardware address. This field must be consistent with the hardware type and hardware length fields. When sending a DHCP Request message, the client fills its hardware address into this field. For Ethernet, a 6-byte Ethernet MAC address must be filled in this field when the hardware type and hardware length fields are set to 1 and 6, respectively.

sname

64 bytes

Server host name. This field is optional and contains the name of the server from which a client obtains configuration parameters. The field is filled in by the DHCP server and must contain a character string that ends with 0.

file

128 bytes

Boot file name specified by the DHCP server for a DHCP client. This field is optional and is delivered to the client when the IP address is assigned to the client. The field is filled in by the DHCP server and must contain a character string that ends with 0.

options

Variable

Optional parameters field. The length of this field must be at least 312 bytes. This field contains the DHCP message type and configuration parameters assigned by a server to a client, including the gateway IP address, DNS server IP address, and IP address lease.

DHCP Options

In the DHCP options field, the first four bytes are decimal numbers 99, 130, 83 and 99, respectively. This is the same as the magic cookie defined in standard protocols. The remaining bytes identify several options as defined in standard protocols. One particular option, the DHCP Message Type option (Option 53), must be included in every DHCP message. Option 53 defines DHCP message types, including the DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK, DHCPNAK, DHCPDECLINE, DHCPRELEASE, and DHCPINFORM messages.

  • DHCP message types

    Table 4-2 lists the DHCP message types.

    Table 4-2 DHCP message types

    TypeDescription

    DHCP DISCOVER

    A DHCP Discover message is broadcast by a DHCP client to locate a DHCP server when the client attempts to access a network for the first time.

    DHCP OFFER

    A DHCP Offer message is sent by a DHCP server in response to a DHCP Discover message. A DHCP Offer message carries various configuration parameters.

    DHCP REQUEST

    A DHCP Request message is sent in the following conditions:

    • After a DHCP client is initialized, it broadcasts a DHCP Request message in response to the DHCP Offer message sent by a DHCP server.
    • After a DHCP client restarts, it broadcasts a DHCP Request message to confirm the configuration including the assigned IP address.
    • After a DHCP client obtains an IP address, it unicasts or broadcasts a DHCP Request message to update the IP address lease.

    DHCP ACK

    A DHCP ACK message is sent by a DHCP server to acknowledge the DHCP Request message from a DHCP client. After receiving a DHCP ACK message, the DHCP client obtains the configuration parameters including the IP address.

    DHCP NAK

    A DHCP NAK message is sent by a DHCP server to reject the DHCP Request message from a DHCP client. For example, if a DHCP server cannot find matching lease records after receiving a DHCP Request message, it sends a DHCP NAK message indicating that no IP address is available for the DHCP client.

    DHCP DECLINE

    A DHCP Decline message is sent by a DHCP client to notify the DHCP server that the assigned IP address conflicts with another IP address. Then the DHCP client applies to the DHCP server for another IP address.

    DHCP RELEASE

    A DHCP Release message is sent by a DHCP client to release its IP address. After receiving a DHCP Release message, the DHCP server can assign this IP address to another DHCP client.

    DHCP INFORM

    A DHCP Inform message is sent by a DHCP client to obtain other network configuration parameters such as the gateway address and DNS server address after the DHCP client has obtained an IP address.

  • DHCP options

    The options field in a DHCP message carries control information and parameters that are not defined in common protocols. When a DHCP client requests an IP address from a DHCP server that has been configured to encapsulate the options field, the server returns a DHCP Reply packet containing the options field. Figure 4-3 shows the options field format.

    Figure 4-3 Options field format

    The options field consists of the sub-fields Type, Length, and Value. Table 4-3 describes these sub-fields.

    Table 4-3 Sub-fields in the DHCP options field

    Sub-field

    Length

    Description

    Type

    1 byte

    Type of the message content

    Length

    1 byte

    Length of the message content

    Value

    Determined by the Length field value

    Message content

    The type value of the options field ranges from 1 to 255. Table 4-4 lists common DHCP options.

    Table 4-4 Options in DHCP messages

    Options ID

    Description

    1

    Subnet mask

    3

    Gateway address

    6

    DNS address

    15

    Domain name

    33

    Group of classful static routes

    After a DHCP client receives DHCP messages with this option, it adds the classful static routes contained in the option to its routing table. In classful routes, masks of destination addresses are natural masks and cannot be used to divide subnets. If Option 121 exists, Option 33 is ignored.

    44

    NetBIOS name

    46

    NetBIOS object type

    50

    Requested IP address

    51

    IP address lease

    52

    Additional option

    53

    DHCP message type

    54

    Server identifier

    55

    Parameter request list

    The DHCP client uses this option to request specified configuration parameters

    58

    Lease renewal time (Time1), which is 50% of the lease time

    59

    Lease renewal time (Time2), which is 87.5% of the lease time

    121

    Group of classless routes

    After a DHCP client receives DHCP messages with this option, it adds the classless static routes contained in the option to its routing table. Classless routes can have destination address masks composed of any values and these masks can be used to divide subnets.

    The use of the options field differs depending on its function.

    For more information about common DHCP options, see standard protocols.

  • Customized DHCP options

    Some options are not defined in standard protocols. Option 43 and Option 82, which are customized options, are described as follows:

    • Option 43

      Option 43 is called the vendor-specific information option. Figure 4-4 shows the Option 43 format.

      Figure 4-4 Option 43 format

      DHCP servers and DHCP clients use Option 43 to exchange vendor-specific information. When a DHCP server receives a DHCP Request message with parameter 43 encapsulated in Option 55, the server encapsulates Option 43 in a DHCP Reply message and sends it to the DHCP client.

      To implement extensibility and allocate more configuration parameters to DHCP clients, Option 43 supports sub-options, which are shown in Figure 4-4. Sub-options follow a similar format to that used for Options. They contain a Type, Length, and Value sub-field. In the Type sub-field, the value 0x01 indicates the Auto-configuration server (ACS) parameter, the value 0x02 indicates the SP ID, and the value 0x80 indicates the Preboot execution environment (PXE) server address.

      If a device functions as a DHCP client, it can obtain the following information using Option 43:

      • ACS parameters, including the uniform resource locator (URL), user name, and password

      • SP ID that the Customer Premises Equipment (CPE) notifies the ACS of so that the ACS can select configuration parameters from the specified SP

      • PXE server address, which is used by a DHCP client to obtain the Bootfile or control information from the PXE server

    • Option 82

      The Option 82 field is called the DHCP relay agent information field. It records the location of a DHCP client. A DHCP relay agent or a DHCP snooping-enabled device appends the Option 82 field to a DHCP Request message sent from a DHCP client and forwards the message to a DHCP server.

      Servers use the Option 82 field to learn the location of DHCP clients, implement client security and accounting, and make parameter assignment policies, allowing for more flexible address allocation.

      The Option 82 field contains a maximum of 255 sub-options. If the Option 82 field is defined, at least one sub-option must be defined. Currently, the following sub-options are supported: sub-option 1 (Circuit ID), sub-option 2 (Remote ID) and sub-option 6 (Subscriber ID).

      The content of the Option 82 field is not uniformly defined, and vendors fill in the Option 82 field as needed.

      The device supports the following Option 82 field formats:

      • Type1: This is the Telecom format of Option 82.

      • Type2: This is the NMS format of Option 82.

      • Cn-telecom: This is the Option 82 format defined by China Telecom.

      • Self-define: This is the user-defined format of DHCP Option 82.

What is a DHCP inform message?

A DHCP Inform message is sent by a DHCP client to obtain other network configuration parameters such as the gateway address and DNS server address after the DHCP client has obtained an IP address.

Which DHCP message is used by a client to inform a DHCP server that it accepts the assigned IP address?

The client receives DHCPOFFER messages from the DHCP servers that responded to the DHCPDISCOVER messages. The client compares the offers with the settings that it requested, and then selects the server that it wants to use. It sends a DHCPREQUEST message to accept the offer, indicating which server it selected.

What type of message does a DHCP server send to a client to verify if an IP address has been assigned to a client?

Offer. When a DHCP server receives a DHCPDISCOVER message from a client, which is an IP address lease request, the DHCP server reserves an IP address for the client and makes a lease offer by sending a DHCPOFFER message to the client.

What are the 4 types of messages sent and received in DHCP?

The DHCP server uses the following messages to communicate with a DHCP client:.
DHCPDISCOVER. Sent by the client as the first step of the DHCP client/server interaction. ... .
DHCPOFFER. Sent by the server to the client in response to a DHCPDISCOVER. ... .
DHCPREQUEST. ... .
DHCPACK. ... .
DHCPNAK. ... .
DHCPRELEASE. ... .
DHCPDECLINE..