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

Configuration Guide - IP Service

S1720, S2700, S5700, and S6720 V200R012(C00 and C20)

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 Server Allocating Network Parameters to New DHCP Clients

DHCP Server Allocating Network Parameters to New DHCP Clients

This section describes how a DHCP server allocates network parameters to DHCP clients with and without a DHCP relay agent.

Network Parameter Allocation Without a DHCP Relay Agent

When accessing a network for the first time, a DHCP client exchanges DHCP messages with a DHCP server to obtain network parameters, as shown in Figure 3-4.

NOTE:

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.

Figure 3-4  DHCP server exchanging messages with a new DHCP client without a DHCP relay agent.

  1. Discovery stage: The DHCP client detects DHCP servers.

    Because the DHCP client does not know the IP addresses of DHCP servers, it broadcasts a DHCP Discover message (with destination IP address 255.255.255.255) to detect DHCP servers. All DHCP servers on the same network segment as the DHCP client can receive the DHCP Discover message. Information carried in a DHCP Discover message includes the client's MAC address (Chaddr field), parameter request list (Option 55 field, indicating the network parameters required by the client), and broadcast flag (Flags field, indicating whether the response should be sent in unicast or broadcast mode).

    • The Options field in a DHCP Discover message defines network parameters that a client requires. Each option identifies a parameter. For example, Option 3 indicates the requested gateway address. (A client adds Option 3 in the Option 55 field when it requests the gateway address.) Option 53 indicates the DHCP message type (such as Discover message). Options are classified into well-known and self-defined options. For more information about well-known DHCP options, see RFC 2132. Vendors can define their own options (for example, Option 43 is defined to indicate vendor-specific information). For details about options, see DHCP Options.

    • The Flags field is defined in RFC 2131. The leftmost bit of this field indicates whether the server is required to unicast or broadcast the DHCP Offer/ACK message. The value 0 indicates unicast, and the value 1 indicates broadcast. The Flags field is set to 1 on the device functioning as DHCP clients.

  2. Offer stage: A DHCP server offers network parameters to the DHCP client.

    All DHCP servers on the same network segment as the DHCP client can receive the DHCP Discover message. Each DHCP server may have multiple address pools to manage network parameters including allocatable IP addresses. A DHCP server selects an address pool on the same network segment as the IP address of the interface receiving the DHCP Discover message, and from the address pool selects an idle IP address. The DHCP server then sends a DHCP Offer message carrying the allocated IP address (in the Yiaddr field) to the DHCP client. The DHCP Offer message also carries other network parameters such as the IP address lease.

    In most cases, an address pool specifies the leases of the IP addresses it contains. If the DHCP Discover message carries an expected lease, the DHCP server compares the expected lease with the specified lease and allocates the IP address with the shorter of the two leases to the DHCP client.

    IP addresses in an address pool are added to IP address lists based on their IP address status:
    • Unallocated IP addresses are added to the allocatable IP address list.
    • Allocated IP addresses are added to the in-use IP address list.
    • Conflicting IP addresses are added to the conflicting IP address list.
    • IP addresses that cannot be allocated are added to the unallocatable IP address list.
    The DHCP server selects an IP address for the client from the address pool in the following sequence:
    1. IP address statically bound to the MAC address of the client on the DHCP server
    2. IP address specified in the Option 50 field (requested IP address) in the DHCP Discover message
    3. IP address that has been previously allocated to the client
    4. Randomly selected IP address from the address pool for allocatable IP addresses
    5. If the DHCP server does not find any allocatable IP address, it searches for expired IP addresses and, if none is found, it searches for conflicting IP addresses. If a valid IP address is found, the DHCP server allocates it to the client. Otherwise, the DHCP server replies with a DHCP NAK message to notify the client that no IP address is available. After receiving the DHCP NAK message, the DHCP client sends a DHCP Discover message to apply for a new IP address.

    DHCP servers can exclude certain IP addresses that cannot be allocated through DHCP from address pools. For example, if 192.168.1.100/24 has been manually configured for a DNS server, the DHCP server excludes this IP address from the address pool on network segment 192.168.1.0/24 so that it is not allocated through DHCP. This helps prevent IP address conflicts.

    To prevent a newly allocated IP address from conflicting with IP addresses of other clients on the network, the DHCP server sends an ICMP Echo Request packet before sending a DHCP Offer message. The DHCP server uses this packet to check whether the IP address to be allocated conflicts with other clients' IP addresses. The source and destination IP addresses of the ICMP Echo Request packet are the DHCP server's IP address and the IP address to be allocated, respectively. If the DHCP server receives no ICMP Echo Reply packet within the detection period, no client is using this IP address, and the DHCP server can allocate it. If the DHCP server receives an ICMP Echo Reply packet within the detection period, this IP address is in use by another client, and the DHCP server lists this IP address as a conflicting IP address. The DHCP server then waits for the next DHCP Discover message to start the IP address selection process again.

    NOTE:

    The IP address allocated in this stage may not be the final IP address used by the client. This is because the IP address may be allocated to another client if the DHCP server receives no response 16 seconds after the DHCP Offer message is sent. The IP address for the client can be determined only after the request and acknowledgment stages.

  3. Request stage: The DHCP client selects an IP address.

    The client broadcasts a DHCP Discover message to all DHCP servers on the local network segment. If multiple DHCP servers reply with a DHCP Offer message to the DHCP client, the client accepts only the first received DHCP Offer message.

    The client then broadcasts a DHCP Request message carrying the selected DHCP server identifier (Option 54) and IP address (Option 50, with the IP address specified in the Yiaddr field of the accepted DHCP Offer message).

    The DHCP Request message notifies all the DHCP servers of the IP address that the DHCP client has selected. The unselected IP addresses from other servers are then free to be allocated to other clients.

    NOTE:

    When a switch functions as a DHCP client (including the cloud-based management scenario) and multiple DHCP servers exist on the network, the DHCP client polls DHCP servers according to the sequence of receiving DHCP Offer messages. If the previous DHCP server fails to allocate IP addresses, the DHCP client selects the next DHCP server.

  4. Acknowledgment stage: The DHCP server acknowledges the IP address offered to the client.

    After receiving the DHCP Request message, the DHCP server sends a DHCP ACK message to the client, carrying the IP address specified in the Option 50 field of the Request message.

    After receiving the DHCP ACK message, the DHCP client broadcasts gratuitous ARP packets to check whether any other terminal is using the IP address allocated by the DHCP server.

    If no response is received within the specified time, the DHCP client can use the IP address. However, if the DHCP client receives a response within the specified time, this IP address is in use by another terminal. In this case, the client then sends a DHCP Decline message to the DHCP server and applies for a new IP address. The DHCP server lists this IP address as a conflicting IP address. A conflicting IP address is allocated only when there is no idle IP address in the address pools, minimizing IP address conflicts.

    Occasionally, the DHCP server may fail to allocate the IP address specified in the Option 50 field because, for example, an error occurs during negotiation or it takes a long time to receive the DHCP Request message. In this case, the DHCP server replies with a DHCP NAK message to notify the DHCP client that the requested IP address cannot be allocated. The DHCP client then sends a DHCP Discover message to apply for a new IP address.

Network Parameter Allocation with DHCP Relay Agents

After a DHCP client connects to the network for the first time, the client exchanges DHCP messages with a DHCP relay agent and DHCP server to obtain network parameters, as shown in Figure 3-5. The interaction between the DHCP client and server is similar to that described in Network Parameter Allocation Without a DHCP Relay Agent. The following describes the working mechanism of the DHCP relay agent.

Figure 3-5  Message exchange among a new DHCP client, DHCP server, and DHCP relay agent

  1. Discovery stage

    When receiving a DHCP Discover message broadcast by a DHCP client, the DHCP relay agent performs the following steps:
    1. Checks the value of the Hops field. If this value exceeds 16, the DHCP relay agent discards the message. Otherwise, the DHCP relay agent increases this value by 1 and proceeds to the next step.

      The Hops field indicates the number of DHCP relay agents that a DHCP message has passed through. This field is set to 0 by a DHCP client or server. Its value is incremented by 1 each time the message passes through a DHCP relay agent. This field limits the number of DHCP relay agents that a DHCP message can pass through. A maximum of 16 DHCP relay agents are allowed between a DHCP client and server.

    2. Checks the value of the Giaddr field. If this value is 0, the DHCP relay agent sets the Giaddr field to the IP address of the interface receiving the DHCP Discover message. Otherwise, the DHCP relay agent does not change the field and proceeds to the next step.

      The Giaddr field indicates the gateway IP address. If the DHCP server and client are located on different network segments, the first DHCP relay agent fills its own IP address in this field and forwards the message to the DHCP server. Other DHCP relay agents on the path forward the message without changing this field. 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. Changes the destination IP address of the DHCP Discover message to the IP address of the DHCP server or the next-hop DHCP relay agent, and changes the source IP address to the IP address of the interface connecting the DHCP relay agent to the client. The message is then unicast to the DHCP server or the next-hop DHCP relay agent.

    If there are multiple DHCP relay agents between the DHCP client and server, each the DHCP relay agent processes the DHCP Discover message using the same method.

  2. Offer stage

    After receiving the DHCP Discover message, the DHCP server selects an address pool on the same network segment as that specified in the Giaddr field and allocates an IP address and other network parameters from the address pool. The sequence in which an IP address is selected is the same as that described in Network Parameter Allocation Without a DHCP Relay Agent. The DHCP server then unicasts a DHCP Offer message to the DHCP relay agent specified in the Giaddr field.

    When receiving the DHCP Offer message, the DHCP relay agent performs the following steps:
    • Checks the value of the Giaddr field. If this value is the IP address of the interface receiving the DHCP Offer message, the DHCP relay agent discards the message. Otherwise, the DHCP relay agent proceeds to the next step.

    • Checks the value of the Flags field. If this value is 1, the DHCP relay agent broadcasts a DHCP Offer message to the DHCP client. Otherwise, the DHCP relay agent unicasts a DHCP Offer message.
  3. Request stage

    The DHCP relay agent processes the DHCP Request message from the client using the same method described in the Discovery stage.

  4. Acknowledgment stage

    The DHCP relay agent processes the DHCP ACK message from the server using the same method described in the Offer stage.

Translation
Download
Updated: 2018-12-24

Document ID: EDOC1100038342

Views: 86020

Downloads: 283

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