The structure of the DHCP protocol is a complex part of knowledge. Here we will look at the relevant content in detail. Describes the fields of the DHCP protocol and related knowledge of DHCP Relay. Hope to help you.
DHCP fields:
When the op field indicates whether the current message is a Client request or when the server responds to 1, it indicates that the Client request is 2 and the server responds.
The htype hlen field indicates the network hardware address type length of the Client. For example, if htype is 1, the network hardware of the Client is 10 MB. If the Ethernet Type of hlen is 6, the network hardware address length of the Client is 6 bytes. MAC address of 6bytes of the Ethernet type, the number of DHCP Relay packets passing through the current DHCP packet is similar to the number of DHCP Relay packets in the IP header. However, the value of this field is initialized to 0 when the Client or server sends a DHCP packet. a DHCP Relay field will add 1. This field is used to restrict DHCP packets from going through too many DHCP Relay protocols. When the hops is greater than 4, the DHCP packet must be set to 16 now. the transaction ID field cannot be processed, but the random number selected by the Client each time the DHCP request packet is sent is discarded to match the server's response packet. packets.
The number of seconds field is used to indicate the time elapsed after the Client starts the DHCP request. This field is generally not significant. Originally, this field was designed to allow the DHCP Server to prioritize DHCP requests with a large value during busy hours because the larger the field, the longer the Client and so on.
In BOOTP, this field is reserved. in DHCP protocol, only the highest bit on the left is used, as shown in format 3.
The leftmost bit of the entire field occupies 16 bits. It is interpreted as the broadcast response identifier. All other bits are reserved. The slave must be set by the Client to 0 server and DHCP Relay. When the Client cannot receive unicast requests when a DHCP response packet is sent, the broadcast response ID location must be set to 1. Otherwise, the DHCP Server determines whether the current Client is set based on whether the broadcast response flag is set to broadcast or unicast when the response message is received. for example, WINDOWS 98 can receive unicast DHCP response packets.
The IP address field of the Client indicates that the Client's IP address can be the IP address assigned to the Client by the server or an existing IP address of the Client. If this field is not 0, the Client can use this IP address to receive IP packets DHCP. when the Server finds that this field is not 0, it can directly unicast the response packet to the Client. your IP address field indicates the IP address allocated to the Client by the server. When the DHCP Server responds to the Client's DHCP request, it will assign enter the IP address of the Client in this field, the Server IP address field indicates that the IP address of the Server that the Client obtains the startup configuration information is generally the IP address of the TFTP Server.
Record the IP address field of the Relay proxy for the first DHCP Relay agent. When the Client sends a DHCP request packet, if there is a DHCP Relay in the network, the first DHCP Relay will forward this DHCP request packet. enter the IP address in this field, and then the DHCP Relay will not rewrite this field, but add the hops to 1) the DHCP Server assigns an IP address based on this field and forwards the response packet to the DHCP Relay agent, which is then forwarded to the Client by the DHCP Relay agent.
The Client hardware address field records the actual hardware address of the Client. When the Client sends a DHCP request message, it will enter the hardware address of its Nic in this field. DHCP Server generally uses this field to uniquely identify a Client. this field must be consistent with the preceding htype hlen field. For example, if htype hlen is set to 1 and 6 respectively, this field must be filled with the 6bytes Ethernet MAC address. The Relay proxy IP address is the IP address of DHCP Relay. The htype, hlen, and Client hardware address fields respectively describe the Client's hardware address type length and address content.
The Host Name field of the Server records the name of the Server in which the Client obtains the startup configuration. This field is entered by the DHCP Server and optional. If the field must be a string ending with 0, start File Name field record Client STARTUP configuration file name this field is filled by DHCP Server and optional if it must be a string ending with 0
The option field is also called the vendor field for BOOTP. This field contains a large number of optional terminal initial configuration information and network configuration information, such as determining the terminal's IP characteristics, configuration information, domain name information, marking the terminal's special information terminal. the default gateway IP address of the DNS server. CLV format: information content after the unique ID of the Code ID occupies 1 bytes length indicates the length of the information content after the ID occupies 1 bytes value information content its length is length Specified in bytes.
The option field is an optional field. It becomes longer. The most important option for us is "server identifier", which identifies the IP address of the server and brings it to the Client.