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

Reminder

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

upgrade

Fat AP and Cloud AP V200R008C00 CLI-based Configuration Guide

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).
Appendix for DHCP

Appendix for DHCP

DHCP Messages

DHCP Message Format

Figure 7-75 shows the format of DHCP message format, with numbers in parenthesis indicating the length of fields, in bytes.

Figure 7-75  DHCP message format

Table 7-47  Description of each field in a DHCP message

Field

Length

Description

op

1 byte

Operation Code: indicates the message type as follows:
  • 1: DHCP Discover message

  • 2: DHCP Offer message

htype

1 byte

Hardware Type: indicates the hardware type. For an Ethernet address, the value of this field is 1.

hlen

1 byte

Hardware Address Length: indicates the length of a hardware address, in bytes. For an Ethernet address, the value of this field is 6.

hops

1 byte

Hops: indicates the number of DHCP relay agents through which a DHCP message passes. A maximum of 16 DHCP relay agents are allowed between a client and server. This field is set to 0 by a DHCP client or server. Its value increases by 1 each time the message passes through a DHCP relay agent. If the value is larger than 16, the message is discarded.

xid

4 bytes

Transaction Identifier: indicates a random number chosen by a DHCP client to exchange messages with a DHCP server.

secs

2 bytes

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

flags

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 in which the DHCP server sends a DHCP Offer message. The values are as follows:
  • 0: The DHCP server unicasts a DHCP Offer message.

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

ciaddr

4 bytes

Client IP Address: indicates the IP address of a client. The IP address is either an existing IP address of a DHCP client or an IP address allocated by a DHCP server to a DHCP client. During the process of a client acquiring an IP address, the value of this field is 0.0.0.0.

The IP address 0.0.0.0 is an invalid destination and is only used by a DHCP-enabled device to temporarily communicate with other devices during startup.

yiaddr

4 bytes

Your Client IP Address: indicates the IP address allocated by a server to a client. The DHCP server fills this field into a DHCP Offer message.

siaddr

4 bytes

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

giaddr

4 bytes

Gateway IP Address: indicates the IP address of the first DHCP relay agent.

If the DHCP server and client are located on different network segments:

  1. The first DHCP relay agent fills its IP address in this field and forwards the message to the DHCP server.
  2. The DHCP server determines on which network segment the client resides based on the Giaddr field, and allocates an IP address on this network segment to the client.
  3. The DHCP server returns a DHCP Offer message to the first DHCP relay agent.
  4. The DHCP relay agent then forwards the DHCP Offer message to the client.

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

chaddr

16 bytes

Client Hardware Address: indicates the MAC address of a client. This field must be consistent with the hardware type (htype) and hardware length (hlen) fields. When sending a DHCP Discover packet, the client fills its hardware address in 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 Name: indicates the name of the server from which a client obtains the configuration. This field is optional and is filled in by a DHCP server. If this field is filled in, the value must be a character string that ends with 0.

file

128 bytes

File Name: indicates the startup configuration file name specified by the DHCP server for a DHCP client. The DHCP server fills this field and delivers it together with the IP address to the client. This field is optional. If this field is filled in, the value must be a character string that ends with 0.

options

Variable

Options: indicates the DHCP Options field, which has a maximum of 312 bytes. This field 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 Message Types

A DHCP server and a DHCP client communicate by exchanging DHCP messages. DHCP messages are classified into eight types.

Table 7-48  DHCP message types
Message Name Description

DHCP Discover

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

DHCP Offer

A DHCP Offer message is sent by a DHCP server to respond to a DHCP Discover message.

DHCP Request

A DHCP Request message is sent in the following scenarios:

  • After a DHCP client starts, it broadcasts a DHCP Request message to respond 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 allocated IP address.
  • After a DHCP client obtains an IP address, it unicasts or broadcasts a DHCP Request message to renew 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, the DHCP server sends a DHCP NAK message to notify the DHCP client that no IP address is available.

DHCP Decline

A DHCP Decline message is sent by a DHCP client 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 Release message is sent by a DHCP client to release its IP address. After receiving a DHCP Release message, the DHCP server can allocate 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

Options Field in a DHCP Message

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 configured with the Options field, the DHCP server replies with a message containing the Options field. Figure 7-76 shows the format of the Options field.

Figure 7-76  Format of the Options field

The Options field consists of Type, Length, and Value, which are described in the following table.

Table 7-49  Description of the Options field

Field

Length

Description

Type

1 byte

Indicates the information type.

Length

1 byte

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

Value

Variable

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

The value of the Options field ranges from 1 to 255. Table 7-50 lists well-known DHCP options.

Table 7-50  Well-known DHCP options in DHCP messages

Option No.

Function

1

Specifies a subnet mask.

3

Specifies a gateway address.

6

Specifies the IP address of a DNS server.

12

Specifies the device name of a DHCP client.

15

Specifies a domain name.

33

Specifies a 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, destination address masks are natural masks and cannot be used to divide subnets. If Option 121 is configured, Option 33 is ignored.

44

Specifies a NetBIOS name.

46

Specifies a NetBIOS node type.

50

Specifies a requested IP address.

51

Specifies an IP address lease.

52

Specifies an additional option.

53

Specifies a DHCP message type.

54

Specifies a server identifier.

55

Specifies the request option list. A DHCP client uses this option to request specified configuration parameters. The content of this option is the value of the option requested by the DHCP client.

58

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

59

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

60

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

61

Specifies a client identifier.

66

Specifies a TFTP server name allocated to DHCP clients.

67

Specifies a startup file name allocated to DHCP clients.

77

Specifies a user type.

121

Specifies a group of classless routes. This option contains a group of classless static 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. In classless routes, masks of destination addresses can be any value and can be used to divide subnets.

NOTE:

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

The preceding options function on different objects. For example, Option 77 is used on a DHCP client to identify user types of the DHCP client. The DHCP server selects an address pool to allocate an IP address and configuration parameters to the DHCP client based on the User Class in the Options field. Option 77 is manually configured only on the DHCP client but not on the server.

For more information about well-known DHCP options, see RFC 2132.

Translation
Download
Updated: 2019-01-11

Document ID: EDOC1000176006

Views: 115799

Downloads: 309

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next