No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.

Configuration Guide - IP Service
S1720, S2700, S5700, and S6720 V200R011C10

This document describes the configurations of IP Service, including IP address, ARP, DHCP, DHCP policy VLAN, DNS, mDNS gateway, mDNS relay, UDP Helper, IP performance optimization, IPv6, DHCPv6, IPv6 DNS, IPv6 over IPv4 tunnel, and IPv4 over IPv6 tunnel.

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
DHCP Messages

DHCP Messages

DHCP Message Types

A DHCP server and a DHCP client communicate by exchanging DHCP messages. DHCP messages are transmitted using the User Datagram Protocol (UDP). A DHCP client uses UDP port 68 to send messages to a DHCP server, and a DHCP server uses UDP port 67 to send messages to a DHCP client. These messages are classified into eight types.

Table 4-1  DHCP message types
DHCP Message Description

DHCP Discover

A DHCP client broadcasts this message to locate a DHCP server when the client attempts to connect to a network for the first time.

DHCP Offer

A DHCP server sends this message in response to a DHCP Discover message. A DHCP Offer message carries configuration information.

DHCP Request

A DHCP client sends this message in the following scenarios:

  • After the client starts, it broadcasts a DHCP Request message to respond to a DHCP Offer message sent by a DHCP server.
  • After the client restarts, it broadcasts a DHCP Request message to confirm the configuration (including the allocated IP address).
  • After the client obtains an IP address, it unicasts or broadcasts a DHCP Request message to renew the IP address lease.


A DHCP server sends this message to acknowledge a DHCP Request message sent from a DHCP client. After receiving a DHCP Ack message, the DHCP client obtains configuration parameters (including an IP address).


A DHCP server sends this message to reject a DHCP Request message from a DHCP client. For example, a DHCP server will send this message if it determines that there is no available IP address after receiving a DHCP Request message.

DHCP Decline

A DHCP client sends this message to notify the DHCP server that the allocated IP address conflicts with another IP address. The DHCP client then applies to the DHCP server for another IP address.

DHCP Release

A DHCP client sends this message to release its allocated IP address. After receiving a DHCP Release message, the DHCP server can allocate this IP address to another DHCP client.

DHCP Inform

A DHCP client sends this message to obtain network configuration parameters, such as the gateway address and DNS server address, after it has obtained an IP address.

DHCP Message Format

The format of DHCP messages is based on the format of BOOTP messages, which ensures support for BOOTP functionality and interoperability between BOOTP clients and DHCP servers.

Figure 4-2 shows the format of a DHCP message and Table 4-2 describes each of the fields in the DHCP message. In the figure, the numbers in parentheses indicate the size of each field in bytes.

Figure 4-2  DHCP message format

Table 4-2  Fields in a DHCP message





1 byte

Operation Code: indicates the general type of message.

The values are:
  • 1: DHCP Discover message

  • 2: DHCP Offer message


1 byte

Hardware Type: indicates the type of hardware used for the local network. The values of this field differ for different hardware types. The most common value is 1, which indicates Ethernet (10 Mb).


1 byte

Hardware Address Length: indicates the length of a hardware address. For Ethernet, the value is 6.


1 byte

Hops: indicates the number of DHCP relay agents through which a DHCP message passes. This value is set to 0 by a client and is incremented by 1 each time the message passes through a DHCP relay agent. A DHCP message passes through a maximum of 16 DHCP relay agents when being transmitted between a server and a client. That is, the number of hops between the server and client cannot exceed 16. Otherwise, the DHCP message is discarded.


4 bytes

Transaction Identifier: indicates a random number chosen by a client for exchanging messages with a DHCP server.


2 bytes

Seconds: indicates the number of seconds elapsed since a client obtained or renewed an IP address.


2 bytes

Flags: indicates the Flags field. Only the leftmost bit in this field is used, and the other bits are set to 0. The leftmost bit specifies the mode a DHCP server uses to transmit a DHCP Offer message.

The values are:
  • 0: The DHCP server unicasts a DHCP Offer message.

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


4 bytes

Client IP Address: indicates the IP address of a DHCP client. The IP address is either the existing IP address of the client or an IP address allocated by a DHCP server to the client. During the process of a client acquiring an IP address, the value of this field is is an invalid destination address and is used by a DHCP-enabled device to communicate only temporarily with other devices during startup.


4 bytes

Your IP Address: indicates the IP address that a DHCP server allocates to a client.


4 bytes

Server IP Address: indicates the server IP address from which a DHCP client obtains its startup configuration file.


4 bytes

Gateway Address: indicates the IP address of the first DHCP relay agent. When a client sends a DHCP Request message and is on a different network segment from its DHCP server, the first DHCP relay agent forwards the message to the DHCP server and fills its IP address in the giaddr field. The DHCP server determines the network segment address of the client based on this field, selects an appropriate address pool, and assigns an IP address on this network segment to the client.

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

If the DHCP Request message passes through multiple DHCP relay agents before reaching the DHCP server, the giaddr field value is still the IP address of the first DHCP relay agent, and the hops field value is incremented by 1 each time the message passes through a DHCP relay agent.


16 bytes

Client Hardware Address: indicates the Layer 2 address of a client. For Ethernet, this field must contain a 6-byte Ethernet MAC address if the hardware type and hardware length fields are set to 1 and 6 respectively.


64 bytes

Server Hostname: indicates the name of the server from which a client obtains configuration information. This field is optional, is filled in by the DHCP server, and must be a character string that ends with 0.


128 bytes

Boot File: indicates the name of the startup configuration file to be obtained by a client. This field is filled in by a DHCP server and delivered to the client when a DHCP address is allocated to the client. The field is optional and must be a character string that ends with 0.



Options: indicates the DHCP Options field. This field is a maximum of 312 bytes in length and contains the DHCP message type and configuration parameters allocated by a DHCP server to a client. The configuration parameters include the gateway IP address, DNS server IP address, and IP address lease.

For details about the Options field, see DHCP Options.

DHCP Options

DHCP Options are tagged data items that provide control information and parameters to a DHCP client. The options are sent in a variable-length field at the end of a DHCP message. This field consists of Type, Length, and Value, which are shown in Figure 4-3 and described in Table 4-3.

Figure 4-3  Options field format

Table 4-3  Options field description





1 byte

Indicates the information type.


1 byte

Indicates the length of the subsequent content in the Options field.



Indicates the message content. The length varies depending on the Length field.

The values of the Options field range from 1 to 255. Some DHCP options are predefined and others can be user defined. Table 4-4 lists some of the common predefined DHCP options.

Table 4-4  Common predefined DHCP options

Option Code



Specifies a subnet mask.


Specifies a gateway address.


Specifies the IP address of a DNS server.


Specifies the device name of a DHCP client.


Specifies a domain name.


Specifies a group of classful static routes that the DHCP client must add to its routing table. In classful static routes, destination address masks are natural masks and cannot be used for subnetting. If Option 121 is configured, Option 33 is ignored.


Specifies a NetBIOS server name.


Specifies a NetBIOS node type.


Specifies a requested IP address.


Specifies an IP address lease.


Specifies an additional option.


Specifies a DHCP message type.


Specifies a server identifier.


Specifies a parameter request list. A DHCP client uses this option to request specified configuration parameters.


Specifies the lease renewal time (T1), which is 50% of the lease time.


Specifies the lease renewal time (T2), which is 87.5% of the lease time.


Specifies the vendor category, which identifies the DHCP client type and configuration.


Specifies a client identifier.


Specifies a TFTP server name allocated to DHCP clients.


Specifies a startup file name allocated to DHCP clients.


Specifies a user type.


Specifies a group of classless static routes that the DHCP client must add to its routing table. In classless static routes, destination address masks can be any value and can be used for subnetting.


A device functioning as a DHCP client can receive static routes delivered from a DHCP server through Option 121.

In addition to the predefined options, you can configure user-defined options to support a wide variety of devices, such as IP phones.

  • Vendor-specific information option (Option 43)

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

    Figure 4-4  Option 43 format

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

    When a device functions as the DHCP server, it can deliver the AC's IP address to connected APs (Huawei devices), which facilitates the connection setup between the AC and APs.

    Option 43 supports sub-options, as shown in Figure 4-4.

    • Sub-option type: type of the sub-option. When the device delivers the AC's IP address to APs, the value can be 0x01 (hexadecimal type), 0x02 (IP address type), or 0x03 (ASCII code type).

    • Sub-option length: length of the sub-option.

    • Sub-option value: value of the sub-option.

  • Relay agent information option (Option 82)

    Option 82 is the DHCP relay agent information option that records the location of a DHCP client. A DHCP relay agent or a device with DHCP snooping enabled appends the Option 82 field to a DHCP Discover message sent from a DHCP client and then forwards the DHCP Discover message to a DHCP server.

    The administrator can use the Option 82 field to locate a DHCP client and control the security and accounting of the DHCP client. The DHCP server that supports the Option 82 field can determine policies to allocate IP addresses and other parameters according to information in the Option 82 field. IP addresses can be allocated flexibly.

    The Option 82 field contains a maximum of 254 sub-options. If the Option 82 field is defined, at least one sub-option must be defined. Sub-options that are currently supported by the device include:
    • sub-option1 (Agent Circuit ID Sub-option)
    • sub-option2 (Agent Remote ID Sub-option)
    • sub-option6 (Subscriber-ID Suboption)
    • sub-option9 (Vendor-Specific Information Suboption)
Updated: 2020-02-26

Document ID: EDOC1000178170

Views: 272209

Downloads: 1028

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Previous Next